Merge "Add format change check rule" into main am: 718ccb5ef7 am: 2da7e2a6ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2711853
Change-Id: I5c86ae20384f7f24549f9c57a3b137ee77b353f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.cpp b/media/codec2/sfplugin/CCodecBufferChannel.cpp
index 29afcee..c93b7d0 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.cpp
+++ b/media/codec2/sfplugin/CCodecBufferChannel.cpp
@@ -2153,8 +2153,15 @@
if (notifyClient && !buffer && !flags) {
if (mTunneled && drop && outputFormat) {
- ALOGV("[%s] onWorkDone: Keep tunneled, drop frame with format change (%lld)",
- mName, work->input.ordinal.frameIndex.peekull());
+ if (mOutputFormat != outputFormat) {
+ ALOGV("[%s] onWorkDone: Keep tunneled, drop frame with format change (%lld)",
+ mName, work->input.ordinal.frameIndex.peekull());
+ mOutputFormat = outputFormat;
+ } else {
+ ALOGV("[%s] onWorkDone: Not reporting output buffer without format change (%lld)",
+ mName, work->input.ordinal.frameIndex.peekull());
+ notifyClient = false;
+ }
} else {
ALOGV("[%s] onWorkDone: Not reporting output buffer (%lld)",
mName, work->input.ordinal.frameIndex.peekull());
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.h b/media/codec2/sfplugin/CCodecBufferChannel.h
index 41f5ae2..1b5c031 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.h
+++ b/media/codec2/sfplugin/CCodecBufferChannel.h
@@ -302,6 +302,7 @@
std::shared_ptr<C2BlockPool> mInputAllocator;
QueueSync mQueueSync;
std::vector<std::unique_ptr<C2Param>> mParamsToBeSet;
+ sp<AMessage> mOutputFormat;
struct Input {
Input();