Revert "MediaCodec: don't cache buffers until requested"

This reverts commit 07358dfea5.

Merged-In: I2e52c3abdd13fa0547a510b3599e082e3bff0989
Change-Id: I2e52c3abdd13fa0547a510b3599e082e3bff0989
This commit is contained in:
Wonsik Kim
2022-07-26 11:09:17 -07:00
parent 6db478c840
commit 5b2d2cf6b9

View File

@@ -2282,6 +2282,10 @@ final public class MediaCodec {
*/
public final void start() {
native_start();
synchronized(mBufferLock) {
cacheBuffers(true /* input */);
cacheBuffers(false /* input */);
}
}
private native final void native_start();
@@ -3912,9 +3916,6 @@ 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();
}
@@ -3953,9 +3954,6 @@ 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();
}