Commit 6052a887 authored by Benjamin Otte's avatar Benjamin Otte

make add_ghost_pad return new pad instead of NULL

Original commit message from CVS:
make add_ghost_pad return new pad instead of NULL
parent 5290fba9
......@@ -350,19 +350,21 @@ gst_element_remove_pad (GstElement *element, GstPad *pad)
*
* Create a ghost pad from the given pad, and add it to the list of pads
* for this element.
*
* Returns: the added ghost pad or NULL, if no ghost pad was created.
*/
void
GstPad *
gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name)
{
GstPad *ghostpad;
g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_ELEMENT (element));
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
/* then check to see if there's already a pad by that name here */
g_return_if_fail (gst_object_check_uniqueness (element->pads, name) == TRUE);
g_return_val_if_fail (gst_object_check_uniqueness (element->pads, name) == TRUE, NULL);
GST_DEBUG(GST_CAT_ELEMENT_PADS,"creating new ghost pad called %s, from pad %s:%s\n",
name,GST_DEBUG_PAD_NAME(pad));
......@@ -380,6 +382,8 @@ gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name)
/* emit the NEW_GHOST_PAD signal */
g_signal_emit (G_OBJECT (element), gst_element_signals[NEW_PAD], 0, ghostpad);
return ghostpad;
}
/**
......
......@@ -194,7 +194,7 @@ GstPad* gst_element_get_pad (GstElement *element, const gchar *name);
GList* gst_element_get_pad_list (GstElement *element);
GList* gst_element_get_padtemplate_list (GstElement *element);
GstPadTemplate* gst_element_get_padtemplate_by_name (GstElement *element, const guchar *name);
void gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name);
GstPad * gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name);
void gst_element_remove_ghost_pad (GstElement *element, GstPad *pad);
GstPad* gst_element_request_compatible_pad (GstElement *element, GstPadTemplate *templ);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment