V4l2object: Avoid colorimetry mismatch for streams with invalid colorimetry
Some streams have invalid gst colorimetry in caps and it will be set to default value by below code in video-info.c. Then this gst colorimetry is used to do mapping with v4l2 colorimetry.
if (!gst_video_colorimetry_from_string (&info->colorimetry, s)) {
GST_WARNING ("unparsable colorimetry, using default");
set_default_colorimetry (info);
} else if (!validate_colorimetry (info)) {
GST_WARNING ("invalid colorimetry, using default");
set_default_colorimetry (info);
} else {
/* force RGB matrix for RGB formats */
if (GST_VIDEO_FORMAT_INFO_IS_RGB (info->finfo) &&
info->colorimetry.matrix != GST_VIDEO_COLOR_MATRIX_RGB) {
GST_WARNING ("invalid matrix %d for RGB format, using RGB",
info->colorimetry.matrix);
info->colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_RGB;
}
}
But when check colorimetry in gst_v4l2_video_colorimetry_matches(), it uses gst colorimetry in caps directly. It will causes mismatch. Seems need to use gst colorimetry obtained like the same way above.
Merge request reports
Activity
mentioned in commit hq/gst-plugins-good@a8b3d30c
added 19 commits
-
e885e0e1...0a0333d9 - 18 commits from branch
gstreamer:master
- a8b3d30c - v4l2object: Avoid colorimetry mismatch for streams with invalid colorimetry
-
e885e0e1...0a0333d9 - 18 commits from branch
assigned to @gstreamer-merge-bot
added 1.18 Needs backport labels
unassigned @gstreamer-merge-bot
- Resolved by Nicolas Dufresne
Ok, simple thing to fix, reported by the CI:
@@ -3388,7 +3388,7 @@ get_v4l2_field_for_info (GstVideoInfo * info) static gboolean gst_v4l2_video_colorimetry_matches (const GstVideoColorimetry * cinfo, - GstCaps *caps) + GstCaps * caps) { GstVideoInfo info; static const GstVideoColorimetry ci_likely_jpeg = {
mentioned in commit hq/gst-plugins-good@e0373913
assigned to @gstreamer-merge-bot
assigned to @hq and unassigned @gstreamer-merge-bot
assigned to @gstreamer-merge-bot and unassigned @hq
mentioned in commit tpm/gst-plugins-good@da72ba08
added Backported into 1.18 label and removed Needs backport label