From dd37e99746267ab86dbc8514eb5087839093c007 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 2 Jan 2001 01:44:53 +0000 Subject: [PATCH] Fixes for gsteditor/gstplay install/build fixed typo in random/eos added num_buffers property to fakesrc Original commit message from CVS: Fixes for gsteditor/gstplay install/build fixed typo in random/eos added num_buffers property to fakesrc --- configure.in | 2 ++ docs/random/eos | 2 +- editor/Makefile.am | 9 ++++++--- editor/gsteditorimage.c | 17 ++++++++++++++--- editor/gsteditorpalette.c | 13 ++++++++++++- editor/gsteditorprojectview.c | 16 +++++++++++++++- editor/gsteditorproperty.c | 13 ++++++++++++- gst/elements/gstfakesrc.c | 19 +++++++++++++++++++ gst/elements/gstfakesrc.h | 1 + gst/gstpad.c | 2 ++ gstplay/Makefile.am | 5 ++--- gstplay/gstmediaplay.c | 15 ++++++++++----- plugins/elements/gstfakesrc.c | 19 +++++++++++++++++++ plugins/elements/gstfakesrc.h | 1 + 14 files changed, 116 insertions(+), 18 deletions(-) diff --git a/configure.in b/configure.in index 30d8579..6639ae6 100644 --- a/configure.in +++ b/configure.in @@ -546,6 +546,7 @@ test/xml/Makefile test/bindings/Makefile tests/Makefile tests/sched/Makefile +tests/eos/Makefile examples/Makefile examples/autoplug/Makefile examples/helloworld/Makefile @@ -558,6 +559,7 @@ examples/queue4/Makefile examples/thread/Makefile examples/xml/Makefile editor/Makefile +editor/pixmaps/Makefile tools/Makefile docs/Makefile docs/gst/Makefile diff --git a/docs/random/eos b/docs/random/eos index 6c1ead9..5cc6732 100644 --- a/docs/random/eos +++ b/docs/random/eos @@ -116,7 +116,7 @@ case 4) fakesrc detects the end of stream. It just sent the last buffer and sets the srcpad to EOS with gst_pad_eos (). - the eos handler returns false because queue2 return false on the + the eos handler returns false because queue2 returns false on the eos request. the parent removes fakesrc as an EOS provider. queue2 was responisble for the EOS delay and so it gets added to the bin diff --git a/editor/Makefile.am b/editor/Makefile.am index 8961856..92939cb 100644 --- a/editor/Makefile.am +++ b/editor/Makefile.am @@ -26,11 +26,12 @@ libgsteditorincludedir = $(includedir)/gst libgsteditorinclude_HEADERS = \ gsteditor.h - bin_PROGRAMS = gsteditor gsteditor_SOURCES = editor.c gsteditor_LDFLAGS = libgsteditor.la +gladedir = $(datadir)/gsteditor +glade_DATA = editor.glade editorelement.glade noinst_HEADERS = \ gsteditorproject.h \ @@ -40,6 +41,8 @@ noinst_HEADERS = \ gsteditorimage.h \ gsteditorcreate.h -CFLAGS = -O2 -Wall +CFLAGS = -O2 -Wall -DDATADIR="\"$(gladedir)/\"" + +SUBDIRS = pixmaps -EXTRA_DIST = editor.glade editorelement.glade +EXTRA_DIST = $(glade_DATA) diff --git a/editor/gsteditorimage.c b/editor/gsteditorimage.c index 998e976..78e956a 100644 --- a/editor/gsteditorimage.c +++ b/editor/gsteditorimage.c @@ -21,6 +21,9 @@ #include #include +#include +#include + #include "gsteditorimage.h" GHashTable *_gst_editor_images; @@ -50,12 +53,20 @@ struct _image_entry _image_types[TYPES_SIZE] = { {GST_EDITOR_IMAGE_TEE, gst_tee_get_type }, }; -GstEditorImage *gst_editor_image_get(GstEditorImageType type) { - +GstEditorImage* +gst_editor_image_get(GstEditorImageType type) +{ + struct stat statbuf; GstEditorImage *new = g_new0(GstEditorImage, 1); - new->pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, gdk_colormap_get_system(), &new->bitmap, NULL, + if (stat (_gst_editor_image_name[type], &statbuf) == 0) { + new->pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, gdk_colormap_get_system(), &new->bitmap, NULL, _gst_editor_image_name[type]); + } + else { + new->pixmap = gdk_pixmap_colormap_create_from_xpm(NULL, gdk_colormap_get_system(), &new->bitmap, NULL, + g_strconcat (DATADIR, _gst_editor_image_name[type], NULL)); + } return new; } diff --git a/editor/gsteditorpalette.c b/editor/gsteditorpalette.c index 6e06b31..27b58ba 100644 --- a/editor/gsteditorpalette.c +++ b/editor/gsteditorpalette.c @@ -21,6 +21,9 @@ #include #include +#include +#include + #include "gsteditorpalette.h" #include "gsteditorimage.h" @@ -148,6 +151,7 @@ gst_editor_palette_new() GtkWidget *palette_window; connect_struct data; GModule *symbols; + struct stat statbuf; palette = GST_EDITOR_PALETTE(gtk_type_new(GST_TYPE_EDITOR_PALETTE)); @@ -156,7 +160,14 @@ gst_editor_palette_new() data.palette = palette; data.symbols = symbols; - palette->xml = glade_xml_new("editor.glade", "palette_window"); + if (stat(DATADIR"editor.glade", &statbuf) == 0) { + palette->xml = glade_xml_new(DATADIR"editor.glade", "palette_window"); + } + else { + palette->xml = glade_xml_new ("editor.glade", "palette_window"); + } + g_assert (palette->xml != NULL); + glade_xml_signal_autoconnect_full (palette->xml, gst_editor_palette_connect_func, &data); palette_window = glade_xml_get_widget(palette->xml, "palette_window"); diff --git a/editor/gsteditorprojectview.c b/editor/gsteditorprojectview.c index 86bd658..3ca2ccc 100644 --- a/editor/gsteditorprojectview.c +++ b/editor/gsteditorprojectview.c @@ -21,6 +21,9 @@ #include #include +#include +#include + #include #include "gsteditorproject.h" #include "gsteditorpalette.h" @@ -257,6 +260,7 @@ gst_editor_project_view_new (GstEditorProject *project) GModule *symbols; GstEditorPalette *palette; GList *elements; + struct stat statbuf; view = GST_EDITOR_PROJECT_VIEW(gtk_type_new(GST_TYPE_EDITOR_PROJECT_VIEW)); @@ -267,7 +271,17 @@ gst_editor_project_view_new (GstEditorProject *project) data.view = view; data.symbols = symbols; - view->xml = glade_xml_new("editor.glade", "main_project_window"); + + if (stat(DATADIR"editor.glade", &statbuf) == 0) { + g_print ("loading from %s\n", DATADIR"editor.glade"); + view->xml = glade_xml_new(DATADIR"editor.glade", "main_project_window"); + } + else { + g_print ("loading from %s\n", "editor.glade"); + view->xml = glade_xml_new ("editor.glade", "main_project_window"); + } + g_assert (view->xml != NULL); + glade_xml_signal_autoconnect_full (view->xml, gst_editor_project_connect_func, &data); main_window = glade_xml_get_widget(view->xml, "main_project_window"); diff --git a/editor/gsteditorproperty.c b/editor/gsteditorproperty.c index 4ccb0e7..48a976d 100644 --- a/editor/gsteditorproperty.c +++ b/editor/gsteditorproperty.c @@ -23,6 +23,9 @@ #include #include +#include +#include + #include "gsteditorproperty.h" #include "gsteditorimage.h" @@ -142,6 +145,7 @@ gst_editor_property_new (void) GtkWidget *property_window; connect_struct data; GModule *symbols; + struct stat statbuf; property = GST_EDITOR_PROPERTY(gtk_type_new(GST_TYPE_EDITOR_PROPERTY)); @@ -150,7 +154,14 @@ gst_editor_property_new (void) data.property = property; data.symbols = symbols; - property->xml = glade_xml_new("editor.glade", "property_window"); + if (stat (DATADIR"editor.glade", &statbuf) == 0) { + property->xml = glade_xml_new(DATADIR"editor.glade", "property_window"); + } + else { + property->xml = glade_xml_new ("editor.glade", "property_window"); + } + g_assert (property->xml != NULL); + glade_xml_signal_autoconnect_full (property->xml, gst_editor_property_connect_func, &data); property_window = glade_xml_get_widget(property->xml, "property_window"); diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index 0ca9606..9525cbf 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -47,6 +47,7 @@ enum { ARG_LOOP_BASED, ARG_OUTPUT, ARG_PATERN, + ARG_NUM_BUFFERS, }; #define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type()) @@ -120,6 +121,8 @@ gst_fakesrc_class_init (GstFakeSrcClass *klass) GTK_ARG_READWRITE, ARG_OUTPUT); gtk_object_add_arg_type ("GstFakeSrc::patern", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_PATERN); + gtk_object_add_arg_type ("GstFakeSrc::num_buffers", GTK_TYPE_INT, + GTK_ARG_READWRITE, ARG_NUM_BUFFERS); gtkobject_class->set_arg = gst_fakesrc_set_arg; gtkobject_class->get_arg = gst_fakesrc_get_arg; @@ -148,6 +151,7 @@ gst_fakesrc_init (GstFakeSrc *fakesrc) fakesrc->srcpads = g_slist_append(NULL,pad); fakesrc->loop_based = FALSE; + fakesrc->num_buffers = -1; // we're ready right away, since we don't have any args... // gst_element_set_state(GST_ELEMENT(fakesrc),GST_STATE_READY); } @@ -204,6 +208,9 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id) break; case ARG_PATERN: break; + case ARG_NUM_BUFFERS: + src->num_buffers = GTK_VALUE_INT (*arg); + break; default: break; } @@ -232,6 +239,9 @@ gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id) case ARG_PATERN: GTK_VALUE_STRING (*arg) = src->patern; break; + case ARG_NUM_BUFFERS: + GTK_VALUE_INT (*arg) = src->num_buffers; + break; default: arg->type = GTK_TYPE_INVALID; break; @@ -257,6 +267,15 @@ gst_fakesrc_get(GstPad *pad) src = GST_FAKESRC(gst_pad_get_parent(pad)); g_return_val_if_fail(GST_IS_FAKESRC(src), NULL); + if (src->num_buffers == 0) { + gst_pad_set_eos (pad); + return NULL; + } + else { + if (src->num_buffers > 0) + src->num_buffers--; + } + g_print("(%s:%s)> ",GST_DEBUG_PAD_NAME(pad)); buf = gst_buffer_new(); diff --git a/gst/elements/gstfakesrc.h b/gst/elements/gstfakesrc.h index 34942fe..a25d0f2 100644 --- a/gst/elements/gstfakesrc.h +++ b/gst/elements/gstfakesrc.h @@ -70,6 +70,7 @@ struct _GstFakeSrc { GstFakeSrcOutputType output; gchar *patern; GList *paternlist; + gint num_buffers; }; struct _GstFakeSrcClass { diff --git a/gst/gstpad.c b/gst/gstpad.c index 87e5e71..531b5db 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1102,5 +1102,7 @@ gst_pad_set_eos(GstPad *pad) GST_INFO (GST_CAT_PADS,"set EOS on src pad %s:%s",GST_DEBUG_PAD_NAME(pad)); GST_FLAG_SET (pad, GST_PAD_EOS); + gst_element_signal_eos (GST_ELEMENT (pad->parent)); + return TRUE; } diff --git a/gstplay/Makefile.am b/gstplay/Makefile.am index 8fa8368..7de399d 100644 --- a/gstplay/Makefile.am +++ b/gstplay/Makefile.am @@ -46,7 +46,6 @@ else xvlibs= endif -gstmediaplay_LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la \ - $(top_builddir)/plugins/videosink/gdkxvimage.lo ${xvlibs} -lXxf86vm - +gstmediaplay_LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la + diff --git a/gstplay/gstmediaplay.c b/gstplay/gstmediaplay.c index 8c19685..d7c6523 100644 --- a/gstplay/gstmediaplay.c +++ b/gstplay/gstmediaplay.c @@ -5,6 +5,9 @@ #include +#include +#include + #include #include "gstmediaplay.h" #include "callbacks.h" @@ -120,13 +123,15 @@ gst_media_play_init(GstMediaPlay *mplay) { GModule *symbols; connect_struct data; + struct stat statbuf; + - g_print("using %s\n", DATADIR"gstmediaplay.glade"); /* load the interface */ - mplay->xml = glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay"); - //mplay->xml = glade_xml_new ("/usr/local/share/gstplay/gstplay.glade", "gstplay"); - if (mplay->xml == NULL) { - glade_xml_new ("gstmediaplay.glade", "gstplay"); + if (stat(DATADIR"gstmediaplay.glade", &statbuf) == 0) { + mplay->xml = glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay"); + } + else { + mplay->xml = glade_xml_new ("gstmediaplay.glade", "gstplay"); } g_assert (mplay->xml != NULL); diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 0ca9606..9525cbf 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -47,6 +47,7 @@ enum { ARG_LOOP_BASED, ARG_OUTPUT, ARG_PATERN, + ARG_NUM_BUFFERS, }; #define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type()) @@ -120,6 +121,8 @@ gst_fakesrc_class_init (GstFakeSrcClass *klass) GTK_ARG_READWRITE, ARG_OUTPUT); gtk_object_add_arg_type ("GstFakeSrc::patern", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_PATERN); + gtk_object_add_arg_type ("GstFakeSrc::num_buffers", GTK_TYPE_INT, + GTK_ARG_READWRITE, ARG_NUM_BUFFERS); gtkobject_class->set_arg = gst_fakesrc_set_arg; gtkobject_class->get_arg = gst_fakesrc_get_arg; @@ -148,6 +151,7 @@ gst_fakesrc_init (GstFakeSrc *fakesrc) fakesrc->srcpads = g_slist_append(NULL,pad); fakesrc->loop_based = FALSE; + fakesrc->num_buffers = -1; // we're ready right away, since we don't have any args... // gst_element_set_state(GST_ELEMENT(fakesrc),GST_STATE_READY); } @@ -204,6 +208,9 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id) break; case ARG_PATERN: break; + case ARG_NUM_BUFFERS: + src->num_buffers = GTK_VALUE_INT (*arg); + break; default: break; } @@ -232,6 +239,9 @@ gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id) case ARG_PATERN: GTK_VALUE_STRING (*arg) = src->patern; break; + case ARG_NUM_BUFFERS: + GTK_VALUE_INT (*arg) = src->num_buffers; + break; default: arg->type = GTK_TYPE_INVALID; break; @@ -257,6 +267,15 @@ gst_fakesrc_get(GstPad *pad) src = GST_FAKESRC(gst_pad_get_parent(pad)); g_return_val_if_fail(GST_IS_FAKESRC(src), NULL); + if (src->num_buffers == 0) { + gst_pad_set_eos (pad); + return NULL; + } + else { + if (src->num_buffers > 0) + src->num_buffers--; + } + g_print("(%s:%s)> ",GST_DEBUG_PAD_NAME(pad)); buf = gst_buffer_new(); diff --git a/plugins/elements/gstfakesrc.h b/plugins/elements/gstfakesrc.h index 34942fe..a25d0f2 100644 --- a/plugins/elements/gstfakesrc.h +++ b/plugins/elements/gstfakesrc.h @@ -70,6 +70,7 @@ struct _GstFakeSrc { GstFakeSrcOutputType output; gchar *patern; GList *paternlist; + gint num_buffers; }; struct _GstFakeSrcClass { -- 2.7.4