mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
plugins/elements/gsttypefindelement.*: When typefinding is done in push mode, we should cache events we receive durin...
Original commit message from CVS: * plugins/elements/gsttypefindelement.c: (stop_typefinding), (gst_type_find_element_handle_event), (gst_type_find_element_send_cached_events), (gst_type_find_element_change_state): * plugins/elements/gsttypefindelement.h: When typefinding is done in push mode, we should cache events we receive during typefinding instead of just dropping them (e.g. newsegment, custom events from dvdreadsrc etc.) and then send them out once we've determined the type of the stream (and decodebin has had a chance to plug in a decoder/demuxer).
This commit is contained in:
parent
3dea59868b
commit
30ae52d1b9
3 changed files with 44 additions and 8 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2006-03-29 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* plugins/elements/gsttypefindelement.c: (stop_typefinding),
|
||||||
|
(gst_type_find_element_handle_event),
|
||||||
|
(gst_type_find_element_send_cached_events),
|
||||||
|
(gst_type_find_element_change_state):
|
||||||
|
* plugins/elements/gsttypefindelement.h:
|
||||||
|
When typefinding is done in push mode, we should cache
|
||||||
|
events we receive during typefinding instead of just
|
||||||
|
dropping them (e.g. newsegment, custom events from
|
||||||
|
dvdreadsrc etc.) and then send them out once we've
|
||||||
|
determined the type of the stream (and decodebin
|
||||||
|
has had a chance to plug in a decoder/demuxer).
|
||||||
|
|
||||||
2006-03-27 Wim Taymans <wim@fluendo.com>
|
2006-03-27 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* docs/design/part-qos.txt:
|
* docs/design/part-qos.txt:
|
||||||
|
|
|
@ -145,6 +145,8 @@ static gboolean
|
||||||
gst_type_find_element_activate_src_pull (GstPad * pad, gboolean active);
|
gst_type_find_element_activate_src_pull (GstPad * pad, gboolean active);
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_type_find_element_chain_do_typefinding (GstTypeFindElement * typefind);
|
gst_type_find_element_chain_do_typefinding (GstTypeFindElement * typefind);
|
||||||
|
static void
|
||||||
|
gst_type_find_element_send_cached_events (GstTypeFindElement * typefind);
|
||||||
|
|
||||||
static guint gst_type_find_element_signals[LAST_SIGNAL] = { 0 };
|
static guint gst_type_find_element_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
|
@ -440,6 +442,7 @@ stop_typefinding (GstTypeFindElement * typefind)
|
||||||
GST_DEBUG_PAD_NAME (peer)));
|
GST_DEBUG_PAD_NAME (peer)));
|
||||||
typefind->mode = MODE_ERROR; /* make the chain function error out */
|
typefind->mode = MODE_ERROR; /* make the chain function error out */
|
||||||
} else {
|
} else {
|
||||||
|
gst_type_find_element_send_cached_events (typefind);
|
||||||
gst_pad_push (typefind->src, typefind->store);
|
gst_pad_push (typefind->src, typefind->store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,19 +491,16 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
gst_event_unref (event);
|
GST_DEBUG_OBJECT (typefind, "Saving %s event to send later",
|
||||||
|
GST_EVENT_TYPE_NAME (event));
|
||||||
|
typefind->cached_events =
|
||||||
|
g_list_append (typefind->cached_events, event);
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MODE_NORMAL:
|
case MODE_NORMAL:
|
||||||
if (FALSE) { // GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
|
res = gst_pad_event_default (pad, event);
|
||||||
start_typefinding (typefind);
|
|
||||||
gst_event_unref (event);
|
|
||||||
res = TRUE;
|
|
||||||
} else {
|
|
||||||
res = gst_pad_event_default (pad, event);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MODE_ERROR:
|
case MODE_ERROR:
|
||||||
break;
|
break;
|
||||||
|
@ -510,6 +510,22 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_type_find_element_send_cached_events (GstTypeFindElement * typefind)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
|
for (l = typefind->cached_events; l != NULL; l = l->next) {
|
||||||
|
GstEvent *event = GST_EVENT (l->data);
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (typefind, "sending cached %s event",
|
||||||
|
GST_EVENT_TYPE_NAME (event));
|
||||||
|
gst_pad_push_event (typefind->src, event);
|
||||||
|
}
|
||||||
|
g_list_free (typefind->cached_events);
|
||||||
|
typefind->cached_events = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
|
gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
|
@ -726,6 +742,10 @@ gst_type_find_element_change_state (GstElement * element,
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
gst_caps_replace (&typefind->caps, NULL);
|
gst_caps_replace (&typefind->caps, NULL);
|
||||||
|
g_list_foreach (typefind->cached_events,
|
||||||
|
(GFunc) gst_mini_object_unref, NULL);
|
||||||
|
g_list_free (typefind->cached_events);
|
||||||
|
typefind->cached_events = NULL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -58,6 +58,8 @@ struct _GstTypeFindElement {
|
||||||
|
|
||||||
guint mode;
|
guint mode;
|
||||||
GstBuffer * store;
|
GstBuffer * store;
|
||||||
|
|
||||||
|
GList * cached_events;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstTypeFindElementClass {
|
struct _GstTypeFindElementClass {
|
||||||
|
|
Loading…
Reference in a new issue