matroskamux: allow width + height changes for avc3|hev1
authorTristan Matthews <tmatth@videolan.org>
Mon, 7 Feb 2022 21:41:40 +0000 (16:41 -0500)
committerTristan Matthews <tmatth@videolan.org>
Fri, 4 Mar 2022 19:17:20 +0000 (14:17 -0500)
For avc3 and hev1, the intent was to allow more flexibility for caps changes
(see https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1047/diffs?commit_id=9bd8d608d5bae27ec5ff09e733f76ca32b17420c)
however width and resolution were previously omitted.

avc3 and hev1 specifically support changing stream-parameters on the fly, whereas avc1/hvc1 disallow in-band SPS.

This commit allows for changes to width and height for these which is in line with matroskamux's behaviour prior to 1.14.0.

Practically speaking, one use case where this is commonly seen is when capturing a WebRTC stream, as the browser will adapt the resolution live.

Suggested-by: Mathieu Duponchelle "<mathieu@centricular.com>"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1657>

subprojects/gst-plugins-good/gst/matroska/matroska-mux.c

index e0d2a46..80160e7 100644 (file)
@@ -998,6 +998,10 @@ check_field (GQuark field_id, const GValue * value, gpointer user_data)
       return FALSE;
     } else if (field_id == g_quark_from_static_string ("level")) {
       return FALSE;
+    } else if (field_id == g_quark_from_static_string ("width")) {
+      return FALSE;
+    } else if (field_id == g_quark_from_static_string ("height")) {
+      return FALSE;
     }
   } else if (gst_structure_has_name (structure, "video/x-vp8")
       || gst_structure_has_name (structure, "video/x-vp9")) {