diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2000-08-18 20:35:48 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2000-08-18 20:35:48 +0000 |
commit | 6661696de02876ee7898de639a8cb10b4fd71227 (patch) | |
tree | d31f3754b1968f2fd236e9c3d2e1718d12a89a70 /gstplay | |
parent | aca33a2b4a9519ee49ffc6e8c8ea10cc18664ef0 (diff) |
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.
Diffstat (limited to 'gstplay')
-rw-r--r-- | gstplay/Makefile.am | 7 | ||||
-rw-r--r-- | gstplay/callbacks.c | 4 | ||||
-rw-r--r-- | gstplay/gstplay.c | 24 |
3 files changed, 20 insertions, 15 deletions
diff --git a/gstplay/Makefile.am b/gstplay/Makefile.am index c901f374d..d7a3c1c7d 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 9b7073631..c1bd000d5 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 5abd8adcd..834d0160a 100644 --- a/gstplay/gstplay.c +++ b/gstplay/gstplay.c @@ -3,9 +3,7 @@ * Glade will not overwrite this file. */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif +#include <config.h> //#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"); |