mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-03 15:06:34 +00:00
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
This commit is contained in:
parent
f173fa15b1
commit
ce50fc221e
1 changed files with 2 additions and 15 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue