mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
v4l2object: handle GST_VIDEO_TRANSFER_BT601
V4L2 makes no difference between the BT.601 and BT.709 transfer functions [1], but GStreamer does since 1.18 [2]. Adapt gst_v4l2_object_get_colorspace() and gst_v4l2_object_set_format_full(). [1] https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/colorspaces-details.html#colorspace-smpte-170m-v4l2-colorspace-smpte170m [2] https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/856>
This commit is contained in:
parent
f2d909eb4e
commit
78dec1e403
1 changed files with 4 additions and 1 deletions
|
@ -2054,7 +2054,7 @@ gst_v4l2_object_get_colorspace (GstV4l2Object * v4l2object,
|
||||||
case V4L2_COLORSPACE_SMPTE170M:
|
case V4L2_COLORSPACE_SMPTE170M:
|
||||||
cinfo->range = GST_VIDEO_COLOR_RANGE_16_235;
|
cinfo->range = GST_VIDEO_COLOR_RANGE_16_235;
|
||||||
cinfo->matrix = GST_VIDEO_COLOR_MATRIX_BT601;
|
cinfo->matrix = GST_VIDEO_COLOR_MATRIX_BT601;
|
||||||
cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
|
cinfo->transfer = GST_VIDEO_TRANSFER_BT601;
|
||||||
cinfo->primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE170M;
|
cinfo->primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE170M;
|
||||||
break;
|
break;
|
||||||
case V4L2_COLORSPACE_REC709:
|
case V4L2_COLORSPACE_REC709:
|
||||||
|
@ -2183,6 +2183,8 @@ gst_v4l2_object_get_colorspace (GstV4l2Object * v4l2object,
|
||||||
case V4L2_XFER_FUNC_709:
|
case V4L2_XFER_FUNC_709:
|
||||||
if (colorspace == V4L2_COLORSPACE_BT2020 && fmt->fmt.pix.height >= 2160)
|
if (colorspace == V4L2_COLORSPACE_BT2020 && fmt->fmt.pix.height >= 2160)
|
||||||
cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12;
|
cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12;
|
||||||
|
else if (colorspace == V4L2_COLORSPACE_SMPTE170M)
|
||||||
|
cinfo->transfer = GST_VIDEO_TRANSFER_BT601;
|
||||||
else
|
else
|
||||||
cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
|
cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
|
||||||
|
|
||||||
|
@ -3589,6 +3591,7 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
|
||||||
case GST_VIDEO_TRANSFER_GAMMA10:
|
case GST_VIDEO_TRANSFER_GAMMA10:
|
||||||
transfer = V4L2_XFER_FUNC_NONE;
|
transfer = V4L2_XFER_FUNC_NONE;
|
||||||
break;
|
break;
|
||||||
|
case GST_VIDEO_TRANSFER_BT601:
|
||||||
case GST_VIDEO_TRANSFER_BT2020_12:
|
case GST_VIDEO_TRANSFER_BT2020_12:
|
||||||
case GST_VIDEO_TRANSFER_BT2020_10:
|
case GST_VIDEO_TRANSFER_BT2020_10:
|
||||||
case GST_VIDEO_TRANSFER_BT709:
|
case GST_VIDEO_TRANSFER_BT709:
|
||||||
|
|
Loading…
Reference in a new issue