From 660b5e4a9864b843c3bc26cd6cdf7b42192f1f36 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 31 Oct 2020 03:14:20 +0900 Subject: [PATCH] videodecoder: Don't assume GstVideoChromaSite and GstVideoColorimetry Even if given GstVideoChromaSite and/or GstVideoColorimetry has unknown value(s), assumption for an unknown value should be done by subclass or downstream element, not a role of video decoder. And subclass might want to output unknown value as is. Part-of: --- gst-libs/gst/video/gstvideodecoder.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 402bdcb3a5..bd6cb76694 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -762,18 +762,8 @@ _new_output_state (GstVideoFormat fmt, GstVideoInterlaceMode interlace_mode, if (copy_interlace_mode) tgt->interlace_mode = ref->interlace_mode; tgt->flags = ref->flags; - /* only copy values that are not unknown so that we don't override the - * defaults. subclasses should really fill these in when they know. */ - if (ref->chroma_site) - tgt->chroma_site = ref->chroma_site; - if (ref->colorimetry.range) - tgt->colorimetry.range = ref->colorimetry.range; - if (ref->colorimetry.matrix) - tgt->colorimetry.matrix = ref->colorimetry.matrix; - if (ref->colorimetry.transfer) - tgt->colorimetry.transfer = ref->colorimetry.transfer; - if (ref->colorimetry.primaries) - tgt->colorimetry.primaries = ref->colorimetry.primaries; + tgt->chroma_site = ref->chroma_site; + tgt->colorimetry = ref->colorimetry; GST_DEBUG ("reference par %d/%d fps %d/%d", ref->par_n, ref->par_d, ref->fps_n, ref->fps_d); tgt->par_n = ref->par_n;