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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e4f38afb622bb9620d7f3345383daeb8a860f55d)
Merged-In: I35f1e8a844d9a96b04d8c6b2c00881e7ec09f98d
Change-Id: I35f1e8a844d9a96b04d8c6b2c00881e7ec09f98d
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.h b/media/codec2/sfplugin/CCodecBufferChannel.h
index 20dca2b..0d25d6d 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.h
+++ b/media/codec2/sfplugin/CCodecBufferChannel.h
@@ -331,6 +331,7 @@
     sp<MemoryDealer> makeMemoryDealer(size_t heapSize);
 
     std::deque<TrackedFrame> mTrackedFrames;
+    bool mIsSurfaceToDisplay;
     bool mHasPresentFenceTimes;
 
     struct OutputSurface {