mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 13:55:41 +00:00
h264parse: Avoid setting wrong colorimetry info if the stream doesn't contain it
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3543>
This commit is contained in:
parent
010ede30dd
commit
e49e0198f1
1 changed files with 9 additions and 5 deletions
|
@ -2146,16 +2146,20 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue