v4l2object: Really always set colorimetry

This fixes patch dd1c5aed65 which
pretended to always set colorimetry but the patch was incomplete.
This is again best effort considering the spec says that for CAPTURE
you may only read this value.
This commit is contained in:
Nicolas Dufresne 2018-06-27 16:57:29 -04:00
parent 35ab185d75
commit b677ae3cb6

View file

@ -3449,23 +3449,21 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
}
#endif
if (V4L2_TYPE_IS_OUTPUT (v4l2object->type)) {
if (is_mplane) {
format.fmt.pix_mp.colorspace = colorspace;
format.fmt.pix_mp.quantization = range;
format.fmt.pix_mp.ycbcr_enc = matrix;
format.fmt.pix_mp.xfer_func = transfer;
} else {
format.fmt.pix.colorspace = colorspace;
format.fmt.pix.quantization = range;
format.fmt.pix.ycbcr_enc = matrix;
format.fmt.pix.xfer_func = transfer;
}
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "Desired colorspace is %d:%d:%d:%d",
colorspace, range, matrix, transfer);
if (is_mplane) {
format.fmt.pix_mp.colorspace = colorspace;
format.fmt.pix_mp.quantization = range;
format.fmt.pix_mp.ycbcr_enc = matrix;
format.fmt.pix_mp.xfer_func = transfer;
} else {
format.fmt.pix.colorspace = colorspace;
format.fmt.pix.quantization = range;
format.fmt.pix.ycbcr_enc = matrix;
format.fmt.pix.xfer_func = transfer;
}
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "Desired colorspace is %d:%d:%d:%d",
colorspace, range, matrix, transfer);
if (try_only) {
if (v4l2object->ioctl (fd, VIDIOC_TRY_FMT, &format) < 0)
goto try_fmt_failed;