gst/playback/gstdecodebin2.c: Fix random fat-fingering making this not compile.

Original commit message from CVS:
* gst/playback/gstdecodebin2.c:
Fix random fat-fingering making this not compile.
This commit is contained in:
Michael Smith 2008-11-21 00:04:48 +00:00
parent 277e46886c
commit 5830b42dc5
3 changed files with 70 additions and 46 deletions

View file

@ -1,3 +1,8 @@
2008-11-20 Michael Smith <msmith@songbirdnest.com>
* gst/playback/gstdecodebin2.c:
Fix random fat-fingering making this not compile.
2008-11-20 Michael Smith <msmith@songbirdnest.com> 2008-11-20 Michael Smith <msmith@songbirdnest.com>
* gst/playback/gstdecodebin2.c: * gst/playback/gstdecodebin2.c:

2
common

@ -1 +1 @@
Subproject commit edfb4b44ea433b0b83b8a2f27a6e0bcbccdc3f2f Subproject commit e4b2fe44724e1c1a6e816ae4fbbae43d7f68f1ef

View file

@ -1435,7 +1435,7 @@ type_found (GstElement * typefind, guint probability,
pad = gst_element_get_static_pad (typefind, "src"); pad = gst_element_get_static_pad (typefind, "src");
analyze_new_paypefind, pad, caps, NULL); analyze_new_pad (decode_bin, typefind, pad, caps, NULL);
gst_object_unref (pad); gst_object_unref (pad);
@ -1444,8 +1444,7 @@ exit:
} }
static void static void
pad_added_group_cb (GstElement * element, GstPad * pad, pad_added_group_cb (GstElement * element, GstPad * pad, GstDecodeGroup * group)
GstDecodeGroup * group)
{ {
GstCaps *caps; GstCaps *caps;
gboolean expose = FALSE; gboolean expose = FALSE;
@ -1474,7 +1473,7 @@ static void
} }
static void static void
pad_removed_group_cb (GstElement * element, GstPad * pad, pad_removed_group_cb (GstElement * element, GstPad * pad,
GstDecodeGroup * group) GstDecodeGroup * group)
{ {
GST_LOG_OBJECT (pad, "pad removed, group:%p", group); GST_LOG_OBJECT (pad, "pad removed, group:%p", group);
@ -1483,7 +1482,8 @@ static void
* removed when the group's multiqueue is drained */ * removed when the group's multiqueue is drained */
} }
static void no_more_pads_group_cb (GstElement * element, GstDecodeGroup * group) static void
no_more_pads_group_cb (GstElement * element, GstDecodeGroup * group)
{ {
GST_LOG_OBJECT (element, "no more pads, setting group %p to complete", group); GST_LOG_OBJECT (element, "no more pads, setting group %p to complete", group);
@ -1492,7 +1492,7 @@ static void no_more_pads_group_cb (GstElement * element, GstDecodeGroup * group)
} }
static void static void
pad_added_cb (GstElement * element, GstPad * pad, GstDecodeBin * dbin) pad_added_cb (GstElement * element, GstPad * pad, GstDecodeBin * dbin)
{ {
GstCaps *caps; GstCaps *caps;
@ -1505,12 +1505,13 @@ static void
} }
static void static void
pad_removed_cb (GstElement * element, GstPad * pad, GstDecodeBin * dbin) pad_removed_cb (GstElement * element, GstPad * pad, GstDecodeBin * dbin)
{ {
GST_LOG_OBJECT (pad, "Pad removed from non-grouped element"); GST_LOG_OBJECT (pad, "Pad removed from non-grouped element");
} }
static void no_more_pads_cb (GstElement * element, GstDecodeBin * dbin) static void
no_more_pads_cb (GstElement * element, GstDecodeBin * dbin)
{ {
GstDecodeGroup *group; GstDecodeGroup *group;
@ -1531,7 +1532,7 @@ no_group:
} }
static void static void
caps_notify_cb (GstPad * pad, GParamSpec * unused, GstDecodeBin * dbin) caps_notify_cb (GstPad * pad, GParamSpec * unused, GstDecodeBin * dbin)
{ {
GstElement *element; GstElement *element;
@ -1546,8 +1547,7 @@ static void
} }
static void static void
caps_notify_group_cb (GstPad * pad, GParamSpec * unused, caps_notify_group_cb (GstPad * pad, GParamSpec * unused, GstDecodeGroup * group)
GstDecodeGroup * group)
{ {
GstElement *element; GstElement *element;
@ -1562,7 +1562,8 @@ static void
/* Decide whether an element is a demuxer based on the /* Decide whether an element is a demuxer based on the
* klass and number/type of src pad templates it has */ * klass and number/type of src pad templates it has */
static gboolean is_demuxer_element (GstElement * srcelement) static gboolean
is_demuxer_element (GstElement * srcelement)
{ {
GstElementFactory *srcfactory; GstElementFactory *srcfactory;
GstElementClass *elemclass; GstElementClass *elemclass;
@ -1614,7 +1615,8 @@ static gboolean is_demuxer_element (GstElement * srcelement)
* *
* The decodebin_lock should be taken ! * The decodebin_lock should be taken !
*/ */
static gboolean are_raw_caps (GstDecodeBin * dbin, GstCaps * caps) static gboolean
are_raw_caps (GstDecodeBin * dbin, GstCaps * caps)
{ {
GstCaps *intersection; GstCaps *intersection;
gboolean res; gboolean res;
@ -1640,7 +1642,8 @@ static gboolean are_raw_caps (GstDecodeBin * dbin, GstCaps * caps)
* GstDecodeGroup functions * GstDecodeGroup functions
****/ ****/
static void multi_queue_overrun_cb (GstElement * queue, GstDecodeGroup * group) static void
multi_queue_overrun_cb (GstElement * queue, GstDecodeGroup * group)
{ {
GST_LOG_OBJECT (group->dbin, "multiqueue is full"); GST_LOG_OBJECT (group->dbin, "multiqueue is full");
@ -1655,8 +1658,8 @@ static void multi_queue_overrun_cb (GstElement * queue, GstDecodeGroup * group)
* Creates a new GstDecodeGroup. It is up to the caller to add it to the list * Creates a new GstDecodeGroup. It is up to the caller to add it to the list
* of groups. * of groups.
*/ */
static GstDecodeGroup *gst_decode_group_new (GstDecodeBin * dbin, static GstDecodeGroup *
gboolean use_queue) gst_decode_group_new (GstDecodeBin * dbin, gboolean use_queue)
{ {
GstDecodeGroup *group; GstDecodeGroup *group;
GstElement *mq; GstElement *mq;
@ -1710,7 +1713,8 @@ static GstDecodeGroup *gst_decode_group_new (GstDecodeBin * dbin,
* *
* Returns: %NULL if no groups are available, or all groups are completed. * Returns: %NULL if no groups are available, or all groups are completed.
*/ */
static GstDecodeGroup *get_current_group (GstDecodeBin * dbin) static GstDecodeGroup *
get_current_group (GstDecodeBin * dbin)
{ {
GList *tmp; GList *tmp;
GstDecodeGroup *group = NULL; GstDecodeGroup *group = NULL;
@ -1740,8 +1744,8 @@ static GstDecodeGroup *get_current_group (GstDecodeBin * dbin)
* Returns the srcpad of the multiqueue corresponding the given pad. * Returns the srcpad of the multiqueue corresponding the given pad.
* Returns NULL if there was an error. * Returns NULL if there was an error.
*/ */
static GstPad *gst_decode_group_control_demuxer_pad (GstDecodeGroup * group, static GstPad *
GstPad * pad) gst_decode_group_control_demuxer_pad (GstDecodeGroup * group, GstPad * pad)
{ {
GstPad *srcpad, *sinkpad; GstPad *srcpad, *sinkpad;
gchar *nb, *sinkname, *srcname; gchar *nb, *sinkname, *srcname;
@ -1784,7 +1788,7 @@ beach:
} }
static gboolean static gboolean
gst_decode_group_control_source_pad (GstDecodeGroup * group, gst_decode_group_control_source_pad (GstDecodeGroup * group,
GstDecodePad * dpad) GstDecodePad * dpad)
{ {
g_return_val_if_fail (group != NULL, FALSE); g_return_val_if_fail (group != NULL, FALSE);
@ -1809,7 +1813,8 @@ static gboolean
* *
* Call with the group lock taken ! MT safe * Call with the group lock taken ! MT safe
*/ */
static void gst_decode_group_check_if_blocked (GstDecodeGroup * group) static void
gst_decode_group_check_if_blocked (GstDecodeGroup * group)
{ {
GList *tmp; GList *tmp;
gboolean blocked = TRUE; gboolean blocked = TRUE;
@ -1847,7 +1852,8 @@ static void gst_decode_group_check_if_blocked (GstDecodeGroup * group)
DECODE_BIN_UNLOCK (group->dbin); DECODE_BIN_UNLOCK (group->dbin);
} }
static void gst_decode_group_check_if_drained (GstDecodeGroup * group) static void
gst_decode_group_check_if_drained (GstDecodeGroup * group)
{ {
GList *tmp; GList *tmp;
GstDecodeBin *dbin = group->dbin; GstDecodeBin *dbin = group->dbin;
@ -1910,7 +1916,8 @@ done:
* Return: negative if a<b, 0 if a==b, positive if a>b * Return: negative if a<b, 0 if a==b, positive if a>b
*/ */
static gint sort_end_pads (GstDecodePad * da, GstDecodePad * db) static gint
sort_end_pads (GstDecodePad * da, GstDecodePad * db)
{ {
gint va, vb; gint va, vb;
GstCaps *capsa, *capsb; GstCaps *capsa, *capsb;
@ -1960,7 +1967,8 @@ static gint sort_end_pads (GstDecodePad * da, GstDecodePad * db)
* *
* Not MT safe, please take the group lock * Not MT safe, please take the group lock
*/ */
static gboolean gst_decode_group_expose (GstDecodeGroup * group) static gboolean
gst_decode_group_expose (GstDecodeGroup * group)
{ {
GList *tmp; GList *tmp;
GList *next = NULL; GList *next = NULL;
@ -2082,7 +2090,8 @@ name_problem:
return FALSE; return FALSE;
} }
static void gst_decode_group_hide (GstDecodeGroup * group) static void
gst_decode_group_hide (GstDecodeGroup * group)
{ {
GList *tmp; GList *tmp;
@ -2108,7 +2117,7 @@ static void gst_decode_group_hide (GstDecodeGroup * group)
} }
static void static void
deactivate_free_recursive (GstDecodeGroup * group, GstElement * element) deactivate_free_recursive (GstDecodeGroup * group, GstElement * element)
{ {
GstIterator *it; GstIterator *it;
GstIteratorResult res; GstIteratorResult res;
@ -2175,7 +2184,8 @@ beach:
return; return;
} }
static void gst_decode_group_free (GstDecodeGroup * group) static void
gst_decode_group_free (GstDecodeGroup * group)
{ {
GList *tmp; GList *tmp;
@ -2223,7 +2233,8 @@ static void gst_decode_group_free (GstDecodeGroup * group)
* *
* MT safe * MT safe
*/ */
static void gst_decode_group_set_complete (GstDecodeGroup * group) static void
gst_decode_group_set_complete (GstDecodeGroup * group)
{ {
GST_LOG_OBJECT (group->dbin, "Setting group %p to COMPLETE", group); GST_LOG_OBJECT (group->dbin, "Setting group %p to COMPLETE", group);
@ -2239,11 +2250,13 @@ static void gst_decode_group_set_complete (GstDecodeGroup * group)
* GstDecodePad functions * GstDecodePad functions
*************************/ *************************/
static void gst_decode_pad_class_init (GstDecodePadClass * klass) static void
gst_decode_pad_class_init (GstDecodePadClass * klass)
{ {
} }
static void gst_decode_pad_init (GstDecodePad * pad) static void
gst_decode_pad_init (GstDecodePad * pad)
{ {
pad->group = NULL; pad->group = NULL;
pad->blocked = FALSE; pad->blocked = FALSE;
@ -2253,8 +2266,7 @@ static void gst_decode_pad_init (GstDecodePad * pad)
} }
static void static void
source_pad_blocked_cb (GstDecodePad * dpad, gboolean blocked, source_pad_blocked_cb (GstDecodePad * dpad, gboolean blocked, gpointer unused)
gpointer unused)
{ {
GST_LOG_OBJECT (dpad, "blocked:%d, dpad->group:%p", blocked, dpad->group); GST_LOG_OBJECT (dpad, "blocked:%d, dpad->group:%p", blocked, dpad->group);
@ -2269,7 +2281,7 @@ static void
} }
static gboolean static gboolean
source_pad_event_probe (GstPad * pad, GstEvent * event, GstDecodePad * dpad) source_pad_event_probe (GstPad * pad, GstEvent * event, GstDecodePad * dpad)
{ {
GST_LOG_OBJECT (pad, "%s dpad:%p", GST_EVENT_TYPE_NAME (event), dpad); GST_LOG_OBJECT (pad, "%s dpad:%p", GST_EVENT_TYPE_NAME (event), dpad);
@ -2288,20 +2300,22 @@ static gboolean
return TRUE; return TRUE;
} }
static void gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked) static void
gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked)
{ {
gst_pad_set_blocked_async (GST_PAD (dpad), blocked, gst_pad_set_blocked_async (GST_PAD (dpad), blocked,
(GstPadBlockCallback) source_pad_blocked_cb, NULL); (GstPadBlockCallback) source_pad_blocked_cb, NULL);
} }
static void gst_decode_pad_add_drained_check (GstDecodePad * dpad) static void
gst_decode_pad_add_drained_check (GstDecodePad * dpad)
{ {
gst_pad_add_event_probe (GST_PAD (dpad), gst_pad_add_event_probe (GST_PAD (dpad),
G_CALLBACK (source_pad_event_probe), dpad); G_CALLBACK (source_pad_event_probe), dpad);
} }
static void static void
gst_decode_pad_activate (GstDecodePad * dpad, GstDecodeGroup * group) gst_decode_pad_activate (GstDecodePad * dpad, GstDecodeGroup * group)
{ {
g_return_if_fail (group != NULL); g_return_if_fail (group != NULL);
@ -2311,7 +2325,8 @@ static void
gst_decode_pad_add_drained_check (dpad); gst_decode_pad_add_drained_check (dpad);
} }
static void gst_decode_pad_unblock (GstDecodePad * dpad) static void
gst_decode_pad_unblock (GstDecodePad * dpad)
{ {
gst_decode_pad_set_blocked (dpad, FALSE); gst_decode_pad_set_blocked (dpad, FALSE);
} }
@ -2320,8 +2335,8 @@ static void gst_decode_pad_unblock (GstDecodePad * dpad)
* *
* Creates a new GstDecodePad for the given pad. * Creates a new GstDecodePad for the given pad.
*/ */
static GstDecodePad *gst_decode_pad_new (GstDecodeBin * dbin, GstPad * pad, static GstDecodePad *
GstDecodeGroup * group) gst_decode_pad_new (GstDecodeBin * dbin, GstPad * pad, GstDecodeGroup * group)
{ {
GstDecodePad *dpad; GstDecodePad *dpad;
@ -2340,7 +2355,8 @@ static GstDecodePad *gst_decode_pad_new (GstDecodeBin * dbin, GstPad * pad,
* Element add/remove * Element add/remove
*****/ *****/
static void do_async_start (GstDecodeBin * dbin) static void
do_async_start (GstDecodeBin * dbin)
{ {
GstMessage *message; GstMessage *message;
@ -2350,7 +2366,8 @@ static void do_async_start (GstDecodeBin * dbin)
parent_class->handle_message (GST_BIN_CAST (dbin), message); parent_class->handle_message (GST_BIN_CAST (dbin), message);
} }
static void do_async_done (GstDecodeBin * dbin) static void
do_async_done (GstDecodeBin * dbin)
{ {
GstMessage *message; GstMessage *message;
@ -2372,7 +2389,8 @@ static void do_async_done (GstDecodeBin * dbin)
* any. * any.
*/ */
static GstPad *find_sink_pad (GstElement * element) static GstPad *
find_sink_pad (GstElement * element)
{ {
GstIterator *it; GstIterator *it;
GstPad *pad = NULL; GstPad *pad = NULL;
@ -2389,8 +2407,7 @@ static GstPad *find_sink_pad (GstElement * element)
} }
static GstStateChangeReturn static GstStateChangeReturn
gst_decode_bin_change_state (GstElement * element, gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
GstStateChange transition)
{ {
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstDecodeBin *dbin = GST_DECODE_BIN (element); GstDecodeBin *dbin = GST_DECODE_BIN (element);
@ -2442,7 +2459,9 @@ activate_failed:
} }
} }
gboolean gst_decode_bin_plugin_init (GstPlugin * plugin) { gboolean
gst_decode_bin_plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_decode_bin_debug, "decodebin2", 0, GST_DEBUG_CATEGORY_INIT (gst_decode_bin_debug, "decodebin2", 0,
"decoder bin"); "decoder bin");