#noinst_PROGRAMS = basic m types a r plugin w s args mpg123 mcut push qtest
noinst_PROGRAMS = qtest spectrum record wave mp3 teardown buffer mp3parse \
- mpeg2parse mp1parse mp3play ac3parse ac3play dvdcat fake cobin
+ mpeg2parse mp1parse mp3play ac3parse ac3play dvdcat fake cobin videotest
SUBDIRS = xml cothreads bindings
spectrum_LDFLAGS = $(shell gnome-config --libs gnomeui)
wave_CFLAGS = $(shell gnome-config --cflags gnomeui)
wave_LDFLAGS = $(shell gnome-config --libs gnomeui)
+videotest_CFLAGS = $(shell gnome-config --cflags gnomeui)
+videotest_LDFLAGS = $(shell gnome-config --libs gnomeui)
+mp1parse_CFLAGS = $(shell gnome-config --cflags gnomeui)
+mp1parse_LDFLAGS = $(shell gnome-config --libs gnomeui)
buffer_SOURCES = buffer.c mem.c
teardown_SOURCES = teardown.c mem.c
+
+#include <gnome.h>
#include <gst/gst.h>
extern gboolean _gst_plugin_spew;
+gboolean idle_func(gpointer data);
void eof(GstSrc *src) {
g_print("have eos, quitting\n");
}
void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
- GstElement *parse_audio, *parse_video, *decode, *decode_video, *play;
+ GstElement *parse_audio, *parse_video, *decode, *decode_video, *play, *show;
GstElement *audio_queue, *video_queue;
GstElement *audio_thread, *video_thread;
GstPad *infopad;
+ GtkWidget *appwindow;
+
g_print("***** a new pad %s was created\n", gst_pad_get_name(pad));
// connect to audio pad
g_return_if_fail(parse_video != NULL);
decode = gst_elementfactory_make("mpeg_play","decode_video");
g_return_if_fail(decode_video != NULL);
+ show = gst_elementfactory_make("videosink","show");
+ g_return_if_fail(show != NULL);
+ g_print("setting size\n");
+ //gtk_object_set(GTK_OBJECT(show),"width",384,NULL);
+ //gtk_object_set(GTK_OBJECT(show),"height",288,NULL);
+
+
+ appwindow = gnome_app_new("MPEG1 player","MPEG1 player");
+ gnome_app_set_contents(GNOME_APP(appwindow),
+ gst_util_get_widget_arg(GTK_OBJECT(show),"widget"));
+ gtk_widget_show_all(appwindow);
// create the thread and pack stuff into it
video_thread = gst_thread_new("video_thread");
g_return_if_fail(video_thread != NULL);
gst_bin_add(GST_BIN(video_thread),GST_ELEMENT(parse_video));
gst_bin_add(GST_BIN(video_thread),GST_ELEMENT(decode));
+ gst_bin_add(GST_BIN(video_thread),GST_ELEMENT(show));
// set up pad connections
gst_element_add_ghost_pad(GST_ELEMENT(video_thread),
gst_pad_connect(gst_element_get_pad(parse_video,"src"),
gst_element_get_pad(decode,"sink"));
gst_pad_connect(gst_element_get_pad(decode,"src"),
- infopad);
+ gst_element_get_pad(show,"sink"));
// construct queue and connect everything in the main pipeline
video_queue = gst_elementfactory_make("queue","video_queue");
_gst_plugin_spew = TRUE;
gst_init(&argc,&argv);
+ gnome_init("MPEG1 Video player","0.0.1",argc,argv);
gst_plugin_load_all();
pipeline = gst_pipeline_new("pipeline");
xmlSaveFile("mp1parse.xml",gst_xml_write(GST_ELEMENT(pipeline)));
g_print("about to enter loop\n");
- while (1) {
- gst_src_push(GST_SRC(src));
- }
+ g_idle_add(idle_func,src);
+
+ gtk_main();
+}
+
+gboolean idle_func(gpointer data) {
+ gst_src_push(GST_SRC(data));
+ return TRUE;
}