mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:28:32 +00:00
gst/selector/gstinputselector.c: Reset the selector state when going to READY.
Original commit message from CVS: * gst/selector/gstinputselector.c: (gst_selector_pad_reset), (gst_input_selector_reset), (gst_input_selector_change_state): Reset the selector state when going to READY.
This commit is contained in:
parent
a35d1dde42
commit
5d1c162f06
3 changed files with 44 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-09-08 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/selector/gstinputselector.c: (gst_selector_pad_reset),
|
||||||
|
(gst_input_selector_reset), (gst_input_selector_change_state):
|
||||||
|
Reset the selector state when going to READY.
|
||||||
|
|
||||||
2008-09-05 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-09-05 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* gst/rtpmanager/gstrtpbin.c: (on_sender_timeout),
|
* gst/rtpmanager/gstrtpbin.c: (on_sender_timeout),
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit a1e554f656b1f8829dbca280c0f1bdee9dec5e48
|
Subproject commit 1ff63d8f92c36bf207434436f4ce75f2a4ea11a4
|
|
@ -313,6 +313,7 @@ gst_selector_pad_reset (GstSelectorPad * pad)
|
||||||
pad->active = FALSE;
|
pad->active = FALSE;
|
||||||
pad->eos = FALSE;
|
pad->eos = FALSE;
|
||||||
pad->segment_pending = FALSE;
|
pad->segment_pending = FALSE;
|
||||||
|
pad->discont = FALSE;
|
||||||
gst_segment_init (&pad->segment, GST_FORMAT_UNDEFINED);
|
gst_segment_init (&pad->segment, GST_FORMAT_UNDEFINED);
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
}
|
}
|
||||||
|
@ -1244,6 +1245,34 @@ gst_input_selector_release_pad (GstElement * element, GstPad * pad)
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_input_selector_reset (GstInputSelector * sel)
|
||||||
|
{
|
||||||
|
GList *walk;
|
||||||
|
|
||||||
|
GST_INPUT_SELECTOR_LOCK (sel);
|
||||||
|
/* clear active pad */
|
||||||
|
if (sel->active_sinkpad) {
|
||||||
|
gst_object_unref (sel->active_sinkpad);
|
||||||
|
sel->active_sinkpad = NULL;
|
||||||
|
}
|
||||||
|
/* reset segment */
|
||||||
|
gst_segment_init (&sel->segment, GST_FORMAT_UNDEFINED);
|
||||||
|
sel->pending_close = FALSE;
|
||||||
|
/* reset each of our sinkpads state */
|
||||||
|
for (walk = GST_ELEMENT_CAST (sel)->sinkpads; walk; walk = g_list_next (walk)) {
|
||||||
|
GstSelectorPad *selpad = GST_SELECTOR_PAD_CAST (walk->data);
|
||||||
|
|
||||||
|
gst_selector_pad_reset (selpad);
|
||||||
|
|
||||||
|
if (selpad->tags) {
|
||||||
|
gst_tag_list_free (selpad->tags);
|
||||||
|
selpad->tags = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||||
|
}
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_input_selector_change_state (GstElement * element,
|
gst_input_selector_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
|
@ -1273,6 +1302,14 @@ gst_input_selector_change_state (GstElement * element,
|
||||||
|
|
||||||
result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
|
switch (transition) {
|
||||||
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
|
gst_input_selector_reset (self);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue