From 6704fbb044f17ddeef9ff70942ff6388fd41bf6a Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 28 Jun 2018 19:08:35 -0400 Subject: [PATCH] v4l2videoenc: Only renegotiate with upstream When the decoder get linked further, it will receive a renegotiation event from downstream. This case is not supported and should be ignored. This fixes issues when this encoder is used inside an GstRtspServer pipeline. https://bugzilla.gnome.org/show_bug.cgi?id=796525 --- sys/v4l2/gstv4l2videoenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c index 5b6b810015..7e88923140 100644 --- a/sys/v4l2/gstv4l2videoenc.c +++ b/sys/v4l2/gstv4l2videoenc.c @@ -521,6 +521,10 @@ gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder) GST_DEBUG_OBJECT (self, "Negotiating %s profile and level.", klass->codec_name); + /* Only renegotiate on upstream changes */ + if (self->input_state) + return TRUE; + allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder)); if (allowed_caps) {