From 59581d464f7a038c970530c913ecd0ca231de6f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 15 Jun 2011 00:32:23 +0100 Subject: [PATCH] uridecodebin, decodebin: remove new-decoded-pad and removed-decoded-pad signals They were deprecated, use "pad-added" and "pad-removed" instead. --- docs/design/design-decodebin.txt | 2 +- gst/playback/gstdecodebin2.c | 53 +++------------------------------------ gst/playback/gstplay-marshal.list | 1 - gst/playback/gsturidecodebin.c | 17 ++++++------- 4 files changed, 11 insertions(+), 62 deletions(-) diff --git a/docs/design/design-decodebin.txt b/docs/design/design-decodebin.txt index 52b343a..d84aa48 100644 --- a/docs/design/design-decodebin.txt +++ b/docs/design/design-decodebin.txt @@ -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. 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 the 'unknown-type' signal is emitted. diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 43c176b..2d7c3fd 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -177,10 +177,6 @@ struct _GstDecodeBinClass { 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 */ void (*unknown_type) (GstElement * element, GstPad * pad, GstCaps * caps); @@ -204,8 +200,6 @@ struct _GstDecodeBinClass /* signals */ enum { - SIGNAL_NEW_DECODED_PAD, - SIGNAL_REMOVED_DECODED_PAD, SIGNAL_UNKNOWN_TYPE, SIGNAL_AUTOPLUG_CONTINUE, SIGNAL_AUTOPLUG_FACTORIES, @@ -594,41 +588,6 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass) 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: * @bin: The decodebin. * @pad: The new pad containing caps that cannot be resolved to a 'final' @@ -661,8 +620,8 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass) * * Returns: #TRUE if you wish decodebin to look for elements that can * 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' - * signal). + * final and the pad will be exposed as such (see 'pad-added' signal of + * #GstElement). */ gst_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE] = 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) { gst_element_remove_pad (GST_ELEMENT_CAST (chain->dbin), 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); @@ -3346,11 +3303,7 @@ gst_decode_bin_expose (GstDecodeBin * dbin) dpad->exposed = TRUE; /* 3. emit signal */ - GST_DEBUG_OBJECT (dbin, "emitting 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"); + GST_INFO_OBJECT (dpad, "added new decoded pad"); } /* 4. Signal no-more-pads. This allows the application to hook stuff to the diff --git a/gst/playback/gstplay-marshal.list b/gst/playback/gstplay-marshal.list index d7eddf4..ace5d91 100644 --- a/gst/playback/gstplay-marshal.list +++ b/gst/playback/gstplay-marshal.list @@ -1,7 +1,6 @@ BOOLEAN:OBJECT,BOXED BOOLEAN:OBJECT,OBJECT,OBJECT BOXED:OBJECT,BOXED -VOID:OBJECT,BOOLEAN ENUM:OBJECT,OBJECT,BOXED ENUM:OBJECT,BOXED,OBJECT BOXED:OBJECT,BOXED,BOXED diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index ae1313d..9224d19 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -486,8 +486,8 @@ gst_uri_decode_bin_class_init (GstURIDecodeBinClass * klass) * * Returns: #TRUE if you wish uridecodebin to look for elements that can * 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' - * signal). + * final and the pad will be exposed as such (see 'pad-added' signal of + * #GstElement). */ gst_uri_decode_bin_signals[SIGNAL_AUTOPLUG_CONTINUE] = 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; } -/* Called by the signal handlers when a decodebin has - * found a new raw pad. - */ +/* Called by the signal handlers when a decodebin has found a new raw pad */ static void -new_decoded_pad_cb (GstElement * element, GstPad * pad, gboolean last, +new_decoded_pad_added_cb (GstElement * element, GstPad * pad, GstURIDecodeBin * decoder) { GstPad *newpad; @@ -1044,8 +1042,7 @@ new_decoded_pad_cb (GstElement * element, GstPad * pad, gboolean last, gchar *padname; GstURIDecodeBinStream *stream; - GST_DEBUG_OBJECT (element, "new decoded pad, name: <%s>. Last: %d", - GST_PAD_NAME (pad), last); + GST_DEBUG_OBJECT (element, "new decoded pad, name: <%s>", GST_PAD_NAME (pad)); GST_URI_DECODE_BIN_LOCK (decoder); 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, NULL); - new_decoded_pad_cb (element, pad, FALSE, decoder); + new_decoded_pad_added_cb (element, pad, decoder); } static void @@ -1658,7 +1655,7 @@ make_decoder (GstURIDecodeBin * decoder) /* set up callbacks to create the links between decoded data * and video/audio/subtitle rendering/output. */ 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, "pad-removed", G_CALLBACK (pad_removed_cb), decoder); g_signal_connect (decodebin, "no-more-pads", -- 2.7.4