Send onFrameRendered differently depending on whether the surface is a
display

When rendering on the display, only send onFrameRendered when the video
frame is actually rendered on the display. Otherwise, send it when it is
queued to the surface.

Bug: 234833109
Bug: 274472195
Test: atest DecoderRenderTest
Change-Id: I35f1e8a844d9a96b04d8c6b2c00881e7ec09f98d
Merged-In: I35f1e8a844d9a96b04d8c6b2c00881e7ec09f98d
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.h b/media/codec2/sfplugin/CCodecBufferChannel.h
index e2e55b9..763eae9 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.h
+++ b/media/codec2/sfplugin/CCodecBufferChannel.h
@@ -330,6 +330,7 @@
     sp<MemoryDealer> makeMemoryDealer(size_t heapSize);
 
     std::deque<TrackedFrame> mTrackedFrames;
+    bool mIsSurfaceToDisplay;
     bool mHasPresentFenceTimes;
 
     struct OutputSurface {