Header cleanup: try to include as little as possible; this will probably speed up...
authorWim Taymans <wim.taymans@gmail.com>
Fri, 15 Dec 2000 01:57:34 +0000 (01:57 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 15 Dec 2000 01:57:34 +0000 (01:57 +0000)
Original commit message from CVS:
Header cleanup: try to include as little as possible; this will probably
speed up compilation a bit.
changed the .c files to use #include "..."
Fix for the 'plugins are loaded twice' bug.
Fix 22186: GstObject flags are now used everywhere. Added *_FLAG_LAST so
elements do not use the same flags. Added some padding in the flag enum
for future expansion.

73 files changed:
gst/Makefile.am
gst/cothreads.c
gst/cothreads.h
gst/elements/gstasyncdisksrc.c
gst/elements/gstasyncdisksrc.h
gst/elements/gstaudiosink.h
gst/elements/gstaudiosrc.h
gst/elements/gstdisksrc.h
gst/elements/gstelements.c
gst/elements/gsthttpsrc.h
gst/elements/gstpipefilter.h
gst/gst.c
gst/gst.h
gst/gstarch.h
gst/gstbin.c
gst/gstbin.h
gst/gstbuffer.c
gst/gstbuffer.h
gst/gstbufferpool.c
gst/gstbufferpool.h
gst/gstcaps.c
gst/gstcaps.h
gst/gstclock.c
gst/gstclock.h
gst/gstconnection.c
gst/gstcpu.c
gst/gstcpu.h
gst/gstdebug.h
gst/gstelement.c
gst/gstelement.h
gst/gstelementfactory.c
gst/gstextratypes.c
gst/gstextratypes.h
gst/gstfilter.c
gst/gstfilter.h
gst/gstmeta.c
gst/gstmeta.h
gst/gstobject.c
gst/gstobject.h
gst/gstpad.c
gst/gstpad.h
gst/gstpipeline.c
gst/gstpipeline.h
gst/gstplugin.c
gst/gstplugin.h
gst/gstprops.c
gst/gstprops.h
gst/gstsink.c
gst/gstsink.h
gst/gstsrc.c
gst/gstsrc.h
gst/gsttee.c
gst/gstthread.c
gst/gstthread.h
gst/gsttrace.c
gst/gsttrace.h
gst/gsttype.c
gst/gstutils.c
gst/gstxml.c
gst/gstxml.h
gst/types/gsttypes.c
gstplay/gstmediaplay.c
plugins/elements/gstasyncdisksrc.c
plugins/elements/gstasyncdisksrc.h
plugins/elements/gstaudiosink.h
plugins/elements/gstaudiosrc.h
plugins/elements/gstdisksrc.h
plugins/elements/gstelements.c
plugins/elements/gsthttpsrc.h
plugins/elements/gstpipefilter.h
tests/.gitignore
tests/rip.c
tools/gstreamer-register.c

index edd8e38..ecbab0e 100644 (file)
@@ -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)
index 0508fed..a60d858 100644 (file)
@@ -18,8 +18,6 @@
  */
 
 #include <pthread.h>
-#include <sys/time.h>
-#include <linux/linkage.h>
 #include <stdio.h>   
 #include <stdlib.h>
 #include <signal.h>   
@@ -30,9 +28,9 @@
 /* we make too much noise for normal debugging... */
 #define GST_DEBUG_FORCE_DISABLE
 
-#include <gst/gst.h>
-#include <gst/cothreads.h>
-#include <gst/gstarch.h>
+#include "gstdebug.h"
+#include "cothreads.h"
+#include "gstarch.h"
 
 pthread_key_t _cothread_key = -1;
 
index 95fe642..0a7d32c 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <glib.h>
 #include <setjmp.h>
-#include <pthread.h>
 
 #define COTHREAD_STACKSIZE 8192
 #define COTHREAD_MAXTHREADS 16
index 907c447..a12d008 100644 (file)
@@ -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);
index 1d2c372..826e8d5 100644 (file)
@@ -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;
index 03e1faa..76e3a4c 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <config.h>
 #include <gst/gst.h>
-#include <gst/gstclock.h>
 
 
 #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;
index 2852b79..a2b3c69 100644 (file)
@@ -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;
index da27358..71e8e96 100644 (file)
@@ -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;
index b79dd9c..5e5bb62 100644 (file)
@@ -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);
 
index 83e7769..bdaa08a 100644 (file)
@@ -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;
index edd1d75..3499749 100644 (file)
@@ -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;
index b57ebbe..2da659d 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gst.h>
+#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);
index c005dcf..aa40b1e 100644 (file)
--- a/gst/gst.h
+++ b/gst/gst.h
 #ifndef __GST_H__
 #define __GST_H__
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <unistd.h>
-
-#include <gtk/gtk.h>
-#include <gmodule.h>
-
 #include <gst/gstdebug.h>
-
 #include <gst/gstlog.h>
-
 #include <gst/gstobject.h>
 #include <gst/gstpad.h>
 #include <gst/gstbuffer.h>
 #include <gst/gstcpu.h>
+#include <gst/gstclock.h>
 #include <gst/gstelement.h>
 #include <gst/gstextratypes.h>
 #include <gst/gstbin.h>
@@ -55,7 +45,6 @@
 #include <gst/gsttrace.h>
 #include <gst/gstxml.h>
 #include <gst/gsttee.h>
-
 #include <gst/cothreads.h>
 
 /* initialize GST */
index c9dee6d..2cf697d 100644 (file)
@@ -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"
index ef9725d..f3b6d81 100644 (file)
 
 //#define GST_DEBUG_ENABLED
 
-#include <gst/gst.h>
-
-#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) 
 {
index d83ceef..1212d77 100644 (file)
 #ifndef __GST_BIN_H__
 #define __GST_BIN_H__
 
-
 #include <gst/gstelement.h>
-#include <gst/gstsrc.h>
-#include <gst/gstconnection.h>
 #include <gst/cothreads.h>
 
-
 #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;
 
index 35d3f6a..19d68d4 100644 (file)
@@ -20,9 +20,9 @@
 
 /* this file makes too much noise for most debugging sessions */
 #define GST_DEBUG_FORCE_DISABLE
-#include <gst/gst.h>
-#include <gst/gstbuffer.h>
 
+#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);
index d6c0781..563f86b 100644 (file)
 #ifndef __GST_BUFFER_H__
 #define __GST_BUFFER_H__
 
-#include <gst/gstmeta.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_ATOMIC_H
+#include <asm/atomic.h>
+#endif
 
+#include <gst/gstmeta.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -66,7 +73,7 @@ typedef enum {
 
 typedef struct _GstBuffer GstBuffer;
 
-#include "gstbufferpool.h"
+#include <gst/gstbufferpool.h>
 
 struct _GstBuffer {
   /* locking */
index 07bcb33..0f9919a 100644 (file)
@@ -18,9 +18,8 @@
  */
 
 
-#include <gst/gst.h>
-#include <gst/gstbufferpool.h>
-
+#include "gstdebug.h"
+#include "gstbuffer.h"
 
 
 /**
index c13367b..189fc03 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef __GST_BUFFER_POOL_H__
 #define __GST_BUFFER_POOL_H__
 
-#include "gstbuffer.h"
+#include <gst/gstbuffer.h>
 
 #ifdef __cplusplus
 extern "C" {
index f51f71b..7643939 100644 (file)
@@ -19,8 +19,8 @@
 
 //#define DEBUG_ENABLED
 
-#include <stdarg.h>
-#include <gst/gst.h>
+#include "gstcaps.h"
+#include "gsttype.h"
 
 void 
 _gst_caps_initialize (void) 
index 43339b7..b564f7e 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef __GST_CAPS_H__
 #define __GST_CAPS_H__
 
-#include <glib.h>
+#include <gnome-xml/parser.h>
 #include <gst/gstprops.h>
 
 typedef struct _GstCaps GstCaps;
index 2ccfdc7..e269c79 100644 (file)
@@ -19,7 +19,9 @@
 
 #include <sys/time.h>
 //#define DEBUG_ENABLED
-#include <gstclock.h>
+#include "gstclock.h"
+#include "gstdebug.h"
+#include "gstsink.h"
 
 static GstClock *the_system_clock = NULL;
 
index 7aa2494..bb8a0a3 100644 (file)
@@ -22,7 +22,7 @@
 #define __GST_CLOCK_H__
 
 
-#include <gst/gst.h>
+#include <gst/gstobject.h>
 
 #ifdef __cplusplus
 extern "C" {
index 5403755..4e0dcf1 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gstconnection.h>
+#include "gstconnection.h"
 
 
 /* Connection signals and args */
index a08dc96..928573a 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
+#include <glib.h>
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
+
 #include "gstcpu.h"
 
 static guint32 _gst_cpu_flags;
index 5ccd89b..306c679 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef __GST_CPU_H__
 #define __GST_CPU_H__
 
-#include <glib.h>
-
 typedef enum {
   GST_CPU_FLAG_MMX      = (1<<0),
   GST_CPU_FLAG_SSE      = (1<<1),
index 84236e0..5059089 100644 (file)
@@ -25,7 +25,8 @@
 #include <config.h>
 #endif
 
-#include <gst/gst.h>
+#include <gmodule.h>
+#include <gst/gsttrace.h>
 
 /* for include files that make too much noise normally */
 #ifdef GST_DEBUG_FORCE_DISABLE
index 57b8436..f07cc73 100644 (file)
@@ -17,9 +17,9 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gstelement.h>
-#include <gst/gstextratypes.h>
-#include <gst/gstxml.h>
+#include "gstdebug.h"
+#include "gstelement.h"
+#include "gstextratypes.h"
 
 /* Element signals and args */
 enum {
index 77ace5c..81e09e7 100644 (file)
@@ -26,8 +26,6 @@
 #include <gst/gstlog.h>
 #include <gst/gstobject.h>
 #include <gst/gstpad.h>
-#include <gst/gstbuffer.h>
-#include <gst/gstcaps.h>
 #include <gst/cothreads.h>
 
 
@@ -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))
index 771f590..be1e934 100644 (file)
 
 //#define DEBUG_ENABLED
 
-#include <gst/gst.h>
-
-#include <gst/gstelement.h>
-#include <gst/gstplugin.h>
+#include "gstdebug.h"
+#include "gstelement.h"
+#include "gstplugin.h"
 
 
 /* global list of registered elementfactories */
index 858a25a..c23898a 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gstextratypes.h>
+#include "gstextratypes.h"
 
 GtkType 
 gst_extra_get_filename_type (void) 
index bbb5710..7d39009 100644 (file)
@@ -21,8 +21,7 @@
 #ifndef __GST_EXTRA_TYPES_H__
 #define __GST_EXTRA_TYPES_H__
 
-#include <gst/gst.h>
-#include <gnome-xml/parser.h>
+#include <gtk/gtk.h>
 
 #ifdef __cplusplus
 extern "C" {
index e7ec2cb..5bfe208 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gstfilter.h>
+#include "gstfilter.h"
 
 
 /* Filter signals and args */
index 86b0656..2764bd1 100644 (file)
 #ifndef __GST_FILTER_H__
 #define __GST_FILTER_H__
 
-
 #include <gst/gstelement.h>
 
-
 #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;
 };
index 75d3a18..db36218 100644 (file)
@@ -18,8 +18,8 @@
  */
 
 
-#include <gst/gstmeta.h>
-#include <gst/gsttrace.h>
+#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");
index f361a47..cb8d600 100644 (file)
 
 #include <glib.h> 
  
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_ATOMIC_H
+#include <asm/atomic.h>
+#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 {
index a9fc15d..c12e88e 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-
-#include <gst/gstobject.h>
-#include <gst/gstbin.h>
-
+#include "gstobject.h"
 
 /* Object signals and args */
 enum {
index a6894d7..b44370f 100644 (file)
 #ifndef __GST_OBJECT_H__
 #define __GST_OBJECT_H__
 
-
 #include <gtk/gtk.h>
 #include <gst/gsttrace.h>
-//#include "config.h"
 
-#undef HAVE_ATOMIC_H
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #ifdef HAVE_ATOMIC_H
 #include <asm/atomic.h>
 #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))
index d1f88aa..27bb198 100644 (file)
 
 
 //#define DEBUG_ENABLED
-#include <gst/gst.h>
-#include <gst/gstpad.h>
-#include <gst/gstelement.h>
-#include <gst/gsttype.h>
-
+#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;
   
index f718106..0d975d8 100644 (file)
 
 
 #include <gnome-xml/parser.h>
+
 #include <gst/gstobject.h>
 #include <gst/gstbuffer.h>
 #include <gst/cothreads.h>
 #include <gst/gstcaps.h>
 
-
 #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);
index a80cedf..2a02bf1 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gstpipeline.h>
-#include <gst/gstthread.h>
-#include <gst/gstsink.h>
-#include <gst/gstutils.h>
-#include <gst/gsttype.h>
-
-#include "config.h"
+#include "gstpipeline.h"
+#include "gstthread.h"
+#include "gstsink.h"
+#include "gstutils.h"
+#include "gsttype.h"
 
 GstElementDetails gst_pipeline_details = {
   "Pipeline object",
index 24f295e..be95eac 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gst/gstbin.h>
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
index 37b3334..0de739e 100644 (file)
@@ -17,6 +17,9 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -24,9 +27,8 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <gst/gstplugin.h>
+#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;
index 3c9899e..997fd39 100644 (file)
@@ -21,8 +21,8 @@
 #ifndef __GST_PLUGIN_H__
 #define __GST_PLUGIN_H__
 
-
 #include <gmodule.h>
+#include <gnome-xml/parser.h>
 
 #include <gst/gsttype.h>
 #include <gst/gstelement.h>
index 7d75143..ddf3ef1 100644 (file)
@@ -19,9 +19,9 @@
 
 //#define DEBUG_ENABLED
 
-#include <stdarg.h>
-#include <gst/gst.h>
-#include <gst/gstpropsprivate.h>
+#include "gstdebug.h"
+#include "gstprops.h"
+#include "gstpropsprivate.h"
 
 static gboolean        gst_props_entry_check_compatibility     (GstPropsEntry *entry1, GstPropsEntry *entry2);
        
index cadfdd3..4bf45a1 100644 (file)
@@ -22,6 +22,7 @@
 #define __GST_PROPS_H__
 
 #include <glib.h>
+#include <gnome-xml/parser.h>
 
 typedef struct _GstProps GstProps;
 typedef gpointer GstPropsFactoryEntry;
index 864a70b..235fb3d 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 
-#include <gst/gstsink.h>
+#include "gstsink.h"
 
 
 /* Sink signals and args */
index 2ea51e3..e64ad8a 100644 (file)
@@ -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;
 };
index 53bc1e5..29aab57 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gst.h>
+#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;
 }
 
 /**
index 4e115e8..208c88e 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gst/gstelement.h>
 
-
 #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);
index 598396e..7c69dba 100644 (file)
@@ -17,9 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gsttee.h>
-
-#include "config.h"
+#include "gsttee.h"
 
 GstElementDetails gst_tee_details = {
   "Tee pipe fitting",
index 3b7736b..edf1a2d 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gst.h>
-#include <gst/gstthread.h>
+#include <unistd.h>
 
-#include "config.h"
+#include "gstthread.h"
+#include "gstdebug.h"
 
 GstElementDetails gst_thread_details = {
   "Threaded container",
index f683044..02a1156 100644 (file)
@@ -22,9 +22,9 @@
 #define __GST_THREAD_H__
 
 
-#include <gst/gstbin.h>
 #include <pthread.h>
 
+#include <gst/gstbin.h>
 
 #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;
 
 
index 0f53cb8..3101fd5 100644 (file)
@@ -24,8 +24,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <string.h>
-#include <glib.h>
-#include <gst/gsttrace.h>
+
+#include "gsttrace.h"
 
 #ifdef HAVE_RDTS
 __inline__ void read_tsc(guint64 *dst) {
index fef370e..36a588f 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef __GST_TRACE_H__
 #define __GST_TRACE_H__
 
+#include <glib.h>
 
 typedef struct _GstTrace       GstTrace;
 typedef struct _GstTraceEntry  GstTraceEntry;
index 08d4209..16c6061 100644 (file)
  * I'm not overly worried yet...
  */
 
-#include <gst/gst.h>
 #include <string.h>
 
+#include "gsttype.h"
+#include "gstplugin.h"
 
 /* global list of registered types */
 GList *_gst_types;
index bac3533..54dae57 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 
-#include <gtk/gtk.h>
+#include "gstutils.h"
 
 /**
  * gst_util_get_int_arg:
index 4d70243..ef7269a 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gst/gstxml.h>
+#include "gstxml.h"
 
 static void gst_xml_class_init(GstXMLClass *klass);
 static void gst_xml_init(GstXML *xml);
index 4ebb9ec..1f9db89 100644 (file)
@@ -21,8 +21,8 @@
 #ifndef __GST_XML_H__
 #define __GST_XML_H__
 
-#include <gst/gst.h>
 #include <gnome-xml/parser.h>
+#include <gst/gstelement.h>
 
 #ifdef __cplusplus
 extern "C" {
index e2b1850..88ad63c 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 
-#include <gtk/gtk.h>
 #include <gst/gst.h>
 #include <string.h>
 
index 836408c..9c559f0 100644 (file)
@@ -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");
 
index 907c447..a12d008 100644 (file)
@@ -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);
index 1d2c372..826e8d5 100644 (file)
@@ -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;
index 03e1faa..76e3a4c 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <config.h>
 #include <gst/gst.h>
-#include <gst/gstclock.h>
 
 
 #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;
index 2852b79..a2b3c69 100644 (file)
@@ -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;
index da27358..71e8e96 100644 (file)
@@ -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;
index b79dd9c..5e5bb62 100644 (file)
@@ -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);
 
index 83e7769..bdaa08a 100644 (file)
@@ -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;
index edd1d75..3499749 100644 (file)
@@ -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;
index c0dff85..e1867ee 100644 (file)
@@ -13,3 +13,5 @@ states
 caps
 queue
 registry
+rip
+paranoia
index d69544b..050a76a 100644 (file)
@@ -2,9 +2,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
 
 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;
 }
index 4dfd703..c040e3a 100644 (file)
@@ -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);