diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2014-07-08 16:59:37 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2014-07-25 14:12:02 -0400 |
commit | ce50fc221e8a795d7cfedf471d239d4a9d3bf824 (patch) | |
tree | 168e18fbf1c66c90920be85de54de42f0d1d3813 | |
parent | f173fa15b19b735b4aa727015c58a177c0b28803 (diff) |
videoencoder: Don't delay set_format
This prevent implementing allocation query, as the format need to be
known in order to determin the size and number of buffers needed.
Note: This may lead to few regressions that will need fixing
https://bugzilla.gnome.org/show_bug.cgi?id=732288
-rw-r--r-- | gst-libs/gst/video/gstvideoencoder.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c index e0264d120..45fdbf9c6 100644 --- a/gst-libs/gst/video/gstvideoencoder.c +++ b/gst-libs/gst/video/gstvideoencoder.c @@ -138,7 +138,6 @@ struct _GstVideoEncoderPrivate /* FIXME : (and introduce a context ?) */ gboolean drained; gboolean at_eos; - gboolean do_caps; gint64 min_latency; gint64 max_latency; @@ -981,8 +980,8 @@ gst_video_encoder_sink_event_default (GstVideoEncoder * encoder, GstCaps *caps; gst_event_parse_caps (event, &caps); - ret = TRUE; - encoder->priv->do_caps = TRUE; + ret = gst_video_encoder_setcaps (encoder, caps); + gst_event_unref (event); event = NULL; break; @@ -1353,18 +1352,6 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) g_return_val_if_fail (klass->handle_frame != NULL, GST_FLOW_ERROR); - if (G_UNLIKELY (encoder->priv->do_caps)) { - GstCaps *caps = gst_pad_get_current_caps (encoder->sinkpad); - if (!caps) - goto not_negotiated; - if (!gst_video_encoder_setcaps (encoder, caps)) { - gst_caps_unref (caps); - goto not_negotiated; - } - gst_caps_unref (caps); - encoder->priv->do_caps = FALSE; - } - if (!encoder->priv->input_state) goto not_negotiated; |