gst/gstpad.*: implement gst_pad_is_linked

Original commit message from CVS:
2004-01-15  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* gst/gstpad.c: (gst_pad_is_linked):
* gst/gstpad.h:
implement gst_pad_is_linked
* gst/gstelement.h:
reserve space for initiate_state_change
This commit is contained in:
Benjamin Otte 2004-01-15 03:03:15 +00:00
parent 5e8a2fb8a4
commit e81fbd612f
4 changed files with 27 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2004-01-15 Benjamin Otte <in7y118@public.uni-hamburg.de>
* gst/gstpad.c: (gst_pad_is_linked):
* gst/gstpad.h:
implement gst_pad_is_linked
* gst/gstelement.h:
reserve space for initiate_state_change
2004-01-15 Benjamin Otte <in7y118@public.uni-hamburg.de>
* gst/autoplug/gstspideridentity.c:

View file

@ -218,6 +218,7 @@ struct _GstElementClass {
GstFormat *format, gint64 *value);
/* change the element state */
GstElementStateReturn (*initiate_state_change)(GstElement *element, GstElementState state);
GstElementStateReturn (*change_state) (GstElement *element);
/* request/release pads */
@ -232,7 +233,7 @@ struct _GstElementClass {
GstIndex* (*get_index) (GstElement *element);
void (*set_index) (GstElement *element, GstIndex *index);
gpointer _gst_reserved[GST_PADDING];
gpointer _gst_reserved[GST_PADDING - 1];
};
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);

View file

@ -953,6 +953,22 @@ gst_pad_unlink (GstPad *srcpad,
gst_object_unref (GST_OBJECT (realsink));
}
/**
* gst_pad_is_linked:
* @pad: pad to check
*
* Checks if a given pad is linked to another pad or not.
*
* Returns: TRUE if the pad is linked.
*/
gboolean
gst_pad_is_linked (GstPad *pad)
{
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
return GST_PAD_PEER (pad) != NULL;
}
struct _GstPadLink {
GType type;

View file

@ -400,6 +400,7 @@ void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_is_linked (GstPad *pad);
GstPad* gst_pad_get_peer (GstPad *pad);