gst_element_get_compatible_pad_template
gst_element_get_request_pad
gst_element_get_static_pad
+gst_element_request_pad
gst_element_no_more_pads
gst_element_release_request_pad
gst_element_remove_pad
}
static GstPad *
-gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
- const gchar * name)
+_gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
+ const gchar * name, const GstCaps * caps)
{
GstPad *newpad = NULL;
GstElementClass *oclass;
oclass = GST_ELEMENT_GET_CLASS (element);
- if (oclass->request_new_pad)
+ 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 (newpad)
* request pads. The pad should be released with
* gst_element_release_request_pad().
*
+ * This method is slow and will be deprecated in the future. New code should
+ * use gst_element_request_pad() with the requested template.
+ *
* Returns: (transfer full): requested #GstPad if found, otherwise %NULL.
* Release after usage.
*/
if (!templ_found)
return NULL;
- pad = gst_element_request_pad (element, templ, req_name);
+ pad = _gst_element_request_pad (element, templ, req_name, NULL);
return pad;
}
+/**
+ * gst_element_request_pad:
+ * @element: a #GstElement to find a request pad of.
+ * @templ: a #GstPadTemplate of which we want a pad of.
+ * @name: (transfer none) (allow-none): the name of the request #GstPad
+ * to retrieve. Can be %NULL.
+ * @caps: (transfer none) (allow-none): the caps of the pad we want to
+ * request. Can be %NULL.
+ *
+ * Retrieves a request pad from the element according to the provided template.
+ *
+ * If the @caps are specified and the element implements thew new
+ * request_new_pad_full virtual method, the element will use them to select
+ * which pad to create.
+ *
+ * The pad should be released with gst_element_release_request_pad().
+ *
+ * Returns: (transfer full): requested #GstPad if found, otherwise %NULL.
+ * Release after usage.
+ *
+ * Since: 0.10.32
+ */
+GstPad *
+gst_element_request_pad (GstElement * element,
+ GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
+{
+ g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
+ g_return_val_if_fail (templ != NULL, NULL);
+
+ return _gst_element_request_pad (element, templ, name, caps);
+}
+
/**
* gst_element_get_pad:
* @element: a #GstElement.
* @send_event: send a #GstEvent to the element
* @get_query_types: get the supported #GstQueryType of this element
* @query: perform a #GstQuery on the element
+ * @request_new_pad_full: called when a new pad is requested. Since: 0.10.32.
*
* GStreamer element class. Override the vmethods to implement the element
* functionality.
/* FIXME-0.11: move up and replace details */
gpointer meta_data;
- gpointer _gst_reserved[GST_PADDING-1];
+ /*< 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-2];
};
/* element class pad templates */
#endif /* GST_DISABLE_DEPRECATED */
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,
+ const gchar * name, const GstCaps *caps);
void gst_element_release_request_pad (GstElement *element, GstPad *pad);
GstIterator * gst_element_iterate_pads (GstElement * element);
return newtempl;
}
-static GstPad *
-gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
- const gchar * name)
-{
- GstPad *newpad = NULL;
- GstElementClass *oclass;
-
- oclass = GST_ELEMENT_GET_CLASS (element);
-
- if (oclass->request_new_pad)
- newpad = (oclass->request_new_pad) (element, templ, name);
-
- if (newpad)
- gst_object_ref (newpad);
-
- return newpad;
-}
-
-
-
/**
* gst_element_get_pad_from_template:
* @element: (transfer none): a #GstElement.
break;
case GST_PAD_REQUEST:
- ret = gst_element_request_pad (element, templ, NULL);
+ ret = gst_element_request_pad (element, templ, NULL, NULL);
break;
}
if (gst_caps_is_always_compatible (gst_pad_template_get_caps
(srctempl), gst_pad_template_get_caps (desttempl))) {
srcpad =
- gst_element_get_request_pad (src, srctempl->name_template);
+ gst_element_request_pad (src, srctempl,
+ srctempl->name_template, NULL);
destpad =
- gst_element_get_request_pad (dest, desttempl->name_template);
+ gst_element_request_pad (dest, desttempl,
+ desttempl->name_template, NULL);
if (srcpad && destpad
&& pad_link_maybe_ghosting (srcpad, destpad, flags)) {
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,
gst_element_register
gst_element_release_request_pad
gst_element_remove_pad
+ gst_element_request_pad
gst_element_requires_clock
gst_element_seek
gst_element_seek_simple