From 6661696de02876ee7898de639a8cb10b4fd71227 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Aug 2000 20:35:48 +0000 Subject: [PATCH] Various fixes for the build/install problems update to the docs/manual. Added a simple helloworld example. Original commit message from CVS: Various fixes for the build/install problems update to the docs/manual. Added a simple helloworld example. --- README | 2 +- docs/gst/Makefile.am | 2 +- docs/manual/gstreamer-manual.sgml | 18 +++--- editor/editor.c | 2 + editor/gsteditorelement.c | 4 +- gst/Makefile.am | 3 - gst/gstbin.c | 91 ++------------------------ gst/gstelement.c | 11 +--- gst/gstelement.h | 35 ---------- gst/gstobject.h | 4 +- gst/gstpad.c | 39 ----------- gst/gstpipeline.c | 2 + gst/gstplugin.c | 1 + gst/gstplugin.h | 3 - gst/gsttee.c | 1 + gst/gstthread.c | 103 +----------------------------- gstplay/Makefile.am | 7 +- gstplay/callbacks.c | 4 +- gstplay/gstplay.c | 24 +++---- gstreamer-config.in | 6 +- libs/colorspace/Makefile.am | 2 +- libs/getbits/Makefile.am | 2 +- libs/idct/Makefile.am | 5 +- libs/putbits/Makefile.am | 2 +- libs/riff/Makefile.am | 3 +- libs/videoscale/Makefile.am | 2 +- libs/winloader/Makefile.am | 5 +- tools/launch.c | 2 +- 28 files changed, 64 insertions(+), 321 deletions(-) diff --git a/README b/README index b66f5df0ff..071f7c54ef 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ This is gnome-streamer, a framework for streaming media in GNOME. The fundamental design comes from the video pipeline at Oregon Graduate -Institute, as well as some ideas from DirectX. It's based on plug-ins +Institute, as well as some ideas from DirectMedia. It's based on plug-ins that will provide the various codec and other functionality. The interface hopefully is generic enough for various companies (ahem, Apple) to release binary codecs for Linux, until such time as they get a clue and diff --git a/docs/gst/Makefile.am b/docs/gst/Makefile.am index 9ca32f3676..4245d87bb7 100644 --- a/docs/gst/Makefile.am +++ b/docs/gst/Makefile.am @@ -14,7 +14,7 @@ LDFLAGS = $(GLIB_LIBS) $(GTK_LIBS) $(top_srcdir)/gst/libgst.la $(top_srcdir)/gst EXTRA_DIST=gstreamer.types.in -HTML_DIR=$(datadir)/gstreamer/gst/html +HTML_DIR=$(datadir)/gstreamer/html TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) diff --git a/docs/manual/gstreamer-manual.sgml b/docs/manual/gstreamer-manual.sgml index e3e1be9032..635e9f70c2 100644 --- a/docs/manual/gstreamer-manual.sgml +++ b/docs/manual/gstreamer-manual.sgml @@ -8,6 +8,8 @@ + + ]> @@ -96,19 +98,15 @@ With the basic concepts out of the way, you're ready to start building a - full-scale GStreamer application. This part of the book walks you through the - creation of a generic application skeleton: a source tree using - automake and - autoconf, argument parsing, session - management, internationalization, the main window, dialogs, toolbars, and - menubars. Many examples in Part 2 come from a simple application called - "GnomeHello"; the source code for this application is included in the - back of the book. Of course the "meat" of the application - is up to you; but in Part 3 of the book we'll cover a range of library - features you can use to develop it. + full-scale GStreamer application. + + + We assume the reader is familiar with GTK+/GNOME programming. + &HELLOWORLD; + diff --git a/editor/editor.c b/editor/editor.c index a16a0f2549..6dcd80672a 100644 --- a/editor/editor.c +++ b/editor/editor.c @@ -26,6 +26,8 @@ #include "gsteditor.h" +#include "config.h" + extern gboolean _gst_plugin_spew; int main(int argc,char *argv[]) { diff --git a/editor/gsteditorelement.c b/editor/gsteditorelement.c index d13c40f4ae..6bad772774 100644 --- a/editor/gsteditorelement.c +++ b/editor/gsteditorelement.c @@ -343,7 +343,7 @@ static void gst_editor_element_realize(GstEditorElement *element) { /* create the title */ element->title = gnome_canvas_item_new(element->group, gnome_canvas_text_get_type(), - "text",gst_element_get_name(GST_OBJECT(element->element)), + "text",gst_element_get_name(GST_ELEMENT(element->element)), "x",x1+1.0,"y",y1+1.0,"anchor",GTK_ANCHOR_NORTH_WEST, "font_gdk",gtk_widget_get_default_style()->font, NULL); @@ -864,6 +864,7 @@ static void gst_editor_element_state_change(GstElement *element, // g_print("gst_editor_element_state_change got state 0x%08x\n",state); // if it's an unset +#ifdef OLD if (state & GST_STATE_MAX) { state = ~state; for (id=0;id<(sizeof(state)*8)-1;id++) { @@ -882,6 +883,7 @@ static void gst_editor_element_state_change(GstElement *element, state /= 2; } } +#endif gst_editor_element_set_state(editorelement,id,FALSE); } diff --git a/gst/Makefile.am b/gst/Makefile.am index 8a3668942d..42ab6b570d 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -60,9 +60,6 @@ libgstinclude_HEADERS = \ cothreads.h CFLAGS += -O2 -Wall -#if USE_DEBUG -CFLAGS += -g -#endif libgst_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(XML_LIBS) libgst_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE) diff --git a/gst/gstbin.c b/gst/gstbin.c index 42baacd8a2..adcaaab4b3 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -19,6 +19,8 @@ #include +#include "config.h" + GstElementDetails gst_bin_details = { "Generic bin", "Bin", @@ -150,23 +152,9 @@ void gst_bin_add(GstBin *bin,GstElement *element) { bin->numchildren++; gst_object_set_parent(GST_OBJECT(element),GST_OBJECT(bin)); -#ifdef OLDSTATE - /* FIXME: this isn't right, the bin should be complete whether or not - the children are, I think. */ -// if (GST_STATE_IS_SET(element,GST_STATE_COMPLETE)) { - if (!GST_STATE_IS_SET(bin,GST_STATE_COMPLETE)) { - g_print("GstBin: adding complete element - "); - gst_bin_change_state_norecurse(GST_ELEMENT(bin)); - } -// } else { -// g_print("GstBin: adding element - "); -// gst_bin_change_state_norecurse(GST_ELEMENT(bin),~GST_STATE_COMPLETE); -// } -#else /* we know we have at least one child, we just added one... */ // if (GST_STATE(element) < GST_STATE_READY) // gst_bin_change_state_norecurse(bin,GST_STATE_READY); -#endif gtk_signal_emit(GTK_OBJECT(bin),gst_bin_signals[OBJECT_ADDED],element); } @@ -250,7 +238,7 @@ static GstElementStateReturn gst_bin_change_state_norecurse(GstBin *bin) { */ if (GST_ELEMENT_CLASS(parent_class)->change_state) - return GST_ELEMENT_CLASS(parent_class)->change_state(bin); + return GST_ELEMENT_CLASS(parent_class)->change_state(GST_ELEMENT(bin)); else return GST_STATE_FAILURE; } @@ -282,7 +270,7 @@ static gboolean gst_bin_change_state_type(GstBin *bin, children = g_list_next(children); } if (type == GST_TYPE_BIN) - gst_element_change_state(GST_ELEMENT(bin),state); + gst_element_set_state(GST_ELEMENT(bin),state); return TRUE; } @@ -417,77 +405,6 @@ void gst_bin_create_plan(GstBin *bin) { (oclass->create_plan)(bin); } -#ifdef OLD_STUFF -static void gst_bin_create_plan_func(GstBin *bin) { - GList *elements; - GstElement *element; - GList *pads; - GstPad *pad, *peer; - GstElement *outside; - - bin->numentries = 0; - - g_print("GstBin: attempting to create a plan for bin %p\n",bin); - - /* walk through all the elements to figure out all kinds of things */ - elements = GST_BIN(bin)->children; - while (elements) { - element = GST_ELEMENT(elements->data); - - // have to use cothreads if any elements use loop functions, or if any - // of them have nontrivial chain functions - if (element->loopfunc != NULL) { - if (bin->threadcontext == NULL) { - g_print("GstBin: initializing cothread context\n"); - bin->threadcontext = cothread_init(); - } - if (element->threadstate == NULL) { - g_print("GstBin: creating thread state for element\n"); - element->threadstate = cothread_create(bin->threadcontext); - cothread_setfunc(element->threadstate,gst_element_loopfunc_wrapper, - 0,element); - } - } - - // we need to find all the entry points into the bin - if (GST_IS_SRC(element)) { - g_print("GstBin: element '%s' is a source entry point for the bin\n", - gst_element_get_name(GST_ELEMENT(element))); - bin->entries = g_list_prepend(bin->entries,element); - bin->numentries++; - } else { - // go through the list of pads to see if there's a Connection - pads = gst_element_get_pad_list(element); - while (pads) { - pad = GST_PAD(pads->data); - /* we only worry about sink pads */ - if (gst_pad_get_direction(pad) == GST_PAD_SINK) { - /* get the pad's peer */ - peer = gst_pad_get_peer(pad); - if (!peer) break; - /* get the parent of the peer of the pad */ - outside = GST_ELEMENT(gst_pad_get_parent(peer)); - if (!outside) break; - /* if it's a connection and it's not ours... */ - if (GST_IS_CONNECTION(outside) && - (gst_object_get_parent(GST_OBJECT(outside)) != GST_OBJECT(bin))) { - g_print("GstBin: element '%s' is the external source Connection \ -for internal element '%s'\n", - gst_element_get_name(GST_ELEMENT(outside)), - gst_element_get_name(GST_ELEMENT(element))); - bin->entries = g_list_prepend(bin->entries,outside); - bin->numentries++; - } - } - pads = g_list_next(pads); - } - } - elements = g_list_next(elements); - } - g_print("have %d entries into bin\n",bin->numentries); -} -#endif - static int gst_bin_loopfunc_wrapper(int argc,char *argv[]) { GstElement *element = GST_ELEMENT(argv); GList *pads; diff --git a/gst/gstelement.c b/gst/gstelement.c index 7d0ef0bc4b..f3c366c1be 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -324,18 +324,9 @@ GstElementStateReturn gst_element_change_state(GstElement *element) { // g_print("gst_element_change_state(\"%s\",%d)\n", // element->name,state); -#ifdef OLDSTATE - /* deal with the inverted state */ - //g_print("changing element state, was %08lx\n",GST_STATE(element)); - if (state & GST_STATE_MAX) - GST_STATE_UNSET(element,~state); - else - GST_STATE_SET(element,state); -// g_print(", is now %08lx\n",GST_STATE(element)); -#else GST_STATE(element) = GST_STATE_PENDING(element); GST_STATE_PENDING(element) = GST_STATE_NONE_PENDING; -#endif + gtk_signal_emit(GTK_OBJECT(element),gst_element_signals[STATE_CHANGE], GST_STATE(element)); return TRUE; diff --git a/gst/gstelement.h b/gst/gstelement.h index 95a3c6a880..f7c44bb135 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -35,25 +35,6 @@ extern "C" { #endif /* __cplusplus */ -#ifdef OLDSTATES -typedef enum { - GST_STATE_COMPLETE = (1 << 0), - GST_STATE_RUNNING = (1 << 1), - GST_STATE_DISCOVERY = (1 << 2), - GST_STATE_PREROLL = (1 << 3), - - GST_STATE_PLAYING = (1 << 4), - GST_STATE_PAUSED = (1 << 5), - - GST_STATE_MAX = (1 << 15), -} GstElementState; - -typedef enum { - GST_STATE_FAILURE = 0, - GST_STATE_SUCCESS = 1, - GST_STATE_ASYNC = 2, -}; -#else typedef enum { GST_STATE_NONE_PENDING = -1, GST_STATE_NULL = 0, @@ -67,7 +48,6 @@ typedef enum { GST_STATE_SUCCESS = 1, GST_STATE_ASYNC = 2, } GstElementStateReturn; -#endif static inline char *_gst_print_statename(int state) { switch (state) { @@ -84,21 +64,6 @@ static inline char *_gst_print_statename(int state) { #define GST_STATE(obj) (GST_ELEMENT(obj)->current_state) #define GST_STATE_PENDING(obj) (GST_ELEMENT(obj)->pending_state) -#ifdef OLDSTATE -#define GST_STATE_IS_SET(obj,flag) (GST_STATE (obj) & (flag)) -#define GST_STATE_SET(obj,flag) \ -G_STMT_START{ (GST_STATE (obj) |= (flag)); \ -gst_info("GstElement: set '%s' state %d(%s)\n",gst_element_get_name(obj),flag, \ -_gst_print_statename(flag)); \ -}G_STMT_END -#define GST_STATE_UNSET(obj,flag) \ -G_STMT_START{ (GST_STATE (obj) &= ~(flag)); \ -gst_info("GstElement: unset '%s' state %d(%s)\n",gst_element_get_name(obj),flag, \ -_gst_print_statename(flag)); \ -}G_STMT_END -#endif - - #define GST_TYPE_ELEMENT \ (gst_element_get_type()) #define GST_ELEMENT(obj) \ diff --git a/gst/gstobject.h b/gst/gstobject.h index 7fa8d53e3d..35e1b5a5ea 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -24,7 +24,9 @@ #include #include -#include "config.h" +//#include "config.h" + +#undef HAVE_ATOMIC_H #ifdef HAVE_ATOMIC_H #include diff --git a/gst/gstpad.c b/gst/gstpad.c index 198b2e653b..e342ecb58b 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -209,20 +209,6 @@ void gst_pad_push(GstPad *pad,GstBuffer *buffer) { //g_print("-- gst_pad_push(): houston, we have a problem, no way of talking to peer\n"); } -#ifdef OLD_STUFF - // if the chain function exists for the pad, call it directly - if (pad->chain) - (pad->chain)(pad->peer,buffer); - // else we're likely going to have to cothread it - else { - pad->peer->bufpen = buffer; - g_print("GstPad: would switch to a coroutine here...\n"); - if (!GST_IS_ELEMENT(pad->peer->parent)) - g_print("GstPad: eek, this isn't an element!\n"); - if (GST_ELEMENT(pad->peer->parent)->threadstate != NULL) - cothread_switch(GST_ELEMENT(pad->peer->parent)->threadstate); - } -#endif } /* gst_pad_pull() is given the sink pad */ @@ -260,31 +246,6 @@ GstBuffer *gst_pad_pull(GstPad *pad) { return NULL; } -#ifdef OLD_STUFF - // if the pull function exists for the pad, call it directly - if (pad->pull) { - return (pad->pull)(pad->peer); - // else we're likely going to have to cothread it - } else if (pad->bufpen == NULL) { - g_print("no buffer available, will have to do something about it\n"); - peerparent = GST_ELEMENT(pad->peer->parent); - // if they're a cothread too, we can just switch to them - if (peerparent->threadstate != NULL) { - cothread_switch(peerparent->threadstate); - // otherwise we have to switch to the main thread - } else { - state = cothread_main(GST_ELEMENT(pad->parent)->threadstate->ctx); - g_print("GstPad: switching to supposed 0th thread at %p\n",state); - cothread_switch(state); - } - } else { - g_print("GstPad: buffer available, pulling\n"); - buf = pad->bufpen; - pad->bufpen = NULL; - return buf; - } -#endif - return NULL; } diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 7e580a23df..428281bfed 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -19,6 +19,8 @@ #include +#include "config.h" + GstElementDetails gst_pipeline_details = { "Pipeline object", "Bin", diff --git a/gst/gstplugin.c b/gst/gstplugin.c index c7f7cf76cf..d455ce190b 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -26,6 +26,7 @@ #include +#include "config.h" /* list of loaded modules and its sequence number */ GList *_gst_modules; diff --git a/gst/gstplugin.h b/gst/gstplugin.h index 9daa1b0f5e..337b8927d2 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -27,9 +27,6 @@ #include #include -#include "config.h" - - typedef struct _GstPlugin GstPlugin; typedef struct _GstPluginElement GstPluginElement; diff --git a/gst/gsttee.c b/gst/gsttee.c index aaec394fd2..598396e193 100644 --- a/gst/gsttee.c +++ b/gst/gsttee.c @@ -19,6 +19,7 @@ #include +#include "config.h" GstElementDetails gst_tee_details = { "Tee pipe fitting", diff --git a/gst/gstthread.c b/gst/gstthread.c index 3b7373e711..9547c8f408 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -20,6 +20,8 @@ #include #include +#include "config.h" + GstElementDetails gst_thread_details = { "Threaded container", "Bin", @@ -162,60 +164,6 @@ GstElement *gst_thread_new(guchar *name) { } -#ifdef OLD_STUFF -static void gst_thread_prepare(GstThread *thread) { - GList *elements; - GstElement *element; - GList *pads; - GstPad *pad, *peer; - GstElement *outside; - - GST_BIN(thread)->numentries = 0; - - /* first we need to find all the entry points into the thread */ - elements = GST_BIN(thread)->children; - while (elements) { - element = GST_ELEMENT(elements->data); - gst_info("gstthread: element \"%s\" found in thread\n", - gst_element_get_name(GST_ELEMENT(element))); - if (GST_IS_SRC(element)) { - gst_info("gstthread: element \"%s\" is a source entry point for the thread\n", - gst_element_get_name(GST_ELEMENT(element))); - GST_BIN(thread)->entries = g_list_prepend(GST_BIN(thread)->entries,element); - GST_BIN(thread)->numentries++; - } else { - /* go through the list of pads to see if there's a Connection */ - pads = gst_element_get_pad_list(element); - while (pads) { - pad = GST_PAD(pads->data); - /* we only worry about sink pads */ - if (gst_pad_get_direction(pad) == GST_PAD_SINK) { - /* get the pad's peer */ - peer = gst_pad_get_peer(pad); - if (!peer) break; - /* get the parent of the peer of the pad */ - outside = GST_ELEMENT(gst_pad_get_parent(peer)); - if (!outside) break; - /* if it's a connection and it's not ours... */ - if (GST_IS_CONNECTION(outside) && - (gst_object_get_parent(GST_OBJECT(outside)) != GST_OBJECT(thread))) { - gst_info("gstthread: element \"%s\" is the external source Connection \ -for internal element \"%s\"\n", - gst_element_get_name(GST_ELEMENT(outside)), - gst_element_get_name(GST_ELEMENT(element))); - GST_BIN(thread)->entries = g_list_prepend(GST_BIN(thread)->entries,outside); - GST_BIN(thread)->numentries++; - } - } - pads = g_list_next(pads); - } - } - elements = g_list_next(elements); - } - gst_info("gstthread: have %d entries into thread\n",GST_BIN(thread)->numentries); -} -#endif - static GstElementStateReturn gst_thread_change_state(GstElement *element) { GstThread *thread; @@ -261,18 +209,6 @@ static GstElementStateReturn gst_thread_change_state(GstElement *element) { } return GST_STATE_SUCCESS; break; -#if OLDSTATE - case ~GST_STATE_RUNNING: - // stop, reap, and join the thread - GST_FLAG_UNSET(thread,GST_THREAD_STATE_SPINNING); - GST_FLAG_SET(thread,GST_THREAD_STATE_REAPING); - gst_thread_signal_thread(thread); - pthread_join(thread->thread_id,0); - // tear down the internal state - gst_info("gstthread: tearing down thread's iteration state\n"); - // FIXME do stuff - break; -#endif case GST_STATE_PLAYING: if (!stateset) return FALSE; gst_info("gstthread: starting thread \"%s\"\n", @@ -324,41 +260,6 @@ void *gst_thread_main_loop(void *arg) { return NULL; } -#ifdef OLD_STUFF -/** - * gst_thread_iterate: - * @thread: the thread to iterate - * - * do one iteration - */ -void gst_thread_iterate(GstThread *thread) { - GList *entries; - GstElement *entry; - - g_return_if_fail(thread != NULL); - g_return_if_fail(GST_IS_THREAD(thread)); -// g_return_if_fail(GST_FLAG_IS_SET(thread,GST_STATE_RUNNING)); - g_return_if_fail(thread->numentries > 0); - - entries = thread->entries; - - DEBUG("gstthread: %s: thread iterate\n", gst_element_get_name(GST_ELEMENT(thread))); - - while (entries) { - entry = GST_ELEMENT(entries->data); - if (GST_IS_SRC(entry)) - gst_src_push(GST_SRC(entry)); - else if (GST_IS_CONNECTION(entry)) - gst_connection_push(GST_CONNECTION(entry)); - else - g_assert_not_reached(); - entries = g_list_next(entries); - } - DEBUG("gstthread: %s: thread iterate done\n", gst_element_get_name(GST_ELEMENT(thread))); - //g_print(","); -} -#endif - static void gst_thread_signal_thread(GstThread *thread) { g_mutex_lock(thread->lock); g_cond_signal(thread->cond); diff --git a/gstplay/Makefile.am b/gstplay/Makefile.am index c901f374d4..d7a3c1c7df 100644 --- a/gstplay/Makefile.am +++ b/gstplay/Makefile.am @@ -6,6 +6,9 @@ INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir) \ bin_PROGRAMS = gstplay +gladedir = $(datadir)/gstplay +glade_DATA = gstplay.glade play.xpm stop.xpm pause.xpm + gstplay_SOURCES = \ gstplay.c \ mpeg1.c mpeg2.c avi.c\ @@ -14,9 +17,9 @@ gstplay_SOURCES = \ noinst_HEADERS = codecs.h -CFLAGS += -O2 -Wall +CFLAGS += -O2 -Wall -DDATADIR=\""$(gladedir)/"\" -gstplay_CFLAGS = $(shell gnome-config --cflags gnomeui) $(shell libglade-config --cflags gnome) +gstplay_CFLAGS = $(shell gnome-config --cflags gnomeui) $(shell libglade-config --cflags gnome) gstplay_LDFLAGS = $(shell gnome-config --libs gnomeui) $(shell libglade-config --libs gnome) gstplay_LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la \ diff --git a/gstplay/callbacks.c b/gstplay/callbacks.c index 9b7073631b..c1bd000d52 100644 --- a/gstplay/callbacks.c +++ b/gstplay/callbacks.c @@ -53,7 +53,7 @@ on_open2_activate (GtkMenuItem *menuitem, gpointer user_data) { GladeXML *xml; - xml = glade_xml_new("gstplay.glade", "fileselection1"); + xml = glade_xml_new(DATADIR "gstplay.glade", "fileselection1"); /* connect the signals in the interface */ glade_xml_signal_autoconnect(xml); open_file_selection = glade_xml_get_widget(xml, "fileselection1"); @@ -115,7 +115,7 @@ on_drawingarea1_configure_event (GtkWidget *widget, GdkEventConfigure *ev void on_about_activate(GtkWidget *widget, gpointer data) { GladeXML *xml; - xml = glade_xml_new("gstplay.glade", "about"); + xml = glade_xml_new(DATADIR "gstplay.glade", "about"); /* connect the signals in the interface */ glade_xml_signal_autoconnect(xml); } diff --git a/gstplay/gstplay.c b/gstplay/gstplay.c index 5abd8adcdf..834d0160a0 100644 --- a/gstplay/gstplay.c +++ b/gstplay/gstplay.c @@ -3,9 +3,7 @@ * Glade will not overwrite this file. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include //#define DEBUG_ENABLED @@ -83,7 +81,8 @@ static void frame_displayed(GstSrc *asrc) gboolean idle_func(gpointer data) { DEBUG("idle start %s\n",MUTEX_STATUS()); - gst_src_push(GST_SRC(data)); + //gst_src_push(GST_SRC(data)); + gst_bin_iterate(GST_BIN(data)); DEBUG("idle stop %s\n",MUTEX_STATUS()); return TRUE; } @@ -170,20 +169,21 @@ void change_state(GstPlayState new_state) { mute_audio(FALSE); statustext = "playing"; update_status_area(status_area); - gtk_idle_add(idle_func,src); + gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING); + gtk_idle_add(idle_func, pipeline); state = GSTPLAY_PLAYING; update_buttons(0); break; case GSTPLAY_PAUSE: statustext = "paused"; update_status_area(status_area); - if (state != GSTPLAY_STOPPED) gtk_idle_remove_by_data(src); + if (state != GSTPLAY_STOPPED) gtk_idle_remove_by_data(pipeline); mute_audio(TRUE); state = GSTPLAY_PAUSE; update_buttons(1); break; case GSTPLAY_STOPPED: - if (state != GSTPLAY_PAUSE) gtk_idle_remove_by_data(src); + if (state != GSTPLAY_PAUSE) gtk_idle_remove_by_data(pipeline); statustext = "stopped"; update_status_area(status_area); mute_audio(TRUE); @@ -232,14 +232,12 @@ static void have_type(GstSink *sink) { } else if (strstr(gsttype->mime, "mpeg1")) { mpeg1_setup_video_thread(gst_element_get_pad(src,"src"), video_render_queue, GST_ELEMENT(pipeline)); - gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING); gst_clock_reset(gst_clock_get_system()); gtk_signal_connect(GTK_OBJECT(show),"frame_displayed", GTK_SIGNAL_FUNC(frame_displayed),NULL); } else if (strstr(gsttype->mime, "mp3")) { mpeg1_setup_audio_thread(gst_element_get_pad(src,"src"), audio_render_queue, GST_ELEMENT(pipeline)); - gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING); gst_clock_reset(gst_clock_get_system()); } else { @@ -254,13 +252,14 @@ static void have_type(GstSink *sink) { gtk_signal_connect(GTK_OBJECT(parse),"pads_created", GTK_SIGNAL_FUNC(gstplay_parse_pads_created),pipeline); } + gtk_object_set(GTK_OBJECT(src),"offset",0,NULL); + g_print("setting to READY state\n"); gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_READY); g_print("setting to PLAYING state\n"); gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING); g_print("set to PLAYING state\n"); - gtk_object_set(GTK_OBJECT(src),"offset",0,NULL); } gint start_from_file(guchar *filename) @@ -286,6 +285,8 @@ gint start_from_file(guchar *filename) gst_element_get_pad(typefind,"sink")); g_print("setting to READY state\n"); + + gst_bin_create_plan(GST_BIN(pipeline)); gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_READY); state = GSTPLAY_STOPPED; @@ -315,8 +316,9 @@ main (int argc, char *argv[]) glade_gnome_init(); gst_init(&argc,&argv); + g_print("using %s\n", DATADIR"gstplay.glade"); /* load the interface */ - xml = glade_xml_new("gstplay.glade", "gstplay"); + xml = glade_xml_new(DATADIR "gstplay.glade", "gstplay"); /* connect the signals in the interface */ status_area = glade_xml_get_widget(xml, "status_area"); diff --git a/gstreamer-config.in b/gstreamer-config.in index a43e2a1d4e..cef310e334 100644 --- a/gstreamer-config.in +++ b/gstreamer-config.in @@ -43,7 +43,7 @@ while test $# -gt 0; do ;; --cflags) if test $prefix -ef @builddir@ ; then - includes=-I@builddir@ + includes=-I@builddir@ elif test @includedir@ != /usr/include ; then includes=-I@includedir@ fi @@ -51,10 +51,10 @@ while test $# -gt 0; do ;; --libs) if test $prefix -ef @builddir@ ; then - echo @builddir@/lib@PACKAGE@.la + echo @builddir@/libgst.la else libdirs=-L@libdir@ - echo $libdirs -l@PACKAGE@ + echo $libdirs -lgst fi ;; *) diff --git a/libs/colorspace/Makefile.am b/libs/colorspace/Makefile.am index 634b143dcd..12090a1746 100644 --- a/libs/colorspace/Makefile.am +++ b/libs/colorspace/Makefile.am @@ -4,7 +4,7 @@ filter_LTLIBRARIES = libgstcolorspace.la libgstcolorspace_la_SOURCES = gstcolorspace.c rgb2rgb.c yuv2rgb.c -libgstcolorspaceincludedir = $(includedir)/gst/libs/gstcolorspace.h +libgstcolorspaceincludedir = $(includedir)/gst/libs/gstcolorspace libgstcolorspaceinclude_HEADERS = gstcolorspace.h noinst_HEADERS = yuv2rgb.h diff --git a/libs/getbits/Makefile.am b/libs/getbits/Makefile.am index 1fd776c523..5a5422cada 100644 --- a/libs/getbits/Makefile.am +++ b/libs/getbits/Makefile.am @@ -4,7 +4,7 @@ filter_LTLIBRARIES = libgstgetbits.la libgstgetbits_la_SOURCES = gstgetbits.c gstgetbits_inl.h -libgstgetbitsincludedir = $(includedir)/gst/libs/gstgetbits.h +libgstgetbitsincludedir = $(includedir)/gst/libs/gstgetbits libgstgetbitsinclude_HEADERS = gstgetbits.h noinst_HEADERS = gstgetbits.h gstgetbits_inl.h diff --git a/libs/idct/Makefile.am b/libs/idct/Makefile.am index a7c6a20e9a..9a97325f6a 100644 --- a/libs/idct/Makefile.am +++ b/libs/idct/Makefile.am @@ -4,6 +4,9 @@ filter_LTLIBRARIES = libgstidct.la libgstidct_la_SOURCES = fastintidct.c floatidct.c gstidct.c intidct.c mmxidct.S mmx32idct.c +libgstidctincludedir = $(includedir)/gst/libs/gstidct +libgstidctinclude_HEADERS = gstidct.h + bin_PROGRAMS = ieeetest ieeetest_SOURCES = ieeetest.c @@ -11,7 +14,7 @@ ieeetest_LDADD = libgstidct.la $(GLIB_LIBS) $(GTK_LIBS) $(top_srcdir)/gst/libgst ieeetest_CFLAGS = $(shell gnome-config --cflags gnomeui) -g -Wall ieeetest_LDFLAGS = $(shell gnome-config --libs gnomeui) -noinst_HEADERS = gstidct.h +noinst_HEADERS = dct.h CFLAGS += -Wall -O2 -funroll-all-loops -finline-functions -ffast-math diff --git a/libs/putbits/Makefile.am b/libs/putbits/Makefile.am index 29b80b8617..e12b45c34c 100644 --- a/libs/putbits/Makefile.am +++ b/libs/putbits/Makefile.am @@ -4,7 +4,7 @@ filter_LTLIBRARIES = libgstputbits.la libgstputbits_la_SOURCES = gstputbits.c -libgstputbitsincludedir = $(includedir)/gst/libs/gstputbits.h +libgstputbitsincludedir = $(includedir)/gst/libs/gstputbits libgstputbitsinclude_HEADERS = gstputbits.h noinst_HEADERS = gstputbits.h diff --git a/libs/riff/Makefile.am b/libs/riff/Makefile.am index 935780bb56..18b5c21409 100644 --- a/libs/riff/Makefile.am +++ b/libs/riff/Makefile.am @@ -4,7 +4,8 @@ filter_LTLIBRARIES = libgstriff.la libgstriff_la_SOURCES = gstriffparse.c gstriffencode.c gstriffutil.c -noinst_HEADERS = gstriff.h +libgstriffincludedir = $(includedir)/gst/libs/gstriff +libgstriffinclude_HEADERS = gstriff.h CFLAGS += -Wall -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math diff --git a/libs/videoscale/Makefile.am b/libs/videoscale/Makefile.am index 7285410a2a..738570f649 100644 --- a/libs/videoscale/Makefile.am +++ b/libs/videoscale/Makefile.am @@ -4,7 +4,7 @@ filter_LTLIBRARIES = libgstvideoscale.la libgstvideoscale_la_SOURCES = gstvideoscale.c -libgstvideoscaleincludedir = $(includedir)/gst/libs/gstvideoscale.h +libgstvideoscaleincludedir = $(includedir)/gst/libs/gstvideoscale libgstvideoscaleinclude_HEADERS = gstvideoscale.h noinst_HEADERS = yuv2rgb.h diff --git a/libs/winloader/Makefile.am b/libs/winloader/Makefile.am index d9b4099ace..20514dd66a 100644 --- a/libs/winloader/Makefile.am +++ b/libs/winloader/Makefile.am @@ -4,12 +4,9 @@ filter_LTLIBRARIES = libwinloader.la libwinloader_la_SOURCES = driver.c elfdll.c ext.c externals.c module.c pe_image.c pe_resource.c registry.c resource.c stubs.s vfl.c afl.c -libwinloaderincludedir = $(includedir)/gst/libs/winloader.h -libwinloaderinclude_HEADERS = - noinst_HEADERS = externals.h -DEFINES=-rdynamic -fPIC -g -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf +DEFINES=-rdynamic -fPIC -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf CFLAGS += $(DEFINES) INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir) -I$(top_srcdir)/include diff --git a/tools/launch.c b/tools/launch.c index 7be7f2cf89..cbec8e30dd 100644 --- a/tools/launch.c +++ b/tools/launch.c @@ -105,7 +105,7 @@ int main(int argc,char *argv[]) { xmlSaveFile("launch.xml",gst_xml_write(pipeline)); - gst_element_set_state(pipeline,GST_STATE_RUNNING); + gst_element_set_state(pipeline,GST_STATE_READY); gst_element_set_state(pipeline,GST_STATE_PLAYING); if (t)