mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
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:
parent
c8e92c77d8
commit
dd37e99746
14 changed files with 116 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)/\""
|
||||
|
||||
EXTRA_DIST = editor.glade editorelement.glade
|
||||
SUBDIRS = pixmaps
|
||||
|
||||
EXTRA_DIST = $(glade_DATA)
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#include <gnome.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#include <gnome.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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");
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#include <gnome.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <glade/glade.h>
|
||||
#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");
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
#include <gst/gst.h>
|
||||
#include <gst/gstpropsprivate.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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");
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ struct _GstFakeSrc {
|
|||
GstFakeSrcOutputType output;
|
||||
gchar *patern;
|
||||
GList *paternlist;
|
||||
gint num_buffers;
|
||||
};
|
||||
|
||||
struct _GstFakeSrcClass {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <gnome.h>
|
||||
#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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ struct _GstFakeSrc {
|
|||
GstFakeSrcOutputType output;
|
||||
gchar *patern;
|
||||
GList *paternlist;
|
||||
gint num_buffers;
|
||||
};
|
||||
|
||||
struct _GstFakeSrcClass {
|
||||
|
|
Loading…
Reference in a new issue