Commit 3a9d15bb authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2object: Really always set colorimetry

This fixes patch dd1c5aed 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.
parent 846d79aa
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment