fix some circular includes

typedef some structs before including other files to avoid circular dependencies
in the header files.
This commit is contained in:
Wim Taymans 2011-06-07 13:25:26 +02:00
parent 0e2981ad50
commit 44b4312d96
8 changed files with 34 additions and 39 deletions

View 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

View 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

View 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>
@ -32,12 +34,13 @@
#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);

View 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:

View file

@ -26,10 +26,29 @@
#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:
@ -548,20 +564,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
@ -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

View file

@ -26,6 +26,10 @@
#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>
@ -35,11 +39,6 @@
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 ())

View 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"

View 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__ */