Merge "MediaCodec: don't cache buffers until requested" am: 4f9ab851b3 am: de5a8defbe

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2092586

Change-Id: I5e2b54e679d45fb0d5a6d89577468c594b3c4d69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Wonsik Kim
2022-05-14 01:05:52 +00:00
committed by Automerger Merge Worker

View File

@@ -2317,10 +2317,6 @@ final public class MediaCodec {
*/
public final void start() {
native_start();
synchronized(mBufferLock) {
cacheBuffers(true /* input */);
cacheBuffers(false /* input */);
}
}
private native final void native_start();
@@ -3951,6 +3947,9 @@ final public class MediaCodec {
+ "Please obtain MediaCodec.LinearBlock or HardwareBuffer "
+ "objects and attach to QueueRequest objects.");
}
if (mCachedInputBuffers == null) {
cacheBuffers(true /* input */);
}
if (mCachedInputBuffers == null) {
throw new IllegalStateException();
}
@@ -3989,6 +3988,9 @@ final public class MediaCodec {
+ "is not compatible with CONFIGURE_FLAG_USE_BLOCK_MODEL. "
+ "Please use getOutputFrame to get output frames.");
}
if (mCachedOutputBuffers == null) {
cacheBuffers(false /* input */);
}
if (mCachedOutputBuffers == null) {
throw new IllegalStateException();
}