vp9parse: Set subsampling to src caps even if GBR stream

Some muxer elements will need the subsampling information

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3297>
This commit is contained in:
Seungha Yang 2022-10-30 18:37:55 +09:00 committed by GStreamer Marge Bot
parent 47f1dc837f
commit 32b13a883a

View 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 (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 (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: