Add support for video peek in Codec2

Video peek is a feature that enables displaying the first video frame
of a video stream decoded by a codec configured in tunnel mode.
This commit adds support for video peek to Codec2-based codecs.

Test: atest android.media.cts.DecoderTest
Merged-In: I74f0b6de2161f563a80b33f1bb3d6ff961de09b6
Merged-In: If8bc83f93d5cf12c1138c467e3152eafc3e92015
Merged-In: I298e27b1024440ea353f8a1db2afdabdb695f702

Change-Id: I533917908a7050c760374c7b607dd736ec173339
diff --git a/media/codec2/sfplugin/CCodecConfig.cpp b/media/codec2/sfplugin/CCodecConfig.cpp
index 27e87e6..5646095 100644
--- a/media/codec2/sfplugin/CCodecConfig.cpp
+++ b/media/codec2/sfplugin/CCodecConfig.cpp
@@ -938,6 +938,14 @@
             return value == 0 ? C2_FALSE : C2_TRUE;
         }));
 
+    add(ConfigMapper("android._trigger-tunnel-peek", C2_PARAMKEY_TUNNEL_START_RENDER, "value")
+       .limitTo(D::PARAM & D::VIDEO & D::DECODER)
+       .withMapper([](C2Value v) -> C2Value {
+           int32_t value = 0;
+           (void)v.get(&value);
+           return value == 0 ? C2_FALSE : C2_TRUE;
+       }));
+
     /* still to do
     constexpr char KEY_PUSH_BLANK_BUFFERS_ON_STOP[] = "push-blank-buffers-on-shutdown";