fix some circular includes
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 7 Jun 2011 11:25:26 +0000 (13:25 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 7 Jun 2011 11:25:26 +0000 (13:25 +0200)
typedef some structs before including other files to avoid circular dependencies
in the header files.

gst/gstelement.h
gst/gstelementfactory.h
gst/gstevent.h
gst/gstmessage.h
gst/gstpad.h
gst/gstpadtemplate.h
gst/gstutils.c
gst/gstutils.h

index e05b859..8ffd6ed 100644 (file)
@@ -64,6 +64,7 @@ typedef enum {
 #include <gst/gstindexfactory.h>
 #include <gst/gstiterator.h>
 #include <gst/gstmessage.h>
+#include <gst/gstquery.h>
 #include <gst/gsttaglist.h>
 
 G_BEGIN_DECLS
index 8f648e0..323aa7a 100644 (file)
@@ -32,6 +32,7 @@ typedef struct _GstElementFactoryClass GstElementFactoryClass;
 #include <gst/gstobject.h>
 #include <gst/gstplugin.h>
 #include <gst/gstpluginfeature.h>
+#include <gst/gstpadtemplate.h>
 #include <gst/gstiterator.h>
 
 G_BEGIN_DECLS
index 8ed06e6..0e22b3c 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef __GST_EVENT_H__
 #define __GST_EVENT_H__
 
+typedef struct _GstEvent GstEvent;
+
 #include <gst/gstminiobject.h>
 #include <gst/gstformat.h>
 #include <gst/gstobject.h>
 #include <gst/gststructure.h>
 #include <gst/gsttaglist.h>
 #include <gst/gstsegment.h>
+#include <gst/gstsegment.h>
+#include <gst/gstmessage.h>
 
 G_BEGIN_DECLS
 
 extern GType _gst_event_type;
 
-typedef struct _GstEvent GstEvent;
 
 #define GST_TYPE_EVENT                  (_gst_event_type)
 #define GST_IS_EVENT(obj)               (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_EVENT))
@@ -422,6 +425,10 @@ GstEvent *      gst_event_new_buffer_size       (GstFormat format, gint64 minsiz
 void            gst_event_parse_buffer_size     (GstEvent *event, GstFormat *format, gint64 *minsize,
                                                  gint64 *maxsize, gboolean *async);
 
+/* sink message */
+GstEvent*       gst_event_new_sink_message      (GstMessage *msg);
+void            gst_event_parse_sink_message    (GstEvent *event, GstMessage **msg);
+
 /* QOS events */
 GstEvent*       gst_event_new_qos               (GstQOSType type, gdouble proportion,
                                                  GstClockTimeDiff diff, GstClockTime timestamp);
index 7d8de66..c93e413 100644 (file)
@@ -132,6 +132,7 @@ typedef enum
 #include <gst/gstelement.h>
 #include <gst/gsttaglist.h>
 #include <gst/gststructure.h>
+#include <gst/gstquery.h>
 
 /**
  * GST_MESSAGE_TRACE_NAME:
index 349f075..93fef63 100644 (file)
 
 #include <gst/gstconfig.h>
 
+typedef struct _GstPad GstPad;
+typedef struct _GstPadPrivate GstPadPrivate;
+typedef struct _GstPadClass GstPadClass;
+
+/**
+ * GstPadDirection:
+ * @GST_PAD_UNKNOWN: direction is unknown.
+ * @GST_PAD_SRC: the pad is a source pad.
+ * @GST_PAD_SINK: the pad is a sink pad.
+ *
+ * The direction of a pad.
+ */
+typedef enum {
+  GST_PAD_UNKNOWN,
+  GST_PAD_SRC,
+  GST_PAD_SINK
+} GstPadDirection;
+
 #include <gst/gstobject.h>
 #include <gst/gstbuffer.h>
 #include <gst/gstbufferlist.h>
 #include <gst/gstcaps.h>
+#include <gst/gstpadtemplate.h>
 #include <gst/gstevent.h>
 #include <gst/gstquery.h>
 #include <gst/gsttask.h>
@@ -47,9 +66,6 @@ G_BEGIN_DECLS
 #define GST_PAD_CAST(obj)              ((GstPad*)(obj))
 
 
-typedef struct _GstPad GstPad;
-typedef struct _GstPadPrivate GstPadPrivate;
-typedef struct _GstPadClass GstPadClass;
 
 /**
  * GstPadLinkReturn:
@@ -549,20 +565,6 @@ typedef GstProbeReturn      (*GstPadProbeCallback)              (GstPad *pad, Gs
 typedef GstFlowReturn           (*GstPadStickyEventsForeachFunction) (GstPad *pad, GstEvent *event, gpointer user_data);
 
 /**
- * GstPadDirection:
- * @GST_PAD_UNKNOWN: direction is unknown.
- * @GST_PAD_SRC: the pad is a source pad.
- * @GST_PAD_SINK: the pad is a sink pad.
- *
- * The direction of a pad.
- */
-typedef enum {
-  GST_PAD_UNKNOWN,
-  GST_PAD_SRC,
-  GST_PAD_SINK
-} GstPadDirection;
-
-/**
  * GstPadFlags:
  * @GST_PAD_BLOCKED: is dataflow on a pad blocked
  * @GST_PAD_FLUSHING: is pad refusing buffers
@@ -594,9 +596,6 @@ typedef enum {
   GST_PAD_FLAG_LAST        = (GST_OBJECT_FLAG_LAST << 16)
 } GstPadFlags;
 
-/* FIXME: this awful circular dependency need to be resolved properly (see padtemplate.h) */
-typedef struct _GstPadTemplate GstPadTemplate;
-
 /**
  * GstPad:
  * @element_private: private data owned by the parent element
index e8e5921..bc2bcee 100644 (file)
 
 #include <gst/gstconfig.h>
 
+typedef struct _GstPadTemplate GstPadTemplate;
+typedef struct _GstPadTemplateClass GstPadTemplateClass;
+typedef struct _GstStaticPadTemplate GstStaticPadTemplate;
+
 #include <gst/gstobject.h>
 #include <gst/gstbuffer.h>
 #include <gst/gstcaps.h>
 
 G_BEGIN_DECLS
 
-/* FIXME: this awful circular dependency need to be resolved properly (see pad.h) */
-/*typedef struct _GstPadTemplate GstPadTemplate; */
-typedef struct _GstPadTemplateClass GstPadTemplateClass;
-typedef struct _GstStaticPadTemplate GstStaticPadTemplate;
-
 #define GST_TYPE_STATIC_PAD_TEMPLATE   (gst_static_pad_template_get_type ())
 
 #define GST_TYPE_PAD_TEMPLATE          (gst_pad_template_get_type ())
index 0c3ed81..21a0b5a 100644 (file)
@@ -25,7 +25,6 @@
  * SECTION:gstutils
  * @short_description: Various utility functions
  *
- * When defining own plugins, use the GST_BOILERPLATE ease gobject creation.
  */
 
 #include "gst_private.h"
index f48b630..a838eee 100644 (file)
@@ -817,18 +817,6 @@ gboolean gst_util_fraction_add (gint a_n, gint a_d, gint b_n, gint b_d, gint *re
 gint gst_util_fraction_compare (gint a_n, gint a_d, gint b_n, gint b_d);
 
 
-/* sink message event
- *
- * FIXME: This should be in gstevent.h but can't because
- * it needs GstMessage and this would introduce circular
- * header includes. And forward declarations of typedefs
- * are unfortunately not possible. The implementation of
- * these functions is in gstevent.c.
- */
-GstEvent*       gst_event_new_sink_message      (GstMessage *msg);
-void            gst_event_parse_sink_message    (GstEvent *event, GstMessage **msg);
-
-
 G_END_DECLS
 
 #endif /* __GST_UTILS_H__ */