uridecodebin, decodebin: remove new-decoded-pad and removed-decoded-pad signals

They were deprecated, use "pad-added" and "pad-removed" instead.
This commit is contained in:
Tim-Philipp Müller 2011-06-15 00:32:23 +01:00
parent 8573dbdf66
commit 59581d464f
4 changed files with 11 additions and 62 deletions

View file

@ -29,7 +29,7 @@ non-target caps are left. It is commonly done while pre-rolling, but can also
happen whenever a new pad appears on any element. happen whenever a new pad appears on any element.
Once a target caps has been found, that pad is ghosted and the Once a target caps has been found, that pad is ghosted and the
'new-decoded-pad' signal is emitted. 'pad-added' signal is emitted.
If no compatible elements can be found for a GstCaps, the pad is ghosted and If no compatible elements can be found for a GstCaps, the pad is ghosted and
the 'unknown-type' signal is emitted. the 'unknown-type' signal is emitted.

View file

@ -177,10 +177,6 @@ struct _GstDecodeBinClass
{ {
GstBinClass parent_class; GstBinClass parent_class;
/* signal we fire when a new pad has been decoded into raw audio/video */
void (*new_decoded_pad) (GstElement * element, GstPad * pad, gboolean last);
/* signal we fire when a pad has been removed */
void (*removed_decoded_pad) (GstElement * element, GstPad * pad);
/* signal fired when we found a pad that we cannot decode */ /* signal fired when we found a pad that we cannot decode */
void (*unknown_type) (GstElement * element, GstPad * pad, GstCaps * caps); void (*unknown_type) (GstElement * element, GstPad * pad, GstCaps * caps);
@ -204,8 +200,6 @@ struct _GstDecodeBinClass
/* signals */ /* signals */
enum enum
{ {
SIGNAL_NEW_DECODED_PAD,
SIGNAL_REMOVED_DECODED_PAD,
SIGNAL_UNKNOWN_TYPE, SIGNAL_UNKNOWN_TYPE,
SIGNAL_AUTOPLUG_CONTINUE, SIGNAL_AUTOPLUG_CONTINUE,
SIGNAL_AUTOPLUG_FACTORIES, SIGNAL_AUTOPLUG_FACTORIES,
@ -593,41 +587,6 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass)
gobject_klass->set_property = gst_decode_bin_set_property; gobject_klass->set_property = gst_decode_bin_set_property;
gobject_klass->get_property = gst_decode_bin_get_property; gobject_klass->get_property = gst_decode_bin_get_property;
/**
* GstDecodeBin::new-decoded-pad:
* @bin: The decodebin.
* @pad: The newly created pad.
* @islast: #TRUE if this is the last pad to be added. Deprecated.
*
* This signal gets emitted as soon as a new pad of the same type as one of
* the valid 'raw' types is added.
*
* Deprecated: Use GstElement::pad-added instead of this signal.
*
*/
gst_decode_bin_signals[SIGNAL_NEW_DECODED_PAD] =
g_signal_new ("new-decoded-pad", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstDecodeBinClass, new_decoded_pad), NULL, NULL,
gst_play_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, GST_TYPE_PAD,
G_TYPE_BOOLEAN);
/**
* GstDecodeBin::removed-decoded-pad:
* @bin: The decodebin.
* @pad: The pad that was removed.
*
* This signal is emitted when a 'final' caps pad has been removed.
*
* Deprecated: Use GstElement::pad-removed instead of this signal.
*
*/
gst_decode_bin_signals[SIGNAL_REMOVED_DECODED_PAD] =
g_signal_new ("removed-decoded-pad", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstDecodeBinClass, removed_decoded_pad), NULL, NULL,
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_PAD);
/** /**
* GstDecodeBin::unknown-type: * GstDecodeBin::unknown-type:
* @bin: The decodebin. * @bin: The decodebin.
@ -661,8 +620,8 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass)
* *
* Returns: #TRUE if you wish decodebin to look for elements that can * Returns: #TRUE if you wish decodebin to look for elements that can
* handle the given @caps. If #FALSE, those caps will be considered as * handle the given @caps. If #FALSE, those caps will be considered as
* final and the pad will be exposed as such (see 'new-decoded-pad' * final and the pad will be exposed as such (see 'pad-added' signal of
* signal). * #GstElement).
*/ */
gst_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE] = gst_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE] =
g_signal_new ("autoplug-continue", G_TYPE_FROM_CLASS (klass), g_signal_new ("autoplug-continue", G_TYPE_FROM_CLASS (klass),
@ -2499,8 +2458,6 @@ gst_decode_chain_free_internal (GstDecodeChain * chain, gboolean hide)
if (chain->endpad->exposed) { if (chain->endpad->exposed) {
gst_element_remove_pad (GST_ELEMENT_CAST (chain->dbin), gst_element_remove_pad (GST_ELEMENT_CAST (chain->dbin),
GST_PAD_CAST (chain->endpad)); GST_PAD_CAST (chain->endpad));
g_signal_emit (G_OBJECT (chain->dbin),
gst_decode_bin_signals[SIGNAL_REMOVED_DECODED_PAD], 0, chain->endpad);
} }
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (chain->endpad), NULL); gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (chain->endpad), NULL);
@ -3346,11 +3303,7 @@ gst_decode_bin_expose (GstDecodeBin * dbin)
dpad->exposed = TRUE; dpad->exposed = TRUE;
/* 3. emit signal */ /* 3. emit signal */
GST_DEBUG_OBJECT (dbin, "emitting new-decoded-pad"); GST_INFO_OBJECT (dpad, "added new decoded pad");
g_signal_emit (G_OBJECT (dbin),
gst_decode_bin_signals[SIGNAL_NEW_DECODED_PAD], 0, dpad,
(tmp->next == NULL));
GST_DEBUG_OBJECT (dbin, "emitted new-decoded-pad");
} }
/* 4. Signal no-more-pads. This allows the application to hook stuff to the /* 4. Signal no-more-pads. This allows the application to hook stuff to the

View file

@ -1,7 +1,6 @@
BOOLEAN:OBJECT,BOXED BOOLEAN:OBJECT,BOXED
BOOLEAN:OBJECT,OBJECT,OBJECT BOOLEAN:OBJECT,OBJECT,OBJECT
BOXED:OBJECT,BOXED BOXED:OBJECT,BOXED
VOID:OBJECT,BOOLEAN
ENUM:OBJECT,OBJECT,BOXED ENUM:OBJECT,OBJECT,BOXED
ENUM:OBJECT,BOXED,OBJECT ENUM:OBJECT,BOXED,OBJECT
BOXED:OBJECT,BOXED,BOXED BOXED:OBJECT,BOXED,BOXED

View file

@ -486,8 +486,8 @@ gst_uri_decode_bin_class_init (GstURIDecodeBinClass * klass)
* *
* Returns: #TRUE if you wish uridecodebin to look for elements that can * Returns: #TRUE if you wish uridecodebin to look for elements that can
* handle the given @caps. If #FALSE, those caps will be considered as * handle the given @caps. If #FALSE, those caps will be considered as
* final and the pad will be exposed as such (see 'new-decoded-pad' * final and the pad will be exposed as such (see 'pad-added' signal of
* signal). * #GstElement).
*/ */
gst_uri_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE] = gst_uri_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE] =
g_signal_new ("autoplug-continue", G_TYPE_FROM_CLASS (klass), g_signal_new ("autoplug-continue", G_TYPE_FROM_CLASS (klass),
@ -1032,11 +1032,9 @@ decoded_pad_event_probe (GstPad * pad, GstProbeType type, gpointer type_data,
return GST_PROBE_OK; return GST_PROBE_OK;
} }
/* Called by the signal handlers when a decodebin has /* Called by the signal handlers when a decodebin has found a new raw pad */
* found a new raw pad.
*/
static void static void
new_decoded_pad_cb (GstElement * element, GstPad * pad, gboolean last, new_decoded_pad_added_cb (GstElement * element, GstPad * pad,
GstURIDecodeBin * decoder) GstURIDecodeBin * decoder)
{ {
GstPad *newpad; GstPad *newpad;
@ -1044,8 +1042,7 @@ new_decoded_pad_cb (GstElement * element, GstPad * pad, gboolean last,
gchar *padname; gchar *padname;
GstURIDecodeBinStream *stream; GstURIDecodeBinStream *stream;
GST_DEBUG_OBJECT (element, "new decoded pad, name: <%s>. Last: %d", GST_DEBUG_OBJECT (element, "new decoded pad, name: <%s>", GST_PAD_NAME (pad));
GST_PAD_NAME (pad), last);
GST_URI_DECODE_BIN_LOCK (decoder); GST_URI_DECODE_BIN_LOCK (decoder);
padname = g_strdup_printf ("src%d", decoder->numpads); padname = g_strdup_printf ("src%d", decoder->numpads);
@ -1101,7 +1098,7 @@ expose_decoded_pad (GstElement * element, GstPad * pad,
gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT, source_pad_event_probe, decoder, gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT, source_pad_event_probe, decoder,
NULL); NULL);
new_decoded_pad_cb (element, pad, FALSE, decoder); new_decoded_pad_added_cb (element, pad, decoder);
} }
static void static void
@ -1658,7 +1655,7 @@ make_decoder (GstURIDecodeBin * decoder)
/* set up callbacks to create the links between decoded data /* set up callbacks to create the links between decoded data
* and video/audio/subtitle rendering/output. */ * and video/audio/subtitle rendering/output. */
g_signal_connect (decodebin, g_signal_connect (decodebin,
"new-decoded-pad", G_CALLBACK (new_decoded_pad_cb), decoder); "pad-added", G_CALLBACK (new_decoded_pad_added_cb), decoder);
g_signal_connect (decodebin, g_signal_connect (decodebin,
"pad-removed", G_CALLBACK (pad_removed_cb), decoder); "pad-removed", G_CALLBACK (pad_removed_cb), decoder);
g_signal_connect (decodebin, "no-more-pads", g_signal_connect (decodebin, "no-more-pads",