openh264enc: Don't set caps manually
authorSebastian Dröge <sebastian@centricular.com>
Thu, 2 Oct 2014 10:53:01 +0000 (13:53 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 3 Oct 2014 14:23:35 +0000 (17:23 +0300)
This will break the order of events in GStreamer.

ext/openh264/gstopenh264enc.cpp

index 8f67dd2..6a66d39 100644 (file)
@@ -542,13 +542,12 @@ static gboolean gst_openh264enc_set_format(GstVideoEncoder *encoder, GstVideoCod
                         "pixel-aspect-ratio", GST_TYPE_FRACTION, par_n, par_d,
                         "codec_data", GST_TYPE_BUFFER, codec_data,
                         NULL);
-    ret = gst_pad_set_caps(GST_VIDEO_ENCODER_SRC_PAD(openh264enc), outcaps);
     gst_buffer_unref(codec_data);
 
     output_state = gst_video_encoder_set_output_state(encoder, outcaps, state);
     gst_video_codec_state_unref(output_state);
 
-    return TRUE;
+    return gst_video_encoder_negotiate (encoder);
 }
 
 static GstFlowReturn gst_openh264enc_handle_frame(GstVideoEncoder *encoder, GstVideoCodecFrame *frame)