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
This commit is contained in:
Wim Taymans 2001-01-02 01:44:53 +00:00
parent c8e92c77d8
commit dd37e99746
14 changed files with 116 additions and 18 deletions

View file

@ -546,6 +546,7 @@ test/xml/Makefile
test/bindings/Makefile test/bindings/Makefile
tests/Makefile tests/Makefile
tests/sched/Makefile tests/sched/Makefile
tests/eos/Makefile
examples/Makefile examples/Makefile
examples/autoplug/Makefile examples/autoplug/Makefile
examples/helloworld/Makefile examples/helloworld/Makefile
@ -558,6 +559,7 @@ examples/queue4/Makefile
examples/thread/Makefile examples/thread/Makefile
examples/xml/Makefile examples/xml/Makefile
editor/Makefile editor/Makefile
editor/pixmaps/Makefile
tools/Makefile tools/Makefile
docs/Makefile docs/Makefile
docs/gst/Makefile docs/gst/Makefile

View file

@ -116,7 +116,7 @@ case 4)
fakesrc detects the end of stream. It just sent the last buffer fakesrc detects the end of stream. It just sent the last buffer
and sets the srcpad to EOS with gst_pad_eos (). 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. 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 queue2 was responisble for the EOS delay and so it gets added to the bin

View file

@ -26,11 +26,12 @@ libgsteditorincludedir = $(includedir)/gst
libgsteditorinclude_HEADERS = \ libgsteditorinclude_HEADERS = \
gsteditor.h gsteditor.h
bin_PROGRAMS = gsteditor bin_PROGRAMS = gsteditor
gsteditor_SOURCES = editor.c gsteditor_SOURCES = editor.c
gsteditor_LDFLAGS = libgsteditor.la gsteditor_LDFLAGS = libgsteditor.la
gladedir = $(datadir)/gsteditor
glade_DATA = editor.glade editorelement.glade
noinst_HEADERS = \ noinst_HEADERS = \
gsteditorproject.h \ gsteditorproject.h \
@ -40,6 +41,8 @@ noinst_HEADERS = \
gsteditorimage.h \ gsteditorimage.h \
gsteditorcreate.h gsteditorcreate.h
CFLAGS = -O2 -Wall CFLAGS = -O2 -Wall -DDATADIR="\"$(gladedir)/\""
EXTRA_DIST = editor.glade editorelement.glade SUBDIRS = pixmaps
EXTRA_DIST = $(glade_DATA)

View file

@ -21,6 +21,9 @@
#include <gnome.h> #include <gnome.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <sys/stat.h>
#include <unistd.h>
#include "gsteditorimage.h" #include "gsteditorimage.h"
GHashTable *_gst_editor_images; GHashTable *_gst_editor_images;
@ -50,12 +53,20 @@ struct _image_entry _image_types[TYPES_SIZE] = {
{GST_EDITOR_IMAGE_TEE, gst_tee_get_type }, {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); 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]); _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; return new;
} }

View file

@ -21,6 +21,9 @@
#include <gnome.h> #include <gnome.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <sys/stat.h>
#include <unistd.h>
#include "gsteditorpalette.h" #include "gsteditorpalette.h"
#include "gsteditorimage.h" #include "gsteditorimage.h"
@ -148,6 +151,7 @@ gst_editor_palette_new()
GtkWidget *palette_window; GtkWidget *palette_window;
connect_struct data; connect_struct data;
GModule *symbols; GModule *symbols;
struct stat statbuf;
palette = GST_EDITOR_PALETTE(gtk_type_new(GST_TYPE_EDITOR_PALETTE)); palette = GST_EDITOR_PALETTE(gtk_type_new(GST_TYPE_EDITOR_PALETTE));
@ -156,7 +160,14 @@ gst_editor_palette_new()
data.palette = palette; data.palette = palette;
data.symbols = symbols; 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); glade_xml_signal_autoconnect_full (palette->xml, gst_editor_palette_connect_func, &data);
palette_window = glade_xml_get_widget(palette->xml, "palette_window"); palette_window = glade_xml_get_widget(palette->xml, "palette_window");

View file

@ -21,6 +21,9 @@
#include <gnome.h> #include <gnome.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glade/glade.h> #include <glade/glade.h>
#include "gsteditorproject.h" #include "gsteditorproject.h"
#include "gsteditorpalette.h" #include "gsteditorpalette.h"
@ -257,6 +260,7 @@ gst_editor_project_view_new (GstEditorProject *project)
GModule *symbols; GModule *symbols;
GstEditorPalette *palette; GstEditorPalette *palette;
GList *elements; GList *elements;
struct stat statbuf;
view = GST_EDITOR_PROJECT_VIEW(gtk_type_new(GST_TYPE_EDITOR_PROJECT_VIEW)); 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.view = view;
data.symbols = symbols; 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); glade_xml_signal_autoconnect_full (view->xml, gst_editor_project_connect_func, &data);
main_window = glade_xml_get_widget(view->xml, "main_project_window"); main_window = glade_xml_get_widget(view->xml, "main_project_window");

View file

@ -23,6 +23,9 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/gstpropsprivate.h> #include <gst/gstpropsprivate.h>
#include <sys/stat.h>
#include <unistd.h>
#include "gsteditorproperty.h" #include "gsteditorproperty.h"
#include "gsteditorimage.h" #include "gsteditorimage.h"
@ -142,6 +145,7 @@ gst_editor_property_new (void)
GtkWidget *property_window; GtkWidget *property_window;
connect_struct data; connect_struct data;
GModule *symbols; GModule *symbols;
struct stat statbuf;
property = GST_EDITOR_PROPERTY(gtk_type_new(GST_TYPE_EDITOR_PROPERTY)); property = GST_EDITOR_PROPERTY(gtk_type_new(GST_TYPE_EDITOR_PROPERTY));
@ -150,7 +154,14 @@ gst_editor_property_new (void)
data.property = property; data.property = property;
data.symbols = symbols; 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); glade_xml_signal_autoconnect_full (property->xml, gst_editor_property_connect_func, &data);
property_window = glade_xml_get_widget(property->xml, "property_window"); property_window = glade_xml_get_widget(property->xml, "property_window");

View file

@ -47,6 +47,7 @@ enum {
ARG_LOOP_BASED, ARG_LOOP_BASED,
ARG_OUTPUT, ARG_OUTPUT,
ARG_PATERN, ARG_PATERN,
ARG_NUM_BUFFERS,
}; };
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type()) #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_ARG_READWRITE, ARG_OUTPUT);
gtk_object_add_arg_type ("GstFakeSrc::patern", GTK_TYPE_STRING, gtk_object_add_arg_type ("GstFakeSrc::patern", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_PATERN); 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->set_arg = gst_fakesrc_set_arg;
gtkobject_class->get_arg = gst_fakesrc_get_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->srcpads = g_slist_append(NULL,pad);
fakesrc->loop_based = FALSE; fakesrc->loop_based = FALSE;
fakesrc->num_buffers = -1;
// we're ready right away, since we don't have any args... // we're ready right away, since we don't have any args...
// gst_element_set_state(GST_ELEMENT(fakesrc),GST_STATE_READY); // 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; break;
case ARG_PATERN: case ARG_PATERN:
break; break;
case ARG_NUM_BUFFERS:
src->num_buffers = GTK_VALUE_INT (*arg);
break;
default: default:
break; break;
} }
@ -232,6 +239,9 @@ gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
case ARG_PATERN: case ARG_PATERN:
GTK_VALUE_STRING (*arg) = src->patern; GTK_VALUE_STRING (*arg) = src->patern;
break; break;
case ARG_NUM_BUFFERS:
GTK_VALUE_INT (*arg) = src->num_buffers;
break;
default: default:
arg->type = GTK_TYPE_INVALID; arg->type = GTK_TYPE_INVALID;
break; break;
@ -257,6 +267,15 @@ gst_fakesrc_get(GstPad *pad)
src = GST_FAKESRC(gst_pad_get_parent(pad)); src = GST_FAKESRC(gst_pad_get_parent(pad));
g_return_val_if_fail(GST_IS_FAKESRC(src), NULL); 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)); g_print("(%s:%s)> ",GST_DEBUG_PAD_NAME(pad));
buf = gst_buffer_new(); buf = gst_buffer_new();

View file

@ -70,6 +70,7 @@ struct _GstFakeSrc {
GstFakeSrcOutputType output; GstFakeSrcOutputType output;
gchar *patern; gchar *patern;
GList *paternlist; GList *paternlist;
gint num_buffers;
}; };
struct _GstFakeSrcClass { struct _GstFakeSrcClass {

View file

@ -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_INFO (GST_CAT_PADS,"set EOS on src pad %s:%s",GST_DEBUG_PAD_NAME(pad));
GST_FLAG_SET (pad, GST_PAD_EOS); GST_FLAG_SET (pad, GST_PAD_EOS);
gst_element_signal_eos (GST_ELEMENT (pad->parent));
return TRUE; return TRUE;
} }

View file

@ -46,7 +46,6 @@ else
xvlibs= xvlibs=
endif endif
gstmediaplay_LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la \ gstmediaplay_LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la
$(top_builddir)/plugins/videosink/gdkxvimage.lo ${xvlibs} -lXxf86vm

View file

@ -5,6 +5,9 @@
#include <config.h> #include <config.h>
#include <sys/stat.h>
#include <unistd.h>
#include <gnome.h> #include <gnome.h>
#include "gstmediaplay.h" #include "gstmediaplay.h"
#include "callbacks.h" #include "callbacks.h"
@ -120,13 +123,15 @@ gst_media_play_init(GstMediaPlay *mplay)
{ {
GModule *symbols; GModule *symbols;
connect_struct data; connect_struct data;
struct stat statbuf;
g_print("using %s\n", DATADIR"gstmediaplay.glade");
/* load the interface */ /* load the interface */
mplay->xml = glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay"); if (stat(DATADIR"gstmediaplay.glade", &statbuf) == 0) {
//mplay->xml = glade_xml_new ("/usr/local/share/gstplay/gstplay.glade", "gstplay"); mplay->xml = glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay");
if (mplay->xml == NULL) { }
glade_xml_new ("gstmediaplay.glade", "gstplay"); else {
mplay->xml = glade_xml_new ("gstmediaplay.glade", "gstplay");
} }
g_assert (mplay->xml != NULL); g_assert (mplay->xml != NULL);

View file

@ -47,6 +47,7 @@ enum {
ARG_LOOP_BASED, ARG_LOOP_BASED,
ARG_OUTPUT, ARG_OUTPUT,
ARG_PATERN, ARG_PATERN,
ARG_NUM_BUFFERS,
}; };
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type()) #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_ARG_READWRITE, ARG_OUTPUT);
gtk_object_add_arg_type ("GstFakeSrc::patern", GTK_TYPE_STRING, gtk_object_add_arg_type ("GstFakeSrc::patern", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_PATERN); 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->set_arg = gst_fakesrc_set_arg;
gtkobject_class->get_arg = gst_fakesrc_get_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->srcpads = g_slist_append(NULL,pad);
fakesrc->loop_based = FALSE; fakesrc->loop_based = FALSE;
fakesrc->num_buffers = -1;
// we're ready right away, since we don't have any args... // we're ready right away, since we don't have any args...
// gst_element_set_state(GST_ELEMENT(fakesrc),GST_STATE_READY); // 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; break;
case ARG_PATERN: case ARG_PATERN:
break; break;
case ARG_NUM_BUFFERS:
src->num_buffers = GTK_VALUE_INT (*arg);
break;
default: default:
break; break;
} }
@ -232,6 +239,9 @@ gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
case ARG_PATERN: case ARG_PATERN:
GTK_VALUE_STRING (*arg) = src->patern; GTK_VALUE_STRING (*arg) = src->patern;
break; break;
case ARG_NUM_BUFFERS:
GTK_VALUE_INT (*arg) = src->num_buffers;
break;
default: default:
arg->type = GTK_TYPE_INVALID; arg->type = GTK_TYPE_INVALID;
break; break;
@ -257,6 +267,15 @@ gst_fakesrc_get(GstPad *pad)
src = GST_FAKESRC(gst_pad_get_parent(pad)); src = GST_FAKESRC(gst_pad_get_parent(pad));
g_return_val_if_fail(GST_IS_FAKESRC(src), NULL); 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)); g_print("(%s:%s)> ",GST_DEBUG_PAD_NAME(pad));
buf = gst_buffer_new(); buf = gst_buffer_new();

View file

@ -70,6 +70,7 @@ struct _GstFakeSrc {
GstFakeSrcOutputType output; GstFakeSrcOutputType output;
gchar *patern; gchar *patern;
GList *paternlist; GList *paternlist;
gint num_buffers;
}; };
struct _GstFakeSrcClass { struct _GstFakeSrcClass {