diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/Makefile.am | 59 | ||||
-rw-r--r-- | gst/autoplug/gststaticautoplug.c | 44 | ||||
-rw-r--r-- | gst/elements/gstdisksrc.c | 2 | ||||
-rw-r--r-- | gst/elements/gstelements.c | 23 | ||||
-rw-r--r-- | gst/gst.c | 60 | ||||
-rw-r--r-- | gst/gst.h | 8 | ||||
-rw-r--r-- | gst/gstbin.c | 24 | ||||
-rw-r--r-- | gst/gstcaps.c | 4 | ||||
-rw-r--r-- | gst/gstcaps.h | 6 | ||||
-rw-r--r-- | gst/gstcpu.c | 11 | ||||
-rw-r--r-- | gst/gstcpu.h | 2 | ||||
-rw-r--r-- | gst/gstelement.h | 10 | ||||
-rw-r--r-- | gst/gstinfo.h | 2 | ||||
-rw-r--r-- | gst/gstpad.c | 84 | ||||
-rw-r--r-- | gst/gstpad.h | 11 | ||||
-rw-r--r-- | gst/gstplugin.c | 22 | ||||
-rw-r--r-- | gst/gstplugin.h | 2 | ||||
-rw-r--r-- | gst/gstprops.c | 16 | ||||
-rw-r--r-- | gst/gstqueue.c | 6 | ||||
-rw-r--r-- | gst/gstscheduler.c | 1 | ||||
-rw-r--r-- | gst/gstthread.c | 4 | ||||
-rw-r--r-- | gst/gsttype.c | 1 | ||||
-rw-r--r-- | gst/gstutils.h | 8 |
23 files changed, 313 insertions, 97 deletions
diff --git a/gst/Makefile.am b/gst/Makefile.am index 5c6c686431..84be380e69 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -43,29 +43,48 @@ libgst_la_SOURCES = \ gstparse.c \ $(GSTARCH_SRCS) + +##### Oh this sucks so badly. This isn't funny. ##### + # the compiler shoots cothreads.c in the head at -O6 # FIXME: these manual rules break the dependency generation, so we have a # nasty hack here. -LTCOMPILE2=$(LTCOMPILE) -O2 -COMPILE2=$(COMPILE) -O2 -cothreads.lo: cothreads.c - @echo '$(LTCOMPILE2) -c $<'; \ - $(LTCOMPILE2) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp -cothreads.o: cothreads.c - @echo '$(COMPILE2) -c $<'; \ - $(COMPILE2) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp +#LTCOMPILE2=$(LTCOMPILE) -O2 +#COMPILE2=$(COMPILE) -O2 + +cothreads.lo: cothreads.c cothreads.h gst_private.h ../config.h gstinfo.c \ +gstarch.h gsti386.h + $(LIBTOOL) --mode=compile $(COMPILE) -O2 -c $< +cothreads.o: cothreads.c cothreads.h gst_private.h ../config.h gstinfo.c \ +gstarch.h gsti386.h + $(COMPILE) -O2 -c $< + +# NOTDEPEND.cothreads.lo: cothreads.c +# NOTDEPEND $(LTCOMPILE2) -c $< +# NOTDEPEND.cothreads.o: cothreads.c +# NOTDEPEND $(COMPILE2) -c $< + +#cothreads.lo: cothreads.c +# @echo '$(LTCOMPILE2) -c $<'; \ +# $(LTCOMPILE2) -Wp,-MD,.deps/$(*F).pp -c $< +# @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ +# < .deps/$(*F).pp > .deps/$(*F).P; \ +# tr ' ' '\012' < .deps/$(*F).pp \ +# | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ +# >> .deps/$(*F).P; \ +# rm -f .deps/$(*F).pp +#cothreads.o: cothreads.c +# @echo '$(COMPILE2) -c $<'; \ +# $(COMPILE2) -Wp,-MD,.deps/$(*F).pp -c $< +# @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ +# < .deps/$(*F).pp > .deps/$(*F).P; \ +# tr ' ' '\012' < .deps/$(*F).pp \ +# | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ +# >> .deps/$(*F).P; \ +# rm -f .deps/$(*F).pp + +##### end immense suckage ##### + libgstincludedir = $(includedir)/gst libgstinclude_HEADERS = \ diff --git a/gst/autoplug/gststaticautoplug.c b/gst/autoplug/gststaticautoplug.c index dc2e730faa..3eab16d77c 100644 --- a/gst/autoplug/gststaticautoplug.c +++ b/gst/autoplug/gststaticautoplug.c @@ -171,6 +171,33 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink) return connected; } +typedef struct { + GstElement *result; + GList *endcap; + gint i; +} dynamic_pad_struct; + +static void +autoplug_dynamic_pad (GstElement *element, GstPad *pad, gpointer data) +{ + dynamic_pad_struct *info = (dynamic_pad_struct *)data; + GList *pads = gst_element_get_pad_list (element); + + GST_DEBUG (0,"attempting to dynamically create a ghostpad for %s=%s\n", GST_ELEMENT_NAME (element), + GST_PAD_NAME (pad)); + + while (pads) { + GstPad *pad = GST_PAD (pads->data); + pads = g_list_next (pads); + + if (gst_caps_list_check_compatibility (gst_pad_get_caps_list (pad), info->endcap)) { + gst_element_add_ghost_pad (info->result, pad, g_strdup_printf("src_%02d", info->i)); + GST_DEBUG (0,"gstpipeline: new dynamic pad %s\n", GST_PAD_NAME (pad)); + break; + } + } +} + static void gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink) { @@ -455,17 +482,34 @@ differ: { GList *endcap = (GList *)(endcaps->data); GList *pads = gst_element_get_pad_list (thesrcelement); + gboolean have_pad = FALSE; endcaps = g_list_next (endcaps); + GST_DEBUG (0,"attempting to create a ghostpad for %s\n", GST_ELEMENT_NAME (thesrcelement)); + while (pads) { GstPad *pad = GST_PAD (pads->data); pads = g_list_next (pads); if (gst_caps_list_check_compatibility (gst_pad_get_caps_list (pad), endcap)) { gst_element_add_ghost_pad (result, pad, g_strdup_printf("src_%02d", i)); + have_pad = TRUE; break; } } + if (!have_pad) { + dynamic_pad_struct *data = g_new0(dynamic_pad_struct, 1); + + data->result = result; + data->endcap = endcap; + data->i = i; + + GST_DEBUG (0,"delaying the creation of a ghostpad for %s\n", GST_ELEMENT_NAME (thesrcelement)); + gtk_signal_connect (GTK_OBJECT (thesrcelement), "new_pad", + autoplug_dynamic_pad, data); + gtk_signal_connect (GTK_OBJECT (thesrcelement), "new_ghost_pad", + autoplug_dynamic_pad, data); + } } } diff --git a/gst/elements/gstdisksrc.c b/gst/elements/gstdisksrc.c index 1978a15b56..9e81eb9b73 100644 --- a/gst/elements/gstdisksrc.c +++ b/gst/elements/gstdisksrc.c @@ -32,7 +32,7 @@ GstElementDetails gst_disksrc_details = { - "asynchronous Disk Source", + "Disk Source", "Source/File", "Read from arbitrary point in a file", VERSION, diff --git a/gst/elements/gstelements.c b/gst/elements/gstelements.c index 1621fd20b4..62b5a9288f 100644 --- a/gst/elements/gstelements.c +++ b/gst/elements/gstelements.c @@ -48,18 +48,17 @@ struct _elements_entry { }; static struct _elements_entry _elements[] = { - { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, NULL }, - { "fakesink", gst_fakesink_get_type, &gst_fakesink_details, NULL }, - { "asyncdisksrc", gst_disksrc_get_type, &gst_disksrc_details, NULL }, - { "audiosink", gst_audiosink_get_type, &gst_audiosink_details, gst_audiosink_factory_init }, - { "audiosrc", gst_audiosrc_get_type, &gst_audiosrc_details, NULL }, - { "disksrc", gst_disksrc_get_type, &gst_disksrc_details, NULL }, - { "identity", gst_identity_get_type, &gst_identity_details, NULL }, - { "fdsink", gst_fdsink_get_type, &gst_fdsink_details, NULL }, - { "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details, NULL }, - { "pipefilter", gst_pipefilter_get_type, &gst_pipefilter_details, NULL }, - { "sinesrc", gst_sinesrc_get_type, &gst_sinesrc_details, NULL }, - { "tee", gst_tee_get_type, &gst_tee_details, gst_tee_factory_init }, + { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, NULL }, + { "fakesink", gst_fakesink_get_type, &gst_fakesink_details, NULL }, + { "audiosink", gst_audiosink_get_type, &gst_audiosink_details, gst_audiosink_factory_init }, + { "audiosrc", gst_audiosrc_get_type, &gst_audiosrc_details, NULL }, + { "disksrc", gst_disksrc_get_type, &gst_disksrc_details, NULL }, + { "identity", gst_identity_get_type, &gst_identity_details, NULL }, + { "fdsink", gst_fdsink_get_type, &gst_fdsink_details, NULL }, + { "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details, NULL }, + { "pipefilter", gst_pipefilter_get_type, &gst_pipefilter_details, NULL }, + { "sinesrc", gst_sinesrc_get_type, &gst_sinesrc_details, NULL }, + { "tee", gst_tee_get_type, &gst_tee_details, gst_tee_factory_init }, #if HAVE_LIBGHTTP { "httpsrc", gst_httpsrc_get_type, &gst_httpsrc_details, NULL }, @@ -35,11 +35,13 @@ #include "gsttypefind.h" +#define MAX_PATH_SPLIT 16 gchar *_gst_progname; extern gint _gst_trace_on; +extern gboolean _gst_plugin_spew; static gboolean gst_init_check (int *argc, gchar ***argv); @@ -88,6 +90,31 @@ gst_init (int *argc, char **argv[]) } } +static void +gst_add_paths_func (gchar *pathlist) +{ + gchar **paths; + gint j = 0; + gchar *lastpath = g_strdup (pathlist); + + while (lastpath) { + paths = g_strsplit (lastpath, G_SEARCHPATH_SEPARATOR_S, MAX_PATH_SPLIT); + g_free (lastpath); + lastpath = NULL; + + while (paths[j]) { + GST_INFO (GST_CAT_GST_INIT, "Adding plugin path: \"%s\"", paths[j]); + gst_plugin_add_path (paths[j]); + if (++j == MAX_PATH_SPLIT) { + lastpath = g_strdup (paths[j]); + g_strfreev (paths); + j=0; + break; + } + } + } +} + /* returns FALSE if the program can be aborted */ static gboolean gst_init_check (int *argc, @@ -128,6 +155,16 @@ gst_init_check (int *argc, (*argv)[i] = NULL; } + else if (!strncmp ("--gst-plugin-spew", (*argv)[i], 17)) { + _gst_plugin_spew = TRUE; + + (*argv)[i] = NULL; + } + else if (!strncmp ("--gst-plugin-path=", (*argv)[i], 17)) { + gst_add_paths_func ((*argv)[i]+18); + + (*argv)[i] = NULL; + } else if (!strncmp ("--help", (*argv)[i], 6)) { showhelp = TRUE; } @@ -147,20 +184,33 @@ gst_init_check (int *argc, } } + + /* check for ENV variables */ + { + gchar *plugin_path = g_getenv("GST_PLUGIN_PATH"); + + gst_add_paths_func (plugin_path); + } + if (showhelp) { guint i; - g_print ("usage %s [OPTION...]\n", (*argv)[0]); + g_print ("usage %s [OPTION...]\n", _gst_progname); g_print ("\nGStreamer options\n"); - g_print (" --gst-info-mask=FLAGS Gst info flags to set (current %08x)\n", gst_info_get_categories()); - g_print (" --gst-debug-mask=FLAGS Gst debugging flags to set\n"); + g_print (" --gst-info-mask=FLAGS GST info flags to set (current %08x)\n", gst_info_get_categories()); + g_print (" --gst-debug-mask=FLAGS GST debugging flags to set\n"); + g_print (" --gst-plugin-spew Enable printout of errors while loading GST plugins\n"); + g_print (" --gst-plugin-path=PATH Add directories separated with '%s' to the plugin search path\n", + G_SEARCHPATH_SEPARATOR_S); - g_print ("\nGStreamer info/debug FLAGS (to be OR'ed)\n"); + g_print ("\n Mask (to be OR'ed) info/debug FLAGS \n"); + g_print ("--------------------------------------------------------\n"); for (i = 0; i<GST_CAT_MAX_CATEGORY; i++) { - g_print (" 0x%08x %s %s\n", 1<<i, + g_print (" 0x%08x %s%s %s\n", 1<<i, (gst_info_get_categories() & (1<<i)?"(enabled)":" "), + (gst_debug_get_categories() & (1<<i)?"/(enabled)":"/ "), gst_get_category_name (i)); } @@ -49,12 +49,20 @@ #include <gst/gstparse.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /* initialize GST */ void gst_init(int *argc,char **argv[]); void gst_main (void); void gst_main_quit (void); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #include <gst/gstlog.h> #endif /* __GST_H__ */ diff --git a/gst/gstbin.c b/gst/gstbin.c index 4e70873d03..00e9acfe13 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -770,9 +770,9 @@ gst_bin_create_plan_func (GstBin *bin) gst_bin_schedule(bin); - g_print ("gstbin \"%s\", eos providers:%d\n", - GST_ELEMENT_NAME (bin), - bin->num_eos_providers); +// g_print ("gstbin \"%s\", eos providers:%d\n", +// GST_ELEMENT_NAME (bin), +// bin->num_eos_providers); GST_DEBUG_LEAVE("(\"%s\")",GST_ELEMENT_NAME (bin)); } @@ -805,11 +805,27 @@ gst_bin_iterate_func (GstBin *bin) if (!chain->need_scheduling) continue; if (chain->need_cothreads) { + GList *entries; + // all we really have to do is switch to the first child // FIXME this should be lots more intelligent about where to start GST_DEBUG (0,"starting iteration via cothreads\n"); - entry = GST_ELEMENT (chain->elements->data); + entries = chain->elements; + entry = NULL; + + // find an element with a threadstate to start with + while (entries) { + entry = GST_ELEMENT (entries->data); + + if (entry->threadstate) + break; + entries = g_list_next (entries); + } + // if we couldn't find one, bail out + if (entries == NULL) + GST_ERROR(GST_ELEMENT(bin),"no cothreaded elements found!"); + GST_FLAG_SET (entry, GST_ELEMENT_COTHREAD_STOPPING); GST_DEBUG (0,"set COTHREAD_STOPPING flag on \"%s\"(@%p)\n", GST_ELEMENT_NAME (entry),entry); diff --git a/gst/gstcaps.c b/gst/gstcaps.c index d9268e48d7..ebdaccc301 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -252,11 +252,11 @@ gst_caps_get_type_id (GstCaps *caps) * Set the type id of the caps. */ void -gst_caps_set_type_id (GstCaps *caps, guint16 typeid) +gst_caps_set_type_id (GstCaps *caps, guint16 type_id) { g_return_if_fail (caps != NULL); - caps->id = typeid; + caps->id = type_id; } /** diff --git a/gst/gstcaps.h b/gst/gstcaps.h index eebaab82d1..dffa1cd3d5 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -37,7 +37,11 @@ typedef struct _GstCaps GstCaps; typedef gpointer GstCapsFactoryEntry; +#ifdef __cplusplus +typedef GstCapsFactoryEntry * GstCapsFactory; +#else // C++ was unable to compile with this typedef GstCapsFactoryEntry GstCapsFactory[]; +#endif struct _GstCaps { gchar *name; /* the name of this caps */ @@ -62,7 +66,7 @@ const gchar* gst_caps_get_mime (GstCaps *caps); void gst_caps_set_mime (GstCaps *caps, const gchar *mime); guint16 gst_caps_get_type_id (GstCaps *caps); -void gst_caps_set_type_id (GstCaps *caps, guint16 typeid); +void gst_caps_set_type_id (GstCaps *caps, guint16 type_id); GstCaps* gst_caps_set_props (GstCaps *caps, GstProps *props); GstProps* gst_caps_get_props (GstCaps *caps); diff --git a/gst/gstcpu.c b/gst/gstcpu.c index 22a77d0897..d286bf7487 100644 --- a/gst/gstcpu.c +++ b/gst/gstcpu.c @@ -63,14 +63,23 @@ _gst_cpu_initialize (void) } if (edx & (1<<25)) { _gst_cpu_flags |= GST_CPU_FLAG_SSE; + _gst_cpu_flags |= GST_CPU_FLAG_MMXEXT; featurelist = stringcat(featurelist,"SSE "); } + if (edx & (1<<24)) { + _gst_cpu_flags |= GST_CPU_FLAG_MMXEXT; + featurelist = stringcat(featurelist,"MMXEXT "); + } + if (edx & (1<<31)) { + _gst_cpu_flags |= GST_CPU_FLAG_3DNOW; + featurelist = stringcat(featurelist,"3DNOW "); + } if (!_gst_cpu_flags) { featurelist = stringcat(featurelist,"NONE"); } - GST_INFO (GST_CAT_GST_INIT, "CPU features: %s",featurelist); + GST_INFO (GST_CAT_GST_INIT, "CPU features: (%08lx) %s",edx, featurelist); g_free(featurelist); } diff --git a/gst/gstcpu.h b/gst/gstcpu.h index f31e709256..e79b9c916a 100644 --- a/gst/gstcpu.h +++ b/gst/gstcpu.h @@ -27,6 +27,8 @@ typedef enum { GST_CPU_FLAG_MMX = (1<<0), GST_CPU_FLAG_SSE = (1<<1), + GST_CPU_FLAG_MMXEXT = (1<<2), + GST_CPU_FLAG_3DNOW = (1<<3), } GstCPUFlags; void _gst_cpu_initialize (void); diff --git a/gst/gstelement.h b/gst/gstelement.h index 398fb78391..655d18fafe 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -58,11 +58,11 @@ typedef enum { static inline char *_gst_print_statename(int state) { switch (state) { - case GST_STATE_NONE_PENDING: return "none pending";break; - case GST_STATE_NULL: return "null";break; - case GST_STATE_READY: return "ready";break; - case GST_STATE_PLAYING: return "playing";break; - case GST_STATE_PAUSED: return "paused";break; + case GST_STATE_NONE_PENDING: return "NONE_PENDING";break; + case GST_STATE_NULL: return "NULL";break; + case GST_STATE_READY: return "READY";break; + case GST_STATE_PLAYING: return "PLAYING";break; + case GST_STATE_PAUSED: return "PAUSED";break; default: return ""; } return ""; diff --git a/gst/gstinfo.h b/gst/gstinfo.h index cb11ca1ead..507b36b218 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -139,7 +139,7 @@ _gst_debug_register_funcptr (void *ptr, gchar *ptrname) static inline gchar * _gst_debug_nameof_funcptr (void *ptr) { - gchar *ptrname = __gst_function_pointers ? g_hash_table_lookup(__gst_function_pointers,ptr) : NULL; + gchar *ptrname = (gchar*)( __gst_function_pointers ? g_hash_table_lookup(__gst_function_pointers,ptr) : NULL ); // FIXME this must go away, it's a major leak if (!ptrname) return g_strdup_printf("%p",ptr); else return ptrname; diff --git a/gst/gstpad.c b/gst/gstpad.c index 74568b89bf..b28bdcfdbd 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -819,7 +819,7 @@ void gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent) { - xmlNodePtr field = self->childs; + xmlNodePtr field = self->xmlChildrenNode; GstPad *pad = NULL, *targetpad; guchar *peer = NULL; gchar **split; @@ -927,22 +927,49 @@ gst_pad_ghost_save_thyself (GstPad *pad, } #ifndef gst_pad_push -void gst_pad_push(GstPad *pad,GstBuffer *buf) { - GstRealPad *peer = GST_RPAD_PEER(pad); - GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad)); +/** + * gst_pad_push: + * @pad: the pad to push + * @buf: the buffer to push + * + * Push a buffer to the peer of the pad. + */ +void +gst_pad_push (GstPad *pad, GstBuffer *buf) +{ + GstRealPad *peer = GST_RPAD_PEER (pad); + + g_return_if_fail (peer != NULL); + + GST_DEBUG_ENTER ("(%s:%s)", GST_DEBUG_PAD_NAME (pad)); + if (peer->pushfunc) { - GST_DEBUG (0,"calling pushfunc &%s of peer pad %s:%s\n", - GST_DEBUG_FUNCPTR_NAME(peer->pushfunc),GST_DEBUG_PAD_NAME(((GstPad*)peer))); - (peer->pushfunc)(((GstPad*)peer),buf); + GST_DEBUG (0, "calling pushfunc &%s of peer pad %s:%s\n", + GST_DEBUG_FUNCPTR_NAME (peer->pushfunc), GST_DEBUG_PAD_NAME (((GstPad*)peer))); + (peer->pushfunc) (((GstPad*)peer), buf); } else - GST_DEBUG (0,"no pushfunc\n"); + GST_DEBUG (0, "no pushfunc\n"); } #endif #ifndef gst_pad_pull -GstBuffer *gst_pad_pull(GstPad *pad) { +/** + * gst_pad_pull: + * @pad: the pad to pull + * + * Pull a buffer from the peer pad. + * + * Returns: a new buffer from the peer pad. + */ +GstBuffer* +gst_pad_pull (GstPad *pad) +{ GstRealPad *peer = GST_RPAD_PEER(pad); + + g_return_val_if_fail (peer != NULL, NULL); + GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad)); + if (peer->pullfunc) { GST_DEBUG (0,"calling pullfunc &%s (@%p) of peer pad %s:%s\n", GST_DEBUG_FUNCPTR_NAME(peer->pullfunc),&peer->pullfunc,GST_DEBUG_PAD_NAME(((GstPad*)peer))); @@ -955,9 +982,29 @@ GstBuffer *gst_pad_pull(GstPad *pad) { #endif #ifndef gst_pad_pullregion -GstBuffer *gst_pad_pullregion(GstPad *pad,GstRegionType type,guint64 offset,guint64 len) { +/** + * gst_pad_pullregion: + * @pad: the pad to pull the region from + * @type: the regiontype + * @offset: the offset/start of the buffer to pull + * @len: the length of the buffer to pull + * + * Pull a buffer region from the peer pad. The region to pull can be + * specified with a offset/lenght pair or with a start/legnth time + * indicator as specified by the type parameter. + * + * Returns: a new buffer from the peer pad with data in the specified + * region. + */ +GstBuffer* +gst_pad_pullregion (GstPad *pad, GstRegionType type, guint64 offset, guint64 len) +{ GstRealPad *peer = GST_RPAD_PEER(pad); + + g_return_val_if_fail (peer != NULL, NULL); + GST_DEBUG_ENTER("(%s:%s,%d,%lld,%lld)",GST_DEBUG_PAD_NAME(pad),type,offset,len); + if (peer->pullregionfunc) { GST_DEBUG (0,"calling pullregionfunc &%s of peer pad %s:%s\n", GST_DEBUG_FUNCPTR_NAME(peer->pullregionfunc),GST_DEBUG_PAD_NAME(((GstPad*)peer))); @@ -1278,23 +1325,6 @@ gst_pad_set_eos(GstPad *pad) return TRUE; } -/* -GstPad * -gst_pad_select(GstPad *nextpad, ...) { - va_list args; - GstPad *pad; - GSList *pads = NULL; - - // construct the list of pads - va_start (args, nextpad); - while ((pad = va_arg (args, GstPad*))) - pads = g_slist_prepend (pads, pad); - va_end (args); - - // now switch to the nextpad -*/ - - /** * gst_pad_set_element_private: * @pad: the pad to set the private data to diff --git a/gst/gstpad.h b/gst/gstpad.h index 9d0e9012e6..ef21617fdd 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -26,6 +26,13 @@ #include <parser.h> // NOTE: This is xml-config's fault +// Include compatability defines: if libxml hasn't already defined these, +// we have an old version 1.x +#ifndef xmlChildrenNode +#define xmlChildrenNode childs +#define xmlRootNode root +#endif + #include <gst/gstobject.h> #include <gst/gstbuffer.h> #include <gst/cothreads.h> @@ -283,7 +290,7 @@ void gst_pad_connect (GstPad *srcpad, GstPad *sinkpad); void gst_pad_disconnect (GstPad *srcpad, GstPad *sinkpad); #if 1 -void gst_pad_push (GstPad *pad, GstBuffer *buffer); +void gst_pad_push (GstPad *pad, GstBuffer *buf); #else #define gst_pad_push(pad,buf) G_STMT_START{ \ if ((pad)->peer->pushfunc) ((pad)->peer->pushfunc)((pad)->peer,(buf)); \ @@ -299,8 +306,6 @@ GstBuffer* gst_pad_pullregion (GstPad *pad, GstRegionType type, guint64 offset (((pad)->peer->pullregionfunc) ? ((pad)->peer->pullregionfunc)((pad)->peer,(type),(offset),(len)) : NULL) #endif -GstPad * gst_pad_select (GstPad *nextpad, ...); - #define gst_pad_eos(pad) (GST_RPAD_EOSFUNC(GST_RPAD_PEER(pad))(GST_PAD(GST_RPAD_PEER(pad)))) gboolean gst_pad_set_eos (GstPad *pad); diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 9012bec2f6..f372fb920a 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -66,6 +66,8 @@ _gst_plugin_initialize (void) _gst_libraries = NULL; _gst_libraries_seqno = 0; + /* add the main (installed) library path */ + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, PLUGINS_DIR); /* if this is set, we add build-directory paths to the list */ #ifdef PLUGINS_USE_SRCDIR @@ -82,9 +84,6 @@ _gst_plugin_initialize (void) PLUGINS_SRCDIR "/gst/types"); _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, PLUGINS_SRCDIR "/gst/autoplug"); -#else /* PLUGINS_USE_SRCDIR */ - /* add the main (installed) library path */ - _gst_plugin_paths = g_list_prepend (_gst_plugin_paths, PLUGINS_DIR); #endif /* PLUGINS_USE_SRCDIR */ doc = xmlParseFile (GST_CONFIG_DIR"/reg.xml"); @@ -101,6 +100,18 @@ _gst_plugin_initialize (void) xmlFreeDoc (doc); } +/** + * gst_plugin_add_path: + * @path: the directory to add to the search path + * + * Add a directory to the path searched for plugins. + */ +void +gst_plugin_add_path (const gchar *path) +{ + _gst_plugin_paths = g_list_prepend (_gst_plugin_paths,g_strdup(path)); +} + static time_t get_time(const char * path) { @@ -216,7 +227,7 @@ gst_plugin_load_all(void) path = _gst_plugin_paths; while (path != NULL) { - GST_DEBUG (GST_CAT_PLUGIN_LOADING,"loading plugins from %s\n",(gchar *)path->data); + GST_INFO (GST_CAT_PLUGIN_LOADING,"loading plugins from %s\n",(gchar *)path->data); gst_plugin_load_recurse(path->data,NULL); path = g_list_next(path); } @@ -366,7 +377,8 @@ gst_plugin_load_absolute (const gchar *name) } return TRUE; } else if (_gst_plugin_spew) { - gst_info("error loading plugin: %s, reason: %s\n", name, g_module_error()); + // FIXME this should be some standard gst mechanism!!! + g_printerr ("error loading plugin %s, reason: %s\n", name, g_module_error()); } return FALSE; diff --git a/gst/gstplugin.h b/gst/gstplugin.h index 545ce05fce..94e7824974 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -64,6 +64,8 @@ void _gst_plugin_initialize (void); GstPlugin* gst_plugin_new (const gchar *name); +void gst_plugin_add_path (const gchar *path); + const gchar* gst_plugin_get_name (GstPlugin *plugin); void gst_plugin_set_name (GstPlugin *plugin, const gchar *name); const gchar* gst_plugin_get_longname (GstPlugin *plugin); diff --git a/gst/gstprops.c b/gst/gstprops.c index b5b11386ab..d3ca3cf8b0 100644 --- a/gst/gstprops.c +++ b/gst/gstprops.c @@ -54,23 +54,23 @@ gst_props_create_entry (GstPropsFactory factory, gint *skipped) tag = factory[i++]; switch (GPOINTER_TO_INT (tag)) { - case GST_PROPS_INT_ID: + case GST_PROPS_INT_ID_NUM: entry->propstype = GST_PROPS_INT_ID_NUM; entry->data.int_data = GPOINTER_TO_INT (factory[i++]); break; - case GST_PROPS_INT_RANGE_ID: + case GST_PROPS_INT_RANGE_ID_NUM: entry->propstype = GST_PROPS_INT_RANGE_ID_NUM; entry->data.int_range_data.min = GPOINTER_TO_INT (factory[i++]); entry->data.int_range_data.max = GPOINTER_TO_INT (factory[i++]); break; - case GST_PROPS_FOURCC_ID: + case GST_PROPS_FOURCC_ID_NUM: entry->propstype = GST_PROPS_FOURCC_ID_NUM; entry->data.fourcc_data = GPOINTER_TO_INT (factory[i++]); break; - case GST_PROPS_LIST_ID: + case GST_PROPS_LIST_ID_NUM: g_print("gstprops: list not allowed in list\n"); break; - case GST_PROPS_BOOL_ID: + case GST_PROPS_BOOL_ID_NUM: entry->propstype = GST_PROPS_BOOL_ID_NUM; entry->data.bool_data = GPOINTER_TO_INT (factory[i++]); break; @@ -154,7 +154,7 @@ gst_props_register_count (GstPropsFactory factory, guint *counter) tag = factory[i]; switch (GPOINTER_TO_INT (tag)) { - case GST_PROPS_LIST_ID: + case GST_PROPS_LIST_ID_NUM: { GstPropsEntry *list_entry; @@ -241,13 +241,13 @@ gst_props_new (GstPropsFactoryEntry entry, ...) value = va_arg (var_args, GstPropsFactoryEntry); } switch (GPOINTER_TO_INT (value)) { - case GST_PROPS_END_ID: + case GST_PROPS_END_ID_NUM: g_assert (inlist == TRUE); inlist = FALSE; skip = 0; break; - case GST_PROPS_LIST_ID: + case GST_PROPS_LIST_ID_NUM: { g_assert (inlist == FALSE); diff --git a/gst/gstqueue.c b/gst/gstqueue.c index ba91043b08..a500f9189a 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -251,11 +251,15 @@ gst_queue_chain (GstPad *pad, GstBuffer *buf) static GstBuffer * gst_queue_get (GstPad *pad) { - GstQueue *queue = GST_QUEUE (GST_OBJECT_PARENT (pad)); + GstQueue *queue; GstBuffer *buf = NULL; GSList *front; const guchar *name; + g_return_val_if_fail (pad != NULL, NULL); + g_return_val_if_fail (GST_IS_PAD (pad), NULL); + + queue = GST_QUEUE (GST_OBJECT_PARENT (pad)); name = GST_ELEMENT_NAME (queue); /* have to lock for thread-safety */ diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c index b2230b2fa5..cc6fe46d0e 100644 --- a/gst/gstscheduler.c +++ b/gst/gstscheduler.c @@ -105,6 +105,7 @@ gst_bin_src_wrapper (int argc,char *argv[]) // fprintf(stderr,"error, no getregionfunc in \"%s\"\n", name); // else buf = (GST_RPAD_GETREGIONFUNC(realpad))((GstPad*)realpad,realpad->regiontype,realpad->offset,realpad->len); + realpad->regiontype = GST_REGION_NONE; } else { g_return_val_if_fail (GST_RPAD_GETFUNC(realpad) != NULL, 0); // if (GST_RPAD_GETFUNC(realpad) == NULL) diff --git a/gst/gstthread.c b/gst/gstthread.c index 04e695c603..ca269b0032 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -282,6 +282,7 @@ gst_thread_change_state (GstElement *element) GST_FLAG_SET (thread, GST_THREAD_STATE_REAPING); gst_thread_signal_thread (thread); + pthread_join(thread->thread_id,NULL); break; default: break; @@ -324,7 +325,8 @@ gst_thread_main_loop (void *arg) } GST_FLAG_UNSET (thread, GST_THREAD_STATE_REAPING); - //pthread_join (thread->thread_id, 0); +// FIXME this should be removed (why's it here???) +// //pthread_join (thread->thread_id, 0); GST_INFO (GST_CAT_THREAD, "gstthread: thread \"%s\" is stopped", GST_ELEMENT_NAME (thread)); diff --git a/gst/gsttype.c b/gst/gsttype.c index 7b7b34efd3..437da194df 100644 --- a/gst/gsttype.c +++ b/gst/gsttype.c @@ -80,6 +80,7 @@ gst_type_register (GstTypeFactory *factory) _gst_types = g_list_prepend (_gst_types, type); id = type->id; + GST_DEBUG (0,"gsttype: new mime type '%s', id %d\n", type->mime, type->id); } else { type = gst_type_find_by_id (id); diff --git a/gst/gstutils.h b/gst/gstutils.h index a6465fee08..3f15ed2c9d 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -26,6 +26,10 @@ #include <gtk/gtk.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + gint gst_util_get_int_arg (GtkObject *object, guchar *argname); gboolean gst_util_get_bool_arg (GtkObject *object, guchar *argname); glong gst_util_get_long_arg (GtkObject *object, guchar *argname); @@ -37,4 +41,8 @@ GtkWidget* gst_util_get_widget_arg (GtkObject *object, guchar *argname); void gst_util_dump_mem (guchar *mem, guint size); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __GST_UTILS_H__ */ |