diff --git a/gst/Makefile.am b/gst/Makefile.am index edd8e38aa5..ecbab0ea63 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -83,7 +83,7 @@ noinst_HEADERS = \ gsti386.h \ gstppc.h -CFLAGS += -g -O6 -Wall +CFLAGS += -O6 -Wall libgst_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(XML_LIBS) libgst_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE) diff --git a/gst/cothreads.c b/gst/cothreads.c index 0508fed3e9..a60d85888d 100644 --- a/gst/cothreads.c +++ b/gst/cothreads.c @@ -18,8 +18,6 @@ */ #include -#include -#include #include #include #include @@ -30,9 +28,9 @@ /* we make too much noise for normal debugging... */ #define GST_DEBUG_FORCE_DISABLE -#include -#include -#include +#include "gstdebug.h" +#include "cothreads.h" +#include "gstarch.h" pthread_key_t _cothread_key = -1; diff --git a/gst/cothreads.h b/gst/cothreads.h index 95fe6420c2..0a7d32c4a9 100644 --- a/gst/cothreads.h +++ b/gst/cothreads.h @@ -22,7 +22,6 @@ #include #include -#include #define COTHREAD_STACKSIZE 8192 #define COTHREAD_MAXTHREADS 16 diff --git a/gst/elements/gstasyncdisksrc.c b/gst/elements/gstasyncdisksrc.c index 907c447848..a12d008cb2 100644 --- a/gst/elements/gstasyncdisksrc.c +++ b/gst/elements/gstasyncdisksrc.c @@ -118,7 +118,7 @@ gst_asyncdisksrc_class_init (GstAsyncDiskSrcClass *klass) static void gst_asyncdisksrc_init (GstAsyncDiskSrc *asyncdisksrc) { - GST_SRC_SET_FLAGS (asyncdisksrc, GST_SRC_ASYNC); + GST_FLAG_SET (asyncdisksrc, GST_SRC_ASYNC); g_print("init\n"); asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC); diff --git a/gst/elements/gstasyncdisksrc.h b/gst/elements/gstasyncdisksrc.h index 1d2c372049..826e8d5ebe 100644 --- a/gst/elements/gstasyncdisksrc.h +++ b/gst/elements/gstasyncdisksrc.h @@ -44,9 +44,10 @@ GstElementDetails gst_asyncdisksrc_details; #define GST_IS_ASYNCDISKSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ASYNCDISKSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_ASYNCDISKSRC_OPEN = (1 << 16), + GST_ASYNCDISKSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_ASYNCDISKSRC_FLAG_LAST = GST_SRC_FLAG_LAST + 2, } GstAsyncDiskSrcFlags; typedef struct _GstAsyncDiskSrc GstAsyncDiskSrc; diff --git a/gst/elements/gstaudiosink.h b/gst/elements/gstaudiosink.h index 03e1faa689..76e3a4c123 100644 --- a/gst/elements/gstaudiosink.h +++ b/gst/elements/gstaudiosink.h @@ -24,7 +24,6 @@ #include #include -#include #ifdef __cplusplus @@ -46,9 +45,10 @@ GstElementDetails gst_audiosink_details; #define GST_IS_AUDIOSINK_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSINK)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_AUDIOSINK_OPEN = (1 << 16), + GST_AUDIOSINK_OPEN = GST_SINK_FLAG_LAST, + + GST_AUDIOSINK_FLAG_LAST = GST_SINK_FLAG_LAST+2, } GstAudioSinkFlags; typedef struct _GstAudioSink GstAudioSink; diff --git a/gst/elements/gstaudiosrc.h b/gst/elements/gstaudiosrc.h index 2852b79d51..a2b3c69f82 100644 --- a/gst/elements/gstaudiosrc.h +++ b/gst/elements/gstaudiosrc.h @@ -46,9 +46,10 @@ GstElementDetails gst_audiosrc_details; #define GST_IS_AUDIOSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_AUDIOSRC_OPEN = (1 < 16), + GST_AUDIOSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_AUDIOSRC_FLAG_LAST = GST_SRC_FLAG_LAST+2, } GstAudioSrcFlags; typedef struct _GstAudioSrc GstAudioSrc; diff --git a/gst/elements/gstdisksrc.h b/gst/elements/gstdisksrc.h index da27358e60..71e8e96813 100644 --- a/gst/elements/gstdisksrc.h +++ b/gst/elements/gstdisksrc.h @@ -45,9 +45,10 @@ extern GstElementDetails gst_disksrc_details; #define GST_IS_DISKSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_DISKSRC_OPEN = (1 << 16), + GST_DISKSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_DISKSRC_FLAG_LAST = GST_SRC_FLAG_LAST+2, } GstDiskSrcFlags; typedef struct _GstDiskSrc GstDiskSrc; diff --git a/gst/elements/gstelements.c b/gst/elements/gstelements.c index b79dd9c3b6..5e5bb6229b 100644 --- a/gst/elements/gstelements.c +++ b/gst/elements/gstelements.c @@ -72,9 +72,6 @@ GstPlugin *plugin_init (GModule *module) GstElementFactory *factory; gint i = 0; - /* we depend on having the usual types loaded first */ - gst_plugin_load("gsttypes"); - plugin = gst_plugin_new("gstelements"); g_return_val_if_fail(plugin != NULL,NULL); diff --git a/gst/elements/gsthttpsrc.h b/gst/elements/gsthttpsrc.h index 83e77699d5..bdaa08a52d 100644 --- a/gst/elements/gsthttpsrc.h +++ b/gst/elements/gsthttpsrc.h @@ -47,9 +47,10 @@ GstElementDetails gst_httpsrc_details; #define GST_IS_HTTPSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_HTTPSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_HTTPSRC_OPEN = (1 << 16), + GST_HTTPSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_HTTPSRC_FLAG_LAST = GST_SRC_FLAG_LAST+2, } GstHttpSrcFlags; typedef struct _GstHttpSrc GstHttpSrc; diff --git a/gst/elements/gstpipefilter.h b/gst/elements/gstpipefilter.h index edd1d759a3..34997495ed 100644 --- a/gst/elements/gstpipefilter.h +++ b/gst/elements/gstpipefilter.h @@ -44,9 +44,10 @@ GstElementDetails gst_pipefilter_details; #define GST_IS_PIPEFILTER_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPEFILTER)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_PIPEFILTER_OPEN = (1 << 16 ), + GST_PIPEFILTER_OPEN = GST_FILTER_FLAG_LAST, + + GST_PIPEFILTER_FLAG_LAST = GST_FILTER_FLAG_LAST, } GstPipeFilterFlags; typedef struct _GstPipefilter GstPipefilter; diff --git a/gst/gst.c b/gst/gst.c index b57ebbe410..2da659d804 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -17,7 +17,14 @@ * Boston, MA 02111-1307, USA. */ -#include +#include "gstdebug.h" +#include "gstcpu.h" +#include "gsttype.h" +#include "gstplugin.h" +#include "gstbuffer.h" +#include "gstbin.h" +#include "gstpipeline.h" +#include "gstthread.h" extern gint _gst_trace_on; @@ -51,9 +58,6 @@ gst_init (int *argc, char **argv[]) gst_elementfactory_register (gst_elementfactory_new("thread", gst_thread_get_type (), &gst_thread_details)); - //gst_plugin_load_elementfactory("gsttypes"); - //gst_plugin_load("libgstelements.so"); - _gst_trace_on = 0; if (_gst_trace_on) { gst_trace = gst_trace_new ("gst.trace",1024); diff --git a/gst/gst.h b/gst/gst.h index c005dcf860..aa40b1eb18 100644 --- a/gst/gst.h +++ b/gst/gst.h @@ -21,23 +21,13 @@ #ifndef __GST_H__ #define __GST_H__ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include - #include - #include - #include #include #include #include +#include #include #include #include @@ -55,7 +45,6 @@ #include #include #include - #include /* initialize GST */ diff --git a/gst/gstarch.h b/gst/gstarch.h index c9dee6dd18..2cf697db12 100644 --- a/gst/gstarch.h +++ b/gst/gstarch.h @@ -20,7 +20,9 @@ #ifndef GST_HGUARD_GSTARCH_H #define GST_HGUARD_GSTARCH_H +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #ifdef HAVE_CPU_I386 #include "gsti386.h" diff --git a/gst/gstbin.c b/gst/gstbin.c index ef9725d68e..f3b6d810c7 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -19,10 +19,10 @@ //#define GST_DEBUG_ENABLED -#include - -#include "config.h" - +#include "gstbin.h" +#include "gstdebug.h" +#include "gstsrc.h" +#include "gstconnection.h" GstElementDetails gst_bin_details = { "Generic bin", @@ -592,73 +592,6 @@ gst_bin_src_wrapper (int argc,char *argv[]) return 0; } -static int -gst_bin_connection_wrapper (int argc,char *argv[]) -{ - GstElement *element = GST_ELEMENT (argv); - GList *pads; - GstPad *pad; - G_GNUC_UNUSED const gchar *name = gst_element_get_name (element); - - DEBUG_ENTER("(%d,\"%s\")",argc,name); - - do { - DEBUG("Connection checking pads\n"); - pads = element->pads; - while (pads) { - pad = GST_PAD (pads->data); - if (pad->direction == GST_PAD_SRC) { - DEBUG("pullfunc for %s:%s(%p) at %p is set to %p\n",GST_DEBUG_PAD_NAME(pad),pad,&pad->pullfunc,pad->pullfunc); - if (pad->pullfunc == NULL) fprintf(stderr,"error, no pullfunc in \"%s\"\n", name); - (pad->pullfunc)(pad); - } - pads = g_list_next(pads); - } - DEBUG("Connection done checking pads, checking COTHREAD_STOPPING on \"%s\"(%p)\n", - gst_element_get_name(element),element); - } while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element)); - GST_FLAG_UNSET(element,GST_ELEMENT_COTHREAD_STOPPING); - - DEBUG_LEAVE(""); - return 0; -} - -static int -gst_bin_sched_wrapper (int argc, char *argv[]) -{ - _GstBinOutsideSchedule *sched = (_GstBinOutsideSchedule *)argv; - GstElement *element = sched->element; - GSList *pads; - GstPad *pad; - region_struct *region; - G_GNUC_UNUSED const gchar *name = gst_element_get_name (element); - - DEBUG_ENTER("(\"%s\")",name); - - do { - pads = sched->padlist; - while (pads) { - pad = GST_PAD (pads->data); - region = cothread_get_data (pad->threadstate, "region"); - if (region) { - //gst_src_push_region (GST_SRC (element), region->offset, region->size); - if (pad->pullregionfunc == NULL) - fprintf(stderr,"error, no pullregionfunc in \"%s\"\n", name); - (pad->pullregionfunc)(pad, region->offset, region->size); - } - else { - if (pad->pullfunc == NULL) - fprintf(stderr,"error, no pullfunc in \"%s\"\n", name); - (pad->pullfunc)(pad); - } - } - } while (!(sched->flags && GST_ELEMENT_COTHREAD_STOPPING)); - sched->flags &= ~GST_ELEMENT_COTHREAD_STOPPING; - - DEBUG_LEAVE(""); - return 0; -} - static void gst_bin_pullfunc_proxy (GstPad *pad) { diff --git a/gst/gstbin.h b/gst/gstbin.h index d83ceef49d..1212d77f07 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -21,13 +21,9 @@ #ifndef __GST_BIN_H__ #define __GST_BIN_H__ - #include -#include -#include #include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -45,6 +41,8 @@ extern GstElementDetails gst_bin_details; #define GST_IS_BIN_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_BIN)) +#define GST_BIN_FLAG_LAST (GST_ELEMENT_FLAG_LAST + 2) + typedef struct _GstBin GstBin; typedef struct _GstBinClass GstBinClass; diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 35d3f6a993..19d68d4bc5 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -20,9 +20,9 @@ /* this file makes too much noise for most debugging sessions */ #define GST_DEBUG_FORCE_DISABLE -#include -#include +#include "gstdebug.h" +#include "gstbuffer.h" GMemChunk *_gst_buffer_chunk; @@ -245,7 +245,7 @@ gst_buffer_ref (GstBuffer *buffer) #ifdef HAVE_ATOMIC_H //g_return_if_fail(atomic_read(&(buffer->refcount)) > 0); - atomic_inc (&(buffer->refcount)) + atomic_inc (&(buffer->refcount)); #else g_return_if_fail (buffer->refcount > 0); GST_BUFFER_LOCK (buffer); @@ -269,7 +269,7 @@ gst_buffer_ref_by_count (GstBuffer *buffer, int count) #ifdef HAVE_ATOMIC_H g_return_if_fail (atomic_read (&(buffer->refcount)) > 0); - atomic_add (count, &(buffer->refcount)) + atomic_add (count, &(buffer->refcount)); #else g_return_if_fail (buffer->refcount > 0); GST_BUFFER_LOCK (buffer); @@ -296,7 +296,7 @@ gst_buffer_unref (GstBuffer *buffer) #ifdef HAVE_ATOMIC_H g_return_if_fail (atomic_read (&(buffer->refcount)) > 0); - zero = atomic_dec_and_test (&(buffer->refcount)) + zero = atomic_dec_and_test (&(buffer->refcount)); #else g_return_if_fail (buffer->refcount > 0); GST_BUFFER_LOCK (buffer); diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index d6c078178f..563f86bbb4 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -21,8 +21,15 @@ #ifndef __GST_BUFFER_H__ #define __GST_BUFFER_H__ -#include +#ifdef HAVE_CONFIG_H +#include +#endif +#ifdef HAVE_ATOMIC_H +#include +#endif + +#include #ifdef __cplusplus extern "C" { @@ -66,7 +73,7 @@ typedef enum { typedef struct _GstBuffer GstBuffer; -#include "gstbufferpool.h" +#include struct _GstBuffer { /* locking */ diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 07bcb33df1..0f9919a4e7 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -18,9 +18,8 @@ */ -#include -#include - +#include "gstdebug.h" +#include "gstbuffer.h" /** diff --git a/gst/gstbufferpool.h b/gst/gstbufferpool.h index c13367b55b..189fc03f34 100644 --- a/gst/gstbufferpool.h +++ b/gst/gstbufferpool.h @@ -21,7 +21,7 @@ #ifndef __GST_BUFFER_POOL_H__ #define __GST_BUFFER_POOL_H__ -#include "gstbuffer.h" +#include #ifdef __cplusplus extern "C" { diff --git a/gst/gstcaps.c b/gst/gstcaps.c index f51f71b4db..7643939b4d 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -19,8 +19,8 @@ //#define DEBUG_ENABLED -#include -#include +#include "gstcaps.h" +#include "gsttype.h" void _gst_caps_initialize (void) diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 43339b79e0..b564f7ed52 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -21,7 +21,7 @@ #ifndef __GST_CAPS_H__ #define __GST_CAPS_H__ -#include +#include #include typedef struct _GstCaps GstCaps; diff --git a/gst/gstclock.c b/gst/gstclock.c index 2ccfdc7095..e269c795a1 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -19,7 +19,9 @@ #include //#define DEBUG_ENABLED -#include +#include "gstclock.h" +#include "gstdebug.h" +#include "gstsink.h" static GstClock *the_system_clock = NULL; diff --git a/gst/gstclock.h b/gst/gstclock.h index 7aa2494d5b..bb8a0a341b 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -22,7 +22,7 @@ #define __GST_CLOCK_H__ -#include +#include #ifdef __cplusplus extern "C" { diff --git a/gst/gstconnection.c b/gst/gstconnection.c index 540375580c..4e0dcf1f76 100644 --- a/gst/gstconnection.c +++ b/gst/gstconnection.c @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include +#include "gstconnection.h" /* Connection signals and args */ diff --git a/gst/gstcpu.c b/gst/gstcpu.c index a08dc961e3..928573ae55 100644 --- a/gst/gstcpu.c +++ b/gst/gstcpu.c @@ -17,8 +17,12 @@ * Boston, MA 02111-1307, USA. */ +#include +#ifdef HAVE_CONFIG_H #include "config.h" +#endif + #include "gstcpu.h" static guint32 _gst_cpu_flags; diff --git a/gst/gstcpu.h b/gst/gstcpu.h index 5ccd89b05e..306c679956 100644 --- a/gst/gstcpu.h +++ b/gst/gstcpu.h @@ -21,8 +21,6 @@ #ifndef __GST_CPU_H__ #define __GST_CPU_H__ -#include - typedef enum { GST_CPU_FLAG_MMX = (1<<0), GST_CPU_FLAG_SSE = (1<<1), diff --git a/gst/gstdebug.h b/gst/gstdebug.h index 84236e0059..5059089960 100644 --- a/gst/gstdebug.h +++ b/gst/gstdebug.h @@ -25,7 +25,8 @@ #include #endif -#include +#include +#include /* for include files that make too much noise normally */ #ifdef GST_DEBUG_FORCE_DISABLE diff --git a/gst/gstelement.c b/gst/gstelement.c index 57b8436f18..f07cc73470 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -17,9 +17,9 @@ * Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include "gstdebug.h" +#include "gstelement.h" +#include "gstextratypes.h" /* Element signals and args */ enum { diff --git a/gst/gstelement.h b/gst/gstelement.h index 77ace5c54a..81e09e71f8 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include @@ -77,12 +75,15 @@ static inline char *_gst_print_statename(int state) { (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT)) typedef enum { - GST_ELEMENT_MULTI_IN = (1 << 4), - GST_ELEMENT_THREAD_SUGGESTED = (1 << 5), - GST_ELEMENT_NO_SEEK = (1 << 6), + GST_ELEMENT_MULTI_IN = GST_OBJECT_FLAG_LAST, + GST_ELEMENT_THREAD_SUGGESTED, + GST_ELEMENT_NO_SEEK, - GST_ELEMENT_NEW_LOOPFUNC = (1 << 16), - GST_ELEMENT_COTHREAD_STOPPING = (1 << 17), + GST_ELEMENT_NEW_LOOPFUNC, + GST_ELEMENT_COTHREAD_STOPPING, + + /* use some padding for future expansion */ + GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8, } GstElementFlags; #define GST_ELEMENT_IS_MULTI_IN(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_MULTI_IN)) diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 771f590d52..be1e9347c7 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -19,10 +19,9 @@ //#define DEBUG_ENABLED -#include - -#include -#include +#include "gstdebug.h" +#include "gstelement.h" +#include "gstplugin.h" /* global list of registered elementfactories */ diff --git a/gst/gstextratypes.c b/gst/gstextratypes.c index 858a25a633..c23898afcc 100644 --- a/gst/gstextratypes.c +++ b/gst/gstextratypes.c @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include +#include "gstextratypes.h" GtkType gst_extra_get_filename_type (void) diff --git a/gst/gstextratypes.h b/gst/gstextratypes.h index bbb5710d3c..7d39009b83 100644 --- a/gst/gstextratypes.h +++ b/gst/gstextratypes.h @@ -21,8 +21,7 @@ #ifndef __GST_EXTRA_TYPES_H__ #define __GST_EXTRA_TYPES_H__ -#include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/gst/gstfilter.c b/gst/gstfilter.c index e7ec2cbeb8..5bfe208472 100644 --- a/gst/gstfilter.c +++ b/gst/gstfilter.c @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include +#include "gstfilter.h" /* Filter signals and args */ diff --git a/gst/gstfilter.h b/gst/gstfilter.h index 86b0656bf0..2764bd18fe 100644 --- a/gst/gstfilter.h +++ b/gst/gstfilter.h @@ -21,10 +21,8 @@ #ifndef __GST_FILTER_H__ #define __GST_FILTER_H__ - #include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -44,6 +42,8 @@ extern "C" { typedef struct _GstFilter GstFilter; typedef struct _GstFilterClass GstFilterClass; +#define GST_FILTER_FLAG_LAST GST_ELEMENT_FLAG_LAST + struct _GstFilter { GstElement element; }; diff --git a/gst/gstmeta.c b/gst/gstmeta.c index 75d3a18d0d..db3621842e 100644 --- a/gst/gstmeta.c +++ b/gst/gstmeta.c @@ -18,8 +18,8 @@ */ -#include -#include +#include "gstmeta.h" +#include "gsttrace.h" /** @@ -54,7 +54,11 @@ gst_meta_ref (GstMeta *meta) gst_trace_add_entry (NULL, 0, meta, "ref meta"); +#ifdef HAVE_ATOMIC_H + atomic_inc (&(meta->refcount)); +#else meta->refcount++; +#endif } /** @@ -67,12 +71,17 @@ gst_meta_ref (GstMeta *meta) void gst_meta_unref (GstMeta *meta) { + gint zero; g_return_if_fail (meta != NULL); gst_trace_add_entry (NULL, 0, meta, "unref meta"); +#ifdef HAVE_ATOMIC_H + zero = atomic_dec_and_test (&(meta->refcount)); +#else meta->refcount--; - - if (meta->refcount == 0) { + zero = (meta->refcount == 0); +#endif + if (zero) { // gst_trace_add_entry(NULL,0,meta,"destroy meta"); g_free (meta); // g_print("freeing metadata\n"); diff --git a/gst/gstmeta.h b/gst/gstmeta.h index f361a47d3c..cb8d6008e4 100644 --- a/gst/gstmeta.h +++ b/gst/gstmeta.h @@ -24,7 +24,14 @@ #include - +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_ATOMIC_H +#include +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -42,12 +49,10 @@ extern "C" { #define GST_META_FLAG_UNSET(meta,flag) \ G_STMT_START{ (GST_META_FLAGS(meta) &= ~(flag)); }G_STMT_END - typedef enum { GST_META_FREEABLE = 1 << 0, } GstMetaFlags; - typedef struct _GstMeta GstMeta; struct _GstMeta { diff --git a/gst/gstobject.c b/gst/gstobject.c index a9fc15dda1..c12e88e20b 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -17,10 +17,7 @@ * Boston, MA 02111-1307, USA. */ - -#include -#include - +#include "gstobject.h" /* Object signals and args */ enum { diff --git a/gst/gstobject.h b/gst/gstobject.h index a6894d7188..b44370f3bb 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -21,18 +21,17 @@ #ifndef __GST_OBJECT_H__ #define __GST_OBJECT_H__ - #include #include -//#include "config.h" -#undef HAVE_ATOMIC_H +#ifdef HAVE_CONFIG_H +#include +#endif #ifdef HAVE_ATOMIC_H #include #endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -52,6 +51,8 @@ extern "C" { typedef struct _GstObject GstObject; typedef struct _GstObjectClass GstObjectClass; +#define GST_OBJECT_FLAG_LAST 4 + struct _GstObject { GtkObject object; @@ -80,9 +81,9 @@ struct _GstObjectClass { #define GST_FLAGS(obj) GTK_OBJECT_FLAGS(obj) -#define GST_FLAG_IS_SET(obj,flag) (GST_FLAGS (obj) & (flag)) -#define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (flag)); }G_STMT_END -#define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(flag)); }G_STMT_END +#define GST_FLAG_IS_SET(obj,flag) (GST_FLAGS (obj) & (1<<(flag))) +#define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (1<<(flag))); }G_STMT_END +#define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(1<<(flag))); }G_STMT_END #define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT(obj)->lock)) #define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT(obj)->lock)) diff --git a/gst/gstpad.c b/gst/gstpad.c index d1f88aa9bf..27bb19846e 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -19,11 +19,10 @@ //#define DEBUG_ENABLED -#include -#include -#include -#include - +#include "gstdebug.h" +#include "gstpad.h" +#include "gstelement.h" +#include "gsttype.h" /* Pad signals and args */ enum { @@ -910,7 +909,7 @@ gst_padtemplate_new (GstPadFactory *factory) GstPadTemplate* gst_padtemplate_create (gchar *name_template, GstPadDirection direction, GstPadPresence presence, - GstCaps *caps, ...) + GstCaps *caps) { GstPadTemplate *new; diff --git a/gst/gstpad.h b/gst/gstpad.h index f718106eeb..0d975d8ab0 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -23,12 +23,12 @@ #include + #include #include #include #include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -63,7 +63,9 @@ typedef enum { } GstPadDirection; typedef enum { - GST_PAD_DISABLED = (1 << 4), + GST_PAD_DISABLED = GST_OBJECT_FLAG_LAST, + + GST_PAD_FLAG_LAST = GST_OBJECT_FLAG_LAST+2, } GstPadFlags; struct _GstPad { @@ -165,7 +167,7 @@ void gst_pad_load_and_connect (xmlNodePtr parent, GstObject *element, GHashTa GstPadTemplate* gst_padtemplate_new (GstPadFactory *factory); GstPadTemplate* gst_padtemplate_create (gchar *name_template, GstPadDirection direction, GstPadPresence presence, - GstCaps *caps, ...); + GstCaps *caps); xmlNodePtr gst_padtemplate_save_thyself (GstPadTemplate *pad, xmlNodePtr parent); GstPadTemplate* gst_padtemplate_load_thyself (xmlNodePtr parent); diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index a80cedf14c..2a02bf1f01 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -17,13 +17,11 @@ * Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include - -#include "config.h" +#include "gstpipeline.h" +#include "gstthread.h" +#include "gstsink.h" +#include "gstutils.h" +#include "gsttype.h" GstElementDetails gst_pipeline_details = { "Pipeline object", diff --git a/gst/gstpipeline.h b/gst/gstpipeline.h index 24f295e1e8..be95eaccd3 100644 --- a/gst/gstpipeline.h +++ b/gst/gstpipeline.h @@ -24,7 +24,6 @@ #include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 37b3334a5b..0de739ee3d 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -17,6 +17,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -24,9 +27,8 @@ #include #include -#include +#include "gstplugin.h" -#include "config.h" //#undef PLUGINS_USE_SRCDIR @@ -43,10 +45,12 @@ GList *_gst_libraries; gint _gst_libraries_seqno; /* whether or not to spew library load issues */ -gboolean _gst_plugin_spew = TRUE; +gboolean _gst_plugin_spew = FALSE; -void _gst_plugin_initialize() { +void +_gst_plugin_initialize (void) +{ xmlDocPtr doc; _gst_modules = NULL; _gst_modules_seqno = 0; @@ -60,37 +64,39 @@ void _gst_plugin_initialize() { /* if this is set, we add build-directory paths to the list */ #ifdef PLUGINS_USE_SRCDIR /* the catch-all plugins directory */ - _gst_plugin_paths = g_list_append(_gst_plugin_paths, - PLUGINS_SRCDIR "/plugins"); + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, + PLUGINS_SRCDIR "/plugins"); /* the libreary directory */ - _gst_plugin_paths = g_list_append(_gst_plugin_paths, - PLUGINS_SRCDIR "/libs"); + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, + PLUGINS_SRCDIR "/libs"); /* location libgstelements.so */ - _gst_plugin_paths = g_list_append(_gst_plugin_paths, - PLUGINS_SRCDIR "/gst/elements"); - _gst_plugin_paths = g_list_append(_gst_plugin_paths, - PLUGINS_SRCDIR "/gst/types"); + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, + PLUGINS_SRCDIR "/gst/elements"); + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, + PLUGINS_SRCDIR "/gst/types"); #else /* add the main (installed) library path */ - _gst_plugin_paths = g_list_append(_gst_plugin_paths,PLUGINS_DIR); + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, PLUGINS_DIR); #endif /* PLUGINS_USE_SRCDIR */ - doc = xmlParseFile("/etc/gstreamer/reg.xml"); + doc = xmlParseFile ("/etc/gstreamer/reg.xml"); - if (!doc || strcmp(doc->root->name, "GST-PluginRegistry")) { - g_print("gstplugin: registry needs rebuild\n"); - gst_plugin_load_all(); + if (!doc || strcmp (doc->root->name, "GST-PluginRegistry")) { + g_print ("gstplugin: registry needs rebuild\n"); + gst_plugin_load_all (); return; } - gst_plugin_load_thyself(doc->root); + gst_plugin_load_thyself (doc->root); } -static gboolean gst_plugin_load_recurse(gchar *directory,gchar *name) { +static gboolean +gst_plugin_load_recurse (gchar *directory, gchar *name) +{ DIR *dir; struct dirent *dirent; gboolean loaded = FALSE; - //g_print("recursive load of '%s' in '%s'\n", name, directory); + //g_print("recursive load of '%s' in '%s'\n", name, directory); dir = opendir(directory); if (dir) { while ((dirent = readdir(dir))) { @@ -98,7 +104,7 @@ static gboolean gst_plugin_load_recurse(gchar *directory,gchar *name) { if (strcmp(dirent->d_name,".") && strcmp(dirent->d_name,"..")) { loaded = gst_plugin_load_recurse(g_strjoin("/",directory,dirent->d_name, NULL),name); - if (loaded && name) return TRUE; + if (loaded && name) return TRUE; } } closedir(dir); @@ -109,12 +115,10 @@ static gboolean gst_plugin_load_recurse(gchar *directory,gchar *name) { if ((temp = strstr(directory,name)) && (!strcmp(temp,name))) { loaded = gst_plugin_load_absolute(directory); - return loaded; } } else if ((temp = strstr(directory,".so")) && (!strcmp(temp,".so"))) { loaded = gst_plugin_load_absolute(directory); - //return loaded; } } } @@ -126,7 +130,9 @@ static gboolean gst_plugin_load_recurse(gchar *directory,gchar *name) { * * Load all plugins in the path. */ -void gst_plugin_load_all() { +void +gst_plugin_load_all(void) +{ GList *path; path = _gst_plugin_paths; @@ -145,7 +151,9 @@ void gst_plugin_load_all() { * * Returns: whether the library was loaded or not */ -gboolean gst_library_load(gchar *name) { +gboolean +gst_library_load (gchar *name) +{ gboolean res; GList *libraries = _gst_libraries; @@ -166,7 +174,7 @@ gboolean gst_library_load(gchar *name) { } static void -gst_plugin_remove(GstPlugin *plugin) +gst_plugin_remove (GstPlugin *plugin) { GList *factories; @@ -188,12 +196,19 @@ gst_plugin_remove(GstPlugin *plugin) * * Returns: whether the plugin was loaded or not */ -gboolean gst_plugin_load(gchar *name) { +gboolean +gst_plugin_load (gchar *name) +{ GList *path; gchar *libspath; + GstPlugin *plugin; //g_print("attempting to load plugin '%s'\n",name); + plugin = gst_plugin_find (name); + + if (plugin && plugin->loaded) return TRUE; + path = _gst_plugin_paths; while (path != NULL) { if (gst_plugin_load_absolute(g_module_build_path(path->data,name))) @@ -220,7 +235,9 @@ gboolean gst_plugin_load(gchar *name) { * * Returns: whether or not the plugin loaded */ -gboolean gst_plugin_load_absolute(gchar *name) { +gboolean +gst_plugin_load_absolute (gchar *name) +{ GModule *module; GstPluginInitFunc initfunc; GstPlugin *plugin; @@ -243,7 +260,7 @@ gboolean gst_plugin_load_absolute(gchar *name) { g_print("gstplugin: plugin %s loaded\n", plugin->name); plugin->filename = g_strdup(name); plugin->loaded = TRUE; - _gst_modules = g_list_append(_gst_modules,module); + _gst_modules = g_list_prepend(_gst_modules,module); _gst_modules_seqno++; _gst_plugins = g_list_prepend(_gst_plugins,plugin); _gst_plugins_seqno++; @@ -252,8 +269,7 @@ gboolean gst_plugin_load_absolute(gchar *name) { } return TRUE; } else if (_gst_plugin_spew) { -// if (strstr(g_module_error(),"No such") == NULL) - gst_info("error loading plugin: %s, reason: %s\n", name, g_module_error()); + gst_info("error loading plugin: %s, reason: %s\n", name, g_module_error()); } return FALSE; @@ -267,10 +283,17 @@ gboolean gst_plugin_load_absolute(gchar *name) { * * Returns: new plugin */ -GstPlugin *gst_plugin_new(gchar *name) { - GstPlugin *plugin = (GstPlugin *)g_malloc(sizeof(GstPlugin)); +GstPlugin* +gst_plugin_new (gchar *name) +{ + GstPlugin *plugin; + + // return NULL if the plugin is allready loaded + plugin = gst_plugin_find (name); + if (plugin) return NULL; + + plugin = (GstPlugin *)g_malloc(sizeof(GstPlugin)); - // FIXME need to make sure the plugin hasn't already loaded plugin->name = g_strdup(name); plugin->longname = NULL; plugin->types = NULL; @@ -287,7 +310,9 @@ GstPlugin *gst_plugin_new(gchar *name) { * * Sets the long name (should be descriptive) of the plugin. */ -void gst_plugin_set_longname(GstPlugin *plugin,gchar *longname) { +void +gst_plugin_set_longname (GstPlugin *plugin, gchar *longname) +{ g_return_if_fail(plugin != NULL); if (plugin->longname) g_free(plugin->longname); @@ -302,7 +327,9 @@ void gst_plugin_set_longname(GstPlugin *plugin,gchar *longname) { * * Returns: pointer to the #GstPlugin if found, NULL otherwise */ -GstPlugin *gst_plugin_find(const gchar *name) { +GstPlugin* +gst_plugin_find (const gchar *name) +{ GList *plugins = _gst_plugins; g_return_val_if_fail(name != NULL, NULL); @@ -328,7 +355,9 @@ GstPlugin *gst_plugin_find(const gchar *name) { * * Returns: @GstElementFactory if found, NULL if not */ -GstElementFactory *gst_plugin_find_elementfactory(gchar *name) { +GstElementFactory* +gst_plugin_find_elementfactory (gchar *name) +{ GList *plugins, *factories; GstElementFactory *factory; @@ -357,7 +386,9 @@ GstElementFactory *gst_plugin_find_elementfactory(gchar *name) { * * Returns: @GstElementFactory if loaded, NULL if not */ -GstElementFactory *gst_plugin_load_elementfactory(gchar *name) { +GstElementFactory* +gst_plugin_load_elementfactory (gchar *name) +{ GList *plugins, *factories; GstElementFactory *factory = NULL; GstPlugin *plugin; @@ -397,12 +428,14 @@ GstElementFactory *gst_plugin_load_elementfactory(gchar *name) { * * Load a registered typefactory by mime type. */ -void gst_plugin_load_typefactory(gchar *mime) { +void +gst_plugin_load_typefactory (gchar *mime) +{ GList *plugins, *factories; GstTypeFactory *factory; GstPlugin *plugin; - g_return_if_fail(mime != NULL); + g_return_if_fail (mime != NULL); plugins = _gst_plugins; while (plugins) { @@ -437,12 +470,14 @@ void gst_plugin_load_typefactory(gchar *mime) { * * Add factory to the list of those provided by the plugin. */ -void gst_plugin_add_factory(GstPlugin *plugin,GstElementFactory *factory) { - g_return_if_fail(plugin != NULL); - g_return_if_fail(factory != NULL); +void +gst_plugin_add_factory (GstPlugin *plugin, GstElementFactory *factory) +{ + g_return_if_fail (plugin != NULL); + g_return_if_fail (factory != NULL); // g_print("adding factory to plugin\n"); - plugin->elements = g_list_append(plugin->elements,factory); + plugin->elements = g_list_prepend (plugin->elements, factory); gst_elementfactory_register (factory); } @@ -453,12 +488,14 @@ void gst_plugin_add_factory(GstPlugin *plugin,GstElementFactory *factory) { * * Add a typefactory to the list of those provided by the plugin. */ -void gst_plugin_add_type(GstPlugin *plugin,GstTypeFactory *factory) { - g_return_if_fail(plugin != NULL); - g_return_if_fail(factory != NULL); +void +gst_plugin_add_type (GstPlugin *plugin, GstTypeFactory *factory) +{ + g_return_if_fail (plugin != NULL); + g_return_if_fail (factory != NULL); // g_print("adding factory to plugin\n"); - plugin->types = g_list_append(plugin->types,factory); + plugin->types = g_list_prepend (plugin->types, factory); } /** @@ -468,7 +505,9 @@ void gst_plugin_add_type(GstPlugin *plugin,GstTypeFactory *factory) { * * Returns; a GList of GstPlugin elements */ -GList *gst_plugin_get_list() { +GList* +gst_plugin_get_list(void) +{ return _gst_plugins; } @@ -480,7 +519,9 @@ GList *gst_plugin_get_list() { * * Returns: the new XML node */ -xmlNodePtr gst_plugin_save_thyself(xmlNodePtr parent) { +xmlNodePtr +gst_plugin_save_thyself (xmlNodePtr parent) +{ xmlNodePtr tree, subtree; GList *plugins = NULL, *elements = NULL, *types = NULL; @@ -520,7 +561,9 @@ xmlNodePtr gst_plugin_save_thyself(xmlNodePtr parent) { * * load the plugin from an XML representation */ -void gst_plugin_load_thyself(xmlNodePtr parent) { +void +gst_plugin_load_thyself (xmlNodePtr parent) +{ xmlNodePtr kinderen; gint elementcount = 0; gint typecount = 0; diff --git a/gst/gstplugin.h b/gst/gstplugin.h index 3c9899e173..997fd39f7e 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -21,8 +21,8 @@ #ifndef __GST_PLUGIN_H__ #define __GST_PLUGIN_H__ - #include +#include #include #include diff --git a/gst/gstprops.c b/gst/gstprops.c index 7d7514317f..ddf3ef1779 100644 --- a/gst/gstprops.c +++ b/gst/gstprops.c @@ -19,9 +19,9 @@ //#define DEBUG_ENABLED -#include -#include -#include +#include "gstdebug.h" +#include "gstprops.h" +#include "gstpropsprivate.h" static gboolean gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2); diff --git a/gst/gstprops.h b/gst/gstprops.h index cadfdd3328..4bf45a1b49 100644 --- a/gst/gstprops.h +++ b/gst/gstprops.h @@ -22,6 +22,7 @@ #define __GST_PROPS_H__ #include +#include typedef struct _GstProps GstProps; typedef gpointer GstPropsFactoryEntry; diff --git a/gst/gstsink.c b/gst/gstsink.c index 864a70b09f..235fb3d474 100644 --- a/gst/gstsink.c +++ b/gst/gstsink.c @@ -18,7 +18,7 @@ */ -#include +#include "gstsink.h" /* Sink signals and args */ diff --git a/gst/gstsink.h b/gst/gstsink.h index 2ea51e3c47..e64ad8a13b 100644 --- a/gst/gstsink.h +++ b/gst/gstsink.h @@ -44,6 +44,8 @@ extern "C" { typedef struct _GstSink GstSink; typedef struct _GstSinkClass GstSinkClass; +#define GST_SINK_FLAG_LAST GST_ELEMENT_FLAG_LAST + struct _GstSink { GstElement element; }; diff --git a/gst/gstsrc.c b/gst/gstsrc.c index 53bc1e5295..29aab57e18 100644 --- a/gst/gstsrc.c +++ b/gst/gstsrc.c @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include +#include "gstsrc.h" /* Src signals and args */ @@ -79,7 +79,6 @@ gst_src_class_init (GstSrcClass *klass) static void gst_src_init (GstSrc *src) { - src->flags = 0; } /** diff --git a/gst/gstsrc.h b/gst/gstsrc.h index 4e115e844b..208c88ecf0 100644 --- a/gst/gstsrc.h +++ b/gst/gstsrc.h @@ -24,7 +24,6 @@ #include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -42,20 +41,18 @@ extern "C" { (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_SRC)) typedef enum { - GST_SRC_ASYNC = (1 << 0), -} GstSrcFlags; + GST_SRC_ASYNC = GST_ELEMENT_FLAG_LAST, -#define GST_SRC_FLAGS(obj) \ - (GST_SRC(obj)->flags) -#define GST_SRC_ASYNC(obj) \ - ((GST_SRC_FLAGS(obj) & GST_SRC_ASYNC)) + GST_SRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST +2, +} GstSrcFlags; typedef struct _GstSrc GstSrc; typedef struct _GstSrcClass GstSrcClass; +#define GST_SRC_ASYNC(obj) (GST_FLAG_IS_SET(obj,GST_SRC_ASYNC)) + struct _GstSrc { GstElement element; - gint32 flags; }; struct _GstSrcClass { @@ -65,11 +62,6 @@ struct _GstSrcClass { void (*eos) (GstSrc *src); }; -#define GST_SRC_SET_FLAGS(src,flag) \ - G_STMT_START{ (GST_SRC_FLAGS (src) |= (flag)); }G_STMT_END -#define GST_SRC_UNSET_FLAGS(src,flag) \ - G_STMT_START{ (GST_SRC_FLAGS (src) &= ~(flag)); }G_STMT_END - GtkType gst_src_get_type (void); void gst_src_signal_eos (GstSrc *src); diff --git a/gst/gsttee.c b/gst/gsttee.c index 598396e193..7c69dba4d3 100644 --- a/gst/gsttee.c +++ b/gst/gsttee.c @@ -17,9 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include - -#include "config.h" +#include "gsttee.h" GstElementDetails gst_tee_details = { "Tee pipe fitting", diff --git a/gst/gstthread.c b/gst/gstthread.c index 3b7736beed..edf1a2db80 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -17,10 +17,10 @@ * Boston, MA 02111-1307, USA. */ -#include -#include +#include -#include "config.h" +#include "gstthread.h" +#include "gstdebug.h" GstElementDetails gst_thread_details = { "Threaded container", diff --git a/gst/gstthread.h b/gst/gstthread.h index f683044789..02a115637a 100644 --- a/gst/gstthread.h +++ b/gst/gstthread.h @@ -22,9 +22,9 @@ #define __GST_THREAD_H__ -#include #include +#include #ifdef __cplusplus extern "C" { @@ -34,9 +34,12 @@ extern GstElementDetails gst_thread_details; typedef enum { - GST_THREAD_CREATE = (1 << 16), - GST_THREAD_STATE_SPINNING = (1 << 17), - GST_THREAD_STATE_REAPING = (1 << 18), + GST_THREAD_CREATE = GST_BIN_FLAG_LAST, + GST_THREAD_STATE_SPINNING, + GST_THREAD_STATE_REAPING, + + /* padding */ + GST_THREAD_FLAG_LAST = GST_BIN_FLAG_LAST + 4, } GstThreadState; diff --git a/gst/gsttrace.c b/gst/gsttrace.c index 0f53cb857d..3101fd525a 100644 --- a/gst/gsttrace.c +++ b/gst/gsttrace.c @@ -24,8 +24,8 @@ #include #include #include -#include -#include + +#include "gsttrace.h" #ifdef HAVE_RDTS __inline__ void read_tsc(guint64 *dst) { diff --git a/gst/gsttrace.h b/gst/gsttrace.h index fef370e6d7..36a588f194 100644 --- a/gst/gsttrace.h +++ b/gst/gsttrace.h @@ -21,6 +21,7 @@ #ifndef __GST_TRACE_H__ #define __GST_TRACE_H__ +#include typedef struct _GstTrace GstTrace; typedef struct _GstTraceEntry GstTraceEntry; diff --git a/gst/gsttype.c b/gst/gsttype.c index 08d4209235..16c60616fd 100644 --- a/gst/gsttype.c +++ b/gst/gsttype.c @@ -24,9 +24,10 @@ * I'm not overly worried yet... */ -#include #include +#include "gsttype.h" +#include "gstplugin.h" /* global list of registered types */ GList *_gst_types; diff --git a/gst/gstutils.c b/gst/gstutils.c index bac353333b..54dae5797e 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -18,7 +18,7 @@ */ -#include +#include "gstutils.h" /** * gst_util_get_int_arg: diff --git a/gst/gstxml.c b/gst/gstxml.c index 4d702438d7..ef7269a237 100644 --- a/gst/gstxml.c +++ b/gst/gstxml.c @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#include +#include "gstxml.h" static void gst_xml_class_init(GstXMLClass *klass); static void gst_xml_init(GstXML *xml); diff --git a/gst/gstxml.h b/gst/gstxml.h index 4ebb9ec617..1f9db892df 100644 --- a/gst/gstxml.h +++ b/gst/gstxml.h @@ -21,8 +21,8 @@ #ifndef __GST_XML_H__ #define __GST_XML_H__ -#include #include +#include #ifdef __cplusplus extern "C" { diff --git a/gst/types/gsttypes.c b/gst/types/gsttypes.c index e2b185021f..88ad63cfbf 100644 --- a/gst/types/gsttypes.c +++ b/gst/types/gsttypes.c @@ -18,7 +18,6 @@ */ -#include #include #include diff --git a/gstplay/gstmediaplay.c b/gstplay/gstmediaplay.c index 836408c805..9c559f03b9 100644 --- a/gstplay/gstmediaplay.c +++ b/gstplay/gstmediaplay.c @@ -179,7 +179,7 @@ gst_media_play_init(GstMediaPlay *mplay) gtk_widget_show (GTK_WIDGET (mplay->play)); - mplay->status = glade_xml_get_widget (mplay->xml, "status_area"); + mplay->status = (GstStatusArea *)glade_xml_get_widget (mplay->xml, "status_area"); gst_status_area_set_state (mplay->status, GST_STATUS_AREA_STATE_INIT); gst_status_area_set_playtime (mplay->status, "00:00 / 00:00"); diff --git a/plugins/elements/gstasyncdisksrc.c b/plugins/elements/gstasyncdisksrc.c index 907c447848..a12d008cb2 100644 --- a/plugins/elements/gstasyncdisksrc.c +++ b/plugins/elements/gstasyncdisksrc.c @@ -118,7 +118,7 @@ gst_asyncdisksrc_class_init (GstAsyncDiskSrcClass *klass) static void gst_asyncdisksrc_init (GstAsyncDiskSrc *asyncdisksrc) { - GST_SRC_SET_FLAGS (asyncdisksrc, GST_SRC_ASYNC); + GST_FLAG_SET (asyncdisksrc, GST_SRC_ASYNC); g_print("init\n"); asyncdisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC); diff --git a/plugins/elements/gstasyncdisksrc.h b/plugins/elements/gstasyncdisksrc.h index 1d2c372049..826e8d5ebe 100644 --- a/plugins/elements/gstasyncdisksrc.h +++ b/plugins/elements/gstasyncdisksrc.h @@ -44,9 +44,10 @@ GstElementDetails gst_asyncdisksrc_details; #define GST_IS_ASYNCDISKSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ASYNCDISKSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_ASYNCDISKSRC_OPEN = (1 << 16), + GST_ASYNCDISKSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_ASYNCDISKSRC_FLAG_LAST = GST_SRC_FLAG_LAST + 2, } GstAsyncDiskSrcFlags; typedef struct _GstAsyncDiskSrc GstAsyncDiskSrc; diff --git a/plugins/elements/gstaudiosink.h b/plugins/elements/gstaudiosink.h index 03e1faa689..76e3a4c123 100644 --- a/plugins/elements/gstaudiosink.h +++ b/plugins/elements/gstaudiosink.h @@ -24,7 +24,6 @@ #include #include -#include #ifdef __cplusplus @@ -46,9 +45,10 @@ GstElementDetails gst_audiosink_details; #define GST_IS_AUDIOSINK_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSINK)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_AUDIOSINK_OPEN = (1 << 16), + GST_AUDIOSINK_OPEN = GST_SINK_FLAG_LAST, + + GST_AUDIOSINK_FLAG_LAST = GST_SINK_FLAG_LAST+2, } GstAudioSinkFlags; typedef struct _GstAudioSink GstAudioSink; diff --git a/plugins/elements/gstaudiosrc.h b/plugins/elements/gstaudiosrc.h index 2852b79d51..a2b3c69f82 100644 --- a/plugins/elements/gstaudiosrc.h +++ b/plugins/elements/gstaudiosrc.h @@ -46,9 +46,10 @@ GstElementDetails gst_audiosrc_details; #define GST_IS_AUDIOSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_AUDIOSRC_OPEN = (1 < 16), + GST_AUDIOSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_AUDIOSRC_FLAG_LAST = GST_SRC_FLAG_LAST+2, } GstAudioSrcFlags; typedef struct _GstAudioSrc GstAudioSrc; diff --git a/plugins/elements/gstdisksrc.h b/plugins/elements/gstdisksrc.h index da27358e60..71e8e96813 100644 --- a/plugins/elements/gstdisksrc.h +++ b/plugins/elements/gstdisksrc.h @@ -45,9 +45,10 @@ extern GstElementDetails gst_disksrc_details; #define GST_IS_DISKSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_DISKSRC_OPEN = (1 << 16), + GST_DISKSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_DISKSRC_FLAG_LAST = GST_SRC_FLAG_LAST+2, } GstDiskSrcFlags; typedef struct _GstDiskSrc GstDiskSrc; diff --git a/plugins/elements/gstelements.c b/plugins/elements/gstelements.c index b79dd9c3b6..5e5bb6229b 100644 --- a/plugins/elements/gstelements.c +++ b/plugins/elements/gstelements.c @@ -72,9 +72,6 @@ GstPlugin *plugin_init (GModule *module) GstElementFactory *factory; gint i = 0; - /* we depend on having the usual types loaded first */ - gst_plugin_load("gsttypes"); - plugin = gst_plugin_new("gstelements"); g_return_val_if_fail(plugin != NULL,NULL); diff --git a/plugins/elements/gsthttpsrc.h b/plugins/elements/gsthttpsrc.h index 83e77699d5..bdaa08a52d 100644 --- a/plugins/elements/gsthttpsrc.h +++ b/plugins/elements/gsthttpsrc.h @@ -47,9 +47,10 @@ GstElementDetails gst_httpsrc_details; #define GST_IS_HTTPSRC_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_HTTPSRC)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_HTTPSRC_OPEN = (1 << 16), + GST_HTTPSRC_OPEN = GST_SRC_FLAG_LAST, + + GST_HTTPSRC_FLAG_LAST = GST_SRC_FLAG_LAST+2, } GstHttpSrcFlags; typedef struct _GstHttpSrc GstHttpSrc; diff --git a/plugins/elements/gstpipefilter.h b/plugins/elements/gstpipefilter.h index edd1d759a3..34997495ed 100644 --- a/plugins/elements/gstpipefilter.h +++ b/plugins/elements/gstpipefilter.h @@ -44,9 +44,10 @@ GstElementDetails gst_pipefilter_details; #define GST_IS_PIPEFILTER_CLASS(obj) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPEFILTER)) -// NOTE: per-element flags start with 16 for now typedef enum { - GST_PIPEFILTER_OPEN = (1 << 16 ), + GST_PIPEFILTER_OPEN = GST_FILTER_FLAG_LAST, + + GST_PIPEFILTER_FLAG_LAST = GST_FILTER_FLAG_LAST, } GstPipeFilterFlags; typedef struct _GstPipefilter GstPipefilter; diff --git a/tests/.gitignore b/tests/.gitignore index c0dff85379..e1867ee465 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -13,3 +13,5 @@ states caps queue registry +rip +paranoia diff --git a/tests/rip.c b/tests/rip.c index d69544bdbf..050a76abc3 100644 --- a/tests/rip.c +++ b/tests/rip.c @@ -2,9 +2,11 @@ #include #include #include +#include +#include int main(int argc,char *argv[]) { - GstPipeline *pipeline; + GstElement *pipeline; GstElement *paranoia,*lame,*sink; int i; int outfile; @@ -46,4 +48,6 @@ int main(int argc,char *argv[]) { fprintf(stderr,"\n"); gst_bin_iterate(GST_BIN(pipeline)); } + + return 0; } diff --git a/tools/gstreamer-register.c b/tools/gstreamer-register.c index 4dfd703f26..c040e3ab56 100644 --- a/tools/gstreamer-register.c +++ b/tools/gstreamer-register.c @@ -7,7 +7,6 @@ int main(int argc,char *argv[]) unlink("/etc/gstreamer/reg.xml"); gst_init(&argc,&argv); - gst_plugin_load_all(); doc = xmlNewDoc("1.0"); doc->root = xmlNewDocNode(doc, NULL, "GST-PluginRegistry", NULL);