v4l2codecs: vp9: Drop frames on non-keyframe format change
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 1 Dec 2021 17:16:40 +0000 (12:16 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 2 Dec 2021 20:52:03 +0000 (15:52 -0500)
V4L2 does not yet support this feature, this will skip over the
transition portion up to the next keyframe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1404>

subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecvp9dec.c

index ee10a24..02b48d6 100644 (file)
@@ -353,6 +353,7 @@ gst_v4l2_codec_vp9_dec_fill_dec_params (GstV4l2CodecVp9Dec * self,
 static gboolean
 gst_v4l2_codec_vp9_dec_open (GstVideoDecoder * decoder)
 {
+  GstVp9Decoder *vp9dec = GST_VP9_DECODER (decoder);
   GstV4l2CodecVp9Dec *self = GST_V4L2_CODEC_VP9_DEC (decoder);
 
   if (!gst_v4l2_decoder_open (self->decoder)) {
@@ -362,6 +363,10 @@ gst_v4l2_codec_vp9_dec_open (GstVideoDecoder * decoder)
     return FALSE;
   }
 
+  /* V4L2 does not support non-keyframe resolution change, this will ask the
+   * base class to drop frame until the next keyframe as a workaround. */
+  gst_vp9_decoder_set_non_keyframe_format_change_support (vp9dec, FALSE);
+
   return TRUE;
 }