summaryrefslogtreecommitdiff
path: root/tests/old/examples/plugins/example.h
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2001-03-01 22:36:26 +0000
committerWim Taymans <wim.taymans@gmail.com>2001-03-01 22:36:26 +0000
commit90ac5da6d6fe07dc902502cfed96a779b1717e23 (patch)
tree8744445209d6438a7be507e3c9bbfcbb3f76f993 /tests/old/examples/plugins/example.h
parent81197b7c0663cf731a4b270fcae7b08e76f2572d (diff)
Merge with the main trunk.BRANCH-AUTOPLUG2-20010301
Original commit message from CVS: Merge with the main trunk. GstPlay needed some changes for the dynamic pads in the avidecoder since the new autoplugger doesn't know about the outher elements. The next version of the autoplugger will also handle the audfio/videosink connections and will do a complete end-to-end autoplugging.
Diffstat (limited to 'tests/old/examples/plugins/example.h')
-rw-r--r--tests/old/examples/plugins/example.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/tests/old/examples/plugins/example.h b/tests/old/examples/plugins/example.h
index d7f19a3f99..840b8a3d18 100644
--- a/tests/old/examples/plugins/example.h
+++ b/tests/old/examples/plugins/example.h
@@ -28,36 +28,61 @@ extern "C" {
#endif /* __cplusplus */
-/* Definition of structure storing data for this element. */
+/* This is the definition of the element's object structure. */
typedef struct _GstExample GstExample;
+/* The structure itself is derived from GstElement, as can be seen by the
+ * fact that there's a complete instance of the GstElement structure at
+ * the beginning of the object. This allows the element to be cast to
+ * an Element or even an Object.
+ */
struct _GstExample {
GstElement element;
+ /* We need to keep track of our pads, so we do so here. */
GstPad *sinkpad,*srcpad;
- gint8 active;
+ /* We'll use this to decide whether to do anything to the data we get. */
+ gboolean active;
};
-/* Standard definition defining a class for this element. */
+/* The other half of the object is its class. The class also derives from
+ * the same parent, though it must be the class structure this time.
+ * Function pointers for polymophic methods and signals are placed in this
+ * structure. */
typedef struct _GstExampleClass GstExampleClass;
+
struct _GstExampleClass {
GstElementClass parent_class;
+
+ /* signals */
+ void (*asdf) (GstElement *element, GstExample *example);
};
-/* Standard macros for defining types for this element. */
+/* Five standard preprocessing macros are used in the Gtk+ object system.
+ * The first uses the object's _get_type function to return the GtkType
+ * of the object.
+ */
#define GST_TYPE_EXAMPLE \
(gst_example_get_type())
+/* The second is a checking cast to the correct type. If the object passed
+ * is not the right type, a warning will be generated on stderr.
+ */
#define GST_EXAMPLE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_EXAMPLE,GstExample))
+/* The third is a checking cast of the class instead of the object. */
#define GST_EXAMPLE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_EXAMPLE,GstExample))
+/* The last two simply check to see if the passed pointer is an object or
+ * class of the correct type. */
#define GST_IS_EXAMPLE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_EXAMPLE))
#define GST_IS_EXAMPLE_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EXAMPLE))
-/* Standard function returning type information. */
+/* This is the only prototype needed, because it is used in the above
+ * GST_TYPE_EXAMPLE macro.
+ */
GtkType gst_example_get_type(void);