From 84a1f4ba7fd8cfc81e6d9d7ea282d4a3e63b270d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 10 May 2011 16:41:36 +0200 Subject: [PATCH] element: use request_new_pad_full as the default Add GstCaps to request_new_pad so that request_new_pad_full can be removed. Fix elements. --- gst/gstelement.c | 6 ++---- gst/gstelement.h | 14 +++----------- plugins/elements/gstfunnel.c | 4 ++-- plugins/elements/gstinputselector.c | 4 ++-- plugins/elements/gstmultiqueue.c | 4 ++-- plugins/elements/gstoutputselector.c | 4 ++-- plugins/elements/gsttee.c | 4 ++-- 7 files changed, 15 insertions(+), 25 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index 149ed30..6903285 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1013,10 +1013,8 @@ _gst_element_request_pad (GstElement * element, GstPadTemplate * templ, } #endif - if (oclass->request_new_pad_full) - newpad = (oclass->request_new_pad_full) (element, templ, name, caps); - else if (oclass->request_new_pad) - newpad = (oclass->request_new_pad) (element, templ, name); + if (oclass->request_new_pad) + newpad = (oclass->request_new_pad) (element, templ, name, caps); if (newpad) gst_object_ref (newpad); diff --git a/gst/gstelement.h b/gst/gstelement.h index 4ac7d16..d458bbe 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -627,7 +627,8 @@ struct _GstElementClass /* virtual methods for subclasses */ /* request/release pads */ - GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name); + GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, + const gchar* name, const GstCaps *caps); void (*release_pad) (GstElement *element, GstPad *pad); /* state changes */ @@ -654,14 +655,6 @@ struct _GstElementClass gboolean (*query) (GstElement *element, GstQuery *query); /*< private >*/ - - /*< public >*/ - /* Virtual method for subclasses (additions) */ - /* FIXME-0.11 Make this the default behaviour */ - GstPad* (*request_new_pad_full) (GstElement *element, GstPadTemplate *templ, - const gchar* name, const GstCaps *caps); - - /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; @@ -754,8 +747,7 @@ void gst_element_no_more_pads (GstElement *element); GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name); GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name); -GstPad* gst_element_request_pad (GstElement *element, - GstPadTemplate *templ, +GstPad* gst_element_request_pad (GstElement *element, GstPadTemplate *templ, const gchar * name, const GstCaps *caps); void gst_element_release_request_pad (GstElement *element, GstPad *pad); diff --git a/plugins/elements/gstfunnel.c b/plugins/elements/gstfunnel.c index 1767c86..532dd83 100644 --- a/plugins/elements/gstfunnel.c +++ b/plugins/elements/gstfunnel.c @@ -113,7 +113,7 @@ G_DEFINE_TYPE_WITH_CODE (GstFunnel, gst_funnel, GST_TYPE_ELEMENT, _do_init); static GstStateChangeReturn gst_funnel_change_state (GstElement * element, GstStateChange transition); static GstPad *gst_funnel_request_new_pad (GstElement * element, - GstPadTemplate * templ, const gchar * name); + GstPadTemplate * templ, const gchar * name, const GstCaps * caps); static void gst_funnel_release_pad (GstElement * element, GstPad * pad); static GstFlowReturn gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer); @@ -175,7 +175,7 @@ gst_funnel_init (GstFunnel * funnel) static GstPad * gst_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ, - const gchar * name) + const gchar * name, const GstCaps * caps) { GstPad *sinkpad; diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 43e2420..8949752 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -688,7 +688,7 @@ static void gst_input_selector_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstPad *gst_input_selector_request_new_pad (GstElement * element, - GstPadTemplate * templ, const gchar * unused); + GstPadTemplate * templ, const gchar * unused, const GstCaps * caps); static void gst_input_selector_release_pad (GstElement * element, GstPad * pad); static GstStateChangeReturn gst_input_selector_change_state (GstElement * @@ -1261,7 +1261,7 @@ gst_input_selector_activate_sinkpad (GstInputSelector * sel, GstPad * pad) static GstPad * gst_input_selector_request_new_pad (GstElement * element, - GstPadTemplate * templ, const gchar * unused) + GstPadTemplate * templ, const gchar * unused, const GstCaps * caps) { GstInputSelector *sel; gchar *name = NULL; diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 52b4fd0..31e936c 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -255,7 +255,7 @@ static void gst_multi_queue_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstPad *gst_multi_queue_request_new_pad (GstElement * element, - GstPadTemplate * temp, const gchar * name); + GstPadTemplate * temp, const gchar * name, const GstCaps * caps); static void gst_multi_queue_release_pad (GstElement * element, GstPad * pad); static GstStateChangeReturn gst_multi_queue_change_state (GstElement * element, GstStateChange transition); @@ -585,7 +585,7 @@ out: static GstPad * gst_multi_queue_request_new_pad (GstElement * element, GstPadTemplate * temp, - const gchar * name) + const gchar * name, const GstCaps * caps) { GstMultiQueue *mqueue = GST_MULTI_QUEUE (element); GstSingleQueue *squeue; diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c index 1c46871..e29812c 100644 --- a/plugins/elements/gstoutputselector.c +++ b/plugins/elements/gstoutputselector.c @@ -99,7 +99,7 @@ static void gst_output_selector_set_property (GObject * object, static void gst_output_selector_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstPad *gst_output_selector_request_new_pad (GstElement * element, - GstPadTemplate * templ, const gchar * unused); + GstPadTemplate * templ, const gchar * unused, const GstCaps * caps); static void gst_output_selector_release_pad (GstElement * element, GstPad * pad); static GstFlowReturn gst_output_selector_chain (GstPad * pad, GstBuffer * buf); @@ -351,7 +351,7 @@ gst_output_selector_switch_pad_negotiation_mode (GstOutputSelector * sel, static GstPad * gst_output_selector_request_new_pad (GstElement * element, - GstPadTemplate * templ, const gchar * name) + GstPadTemplate * templ, const gchar * name, const GstCaps * caps) { gchar *padname; GstPad *srcpad; diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index c768448..3edd398 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -125,7 +125,7 @@ typedef struct } PushData; static GstPad *gst_tee_request_new_pad (GstElement * element, - GstPadTemplate * temp, const gchar * unused); + GstPadTemplate * temp, const gchar * unused, const GstCaps * caps); static void gst_tee_release_pad (GstElement * element, GstPad * pad); static void gst_tee_finalize (GObject * object); @@ -273,7 +273,7 @@ gst_tee_notify_alloc_pad (GstTee * tee) static GstPad * gst_tee_request_new_pad (GstElement * element, GstPadTemplate * templ, - const gchar * unused) + const gchar * unused, const GstCaps * caps) { gchar *name; GstPad *srcpad; -- 2.7.4