v4l2: Reset transfer in gst_v4l2_object_acquire_format()

get_colorspace() checks input caps transfer when mapping V4L2_XFER_FUNC_709
back to V4L2_COLORSPACE_BT2020 and GST_VIDEO_TRANSFER_BT2020_12. After
receiving source change event, decoder will G_FMT and S_FMT again. So need
to reset transfer when acquiring format to avoid using the old transfer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2475>
This commit is contained in:
Hou Qi 2022-05-24 16:07:13 +08:00 committed by GStreamer Marge Bot
parent 6c0423b861
commit 7f2fb3b783

View file

@ -4225,6 +4225,7 @@ gst_v4l2_object_acquire_format (GstV4l2Object * v4l2object, GstVideoInfo * info)
gst_video_info_init (info);
gst_video_alignment_reset (&align);
v4l2object->transfer = GST_VIDEO_TRANSFER_UNKNOWN;
memset (&fmt, 0x00, sizeof (struct v4l2_format));
fmt.type = v4l2object->type;