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.
This commit is contained in:
Wim Taymans 2011-05-10 16:41:36 +02:00
parent fbf306449e
commit 84a1f4ba7f
7 changed files with 15 additions and 25 deletions

View file

@ -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);

View file

@ -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 */
@ -653,14 +654,6 @@ struct _GstElementClass
const GstQueryType* (*get_query_types) (GstElement *element);
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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;