mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
gst/playback/gststreamselector.*: Be more selective when we're redoing caps negotiation from within the chain functio...
Original commit message from CVS: * gst/playback/gststreamselector.c: (gst_stream_selector_init), (gst_stream_selector_get_caps), (gst_stream_selector_chain): * gst/playback/gststreamselector.h: Be more selective when we're redoing caps negotiation from within the chain function on a stream change.
This commit is contained in:
parent
705aac4125
commit
05d83eb4cd
3 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-01-28 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/playback/gststreamselector.c: (gst_stream_selector_init),
|
||||
(gst_stream_selector_get_caps), (gst_stream_selector_chain):
|
||||
* gst/playback/gststreamselector.h:
|
||||
Be more selective when we're redoing caps negotiation from
|
||||
within the chain function on a stream change.
|
||||
|
||||
2005-01-28 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* configure.ac:
|
||||
|
|
|
@ -143,6 +143,7 @@ gst_stream_selector_init (GstStreamSelector * sel)
|
|||
/* sinkpad management */
|
||||
sel->last_active_sinkpad = NULL;
|
||||
sel->nb_sinkpads = 0;
|
||||
sel->in_chain = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -172,6 +173,7 @@ gst_stream_selector_get_linked_pad (GstPad * pad)
|
|||
static GstCaps *
|
||||
gst_stream_selector_get_caps (GstPad * pad)
|
||||
{
|
||||
GstStreamSelector *sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad));
|
||||
GstPad *otherpad = gst_stream_selector_get_linked_pad (pad);
|
||||
|
||||
if (!otherpad) {
|
||||
|
@ -179,6 +181,8 @@ gst_stream_selector_get_caps (GstPad * pad)
|
|||
"Pad %s not linked, returning ANY", gst_pad_get_name (pad));
|
||||
|
||||
return gst_caps_new_any ();
|
||||
} else if (otherpad == sel->last_active_sinkpad && sel->in_chain) {
|
||||
return gst_caps_copy (GST_PAD_CAPS (sel->last_active_sinkpad));
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (gst_pad_get_parent (pad),
|
||||
|
@ -265,7 +269,9 @@ gst_stream_selector_chain (GstPad * pad, GstData * data)
|
|||
gst_pad_get_name (sel->last_active_sinkpad) : "none",
|
||||
gst_pad_get_name (pad));
|
||||
sel->last_active_sinkpad = pad;
|
||||
ret = gst_pad_renegotiate (pad);
|
||||
sel->in_chain = TRUE;
|
||||
ret = gst_pad_renegotiate (sel->srcpad);
|
||||
sel->in_chain = FALSE;
|
||||
if (GST_PAD_LINK_FAILED (ret)) {
|
||||
GST_ELEMENT_ERROR (sel, CORE, NEGOTIATION, (NULL), (NULL));
|
||||
sel->last_active_sinkpad = NULL;
|
||||
|
|
|
@ -45,6 +45,7 @@ struct _GstStreamSelector {
|
|||
GstPad *last_active_sinkpad;
|
||||
GstPad *srcpad;
|
||||
guint nb_sinkpads;
|
||||
gboolean in_chain;
|
||||
};
|
||||
|
||||
struct _GstStreamSelectorClass {
|
||||
|
|
Loading…
Reference in a new issue