Allow the default mode for video peek to be undefined
Forcing the default mode for video peek to be defined to on has broken
use cases for Broadcom devices.
See go/video-peek-legacy-mode for more details.
Bug: 220266078
Test: atest android.media.decoder.cts.DecoderTest
Change-Id: Ib5c9c7c232645509022f3aaebf89f90010a76b0b
diff --git a/media/codec2/core/include/C2Config.h b/media/codec2/core/include/C2Config.h
index 31840a2..6ff3dbc 100644
--- a/media/codec2/core/include/C2Config.h
+++ b/media/codec2/core/include/C2Config.h
@@ -79,6 +79,7 @@
struct C2PlatformConfig {
enum encoding_quality_level_t : uint32_t; ///< encoding quality level
+ enum tunnel_peek_mode_t: uint32_t; ///< tunnel peek mode
};
namespace {
@@ -280,6 +281,9 @@
// channel mask for decoded audio
kParamIndexAndroidChannelMask, // uint32
+
+ // allow tunnel peek behavior to be unspecified for app compatibility
+ kParamIndexTunnelPeekMode, // tunnel mode, enum
};
}
@@ -2482,6 +2486,28 @@
C2StreamTunnelStartRender;
constexpr char C2_PARAMKEY_TUNNEL_START_RENDER[] = "output.tunnel-start-render";
+/** Tunnel Peek Mode. */
+C2ENUM(C2PlatformConfig::tunnel_peek_mode_t, uint32_t,
+ UNSPECIFIED_PEEK = 0,
+ SPECIFIED_PEEK = 1
+);
+
+/**
+ * Tunnel Peek Mode Tuning parameter.
+ *
+ * If set to UNSPECIFIED_PEEK_MODE, the decoder is free to ignore the
+ * C2StreamTunnelHoldRender and C2StreamTunnelStartRender flags and associated
+ * features. Additionally, it becomes up to the decoder to display any frame
+ * before receiving synchronization information.
+ *
+ * Note: This parameter allows a decoder to ignore the video peek machinery and
+ * to revert to its preferred behavior.
+ */
+typedef C2StreamParam<C2Tuning, C2EasyEnum<C2PlatformConfig::tunnel_peek_mode_t>,
+ kParamIndexTunnelPeekMode> C2StreamTunnelPeekModeTuning;
+constexpr char C2_PARAMKEY_TUNNEL_PEEK_MODE[] =
+ "output.tunnel-peek-mode";
+
/**
* Encoding quality level signaling.
*