[PATCH] Fix some BT2020 colorimetry handling in v4l2 objects

Nicolas Dufresne nicolas.dufresne at collabora.com
Tue Sep 5 13:24:17 UTC 2017


Hi Ian,

the GStreamer project accepts and review patches attached to
bugs.gnome.org in "git format-patch" format. You may use "git-bz" for
ease of uploading.

I'll review you patch from there later on.

regards,
Nicolas

Le lundi 04 septembre 2017 à 12:17 +0100, Ian Jamison a écrit :
> Signed-off-by: Ian Jamison <ian.dev at arkver.com>
> ---
> Hi Nicholas,
> I had a look at this file and there seemed to be some other cases in
> gst_v4l2_object_set_format_full that weren't handling BT2020.
> Thought I'd send you this, fyi.
> Regards,
> Ian
> 
>  sys/v4l2/gstv4l2object.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
> index af62d6db6..57d7b3840 100644
> --- a/sys/v4l2/gstv4l2object.c
> +++ b/sys/v4l2/gstv4l2object.c
> @@ -2032,7 +2032,7 @@ gst_v4l2_object_get_colorspace (struct
> v4l2_format *fmt,
>        cinfo->matrix = GST_VIDEO_COLOR_MATRIX_BT709;
>        break;
>      case V4L2_YCBCR_ENC_BT2020_CONST_LUM:
> -      GST_FIXME ("BT2020 with constant lumma is not defined,
> assuming BT2020");
> +      GST_FIXME ("BT2020 with constant luma is not defined, assuming
> BT2020");
>        /* fallthrough */
>      case V4L2_YCBCR_ENC_BT2020:
>        cinfo->matrix = GST_VIDEO_COLOR_MATRIX_BT2020;
> @@ -2057,7 +2057,7 @@ gst_v4l2_object_get_colorspace (struct
> v4l2_format *fmt,
>  
>    switch (transfer) {
>      case V4L2_XFER_FUNC_709:
> -      if (fmt->fmt.pix.height > 2160)
> +      if (fmt->fmt.pix.height >= 2160)
>          cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12;
>        else
>          cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
> @@ -3199,6 +3199,9 @@ gst_v4l2_object_set_format_full (GstV4l2Object
> * v4l2object, GstCaps * caps,
>          else
>            colorspace = V4L2_COLORSPACE_SRGB;
>          break;
> +      case GST_VIDEO_COLOR_PRIMARIES_BT2020:
> +        colorspace = V4L2_COLORSPACE_BT2020;
> +        break;
>        case GST_VIDEO_COLOR_PRIMARIES_BT470M:
>          colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
>          break;
> @@ -3277,6 +3280,7 @@ gst_v4l2_object_set_format_full (GstV4l2Object
> * v4l2object, GstCaps * caps,
>        case GST_VIDEO_TRANSFER_GAMMA10:
>          transfer = V4L2_XFER_FUNC_NONE;
>          break;
> +      case GST_VIDEO_TRANSFER_BT2020_12:
>        case GST_VIDEO_TRANSFER_BT709:
>          transfer = V4L2_XFER_FUNC_709;
>          break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170905/9a40c97e/attachment.sig>


More information about the gstreamer-devel mailing list