matroskamux: Ignore some fields when renegotiating
authorThibault Saunier <tsaunier@igalia.com>
Tue, 5 Oct 2021 13:50:32 +0000 (10:50 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Mon, 18 Oct 2021 13:10:24 +0000 (10:10 -0300)
Those values are never used in the muxer so we should not fail the
negotiation if those are changing.

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

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

index c7a5adf..5d48b67 100644 (file)
@@ -989,6 +989,25 @@ check_field (GQuark field_id, const GValue * value, gpointer user_data)
     } else if (field_id == g_quark_from_static_string ("level")) {
       return FALSE;
     }
+  } else if (gst_structure_has_name (structure, "video/x-vp8")
+      || gst_structure_has_name (structure, "video/x-vp9")) {
+    /* We do not use profile and streamheader for VPX so let it change
+     * mid stream */
+    if (field_id == g_quark_from_static_string ("streamheader"))
+      return FALSE;
+    else if (field_id == g_quark_from_static_string ("profile"))
+      return FALSE;
+  }
+
+  /* This fields aren't used and are not retained into the bitstream so we can
+   * discard them. */
+  if (g_str_has_prefix (gst_structure_get_name (structure), "video/")) {
+    if (field_id == g_quark_from_static_string ("chroma-site"))
+      return FALSE;
+    else if (field_id == g_quark_from_static_string ("chroma-format"))
+      return FALSE;
+    else if (field_id == g_quark_from_static_string ("bit-depth-luma"))
+      return FALSE;
   }
 
   return TRUE;