GstVideoColorimetry ci = { 0, };
gchar *old_colorimetry = NULL;
- if (vui->video_full_range_flag)
- ci.range = GST_VIDEO_COLOR_RANGE_0_255;
- else
- ci.range = GST_VIDEO_COLOR_RANGE_16_235;
-
ci.matrix = gst_video_color_matrix_from_iso (vui->matrix_coefficients);
ci.transfer =
gst_video_transfer_function_from_iso (vui->transfer_characteristics);
ci.primaries = gst_video_color_primaries_from_iso (vui->colour_primaries);
+ if (ci.matrix != GST_VIDEO_COLOR_MATRIX_UNKNOWN
+ && ci.transfer != GST_VIDEO_TRANSFER_UNKNOWN
+ && ci.primaries != GST_VIDEO_COLOR_PRIMARIES_UNKNOWN) {
+ if (vui->video_full_range_flag)
+ ci.range = GST_VIDEO_COLOR_RANGE_0_255;
+ else
+ ci.range = GST_VIDEO_COLOR_RANGE_16_235;
+ }
+
old_colorimetry =
gst_video_colorimetry_to_string (&h264parse->parsed_colorimetry);
colorimetry = gst_video_colorimetry_to_string (&ci);