Aplied more fixage from Michael Meeks.

Original commit message from CVS:
Aplied more fixage from Michael Meeks.
This commit is contained in:
Wim Taymans 2001-12-13 23:14:39 +00:00
parent fd1d85bee4
commit 9f23c76bea
28 changed files with 271 additions and 88 deletions

View file

@ -1,3 +1,60 @@
2001-12-13 Michael Meeks <michael@ximian.com>
* gst/gstplugin.c (_gst_plugin_initialize): g_error
instead of warning.
* Makefile.am: update.
* editor/gsteditorprojectview.c (view_on_element_added):
* editor/gsteditorproject.c
(gst_editor_project_class_init): upd.
* plugins/avi/gstavimux.c
(gst_avimux_request_new_pad): don't clobber name.
* libs/control/gstdparammanager.c
(gst_dpman_class_init): upd.
(gst_dpman_dispose): chain to parent.
* gst/cothreads.c (cothread_create): use guchar *'s
not void *'s for bytewise pointer arithmetic.
* gst/gstelement.h: kill const on get_property value.
* plugins/avi/gstavimux.c
(gst_avimux_request_new_pad): add name param.
* configure.ac: Add checks for libglade-2.0 and
gnome-vfs-2.0
2001-12-13 Michael Meeks <michael@ximian.com>
* plugins/xvideosink/Makefile.am: add $(X_LIBS)
* examples/typefind/typefind.c (type_found): upd.
xml code.
* plugins/mikmod/gstmikmod.c
(gst_mikmod_set_property): same memory bug here -
unfixed.
* plugins/oss/gstosssrc.c
(gst_osssrc_set_property): fix memory issue.
(gst_osssrc_init): dup the string - argh; quit here -
such code should be stuck in a common base class not
cut and pasted.
* plugins/oss/gstosssink.c
(gst_osssink_init): manage the device allocation.
(gst_osssink_finalize): impl.
(gst_osssink_class_init): upd.
(gst_osssink_set_property): upd.
* acconfig.h: cover HAVE_LIBXML2
* configure.ac: update libxml checks.
2001-12-13 Michael Meeks <michael@ximian.com>
* plugins/xvideosink/Makefile.am: add $(X_LIBS)

View file

@ -3,7 +3,12 @@ VERSION = @VERSION@
# if libglade is present, build the player and editor
if HAVE_LIBGLADE_GNOME
SUBDIRS_LGG = gstplay editor
if HAVE_GNOME
SUBDIRS_LGG = gstplay editor
else
# Gnome 2.0 ...
SUBDIRS_LGG = gstplay
endif
else
SUBDIRS_LGG =
endif

View file

@ -455,16 +455,16 @@ AM_PATH_XMMS(0.9.4, HAVE_XXMS=yes, HAVE_XMMS=no)
dnl Check for libglade
HAVE_LIBGLADE_GNOME="no"
if test x$USE_GLIB2 = xyes; then
dnl no glade for glib2.0
LIBGLADE_GNOME_LIBS=
LIBGLADE_GNOME_CFLAGS=
AC_MSG_WARN(libglade disabled for glib2.0)
PKG_CHECK_MODULES(LIBGLADE_GNOME, libglade-2.0 libgnomeui-2.0, HAVE_LIBGLADE_GNOME=yes, HAVE_LIBGLADE_GNOME=no)
if test x$HAVE_LIBGLADE_GNOME = xno; then
AC_MSG_WARN(Couldn't find libglade-2.0 - Can't build gstplay)
LIBGLADE_GNOME_LIBS=
LIBGLADE_GNOME_CFLAGS=
fi;
else
AM_PATH_LIBGLADE(HAVE_LIBGLADE_GNOME="yes", HAVE_LIBGLADE_GNOME="no", gnome)
if test x$HAVE_LIBGLADE_GNOME = xno; then
AC_MSG_WARN(Couldn't find libglade-config - Can't build gstplay)
LIBGLADE_GNOME_LIBS=
LIBGLADE_GNOME_CFLAGS=
else
LIBGLADE_GNOME_LIBS=$LIBGLADE_LIBS
LIBGLADE_GNOME_CFLAGS=$LIBGLADE_CFLAGS
@ -481,9 +481,11 @@ AC_SUBST(LIBGLADE_GNOME_CFLAGS)
dnl Check for Gnome VFS
HAVE_GNOME_VFS="no"
if test x$USE_GLIB2 = xyes; then
VFS_LIBS=
VFS_CFLAGS=
AC_MSG_WARN(Gnome-VFS disabled for glib2.0)
PKG_CHECK_MODULES(VFS, gnome-vfs-2.0, HAVE_GNOME_VFS=yes, HAVE_GNOME_VFS=no)
if test x$HAVE_GNOME_VFS = xno; then
AC_MSG_WARN(Couldn't find gnome-vfs-2.0 - Gnome-VFS support disabled)
fi;
else
AC_MSG_CHECKING(for Gnome VFS)
if gnome-config --libs vfs > /dev/null 2>&1; then

View file

@ -78,24 +78,26 @@ gst_editor_project_class_init (GstEditorProjectClass *klass)
parent_class = gtk_type_class(gtk_object_get_type());
gst_editor_project_signals[ELEMENT_ADDED] =
gtk_signal_new("element_added",GTK_RUN_FIRST,object_class->type,
gtk_signal_new("element_added",GTK_RUN_FIRST,G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET(GstEditorProjectClass,element_added),
gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1,
GST_TYPE_ELEMENT);
gst_editor_project_signals[ELEMENT_REMOVED] =
gtk_signal_new("element_removed",GTK_RUN_FIRST,object_class->type,
gtk_signal_new("element_removed",GTK_RUN_FIRST,G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET(GstEditorProjectClass,element_removed),
gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1,
GST_TYPE_ELEMENT);
gst_editor_project_signals[ELEMENT_CHANGED] =
gtk_signal_new("element_changed",GTK_RUN_FIRST,object_class->type,
gtk_signal_new("element_changed",GTK_RUN_FIRST,G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET(GstEditorProjectClass,element_changed),
gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1,
GST_TYPE_ELEMENT);
#ifndef USE_GLIB2
gtk_object_class_add_signals(object_class,gst_editor_project_signals,LAST_SIGNAL);
#endif
object_class->set_arg = gst_editor_project_set_arg;
object_class->get_arg = gst_editor_project_get_arg;

View file

@ -159,7 +159,8 @@ view_on_element_added (GstEditorProjectView *view, GstElement *element)
row = gtk_clist_append(GTK_CLIST(view->list), &name);
editor = gst_editor_new(element);
gtk_signal_connect_object(GTK_OBJECT(editor), "name_changed", on_name_change, GTK_OBJECT(view));
g_signal_connect_swapped(G_OBJECT (editor), "name_changed",
G_CALLBACK (on_name_change), G_OBJECT(view));
gtk_clist_set_row_data(GTK_CLIST(view->list), row, editor);
gtk_clist_set_pixtext(GTK_CLIST(view->list), row, 0, name, 3, image->pixmap, image->bitmap);
}
@ -214,10 +215,12 @@ static void
on_load_file_selected (GtkWidget *button,
file_select *data)
{
GtkWidget *selector = data->selection;
GtkWidget *selector = data->selection;
const gchar *file_name;
GstEditorProjectView *view = data->view;
gchar *file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector));
file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector));
gst_editor_project_load (view->project, file_name);
g_free (data);

View file

@ -133,7 +133,7 @@ cothread_create (cothread_context *ctx)
// FIXME this may not be 64bit clean
// could use casts to uintptr_t from inttypes.h
// if only all platforms had inttypes.h
void *stack_end = (void *)((unsigned long)sp & ~(STACK_SIZE - 1));
guchar *stack_end = (guchar *)((unsigned long)sp & ~(STACK_SIZE - 1));
s = (cothread_state *)(stack_end + ((ctx->nthreads - 1) *
COTHREAD_STACKSIZE));
GST_DEBUG (0,"new stack (case 2) at %p\n",s);
@ -148,7 +148,7 @@ cothread_create (cothread_context *ctx)
s->ctx = ctx;
s->threadnum = ctx->nthreads;
s->flags = 0;
s->sp = ((void *)s + COTHREAD_STACKSIZE);
s->sp = ((guchar *)s + COTHREAD_STACKSIZE);
// is this needed anymore?
s->top_sp = s->sp;

View file

@ -811,7 +811,8 @@ gst_element_wait_state_change (GstElement *element)
GMutex *mutex = g_mutex_new ();
g_mutex_lock (mutex);
g_signal_connect (G_OBJECT (element), "state_change", gst_element_wait_done, cond);
g_signal_connect (G_OBJECT (element), "state_change",
G_CALLBACK (gst_element_wait_done), cond);
g_cond_wait (cond, mutex);
g_mutex_unlock (mutex);

View file

@ -169,7 +169,7 @@ struct _GstElementClass {
/* local pointers for get/set */
void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
void (*get_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
void (*get_property) (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
/* change the element state */
GstElementStateReturn (*change_state) (GstElement *element);

View file

@ -468,7 +468,7 @@ gst_default_error_handler (gchar *file, gchar *function,
/***** DEBUG system *****/
GHashTable *__gst_function_pointers = NULL;
// FIXME make this thread specific
static GSList* stack_trace = NULL;
static GSList *stack_trace = NULL;
gchar *_gst_debug_nameof_funcptr (void *ptr) __attribute__ ((no_instrument_function));

View file

@ -99,7 +99,7 @@ _gst_plugin_initialize (void)
strcmp (doc->xmlRootNode->name, "GST-PluginRegistry") ||
!plugin_times_older_than(get_time(GST_CONFIG_DIR"/reg.xml"))) {
if (_gst_warn_old_registry)
g_warning ("gstplugin: registry needs rebuild: run gstreamer-register\n");
g_error ("gstplugin: registry needs rebuild: run gstreamer-register\n");
gst_plugin_load_all ();
//gst_plugin_unload_all ();
return;

View file

@ -290,8 +290,6 @@ gst_basic_scheduler_chainhandler_proxy (GstPad * pad, GstBuffer * buf)
static void
gst_basic_scheduler_select_proxy (GstPad * pad, GstBuffer * buf)
{
GstRealPad *peer = GST_RPAD_PEER (pad);
g_print ("select proxy (%s:%s)\n", GST_DEBUG_PAD_NAME (pad));
GST_DEBUG_ENTER ("(%s:%s)", GST_DEBUG_PAD_NAME (pad));
@ -1011,7 +1009,6 @@ gst_basic_scheduler_iterate (GstScheduler * sched)
GList *chains;
GstSchedulerChain *chain;
GstElement *entry;
gint num_basic_schedulerd = 0;
gboolean eos = FALSE;
GList *elements;

View file

@ -68,10 +68,10 @@ on_preferences1_activate (GtkMenuItem *menuitem, gpointer user_data)
struct stat statbuf;
if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) {
xml = glade_xml_new (DATADIR"gstmediaplay.glade", "preferences");
xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "preferences");
}
else
xml = glade_xml_new ("gstmediaplay.glade", "preferences");
xml = gst_glade_xml_new ("gstmediaplay.glade", "preferences");
}
void on_about_activate (GtkWidget *widget, gpointer data)
@ -80,10 +80,10 @@ void on_about_activate (GtkWidget *widget, gpointer data)
struct stat statbuf;
if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) {
xml = glade_xml_new (DATADIR"gstmediaplay.glade", "about");
xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "about");
}
else
xml = glade_xml_new ("gstmediaplay.glade", "about");
xml = gst_glade_xml_new ("gstmediaplay.glade", "about");
/* connect the signals in the interface */
glade_xml_signal_autoconnect (xml);

View file

@ -4,6 +4,9 @@
#include <unistd.h>
#include <gnome.h>
#ifdef USE_GLIB2
#include <libgnomeui/libgnomeui.h>
#endif
#include "gstmediaplay.h"
#include "callbacks.h"
@ -130,23 +133,28 @@ gst_media_play_init (GstMediaPlay *mplay)
/* load the interface */
if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) {
mplay->xml = glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay");
mplay->xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "gstplay");
}
else {
mplay->xml = glade_xml_new ("gstmediaplay.glade", "gstplay");
mplay->xml = gst_glade_xml_new ("gstmediaplay.glade", "gstplay");
}
g_assert (mplay->xml != NULL);
mplay->slider = glade_xml_get_widget (mplay->xml, "slider");
g_assert (mplay->slider != NULL);
{
GtkArg arg;
GtkRange *range;
arg.name = "adjustment";
#ifndef USE_GLIB2
GtkArg arg;
GtkRange *range;
arg.name = "adjustment";
gtk_object_getv (GTK_OBJECT (mplay->slider), 1, &arg);
range = GTK_RANGE (GTK_VALUE_POINTER (arg));
mplay->adjustment = gtk_range_get_adjustment (range);
range = GTK_RANGE (GTK_VALUE_POINTER (arg));
mplay->adjustment = gtk_range_get_adjustment (range);
#else
mplay->adjustment = gtk_range_get_adjustment (GTK_RANGE (mplay->slider));
#endif
gtk_signal_connect (GTK_OBJECT (mplay->adjustment), "value_changed",
GTK_SIGNAL_FUNC (gst_media_play_slider_changed), mplay);
@ -187,8 +195,13 @@ gst_media_play_init (GstMediaPlay *mplay)
GTK_SIGNAL_FUNC (gst_media_play_state_changed),
mplay);
#ifdef USE_GLIB2
bonobo_dock_set_client_area (BONOBO_DOCK (glade_xml_get_widget(mplay->xml, "dock1")),
GTK_WIDGET (mplay->play));
#else
gnome_dock_set_client_area (GNOME_DOCK (glade_xml_get_widget(mplay->xml, "dock1")),
GTK_WIDGET (mplay->play));
#endif
gtk_widget_show (GTK_WIDGET (mplay->play));
@ -273,10 +286,11 @@ gst_media_play_show_playlist (GstMediaPlay *mplay)
/* load the interface */
if (stat (DATADIR"gstmediaplay.glade", &statbuf) == 0) {
mplay->playlist_xml = glade_xml_new (DATADIR"gstmediaplay.glade", "playlist_window");
mplay->playlist_xml = gst_glade_xml_new (DATADIR"gstmediaplay.glade", "playlist_window");
}
else {
mplay->playlist_xml = glade_xml_new ("gstmediaplay.glade", "playlist_window");
mplay->playlist_xml = gst_glade_xml_new ("gstmediaplay.glade",
"playlist_window");
}
g_assert (mplay->playlist_xml != NULL);
@ -351,13 +365,14 @@ static void
on_load_file_selected (GtkWidget *button,
file_select *data)
{
GtkWidget *selector = data->selection;
GtkWidget *selector = data->selection;
const gchar *file_name;
GstMediaPlay *play = data->play;
gchar *file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION (selector));
gdk_threads_leave();
file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION (selector));
gdk_threads_leave ();
gst_media_play_start_uri (play, file_name);
gdk_threads_enter();
gdk_threads_enter ();
//gst_media_play_addto_playlist (play, file_name);

View file

@ -1,6 +1,10 @@
#include <config.h>
#include <string.h>
#include <gtk/gtkobject.h>
#include <gtk/gtksignal.h>
#include <gtk/gtksocket.h>
#include <gtk/gtkmain.h>
#include "gstplay.h"
#include "gstplayprivate.h"
@ -72,28 +76,42 @@ gst_play_class_init (GstPlayClass *klass)
widget_class = (GtkWidgetClass*)klass;
gst_play_signals[SIGNAL_STATE_CHANGED] =
gtk_signal_new ("playing_state_changed", GTK_RUN_FIRST, object_class->type,
gtk_signal_new ("playing_state_changed", GTK_RUN_FIRST,
G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET (GstPlayClass, state_changed),
gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gst_play_signals[SIGNAL_FRAME_DISPLAYED] =
gtk_signal_new ("frame_displayed",GTK_RUN_FIRST, object_class->type,
gtk_signal_new ("frame_displayed",GTK_RUN_FIRST, G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET (GstPlayClass, frame_displayed),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
gst_play_signals[SIGNAL_AUDIO_PLAYED] =
gtk_signal_new ("audio_played",GTK_RUN_FIRST, object_class->type,
gtk_signal_new ("audio_played",GTK_RUN_FIRST, G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET (GstPlayClass, audio_played),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
#ifndef USE_GLIB2
gtk_object_class_add_signals (object_class, gst_play_signals, LAST_SIGNAL);
#endif
gtk_object_add_arg_type ("GstPlay::uri", GTK_TYPE_STRING,
GTK_ARG_READABLE, ARG_URI);
gtk_object_add_arg_type ("GstPlay::mute", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_MUTE);
gtk_object_add_arg_type ("GstPlay::state", GTK_TYPE_INT,
GTK_ARG_READABLE, ARG_STATE);
#ifdef USE_GLIB2
gtk_object_add_arg_type ("GstPlay::media_size", GTK_TYPE_UINT,
GTK_ARG_READABLE, ARG_MEDIA_SIZE);
gtk_object_add_arg_type ("GstPlay::media_offset", GTK_TYPE_UINT,
GTK_ARG_READABLE, ARG_MEDIA_OFFSET);
gtk_object_add_arg_type ("GstPlay::media_total_time", GTK_TYPE_UINT,
GTK_ARG_READABLE, ARG_MEDIA_TOTAL_TIME);
gtk_object_add_arg_type ("GstPlay::media_current_time", GTK_TYPE_UINT,
GTK_ARG_READABLE, ARG_MEDIA_CURRENT_TIME);
#else
gtk_object_add_arg_type ("GstPlay::media_size", GTK_TYPE_ULONG,
GTK_ARG_READABLE, ARG_MEDIA_SIZE);
gtk_object_add_arg_type ("GstPlay::media_offset", GTK_TYPE_ULONG,
@ -102,6 +120,7 @@ gst_play_class_init (GstPlayClass *klass)
GTK_ARG_READABLE, ARG_MEDIA_TOTAL_TIME);
gtk_object_add_arg_type ("GstPlay::media_current_time", GTK_TYPE_ULONG,
GTK_ARG_READABLE, ARG_MEDIA_CURRENT_TIME);
#endif
object_class->set_arg = gst_play_set_arg;
object_class->get_arg = gst_play_get_arg;
@ -124,18 +143,18 @@ gst_play_init (GstPlay *play)
priv->audio_element = gst_elementfactory_make ("osssink", "play_audio");
g_return_if_fail (priv->audio_element != NULL);
gtk_signal_connect (GTK_OBJECT (priv->audio_element), "handoff",
GTK_SIGNAL_FUNC (gst_play_audio_handoff), play);
g_signal_connect (G_OBJECT (priv->audio_element), "handoff",
G_CALLBACK (gst_play_audio_handoff), play);
priv->video_element = gst_elementfactory_make ("bin", "video_bin");
priv->video_show = gst_elementfactory_make ("xvideosink", "show");
g_return_if_fail (priv->video_show != NULL);
//gtk_object_set (GTK_OBJECT (priv->video_element), "xv_enabled", FALSE, NULL);
gtk_signal_connect (GTK_OBJECT (priv->video_show), "frame_displayed",
GTK_SIGNAL_FUNC (gst_play_frame_displayed), play);
gtk_signal_connect (GTK_OBJECT (priv->video_show), "have_size",
GTK_SIGNAL_FUNC (gst_play_have_size), play);
g_signal_connect (G_OBJECT (priv->video_show), "frame_displayed",
G_CALLBACK (gst_play_frame_displayed), play);
g_signal_connect (G_OBJECT (priv->video_show), "have_size",
G_CALLBACK (gst_play_have_size), play);
gst_bin_add (GST_BIN (priv->video_element), priv->video_show);
@ -237,6 +256,28 @@ gst_play_audio_handoff (GstElement *element, GstPlay *play)
NULL);
}
#ifdef USE_GLIB2
static void
gst_play_object_introspect (GstObject *object, const gchar *property, GstElement **target)
{
GParamSpec *pspec;
GstElement *element;
if (!GST_IS_ELEMENT (object) && !GST_IS_BIN (object))
return;
element = GST_ELEMENT (object);
#warning this looks grim, did I port it right ?
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (element), property);
if (!pspec) {
*target = element;
GST_DEBUG(0, "gstplay: using element \"%s\" for %s property\n",
gst_element_get_name(element), property);
}
}
#else
static void
gst_play_object_introspect (GstObject *object, const gchar *property, GstElement **target)
{
@ -260,6 +301,7 @@ gst_play_object_introspect (GstObject *object, const gchar *property, GstElement
gst_element_get_name(element), property);
}
}
#endif
/* Dumb introspection of the interface...
* this will change with glib 1.4
@ -328,7 +370,8 @@ gst_play_have_type (GstElement *sink, GstCaps *caps, GstPlay *play)
autoplug = gst_autoplugfactory_make ("staticrender");
g_assert (autoplug != NULL);
gtk_signal_connect (GTK_OBJECT (autoplug), "new_object", gst_play_object_added, play);
g_signal_connect (G_OBJECT (autoplug), "new_object",
G_CALLBACK (gst_play_object_added), play);
new_element = gst_autoplug_to_renderers (autoplug,
caps,
@ -345,11 +388,11 @@ gst_play_have_type (GstElement *sink, GstCaps *caps, GstPlay *play)
gst_bin_add (GST_BIN (priv->pipeline), new_element);
gtk_object_set (G_OBJECT (priv->cache), "reset", TRUE, NULL);
g_object_set (G_OBJECT (priv->cache), "reset", TRUE, NULL);
gst_element_connect (priv->cache, "src", new_element, "sink");
gtk_signal_connect (GTK_OBJECT (priv->pipeline), "eos", GTK_SIGNAL_FUNC (gst_play_eos), play);
g_signal_connect (G_OBJECT (priv->pipeline), "eos", G_CALLBACK (gst_play_eos), play);
gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
}
@ -380,9 +423,8 @@ connect_pads (GstElement *new_element, GstElement *target, gboolean add)
GstPlayReturn
gst_play_set_uri (GstPlay *play, const guchar *uri)
{
gchar *uriloc;
GstPlayPrivate *priv;
FILE *file;
gchar* uriloc;
g_return_val_if_fail (play != NULL, GST_PLAY_ERROR);
g_return_val_if_fail (GST_IS_PLAY (play), GST_PLAY_ERROR);
@ -407,7 +449,7 @@ gst_play_set_uri (GstPlay *play, const guchar *uri)
}
if (priv->src == NULL) {
priv->src = gst_elementfactory_make ("filesrc", "srcelement");
priv->src = gst_elementfactory_make ("disksrc", "srcelement");
}
priv->uri = g_strdup (uri);
@ -416,18 +458,18 @@ gst_play_set_uri (GstPlay *play, const guchar *uri)
priv->offset_element = priv->src;
g_return_val_if_fail (priv->src != NULL, GST_PLAY_CANNOT_PLAY);
gtk_object_set (G_OBJECT (priv->src), "location", priv->uri, NULL);
g_object_set (G_OBJECT (priv->src), "location", priv->uri, NULL);
priv->cache = gst_elementfactory_make ("autoplugcache", "cache");
g_return_val_if_fail (priv->cache != NULL, GST_PLAY_CANNOT_PLAY);
gtk_signal_connect (GTK_OBJECT (priv->cache), "cache_empty",
GTK_SIGNAL_FUNC (gst_play_cache_empty), play);
g_signal_connect (G_OBJECT (priv->cache), "cache_empty",
G_CALLBACK (gst_play_cache_empty), play);
priv->typefind = gst_elementfactory_make ("typefind", "typefind");
g_return_val_if_fail (priv->typefind != NULL, GST_PLAY_CANNOT_PLAY);
gtk_signal_connect (GTK_OBJECT (priv->typefind), "have_type",
GTK_SIGNAL_FUNC (gst_play_have_type), play);
g_signal_connect (G_OBJECT (priv->typefind), "have_type",
G_CALLBACK (gst_play_have_type), play);
gst_bin_add (GST_BIN (priv->pipeline), priv->src);
@ -739,12 +781,21 @@ gst_play_get_arg (GtkObject *object, GtkArg *arg, guint id)
case ARG_STATE:
GTK_VALUE_INT (*arg) = play->state;
break;
#ifdef USE_GLIB2
case ARG_MEDIA_SIZE:
GTK_VALUE_UINT (*arg) = gst_play_get_media_size(play);
break;
case ARG_MEDIA_OFFSET:
GTK_VALUE_UINT (*arg) = gst_play_get_media_offset(play);
break;
#else
case ARG_MEDIA_SIZE:
GTK_VALUE_LONG (*arg) = gst_play_get_media_size(play);
break;
case ARG_MEDIA_OFFSET:
GTK_VALUE_LONG (*arg) = gst_play_get_media_offset(play);
break;
#endif
case ARG_MEDIA_TOTAL_TIME:
break;
case ARG_MEDIA_CURRENT_TIME:

View file

@ -1,7 +1,16 @@
#ifndef __GSTPLAY_H__
#define __GSTPLAY_H__
#include <config.h>
#ifdef USE_GLIB2
#define gst_glade_xml_new(path,misc) (glade_xml_new (path "2", (misc), NULL))
#else
#define gst_glade_xml_new(path,misc) (glade_xml_new (path, (misc)))
#endif
#include <gst/gst.h>
#include <gtk/gtkhbox.h>
#define GST_TYPE_PLAY (gst_play_get_type ())
#define GST_PLAY(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PLAY, GstPlay))

View file

@ -122,6 +122,7 @@ gst_status_area_expose(GtkWidget *widget, GdkEventExpose *event)
status_area = GST_STATUS_AREA (widget);
#ifndef USE_GLIB2
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) {
gdk_draw_rectangle (widget->window,
widget->style->black_gc,
@ -215,6 +216,9 @@ gst_status_area_expose(GtkWidget *widget, GdkEventExpose *event)
status_area->playtime);
}
}
#else
#warning this needs pangoizing.
#endif
return FALSE;
}

View file

@ -1,5 +1,9 @@
#include <config.h>
#include <gnome.h>
#ifdef USE_GLIB2
#include <libgnomeui/libgnomeui.h>
#include <libgnomeui/gnome-ui-init.h>
#endif
#include "gstmediaplay.h"
int
@ -8,9 +12,16 @@ main (int argc, char *argv[])
GstMediaPlay *play;
gst_init (&argc,&argv);
#ifdef USE_GLIB2
gnome_program_init ("gstmediaplay", "0.3",
LIBGNOMEUI_MODULE,
argc, argv, NULL);
#else
gnome_init ("gstreamer", VERSION, argc, argv);
glade_init();
glade_gnome_init();
#endif
play = gst_media_play_new ();

View file

@ -36,6 +36,8 @@ static guint gst_dpman_preprocess_synchronous(GstDParamManager *dpman, guint fra
static guint gst_dpman_preprocess_noop(GstDParamManager *dpman, guint frames, gint64 timestamp);
static guint gst_dpman_process_noop(GstDParamManager *dpman, guint frame_count);
static GObjectClass *parent_class;
void
_gst_dpman_initialize()
{
@ -69,6 +71,8 @@ gst_dpman_class_init (GstDParamManagerClass *klass)
GstObjectClass *gstobject_class;
GObjectClass *gobject_class;
parent_class = g_type_class_peek_parent (klass);
gstobject_class = (GstObjectClass*) klass;
gobject_class = (GObjectClass*) klass;
gobject_class->dispose = gst_dpman_dispose;
@ -125,9 +129,9 @@ gst_dpman_new (gchar *name, GstElement *parent)
static void
gst_dpman_dispose (GObject *object)
{
GstDParamManager *dpman = GST_DPMAN(object);
/* GstDParamManager *dpman = GST_DPMAN(object); */
G_OBJECT_CLASS (parent_class)->dispose (object);
}
/**

View file

@ -30,7 +30,8 @@ main (int argc, char *argv[])
autoplugger = gst_autoplugfactory_make ("static");
g_signal_connect (G_OBJECT (autoplugger), "new_object", new_object_added, NULL);
g_signal_connect (G_OBJECT (autoplugger), "new_object",
G_CALLBACK (new_object_added), NULL);
element = gst_autoplug_to_caps (autoplugger, testcaps,
gst_pad_get_caps (gst_element_get_pad (osssink, "sink")),

View file

@ -43,8 +43,10 @@ main(int argc,char *argv[])
gst_element_connect(src,"src",identity,"sink");
gst_element_connect(identity,"src",sink,"sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (pipeline), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (pipeline), "eos",
G_CALLBACK (eos_signal), NULL);
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);

View file

@ -62,8 +62,10 @@ main(int argc,char *argv[])
gst_element_connect(src2,"src",identity2,"sink");
gst_element_connect(identity2,"src",sink2,"sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (pipeline), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (pipeline), "eos",
G_CALLBACK (eos_signal), NULL);
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);

View file

@ -58,8 +58,10 @@ main(int argc,char *argv[])
gst_element_connect(src,"src1",identity2,"sink");
gst_element_connect(identity2,"src",sink2,"sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (pipeline), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (pipeline), "eos",
G_CALLBACK (eos_signal), NULL);
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);

View file

@ -67,8 +67,10 @@ main(int argc,char *argv[])
gst_element_connect(src2,"src",identity2,"sink");
gst_element_connect(identity2,"src",sink2,"sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (pipeline), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (pipeline), "eos",
G_CALLBACK (eos_signal), NULL);
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);

View file

@ -68,10 +68,14 @@ main(int argc,char *argv[])
gst_element_connect(src2,"src",identity2,"sink");
gst_element_connect(identity2,"src",sink2,"sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (src2), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (pipeline), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (thread), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (src2), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (pipeline), "eos",
G_CALLBACK (eos_signal), NULL);
g_signal_connect (G_OBJECT (thread), "eos",
G_CALLBACK (eos_signal_element), NULL);
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);

View file

@ -64,10 +64,14 @@ main(int argc,char *argv[])
gst_element_connect(queue,"src",identity,"sink");
gst_element_connect(identity,"src",sink,"sink");
g_signal_connect (G_OBJECT (src2), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (queue), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (pipeline), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (thread), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (src2), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (queue), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (pipeline), "eos",
G_CALLBACK (eos_signal), NULL);
g_signal_connect (G_OBJECT (thread), "eos",
G_CALLBACK (eos_signal_element), NULL);
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);

View file

@ -52,9 +52,12 @@ main(int argc,char *argv[])
gst_element_connect(src, "src", identity, "sink");
gst_element_connect(identity, "src", sink, "sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (bin), "eos", eos_signal_element, NULL);
g_signal_connect (G_OBJECT (thread), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (bin), "eos",
G_CALLBACK (eos_signal_element), NULL);
g_signal_connect (G_OBJECT (thread), "eos",
G_CALLBACK (eos_signal), NULL);
gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING);

View file

@ -15,7 +15,7 @@ int main (int argc,char *argv[]) {
fakesink = gst_elementfactory_make("fakesink","fakesink");
g_object_set(G_OBJECT(disksrc),"location","events.c",NULL);
g_signal_connect(G_OBJECT(fakesink),"eos",eos_handler,NULL);
g_signal_connect(G_OBJECT(fakesink),"eos",G_CALLBACK (eos_handler),NULL);
gst_bin_add(GST_BIN(pipeline),disksrc);
gst_bin_add(GST_BIN(pipeline),fakesink);

View file

@ -62,8 +62,10 @@ main(int argc,char *argv[])
gst_element_request_pad_by_name (aggregator, "sink%d"));
gst_element_connect (aggregator, "src", sink, "sink");
g_signal_connect (G_OBJECT (src), "eos", eos_signal, NULL);
g_signal_connect (G_OBJECT (sink), "handoff", handoff_signal, NULL);
g_signal_connect (G_OBJECT (src), "eos",
G_CALLBACK (eos_signal), NULL);
g_signal_connect (G_OBJECT (sink), "handoff",
G_CALLBACK (handoff_signal), NULL);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);