mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
v4l2object: Fix colorimetry validation
While not documented, gst_video_colorimetry_matches() only accepts well known names. Looking at the code and unit test, this seems to be on purpose, so fixing by parsing the string and compating the colorimetry structures.
This commit is contained in:
parent
ef633e28f8
commit
4bcec1b190
1 changed files with 7 additions and 4 deletions
|
@ -3424,10 +3424,13 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
|
|||
gst_v4l2_object_get_colorspace (&format, &info.colorimetry);
|
||||
|
||||
s = gst_caps_get_structure (caps, 0);
|
||||
if (gst_structure_has_field (s, "colorimetry") &&
|
||||
!gst_video_colorimetry_matches (&info.colorimetry,
|
||||
gst_structure_get_string (s, "colorimetry")))
|
||||
goto invalid_colorimetry;
|
||||
if (gst_structure_has_field (s, "colorimetry")) {
|
||||
GstVideoColorimetry ci;
|
||||
if (!gst_video_colorimetry_from_string (&ci,
|
||||
gst_structure_get_string (s, "colorimetry"))
|
||||
|| !gst_video_colorimetry_is_equal (&ci, &info.colorimetry))
|
||||
goto invalid_colorimetry;
|
||||
}
|
||||
|
||||
/* In case we have skipped the try_fmt probes, we'll need to set the
|
||||
* colorimetry and interlace-mode back into the caps. */
|
||||
|
|
Loading…
Reference in a new issue