From: Nicolas Dufresne Date: Fri, 22 Jun 2018 14:56:31 +0000 (+0000) Subject: v4l2videoenc: Don't set colorimetry on capture X-Git-Tag: 1.16.2~493 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fc67b248b84f6e631cd80ddb171ccea97392a31;p=platform%2Fupstream%2Fgst-plugins-good.git v4l2videoenc: Don't set colorimetry on capture The colorimetry will be set along with the raw format and those fields will then be copied from sink to src caps by the gst encoder. https://bugzilla.gnome.org/show_bug.cgi?id=791471 --- diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c index 9931329..5b6b810 100644 --- a/sys/v4l2/gstv4l2videoenc.c +++ b/sys/v4l2/gstv4l2videoenc.c @@ -813,6 +813,7 @@ gst_v4l2_video_enc_decide_allocation (GstVideoEncoder * { GstV4l2VideoEnc *self = GST_V4L2_VIDEO_ENC (encoder); GstVideoCodecState *state = gst_video_encoder_get_output_state (encoder); + GstCaps *caps; GstV4l2Error error = GST_V4L2_ERROR_INIT; GstClockTime latency; gboolean ret = FALSE; @@ -821,11 +822,15 @@ gst_v4l2_video_enc_decide_allocation (GstVideoEncoder * * GstVideoEncoder have set the width, height and framerate into the state * caps. These are needed by the driver to calculate the buffer size and to * implement bitrate adaptation. */ - if (!gst_v4l2_object_set_format (self->v4l2capture, state->caps, &error)) { + caps = gst_caps_copy (state->caps); + gst_structure_remove_field (gst_caps_get_structure (caps, 0), "colorimetry"); + if (!gst_v4l2_object_set_format (self->v4l2capture, caps, &error)) { gst_v4l2_error (self, &error); + gst_caps_unref (caps); ret = FALSE; goto done; } + gst_caps_unref (caps); if (gst_v4l2_object_decide_allocation (self->v4l2capture, query)) { GstVideoEncoderClass *enc_class = GST_VIDEO_ENCODER_CLASS (parent_class);