gst/gstpad.*: implement gst_pad_is_linked
authorBenjamin Otte <otte@gnome.org>
Thu, 15 Jan 2004 03:03:15 +0000 (03:03 +0000)
committerBenjamin Otte <otte@gnome.org>
Thu, 15 Jan 2004 03:03:15 +0000 (03:03 +0000)
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

ChangeLog
gst/gstelement.h
gst/gstpad.c
gst/gstpad.h

index 6d47cb1..809a2da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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:
        (gst_spider_identity_sink_loop_type_finding):
          break infinite loop by just returning instead of looping
index e840324..6b07468 100644 (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);
index 877d1ba..58b1883 100644 (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;
 
index c0efb0f..2b96c3b 100644 (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);