vp9parse: Set subsampling to src caps even if GBR stream
authorSeungha Yang <seungha@centricular.com>
Sun, 30 Oct 2022 09:37:55 +0000 (18:37 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 31 Oct 2022 11:29:38 +0000 (11:29 +0000)
Some muxer elements will need the subsampling information

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

subprojects/gst-plugins-bad/gst/videoparsers/gstvp9parse.c

index 4d44642..c859054 100644 (file)
@@ -686,23 +686,18 @@ gst_vp9_parse_update_src_caps (GstVp9Parse * self, GstCaps * caps)
     }
   }
 
-  if (self->color_space != GST_VP9_CS_SRGB) {
-    if (self->parser->subsampling_x == 1 && self->parser->subsampling_y == 1)
-      chroma_format = "4:2:0";
-    else if (self->parser->subsampling_x == 1 &&
-        self->parser->subsampling_y == 0)
-      chroma_format = "4:2:2";
-    else if (self->parser->subsampling_x == 0 &&
-        self->parser->subsampling_y == 1)
-      chroma_format = "4:4:0";
-    else if (self->parser->subsampling_x == 0 &&
-        self->parser->subsampling_y == 0)
-      chroma_format = "4:4:4";
-
-    if (chroma_format)
-      gst_caps_set_simple (final_caps,
-          "chroma-format", G_TYPE_STRING, chroma_format, NULL);
-  }
+  if (self->parser->subsampling_x == 1 && self->parser->subsampling_y == 1)
+    chroma_format = "4:2:0";
+  else if (self->parser->subsampling_x == 1 && self->parser->subsampling_y == 0)
+    chroma_format = "4:2:2";
+  else if (self->parser->subsampling_x == 0 && self->parser->subsampling_y == 1)
+    chroma_format = "4:4:0";
+  else if (self->parser->subsampling_x == 0 && self->parser->subsampling_y == 0)
+    chroma_format = "4:4:4";
+
+  if (chroma_format)
+    gst_caps_set_simple (final_caps,
+        "chroma-format", G_TYPE_STRING, chroma_format, NULL);
 
   switch (self->bit_depth) {
     case GST_VP9_BIT_DEPTH_8: