mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
v4l2object: Use default colorimetry if that in caps is unknown
Some streams have unknown colorimetry in caps, but v4l2object sets default values for each primaries. It will cause check colorimetry fail when do gst_v4l2_video_colorimetry_matches(). To fix this, need to keep the unknown colorimetry in caps same as the default value set by v4l2object. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/923>
This commit is contained in:
parent
5f783647a0
commit
a75cfa522d
1 changed files with 10 additions and 0 deletions
|
@ -3406,6 +3406,16 @@ gst_v4l2_video_colorimetry_matches (const GstVideoColorimetry * cinfo,
|
|||
if (!gst_video_info_from_caps (&info, caps))
|
||||
return FALSE;
|
||||
|
||||
/* if colorimetry in caps is unknown, use the default one */
|
||||
if (info.colorimetry.primaries == GST_VIDEO_COLOR_PRIMARIES_UNKNOWN)
|
||||
info.colorimetry.primaries = cinfo->primaries;
|
||||
if (info.colorimetry.range == GST_VIDEO_COLOR_RANGE_UNKNOWN)
|
||||
info.colorimetry.range = cinfo->range;
|
||||
if (info.colorimetry.matrix == GST_VIDEO_COLOR_MATRIX_UNKNOWN)
|
||||
info.colorimetry.matrix = cinfo->matrix;
|
||||
if (info.colorimetry.transfer == GST_VIDEO_TRANSFER_UNKNOWN)
|
||||
info.colorimetry.transfer = cinfo->transfer;
|
||||
|
||||
if (gst_video_colorimetry_is_equal (&info.colorimetry, cinfo))
|
||||
return TRUE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue