Merged from GOBJECT1 to HEAD at 200106241

Original commit message from CVS:
Merged from GOBJECT1 to HEAD at 200106241
This commit is contained in:
Erik Walthinsen 2001-06-25 01:20:11 +00:00
parent 2703619624
commit 7f8d8fe8d5
180 changed files with 3692 additions and 2595 deletions

View file

@ -8,6 +8,8 @@
#undef HAVE_LC_MESSAGES
#undef HAVE_STPCPY
#undef USE_GLIB2
#undef PLUGINS_DIR
#undef PLUGINS_BUILDDIR
#undef PLUGINS_USE_BUILDDIR

View file

@ -169,21 +169,62 @@ dnl Check for essential libraries first:
dnl ====================================
dnl Check for glib
AM_PATH_GLIB(1.2.0,,
AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
glib gmodule gthread)
dnl Put the glib flags into $LIBS and $CFLAGS since we always use them
CORE_LIBS="$GLIB_LIBS"
CORE_CFLAGS="$GLIB_CFLAGS"
AC_ARG_ENABLE(glib2,
[ --enable-glib2 enable the use of glib-2.0 and GObject if available],
[ case "${enableval}" in
yes) USE_GLIB2=yes ;;
no) USE_GLIB2=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-glib2) ;;
esac],
[:])
HAVE_OBJECT_MODEL=no
if test x$USE_GLIB2 = xyes; then
AC_MSG_CHECKING(glib-2.0)
PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
HAVE_GLIB2=yes,HAVE_GLIB2=yes)
dnl Check for gtk
AM_PATH_GTK(1.2.0,,
AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
dnl Put the gtk flags into $LIBS and $CFLAGS since we always use them
CORE_LIBS="$CORE_LIBS $GTK_LIBS"
CORE_CFLAGS="$CORE_CFLAGS $GTK_CFLAGS"
if test x$HAVE_GLIB2 = xyes; then
CORE_LIBS="$GLIB2_LIBS"
CORE_CFLAGS="$GLIB2_CFLAGS"
AC_SUBST(GLIB2_LIBS)
AC_SUBST(GLIB2_CFLAGS)
AC_DEFINE(USE_GLIB2)
HAVE_OBJECT_MODEL=yes
else
USE_GLIB2=no
HAVE_OBJECT_MODEL=no
fi
fi
AM_CONDITIONAL(USE_GLIB2, test "x$USE_GLIB2" = "xyes")
AC_SUBST(USE_GLIB2)
AM_CONDITIONAL(USE_GTK2, test "x$USE_GTK2" = "xyes")
AC_SUBST(USE_GTK2)
AM_CONDITIONAL(USE_GNOME2, test "x$USE_GNOME2" = "xyes")
AC_SUBST(USE_GNOME2)
if test x$HAVE_OBJECT_MODEL = xno; then
dnl Check for glib
AM_PATH_GLIB(1.2.0,,
AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
glib gmodule gthread)
dnl Put the glib flags into $LIBS and $CFLAGS since we always use them
CORE_LIBS="$GLIB_LIBS"
CORE_CFLAGS="$GLIB_CFLAGS"
dnl Check for gtk
AM_PATH_GTK(1.2.0,,
AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
dnl Put the gtk flags into $LIBS and $CFLAGS since we always use them
CORE_LIBS="$CORE_LIBS $GTK_LIBS"
CORE_CFLAGS="$CORE_CFLAGS $GTK_CFLAGS"
HAVE_OBJECT_MODEL=yes
fi
dnl Check for libxml
@ -381,19 +422,27 @@ AC_SUBST(GDK_PIXBUF_LIBS)
AC_SUBST(GDK_PIXBUF_CFLAGS)
dnl Check for libgnome
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
if test x$GNOME_CONFIG = xno; then
AC_MSG_WARN(Couldn't find gnome-config: can't build editor or gstplay)
if test x$USE_GLIB2 = xyes; then
dnl we don't support gnome/gtk with glib2.0 yet
GNOME_LIBS=
GNOME_CFLAGS=
HAVE_GNOME=no
AC_MSG_WARN(gnome disabled for glib2.0)
else
GNOME_LIBS=`gnome-config --libs gnome gnomeui`
GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
GHTTP_LIBS=`gnome-config --libs gnome gnomeui`
GHTTP_CFLAGS=`gnome-config --cflags gnome gnomeui`
HAVE_GNOME=yes
dnl Check for libgnome
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
if test x$GNOME_CONFIG = xno; then
AC_MSG_WARN(Couldn't find gnome-config: can't build editor or gstplay)
GNOME_LIBS=
GNOME_CFLAGS=
HAVE_GNOME=no
else
GNOME_LIBS=`gnome-config --libs gnome gnomeui`
GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
GHTTP_LIBS=`gnome-config --libs gnome gnomeui`
GHTTP_CFLAGS=`gnome-config --cflags gnome gnomeui`
HAVE_GNOME=yes
fi
fi
AC_SUBST(GNOME_LIBS)
AC_SUBST(GNOME_CFLAGS)
@ -401,57 +450,77 @@ AC_SUBST(GHTTP_LIBS)
dnl Check for libghttp
dnl FIXME: need to check for header
AC_CHECK_LIB(ghttp, ghttp_request_new,
[GHTTP_LIBS="-lghttp"
GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
HAVE_LIBGHTTP=yes
],
[AC_MSG_WARN(Cannot find libghttp: can't build gsthttpsrc)
GHTTP_LIBS=
GST_HTTPSRC_GET_TYPE=
HAVE_LIBGHTTP=no
],
$LIBS)
if test x$USE_GLIB2 = xyes; then
GHTTP_LIBS=
GST_HTTPSRC_GET_TYPE=
HAVE_LIBGHTTP=no
AC_MSG_WARN(ghttp disabled for glib2.0)
else
AC_CHECK_LIB(ghttp, ghttp_request_new,
[GHTTP_LIBS="-lghttp"
GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
HAVE_LIBGHTTP=yes
],
[AC_MSG_WARN(Cannot find libghttp: can't build gsthttpsrc)
GHTTP_LIBS=
GST_HTTPSRC_GET_TYPE=
HAVE_LIBGHTTP=no
],
$LIBS)
fi
AC_SUBST(GST_HTTPSRC_GET_TYPE)
dnl Check for libglade
HAVE_LIBGLADE_GNOME="no"
AC_PATH_PROG(LIBGLADE_CONFIG_PATH, libglade-config, no)
if test x$LIBGLADE_CONFIG_PATH = xno; then
AC_MSG_WARN(Couldn't find libglade-config - Can't build gstplay)
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)
else
LIBGLADE_GNOME_LIBS=`libglade-config --libs gnome`
LIBGLADE_GNOME_CFLAGS=`libglade-config --cflags gnome`
libglade_save_CFLAGS="$CFLAGS"
libglade_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBGLADE_GNOME_CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $LIBGLADE_GNOME_LIBS $GTK_LIBS"
AC_TRY_LINK([#include <glade/glade.h>],[glade_gnome_init();],
HAVE_LIBGLADE_GNOME="yes",
AC_MSG_WARN(
AC_PATH_PROG(LIBGLADE_CONFIG_PATH, libglade-config, no)
if test x$LIBGLADE_CONFIG_PATH = 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-config --libs gnome`
LIBGLADE_GNOME_CFLAGS=`libglade-config --cflags gnome`
libglade_save_CFLAGS="$CFLAGS"
libglade_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBGLADE_GNOME_CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $LIBGLADE_GNOME_LIBS $GTK_LIBS"
AC_TRY_LINK([#include <glade/glade.h>],[glade_gnome_init();],
HAVE_LIBGLADE_GNOME="yes",
AC_MSG_WARN(
[Couldn't find gnome libraries for libglade - Can't build gstmediaplay and gsteditor])
)
CFLAGS="$libglade_save_CFLAGS"
LIBS="$libglade_save_LIBS"
CFLAGS="$libglade_save_CFLAGS"
LIBS="$libglade_save_LIBS"
fi
fi
AC_SUBST(LIBGLADE_GNOME_LIBS)
AC_SUBST(LIBGLADE_GNOME_CFLAGS)
dnl Check for Gnome VFS
HAVE_GNOME_VFS="no"
AC_MSG_CHECKING(for Gnome VFS)
if gnome-config --libs vfs > /dev/null 2>&1; then
if test x$USE_GLIB2 = xyes; then
VFS_LIBS=
VFS_CFLAGS=
AC_MSG_WARN(Gnome-VFS disabled for glib2.0)
else
AC_MSG_CHECKING(for Gnome VFS)
if gnome-config --libs vfs > /dev/null 2>&1; then
HAVE_GNOME_VFS="yes"
AC_MSG_RESULT(found)
else
VFS_LIBS="`gnome-config --libs vfs`"
VFS_CFLAGS="`gnome-config --cflags vfs`"
else
AC_MSG_WARN(Did not find Gnome-VFS installed)
VFS_LIBS=
VFS_CFLAGS=
fi
fi
VFS_LIBS="`gnome-config --libs vfs`"
VFS_CFLAGS="`gnome-config --cflags vfs`"
AC_SUBST(VFS_LIBS)
AC_SUBST(VFS_CFLAGS)
@ -459,15 +528,13 @@ dnl Check for Avifile
HAVE_AVIFILE="no"
AC_MSG_CHECKING(for Avifile)
if avifile-config --libs > /dev/null 2>&1; then
HAVE_AVIFILE="yes"
AC_MSG_RESULT(found)
HAVE_AVIFILE="yes"
AC_MSG_RESULT(found)
else
AC_MSG_WARN(Did not find Avifile installed)
AC_MSG_WARN(Did not find Avifile installed)
fi
AVIFILE_LIBS="`avifile-config --libs`"
AVIFILE_CFLAGS="`avifile-config --cflags`"
AC_SUBST(AVIFILE_LIBS)
AC_SUBST(AVIFILE_CFLAGS)
@ -1148,8 +1215,6 @@ gst/elements/Makefile
gst/autoplug/Makefile
libs/Makefile
libs/riff/Makefile
libs/colorspace/Makefile
libs/videoscale/Makefile
libs/getbits/Makefile
libs/putbits/Makefile
libs/idct/Makefile
@ -1164,6 +1229,7 @@ plugins/avi/Makefile
plugins/avi/wincodec/Makefile
plugins/avi/winaudio/Makefile
plugins/flx/Makefile
plugins/festival/Makefile
plugins/flac/Makefile
plugins/jpeg/Makefile
plugins/mp3decode/Makefile
@ -1219,6 +1285,7 @@ plugins/icecast/icecastsend/Makefile
plugins/effects/Makefile
plugins/effects/stereo/Makefile
plugins/effects/volume/Makefile
plugins/udp/Makefile
plugins/visualization/Makefile
plugins/visualization/spectrum/Makefile
plugins/visualization/vumeter/Makefile

140
docs/random/wtay/events Normal file
View file

@ -0,0 +1,140 @@
some random ramblings about the event system:
Possible candidates for events
------------------------------
- QoS
- EOS
- Seek
- caps nego??
- bufferpool get??
- ...
Assumptions for events
----------------------
- They are tied to a pad.
- get rid of gst_pad_set_*_function (except for the chain/get ones)
- occur async to dataflow. (need locking?)
- fixed set of events only for core features. (elements cannot abuse
events for doing dataflow)
Questions
---------
limit the valid directions an event can travel in? ie. Can EOS only
travel downstream (left to right)?
eg. Seek travels upstream, but it makes sense to also make it travel
downstream (the case of a disksink, where we overwrite the header)
Setting an event function
-------------------------
void gst_pad_set_event_function (GstPad *pad, gint event_mask,
GstEventFunction *function);
event masks:
typedef enum {
GST_EVENT_EOS = (1 << 0),
GST_EVENT_QOS = (1 << 1),
GST_EVENT_SEEK = (1 << 2),
GST_EVENT_CAPS = (1 << 3),
} GstEventType;
Event structure
---------------
typedef struct {
GstEventType type;
GstEventMinorType minor;
guint64 timestamp; /* also sequence number ?? */
union {
/* EOS stuff */
/* QoS stuff */
/* Seek stuff */
GstSeekType type; /* time, bytes, ... */
gint64 offset;
gint64 lenth;
/* Caps stuff */
GstCaps *caps;
} data;
} GstEvent;
typedef enum {
GST_EVENT_MINOR_NONE,
/* EOS stuff */
/* QoS stuff */
/* Seek stuff */
GST_EVENT_MINOR_OFFSET,
GST_EVENT_MINOR_TIME,
/* caps nego stuff */
GST_EVENT_MINOR_CAPS_TRY,
GST_EVENT_MINOR_CAPS_START,
GST_EVENT_MINOR_CAPS_FINAL,
} GstEventMinorType;
Receiving events
----------------
a sample GstEventFunction, the event functions returns TRUE if the event is handled,
FALSE otherwise.
gboolean
gst_anelement_handle_event (GstPad *pad, GstEvent *event)
{
if (event->type == GST_EVENT_EOS) {
/* do something */
return TRUE;
}
else if (event->type == GST_EVENT_CAPS) {
if (event->minor == GST_EVENT_CAPS_TRY) {
/* try using this caps structure */
return TRUE; /* return FALSE to proxy ???*/
}
}
return FALSE;
}
Default event handler for pads
------------------------------
gboolean
gst_pad_handle_event (GstPad *pad, GstEvent *event)
{
GstElement *element;
GList *pads;
GstPad *srcpad;
gboolean result = TRUE;
GstPadDirection dir = GST_PAD_DIRECTION (pad);
g_return_val_if_fail (pad != NULL, FALSE);
g_return_val_if_fail (GST_IS_REAL_PAD(pad), FALSE); // NOTE the restriction
element = GST_ELEMENT (gst_object_get_parent (GST_OBJECT (pad)));
/* send out the events to all pad with opposite direction */
pads = gst_element_get_pad_list(element);
while (pads) {
otherpad = GST_PAD(pads->data);
pads = g_list_next(pads);
if (gst_pad_get_direction(otherpad) != dir) {
result &= gst_pad_send_event (GST_REAL_PAD(otherpad), event);
}
}
/* result is combined result of all handlers? */
return result;
}

View file

@ -9,3 +9,9 @@ SUBDIRS = $(GNOME_SUBDS) \
helloworld helloworld2 \
queue queue2 queue3 queue4 \
launch thread xml plugins typefind mixer cutter
DIST_SUBDIRS = autoplug \
helloworld helloworld2 \
queue queue2 queue3 queue4 \
launch thread xml plugins typefind mixer cutter

View file

@ -53,8 +53,8 @@ void cut_start (GstElement *element)
ct->tm_hour, ct->tm_min, ct->tm_sec);
}
g_print ("DEBUG: cut_start: setting new location to %s\n", buffer);
gtk_object_set (GTK_OBJECT (disksink), "location", buffer, NULL);
gtk_object_set (GTK_OBJECT (disksink), "type", 4, NULL);
g_object_set (G_OBJECT (disksink), "location", buffer, NULL);
g_object_set (G_OBJECT (disksink), "type", 4, NULL);
gst_element_set_state (main_bin, GST_STATE_PLAYING);
++id;
@ -78,7 +78,7 @@ void cut_stop (GstElement *element)
gst_element_set_state (main_bin, GST_STATE_PAUSED);
g_print ("DEBUG: cut_stop: setting new location\n");
gtk_object_set (GTK_OBJECT (disksink), "location", "/dev/null", NULL);
g_object_set (G_OBJECT (disksink), "location", "/dev/null", NULL);
gst_element_set_state (main_bin, GST_STATE_PLAYING);
g_print ("stop_cut_signal done\n");
@ -116,7 +116,7 @@ int main (int argc, char *argv[])
/* create cutter */
cutter = gst_elementfactory_make ("cutter", "cutter");
gtk_object_set (GTK_OBJECT (cutter),
g_object_set (G_OBJECT (cutter),
"threshold_dB", -40.0,
"runlength", 0.5,
NULL);
@ -126,14 +126,14 @@ int main (int argc, char *argv[])
/* set params */
gtk_object_set (GTK_OBJECT (audiosrc), "frequency", 44100,
g_object_set (G_OBJECT (audiosrc), "frequency", 44100,
"channels", 1,
"format", 16, NULL);
encoder = gst_elementfactory_make ("passthrough", "encoder");
disksink = gst_elementfactory_make ("afsink", "disk_sink");
gtk_object_set (GTK_OBJECT (disksink), "location", "/dev/null", NULL);
g_object_set (G_OBJECT (disksink), "location", "/dev/null", NULL);
thread = gst_thread_new ("thread");
g_assert (thread != NULL);
@ -168,10 +168,10 @@ int main (int argc, char *argv[])
/* set signal handlers */
g_print ("setting signal handlers\n");
gtk_signal_connect (GTK_OBJECT(cutter), "cut_start",
GTK_SIGNAL_FUNC(cut_start_signal), NULL);
gtk_signal_connect (GTK_OBJECT(cutter), "cut_stop",
GTK_SIGNAL_FUNC(cut_stop_signal), NULL);
g_signal_connectc (G_OBJECT(cutter), "cut_start",
(GCallback)cut_start_signal, NULL, FALSE);
g_signal_connectc (G_OBJECT(cutter), "cut_stop",
(GCallback)cut_stop_signal, NULL, FALSE);
/* start playing */
g_print ("setting to play\n");

View file

@ -27,9 +27,9 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
GTK_SIGNAL_FUNC(eos),NULL);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
g_signal_connectc(G_OBJECT(disksrc),"eos",
G_CALLBACK(eos),NULL,FALSE);
/* now it's time to get the parser */
parse = gst_elementfactory_make("mp3parse","parse");

View file

@ -32,9 +32,9 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
GTK_SIGNAL_FUNC(eos),NULL);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
g_signal_connectc(G_OBJECT(disksrc),"eos",
G_CALLBACK(eos),NULL,FALSE);
/* and an audio sink */
osssink = gst_elementfactory_make("osssink", "play_audio");

View file

@ -270,14 +270,14 @@ create_input_channel (int id, char* location)
g_assert(channel->disksrc != NULL);
GST_DEBUG(0, "c_i_p : setting location\n");
gtk_object_set(GTK_OBJECT(channel->disksrc),"location", location, NULL);
g_object_set(G_OBJECT(channel->disksrc),"location", location, NULL);
/* add disksrc to the bin before autoplug */
gst_bin_add(GST_BIN(channel->pipe), channel->disksrc);
/* connect signal to eos of disksrc */
gtk_signal_connect(GTK_OBJECT(channel->disksrc),"eos",
GTK_SIGNAL_FUNC(eos),NULL);
g_signal_connectc (G_OBJECT(channel->disksrc),"eos",
G_CALLBACK(eos),NULL,FALSE);
#ifdef DEBUG
@ -395,7 +395,7 @@ void env_register_cp (GstElement *volenv, double cp_time, double cp_level)
char buffer[30];
sprintf (buffer, "%f:%f", cp_time, cp_level);
gtk_object_set(GTK_OBJECT(volenv), "controlpoint", buffer, NULL);
g_object_set(G_OBJECT(volenv), "controlpoint", buffer, NULL);
}

View file

@ -100,8 +100,8 @@ static void gst_example_init (GstExample *example);
static void gst_example_chain (GstPad *pad, GstBuffer *buf);
static void gst_example_set_arg (GtkObject *object,GtkArg *arg,guint id);
static void gst_example_get_arg (GtkObject *object,GtkArg *arg,guint id);
static void gst_example_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_example_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
/* These hold the constructed pad templates, which are created during
* plugin load, and used during element instantiation.
@ -123,29 +123,29 @@ static guint gst_example_signals[LAST_SIGNAL] = { 0 };
* register the type, providing the name of the class, struct sizes,
* and pointers to the various functions that define the class.
*/
GtkType
GType
gst_example_get_type(void)
{
static GtkType example_type = 0;
static GType example_type = 0;
if (!example_type) {
static const GtkTypeInfo example_info = {
"GstExample",
static const GTypeInfo example_info = {
sizeof(GstExampleClass), NULL,
NULL,
(GClassInitFunc)gst_example_class_init,
NULL,
NULL,
sizeof(GstExample),
sizeof(GstExampleClass),
(GtkClassInitFunc)gst_example_class_init,
(GtkObjectInitFunc)gst_example_init,
(GtkArgSetFunc)NULL, /* These last three are depracated */
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_example_init,
};
example_type = gtk_type_unique(GST_TYPE_ELEMENT,&example_info);
example_type = g_type_register_static(GST_TYPE_ELEMENT, "GstExample", &example_info, 0);
}
return example_type;
}
/* In order to create an instance of an object, the class must be
* initialized by this function. GtkObject will take care of running
* initialized by this function. GObject will take care of running
* it, based on the pointer to the function provided above.
*/
static void
@ -154,41 +154,40 @@ gst_example_class_init (GstExampleClass *klass)
/* Class pointers are needed to supply pointers to the private
* implementations of parent class methods.
*/
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
/* Since the example class contains the parent classes, you can simply
* cast the pointer to get access to the parent classes.
*/
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
/* The parent class is needed for class method overrides. */
parent_class = gtk_type_class(GST_TYPE_ELEMENT);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
/* Here we add an argument to the object. This argument is an integer,
* and can be both read and written.
*/
gtk_object_add_arg_type("GstExample::active", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_ACTIVE);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_ACTIVE,
g_param_spec_int("active","active","active",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
/* Here we add a signal to the object. This is avery useless signal
* called asdf. The signal will also pass a pointer to the listeners
* which happens to be the example element itself */
gst_example_signals[ASDF] =
gtk_signal_new("asdf", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstExampleClass, asdf),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc("asdf", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstExampleClass, asdf), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_EXAMPLE);
gtk_object_class_add_signals (gtkobject_class, gst_example_signals,
LAST_SIGNAL);
/* The last thing is to provide the functions that implement get and set
* of arguments.
*/
gtkobject_class->set_arg = gst_example_set_arg;
gtkobject_class->get_arg = gst_example_get_arg;
gobject_class->set_property = gst_example_set_property;
gobject_class->get_property = gst_example_get_property;
}
/* This function is responsible for initializing a specific instance of
@ -277,8 +276,8 @@ gst_example_chain (GstPad *pad, GstBuffer *buf)
gst_pad_push(example->srcpad,outbuf);
/* For fun we'll emit our useless signal here */
gtk_signal_emit (GTK_OBJECT (example), gst_example_signals[ASDF],
example);
g_signal_emit(G_OBJECT (example), gst_example_signals[ASDF], 0,
example);
/* If we're not doing something, just send the original incoming buffer. */
} else {
@ -290,7 +289,7 @@ gst_example_chain (GstPad *pad, GstBuffer *buf)
* enable the element to respond to various arguments.
*/
static void
gst_example_set_arg (GtkObject *object,GtkArg *arg,guint id)
gst_example_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstExample *example;
@ -301,14 +300,14 @@ gst_example_set_arg (GtkObject *object,GtkArg *arg,guint id)
example = GST_EXAMPLE(object);
/* Check the argument id to see which argument we're setting. */
switch (id) {
switch (prop_id) {
case ARG_ACTIVE:
/* Here we simply copy the value of the argument to our private
* storage. More complex operations can be done, but beware that
* they may occur at any time, possibly even while your chain function
* is running, if you are using threads.
*/
example->active = GTK_VALUE_INT(*arg);
example->active = g_value_get_int (value);
g_print("example: set active to %d\n",example->active);
break;
default:
@ -318,7 +317,7 @@ gst_example_set_arg (GtkObject *object,GtkArg *arg,guint id)
/* The set function is simply the inverse of the get fuction. */
static void
gst_example_get_arg (GtkObject *object,GtkArg *arg,guint id)
gst_example_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstExample *example;
@ -326,12 +325,12 @@ gst_example_get_arg (GtkObject *object,GtkArg *arg,guint id)
g_return_if_fail(GST_IS_EXAMPLE(object));
example = GST_EXAMPLE(object);
switch (id) {
switch (prop_id) {
case ARG_ACTIVE:
GTK_VALUE_INT(*arg) = example->active;
g_value_set_int (value, example->active);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -345,7 +344,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
GstElementFactory *factory;
/* We need to create an ElementFactory for each element we provide.
* This consists of the name of the element, the GtkType identifier,
* This consists of the name of the element, the GType identifier,
* and a pointer to the details structure at the top of the file.
*/
factory = gst_elementfactory_new("example", GST_TYPE_EXAMPLE, &example_details);

View file

@ -60,7 +60,7 @@ struct _GstExampleClass {
};
/* Five standard preprocessing macros are used in the Gtk+ object system.
* The first uses the object's _get_type function to return the GtkType
* The first uses the object's _get_type function to return the GType
* of the object.
*/
#define GST_TYPE_EXAMPLE \
@ -69,21 +69,21 @@ struct _GstExampleClass {
* is not the right type, a warning will be generated on stderr.
*/
#define GST_EXAMPLE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_EXAMPLE,GstExample))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_EXAMPLE,GstExample))
/* The third is a checking cast of the class instead of the object. */
#define GST_EXAMPLE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_EXAMPLE,GstExample))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_EXAMPLE,GstExample))
/* The last two simply check to see if the passed pointer is an object or
* class of the correct type. */
#define GST_IS_EXAMPLE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_EXAMPLE))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_EXAMPLE))
#define GST_IS_EXAMPLE_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_EXAMPLE))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_EXAMPLE))
/* This is the only prototype needed, because it is used in the above
* GST_TYPE_EXAMPLE macro.
*/
GtkType gst_example_get_type(void);
GType gst_example_get_type(void);
#ifdef __cplusplus

View file

@ -25,7 +25,7 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
parse = gst_elementfactory_make("mp3parse", "parse");
decode = gst_elementfactory_make("mpg123", "decode");

View file

@ -35,9 +35,9 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
GTK_SIGNAL_FUNC(eos), thread);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
g_signal_connectc (G_OBJECT(disksrc),"eos",
G_CALLBACK(eos), thread, FALSE);
queue = gst_elementfactory_make("queue", "queue");

View file

@ -35,9 +35,9 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
GTK_SIGNAL_FUNC(eos), thread);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
g_signal_connectc(G_OBJECT(disksrc),"eos",
G_CALLBACK(eos), thread, FALSE);
queue = gst_elementfactory_make("queue", "queue");

View file

@ -37,9 +37,9 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
GTK_SIGNAL_FUNC(eos), thread);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
g_signal_connectc(G_OBJECT(disksrc),"eos",
G_CALLBACK(eos), thread, FALSE);
queue = gst_elementfactory_make("queue", "queue");
queue2 = gst_elementfactory_make("queue", "queue2");

View file

@ -36,9 +36,9 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
GTK_SIGNAL_FUNC(eos), thread);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
g_signal_connectc(G_OBJECT(disksrc),"eos",
G_CALLBACK(eos), thread, FALSE);
/* and an audio sink */
osssink = gst_elementfactory_make("osssink", "play_audio");

View file

@ -34,7 +34,7 @@ main(int argc, char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
typefind = gst_elementfactory_make("typefind", "typefind");
g_assert(typefind != NULL);
@ -43,8 +43,8 @@ main(int argc, char *argv[])
gst_bin_add(GST_BIN(bin), disksrc);
gst_bin_add(GST_BIN(bin), typefind);
gtk_signal_connect (GTK_OBJECT (typefind), "have_type",
type_found, NULL);
g_signal_connectc (G_OBJECT (typefind), "have_type",
type_found, NULL, FALSE);
gst_pad_connect(gst_element_get_pad(disksrc,"src"),
gst_element_get_pad(typefind,"sink"));

View file

@ -32,12 +32,12 @@ int main(int argc,char *argv[])
//thread = gst_thread_new("thread");
thread = gst_elementfactory_make("thread", "thread");
g_assert(thread != NULL);
gtk_signal_connect (GTK_OBJECT (thread), "object_saved", object_saved, g_strdup ("decoder thread"));
g_signal_connectc (G_OBJECT (thread), "object_saved", object_saved, g_strdup ("decoder thread"), FALSE);
thread2 = gst_elementfactory_make("thread", "thread2");
//thread2 = gst_thread_new("thread2");
g_assert(thread2 != NULL);
gtk_signal_connect (GTK_OBJECT (thread2), "object_saved", object_saved, g_strdup ("render thread"));
g_signal_connectc (G_OBJECT (thread2), "object_saved", object_saved, g_strdup ("render thread"), FALSE);
/* create a new bin to hold the elements */
bin = gst_bin_new("bin");
@ -46,7 +46,7 @@ int main(int argc,char *argv[])
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
g_object_set(G_OBJECT(disksrc),"location", argv[1],NULL);
queue = gst_elementfactory_make("queue", "queue");
queue2 = gst_elementfactory_make("queue", "queue2");

View file

@ -35,7 +35,7 @@ int main(int argc,char *argv[])
xml = gst_xml_new ();
gtk_signal_connect (GTK_OBJECT (xml), "object_loaded", xml_loaded, xml);
g_signal_connectc (G_OBJECT (xml), "object_loaded", xml_loaded, xml, FALSE);
ret = gst_xml_parse_file(xml, "xmlTest.gst", NULL);
g_assert (ret == TRUE);

View file

@ -12,9 +12,19 @@ endif
EXTRA_libgst_la_SOURCES = \
gstcpuid_i386.s
if USE_GLIB2
GST_OBJECT_MODEL_SRC = gstmarshal.c
GST_OBJECT_MODEL_HDR = gstmarshal.h
else
GST_OBJECT_MODEL_SRC = gobject2gtk.c
GST_OBJECT_MODEL_HDR = gobject2gtk.h
endif
libgst_la_SOURCES = \
cothreads.c \
gst.c \
$(GST_OBJECT_MODEL_SRC) \
gstobject.c \
gstautoplug.c \
gstbin.c \
gstbuffer.c \
@ -27,7 +37,6 @@ libgst_la_SOURCES = \
gstextratypes.c \
gstinfo.c \
gstmeta.c \
gstobject.c \
gstpad.c \
gstpipeline.c \
gstplugin.c \
@ -91,6 +100,8 @@ libgstincludedir = $(includedir)/gst
libgstinclude_HEADERS = \
cothreads.h \
gst.h \
$(GST_OBJECT_MODEL_HDR) \
gstobject.h \
gsttypes.h \
gstautoplug.h \
gstbin.h \
@ -104,7 +115,6 @@ libgstinclude_HEADERS = \
gstinfo.h \
gstlog.h \
gstmeta.h \
gstobject.h \
gstpad.h \
gstpipeline.h \
gstplugin.h \

View file

@ -41,7 +41,7 @@ void have_type(GstElement *element, GstCaps *caps, GstCaps **private_caps) {
gst_bin_add(GST_BIN(autobin),sink);
gst_element_connect(decoder,"src",sink,"sink");
gtk_object_set (GTK_OBJECT(cache), "reset", TRUE, NULL);
g_object_set (G_OBJECT(cache), "reset", TRUE, NULL);
gst_element_connect(cache,"src",decoder,"sink");
}
@ -52,7 +52,7 @@ void have_type(GstElement *element, GstCaps *caps, GstCaps **private_caps) {
gst_bin_add(GST_BIN(autobin),sink);
gst_element_connect(decoder,"src",sink,"sink");
gtk_object_set (GTK_OBJECT(cache), "reset", TRUE, NULL);
g_object_set (G_OBJECT(cache), "reset", TRUE, NULL);
gst_element_connect(cache,"src",decoder,"sink");
}
@ -68,14 +68,14 @@ int main (int argc,char *argv[]) {
pipeline = gst_pipeline_new("pipeline");
src = gst_elementfactory_make ("disksrc","src");
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
gst_bin_add (GST_BIN(pipeline),src);
autobin = gst_bin_new("autobin");
cache = gst_elementfactory_make ("autoplugcache","cache");
gtk_signal_connect (GTK_OBJECT(cache),"cache_empty",GTK_SIGNAL_FUNC(cache_empty),NULL);
g_signal_connectc (G_OBJECT(cache),"cache_empty",(GCallback)cache_empty,NULL,FALSE);
typefind = gst_elementfactory_make ("typefind", "typefind");
gtk_signal_connect (GTK_OBJECT(typefind),"have_type",GTK_SIGNAL_FUNC(have_type),&caps);
g_signal_connectc (G_OBJECT(typefind),"have_type",(GCallback)have_type,&caps,FALSE);
gst_bin_add (GST_BIN(autobin),cache);
gst_bin_add (GST_BIN(autobin),typefind);
gst_element_connect(cache,"src",typefind,"sink");

View file

@ -33,13 +33,13 @@ GstElementDetails gst_autoplugcache_details = {
#define GST_TYPE_AUTOPLUGCACHE \
(gst_autoplugcache_get_type())
#define GST_AUTOPLUGCACHE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_AUTOPLUGCACHE,GstAutoplugCache))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUGCACHE,GstAutoplugCache))
#define GST_AUTOPLUGCACHE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUGCACHE,GstAutoplugCacheClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUGCACHE,GstAutoplugCacheClass))
#define GST_IS_AUTOPLUGCACHE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_AUTOPLUGCACHE))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUGCACHE))
#define GST_IS_AUTOPLUGCACHE_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUGCACHE))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUGCACHE))
typedef struct _GstAutoplugCache GstAutoplugCache;
typedef struct _GstAutoplugCacheClass GstAutoplugCacheClass;
@ -85,8 +85,10 @@ enum {
static void gst_autoplugcache_class_init (GstAutoplugCacheClass *klass);
static void gst_autoplugcache_init (GstAutoplugCache *cache);
static void gst_autoplugcache_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_autoplugcache_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_autoplugcache_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gst_autoplugcache_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
static void gst_autoplugcache_loop (GstElement *element);
@ -98,22 +100,23 @@ static GstElementStateReturn gst_autoplugcache_change_state (GstElement *element
static GstElementClass *parent_class = NULL;
static guint gst_autoplugcache_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_autoplugcache_get_type(void) {
static GtkType autoplugcache_type = 0;
static GType autoplugcache_type = 0;
if (!autoplugcache_type) {
static const GtkTypeInfo autoplugcache_info = {
"GstAutoplugCache",
sizeof(GstAutoplugCache),
static const GTypeInfo autoplugcache_info = {
sizeof(GstAutoplugCacheClass),
(GtkClassInitFunc)gst_autoplugcache_class_init,
(GtkObjectInitFunc)gst_autoplugcache_init,
(GtkArgSetFunc)gst_autoplugcache_set_arg,
(GtkArgGetFunc)gst_autoplugcache_get_arg,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_autoplugcache_class_init,
NULL,
NULL,
sizeof(GstAutoplugCache),
0,
(GInstanceInitFunc)gst_autoplugcache_init,
};
autoplugcache_type = gtk_type_unique (GST_TYPE_ELEMENT, &autoplugcache_info);
autoplugcache_type = g_type_register_static (GST_TYPE_ELEMENT, "GstAutoplugCache", &autoplugcache_info, 0);
}
return autoplugcache_type;
}
@ -121,34 +124,36 @@ gst_autoplugcache_get_type(void) {
static void
gst_autoplugcache_class_init (GstAutoplugCacheClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BUFFER_COUNT,
g_param_spec_int("buffer_count","buffer_count","buffer_count",
0,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CAPS_PROXY,
g_param_spec_boolean("caps_proxy","caps_proxy","caps_proxy",
FALSE,G_PARAM_READWRITE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RESET,
g_param_spec_boolean("reset","reset","reset",
FALSE,G_PARAM_WRITABLE)); // CHECKME!
gst_autoplugcache_signals[FIRST_BUFFER] =
gtk_signal_new ("first_buffer", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstAutoplugCacheClass, first_buffer),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("first_buffer", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstAutoplugCacheClass, first_buffer), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gst_autoplugcache_signals[CACHE_EMPTY] =
gtk_signal_new ("cache_empty", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstAutoplugCacheClass, cache_empty),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (gtkobject_class, gst_autoplugcache_signals, LAST_SIGNAL);
g_signal_newc ("cache_empty", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstAutoplugCacheClass, cache_empty), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gtk_object_add_arg_type ("GstAutoplugCache::buffer_count", GTK_TYPE_INT,
GTK_ARG_READABLE, ARG_BUFFER_COUNT);
gtk_object_add_arg_type ("GstAutoplugCache::caps_proxy", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_CAPS_PROXY);
gtk_object_add_arg_type ("GstAutoplugCache::reset", GTK_TYPE_BOOL,
GTK_ARG_WRITABLE, ARG_RESET);
gtkobject_class->set_arg = gst_autoplugcache_set_arg;
gtkobject_class->get_arg = gst_autoplugcache_get_arg;
gobject_class->set_property = gst_autoplugcache_set_property;
gobject_class->get_property = gst_autoplugcache_get_property;
gstelement_class->change_state = gst_autoplugcache_change_state;
}
@ -193,7 +198,7 @@ gst_autoplugcache_loop (GstElement *element)
* buffer, i.e. the end of the list.
* If the playout pointer does not have a prev (towards the most recent) buffer
* (== NULL), a buffer must be pulled from the sink pad and added to the cache.
* When the playout pointer gets reset (as in a set_arg), the cache is walked
* When the playout pointer gets reset (as in a set_property), the cache is walked
* without problems, because the playout pointer has a non-NULL next. When
* the playout pointer hits the end of cache again it has to start pulling.
*/
@ -212,7 +217,7 @@ gst_autoplugcache_loop (GstElement *element)
// set the current_playout pointer
cache->current_playout = cache->cache;
gtk_signal_emit (GTK_OBJECT(cache), gst_autoplugcache_signals[FIRST_BUFFER], buf);
g_signal_emit (G_OBJECT(cache), gst_autoplugcache_signals[FIRST_BUFFER], 0, buf);
// send the buffer on its way
gst_pad_push (cache->srcpad, buf);
@ -226,7 +231,7 @@ gst_autoplugcache_loop (GstElement *element)
int oldstate = GST_STATE(cache);
GST_DEBUG(0,"at front of cache, about to pull, but firing signal\n");
gst_object_ref (GST_OBJECT (cache));
gtk_signal_emit (GTK_OBJECT(cache), gst_autoplugcache_signals[CACHE_EMPTY], NULL);
g_signal_emit (G_OBJECT(cache), gst_autoplugcache_signals[CACHE_EMPTY], 0, NULL);
if (GST_STATE(cache) != oldstate) {
gst_object_ref (GST_OBJECT (cache));
GST_DEBUG(GST_CAT_AUTOPLUG, "state changed during signal, aborting\n");
@ -256,7 +261,7 @@ gst_autoplugcache_loop (GstElement *element)
cache->current_playout = g_list_previous (cache->current_playout);
if (cache->fire_first) {
gtk_signal_emit (GTK_OBJECT(cache), gst_autoplugcache_signals[FIRST_BUFFER], buf);
g_signal_emit (G_OBJECT(cache), gst_autoplugcache_signals[FIRST_BUFFER], 0, buf);
cache->fire_first = FALSE;
}
@ -294,15 +299,15 @@ gst_autoplugcache_change_state (GstElement *element)
}
static void
gst_autoplugcache_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_autoplugcache_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstAutoplugCache *cache;
cache = GST_AUTOPLUGCACHE (object);
switch (id) {
switch (prop_id) {
case ARG_CAPS_PROXY:
cache->caps_proxy = GTK_VALUE_BOOL(*arg);
cache->caps_proxy = g_value_get_boolean (value);
GST_DEBUG(0,"caps_proxy is %d\n",cache->caps_proxy);
if (cache->caps_proxy) {
gst_pad_set_negotiate_function (cache->sinkpad, GST_DEBUG_FUNCPTR(gst_autoplugcache_nego_sink));
@ -314,7 +319,7 @@ GST_DEBUG(0,"caps_proxy is %d\n",cache->caps_proxy);
break;
case ARG_RESET:
// no idea why anyone would set this to FALSE, but just in case ;-)
if (GTK_VALUE_BOOL(*arg)) {
if (g_value_get_boolean (value)) {
GST_DEBUG(0,"resetting playout pointer\n");
// reset the playout pointer to the begining again
cache->current_playout = cache->cache_start;
@ -330,20 +335,20 @@ GST_DEBUG(0,"caps_proxy is %d\n",cache->caps_proxy);
}
static void
gst_autoplugcache_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_autoplugcache_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstAutoplugCache *cache;
cache = GST_AUTOPLUGCACHE (object);
switch (id) {
switch (prop_id) {
case ARG_BUFFER_COUNT:
GTK_VALUE_INT(*arg) = cache->buffer_count;
g_value_set_int (value, cache->buffer_count);
break;
case ARG_CAPS_PROXY:
GTK_VALUE_BOOL(*arg) = cache->caps_proxy;
g_value_set_boolean (value, cache->caps_proxy);
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -33,13 +33,13 @@ GstElementDetails gst_autoplugger_details = {
#define GST_TYPE_AUTOPLUGGER \
(gst_autoplugger_get_type())
#define GST_AUTOPLUGGER(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_AUTOPLUGGER,GstAutoplugger))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUGGER,GstAutoplugger))
#define GST_AUTOPLUGGER_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUGGER,GstAutopluggerClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUGGER,GstAutopluggerClass))
#define GST_IS_AUTOPLUGGER(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_AUTOPLUGGER))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUGGER))
#define GST_IS_AUTOPLUGGER_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUGGER))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUGGER))
typedef struct _GstAutoplugger GstAutoplugger;
typedef struct _GstAutopluggerClass GstAutopluggerClass;
@ -84,8 +84,8 @@ enum {
static void gst_autoplugger_class_init (GstAutopluggerClass *klass);
static void gst_autoplugger_init (GstAutoplugger *queue);
static void gst_autoplugger_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_autoplugger_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_autoplugger_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_autoplugger_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
//static GstElementStateReturn gst_autoplugger_change_state (GstElement *element);
@ -104,22 +104,23 @@ static void gst_autoplugger_typefind_have_type (GstElement *element, GstCaps *c
static GstElementClass *parent_class = NULL;
//static guint gst_autoplugger_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_autoplugger_get_type(void) {
static GtkType autoplugger_type = 0;
static GType autoplugger_type = 0;
if (!autoplugger_type) {
static const GtkTypeInfo autoplugger_info = {
"GstAutoplugger",
sizeof(GstAutoplugger),
static const GTypeInfo autoplugger_info = {
sizeof(GstAutopluggerClass),
(GtkClassInitFunc)gst_autoplugger_class_init,
(GtkObjectInitFunc)gst_autoplugger_init,
(GtkArgSetFunc)gst_autoplugger_set_arg,
(GtkArgGetFunc)gst_autoplugger_get_arg,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_autoplugger_class_init,
NULL,
NULL,
sizeof(GstAutoplugger),
0,
(GInstanceInitFunc)gst_autoplugger_init,
};
autoplugger_type = gtk_type_unique (GST_TYPE_BIN, &autoplugger_info);
autoplugger_type = g_type_register_static (GST_TYPE_BIN, "GstAutoplugger", &autoplugger_info, 0);
}
return autoplugger_type;
}
@ -127,31 +128,32 @@ gst_autoplugger_get_type(void) {
static void
gst_autoplugger_class_init (GstAutopluggerClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
/*
gst_autoplugger_signals[_EMPTY] =
gtk_signal_new ("_empty", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstAutopluggerClass, _empty),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (gtkobject_class, gst_autoplugger_signals, LAST_SIGNAL);
g_signal_newc ("_empty", G_OBJECT_TYPE(gobject_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstAutopluggerClass, _empty), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
*/
/*
gtk_object_add_arg_type ("GstAutoplugger::buffer_count", GTK_TYPE_INT,
GTK_ARG_READABLE, ARG_BUFFER_COUNT);
gtk_object_add_arg_type ("GstAutoplugger::reset", GTK_TYPE_BOOL,
GTK_ARG_WRITABLE, ARG_RESET);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BUFFER_COUNT,
g_param_spec_int("buffer_count","buffer_count","buffer_count",
0,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RESET,
g_param_spec_boolean("reset","reset","reset",
FALSE,G_PARAM_WRITABLE)); // CHECKME!
*/
gtkobject_class->set_arg = gst_autoplugger_set_arg;
gtkobject_class->get_arg = gst_autoplugger_get_arg;
gobject_class->set_property = gst_autoplugger_set_property;
gobject_class->get_property = gst_autoplugger_get_property;
// gstelement_class->change_state = gst_autoplugger_change_state;
}
@ -166,11 +168,11 @@ gst_autoplugger_init (GstAutoplugger *autoplugger)
g_return_if_fail (autoplugger->cache != NULL);
GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache\n");
gtk_object_set(GTK_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
g_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
// attach signals to the cache
gtk_signal_connect (GTK_OBJECT (autoplugger->cache), "first_buffer",
GTK_SIGNAL_FUNC (gst_autoplugger_cache_first_buffer), autoplugger);
g_signal_connectc (G_OBJECT (autoplugger->cache), "first_buffer",
G_CALLBACK (gst_autoplugger_cache_first_buffer), autoplugger, FALSE);
// add the cache to self
gst_bin_add (GST_BIN(autoplugger), autoplugger->cache);
@ -180,18 +182,18 @@ gst_autoplugger_init (GstAutoplugger *autoplugger)
autoplugger->cache_srcpad = gst_element_get_pad (autoplugger->cache, "src");
// attach handlers to the typefind pads
gtk_signal_connect (GTK_OBJECT (autoplugger->cache_sinkpad), "caps_changed",
GTK_SIGNAL_FUNC (gst_autoplugger_external_sink_caps_changed), autoplugger);
gtk_signal_connect (GTK_OBJECT (autoplugger->cache_srcpad), "caps_changed",
GTK_SIGNAL_FUNC (gst_autoplugger_external_src_caps_changed), autoplugger);
gtk_signal_connect (GTK_OBJECT (autoplugger->cache_sinkpad), "caps_nego_failed",
GTK_SIGNAL_FUNC (gst_autoplugger_external_sink_caps_nego_failed), autoplugger);
gtk_signal_connect (GTK_OBJECT (autoplugger->cache_srcpad), "caps_nego_failed",
GTK_SIGNAL_FUNC (gst_autoplugger_external_src_caps_nego_failed), autoplugger);
// gtk_signal_connect (GTK_OBJECT (autoplugger->cache_sinkpad), "connected",
// GTK_SIGNAL_FUNC (gst_autoplugger_external_sink_connected), autoplugger);
// gtk_signal_connect (GTK_OBJECT (autoplugger->cache_srcpad), "connected",
// GTK_SIGNAL_FUNC (gst_autoplugger_external_src_connected), autoplugger);
g_signal_connectc (G_OBJECT (autoplugger->cache_sinkpad), "caps_changed",
G_CALLBACK (gst_autoplugger_external_sink_caps_changed), autoplugger,FALSE);
g_signal_connectc (G_OBJECT (autoplugger->cache_srcpad), "caps_changed",
G_CALLBACK (gst_autoplugger_external_src_caps_changed), autoplugger,FALSE);
g_signal_connectc (G_OBJECT (autoplugger->cache_sinkpad), "caps_nego_failed",
G_CALLBACK (gst_autoplugger_external_sink_caps_nego_failed), autoplugger,FALSE);
g_signal_connectc (G_OBJECT (autoplugger->cache_srcpad), "caps_nego_failed",
G_CALLBACK (gst_autoplugger_external_src_caps_nego_failed), autoplugger,FALSE);
// g_signal_connectc (G_OBJECT (autoplugger->cache_sinkpad), "connected",
// gst_autoplugger_external_sink_connected, autoplugger,FALSE);
// g_signal_connectc (G_OBJECT (autoplugger->cache_srcpad), "connected",
// gst_autoplugger_external_src_connected, autoplugger,FALSE);
// ghost both of these pads to the outside world
gst_element_add_ghost_pad (GST_ELEMENT(autoplugger), autoplugger->cache_sinkpad, "sink");
@ -246,7 +248,7 @@ gst_autoplugger_external_src_connected(GstPad *pad, GstPad *peerpad, GstAutoplug
gst_caps_get_mime(peertemplatecaps));
autoplugger->sinktemplatecaps = peertemplatecaps;
// GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache\n");
// gtk_object_set(GTK_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
// gtk_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
}
}
}
@ -482,12 +484,12 @@ gst_schedule_show(GST_ELEMENT_SCHED(autoplugger));
// now reset the autoplugcache
GST_DEBUG(GST_CAT_AUTOPLUG, "resetting the cache to send first buffer(s) again\n");
gtk_object_set(GTK_OBJECT(autoplugger->cache),"reset",TRUE,NULL);
g_object_set(G_OBJECT(autoplugger->cache),"reset",TRUE,NULL);
// attach the cache_empty handler
// FIXME this is the wrong place, it shouldn't be done until we get successful caps nego!
gtk_signal_connect(GTK_OBJECT(autoplugger->cache),"cache_empty",
GTK_SIGNAL_FUNC(gst_autoplugger_cache_empty),autoplugger);
g_signal_connectc (G_OBJECT(autoplugger->cache),"cache_empty",
G_CALLBACK (gst_autoplugger_cache_empty), autoplugger, FALSE);
autoplugger->paused--;
if (autoplugger->paused == 0)
@ -530,8 +532,8 @@ gst_schedule_show(GST_ELEMENT_SCHED(autoplugger));
GST_DEBUG(GST_CAT_AUTOPLUG, "creating typefind and setting signal handler\n");
autoplugger->typefind = gst_elementfactory_make("typefind","unnamed_typefind");
autoplugger->typefind_sinkpad = gst_element_get_pad(autoplugger->typefind,"sink");
gtk_signal_connect(GTK_OBJECT(autoplugger->typefind),"have_type",
GTK_SIGNAL_FUNC (gst_autoplugger_typefind_have_type), autoplugger);
g_signal_connectc (G_OBJECT(autoplugger->typefind),"have_type",
G_CALLBACK (gst_autoplugger_typefind_have_type), autoplugger, FALSE);
}
// add it to self and attach it
GST_DEBUG(GST_CAT_AUTOPLUG, "adding typefind to self and connecting to cache\n");
@ -551,34 +553,34 @@ gst_schedule_show(GST_ELEMENT_SCHED(autoplugger));
gst_schedule_show(GST_ELEMENT_SCHED(autoplugger));
} else {
// // attach the cache_empty handler, since the cache simply isn't needed
// gtk_signal_connect(GTK_OBJECT(autoplugger->cache),"cache_empty",
// GTK_SIGNAL_FUNC(gst_autoplugger_cache_empty),autoplugger);
// g_signal_connectc (G_OBJECT(autoplugger->cache),"cache_empty",
// gst_autoplugger_cache_empty,autoplugger,FALSE);
}
}
static void
gst_autoplugger_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_autoplugger_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstAutoplugger *autoplugger;
autoplugger = GST_AUTOPLUGGER (object);
switch (id) {
switch (prop_id) {
default:
break;
}
}
static void
gst_autoplugger_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_autoplugger_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstAutoplugger *autoplugger;
autoplugger = GST_AUTOPLUGGER (object);
switch (id) {
switch (prop_id) {
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -45,22 +45,23 @@ static GstElement* gst_static_autoplug_to_caps (GstAutoplug *autoplug,
static GstAutoplugClass *parent_class = NULL;
GtkType gst_static_autoplug_get_type(void)
GType gst_static_autoplug_get_type(void)
{
static GtkType static_autoplug_type = 0;
static GType static_autoplug_type = 0;
if (!static_autoplug_type) {
static const GtkTypeInfo static_autoplug_info = {
"GstStaticAutoplug",
sizeof(GstElement),
static const GTypeInfo static_autoplug_info = {
sizeof(GstElementClass),
(GtkClassInitFunc)gst_static_autoplug_class_init,
(GtkObjectInitFunc)gst_static_autoplug_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_static_autoplug_class_init,
NULL,
NULL,
sizeof(GstElement),
0,
(GInstanceInitFunc)gst_static_autoplug_init,
};
static_autoplug_type = gtk_type_unique (GST_TYPE_AUTOPLUG, &static_autoplug_info);
static_autoplug_type = g_type_register_static (GST_TYPE_AUTOPLUG, "GstStaticAutoplug", &static_autoplug_info, 0);
}
return static_autoplug_type;
}
@ -72,7 +73,7 @@ gst_static_autoplug_class_init(GstStaticAutoplugClass *klass)
gstautoplug_class = (GstAutoplugClass*) klass;
parent_class = gtk_type_class(GST_TYPE_AUTOPLUG);
parent_class = g_type_class_ref(GST_TYPE_AUTOPLUG);
gstautoplug_class->autoplug_to_caps = gst_static_autoplug_to_caps;
}
@ -225,8 +226,8 @@ gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink)
if (!connected) {
GST_DEBUG (0,"gstpipeline: delaying pad connections for \"%s\" to \"%s\"\n",
GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink));
gtk_signal_connect(GTK_OBJECT(src),"new_pad",
GTK_SIGNAL_FUNC(gst_autoplug_pads_autoplug_func), sink);
g_signal_connectc (G_OBJECT(src), "new_pad",
G_CALLBACK (gst_autoplug_pads_autoplug_func), sink, FALSE);
}
}
@ -459,10 +460,10 @@ differ:
data->i = i;
GST_DEBUG (0,"delaying the creation of a ghostpad for %s\n", GST_ELEMENT_NAME (thesrcelement));
gtk_signal_connect (GTK_OBJECT (thesrcelement), "new_pad",
autoplug_dynamic_pad, data);
gtk_signal_connect (GTK_OBJECT (thesrcelement), "new_ghost_pad",
autoplug_dynamic_pad, data);
g_signal_connectc (G_OBJECT (thesrcelement), "new_pad",
G_CALLBACK (autoplug_dynamic_pad), data, FALSE);
g_signal_connectc (G_OBJECT (thesrcelement), "new_ghost_pad",
G_CALLBACK (autoplug_dynamic_pad), data, FALSE);
}
}
}

View file

@ -33,13 +33,13 @@ extern "C" {
#define GST_TYPE_STATIC_AUTOPLUG \
(gst_static_autoplug_get_type())
#define GST_STATIC_AUTOPLUG(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_STATIC_AUTOPLUG,GstStaticAutoplug))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STATIC_AUTOPLUG,GstStaticAutoplug))
#define GST_STATIC_AUTOPLUG_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_STATIC_AUTOPLUG,GstStaticAutoplugClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STATIC_AUTOPLUG,GstStaticAutoplugClass))
#define GST_IS_STATIC_AUTOPLUG(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_STATIC_AUTOPLUG))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STATIC_AUTOPLUG))
#define GST_IS_STATIC_AUTOPLUG_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_STATIC_AUTOPLUG))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STATIC_AUTOPLUG))
typedef struct _GstStaticAutoplug GstStaticAutoplug;
typedef struct _GstStaticAutoplugClass GstStaticAutoplugClass;
@ -53,7 +53,7 @@ struct _GstStaticAutoplugClass {
};
GtkType gst_static_autoplug_get_type (void);
GType gst_static_autoplug_get_type (void);
#ifdef __cplusplus
}

View file

@ -45,22 +45,23 @@ static GstElement* gst_static_autoplug_to_render (GstAutoplug *autoplug,
static GstAutoplugClass *parent_class = NULL;
GtkType gst_static_autoplug_render_get_type(void)
GType gst_static_autoplug_render_get_type(void)
{
static GtkType static_autoplug_type = 0;
static GType static_autoplug_type = 0;
if (!static_autoplug_type) {
static const GtkTypeInfo static_autoplug_info = {
"GstStaticAutoplugRender",
sizeof(GstElement),
static const GTypeInfo static_autoplug_info = {
sizeof(GstElementClass),
(GtkClassInitFunc)gst_static_autoplug_render_class_init,
(GtkObjectInitFunc)gst_static_autoplug_render_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_static_autoplug_render_class_init,
NULL,
NULL,
sizeof(GstElement),
0,
(GInstanceInitFunc)gst_static_autoplug_render_init,
};
static_autoplug_type = gtk_type_unique (GST_TYPE_AUTOPLUG, &static_autoplug_info);
static_autoplug_type = g_type_register_static (GST_TYPE_AUTOPLUG, "GstStaticAutoplugRender", &static_autoplug_info, 0);
}
return static_autoplug_type;
}
@ -72,7 +73,7 @@ gst_static_autoplug_render_class_init(GstStaticAutoplugRenderClass *klass)
gstautoplug_class = (GstAutoplugClass*) klass;
parent_class = gtk_type_class(GST_TYPE_AUTOPLUG);
parent_class = g_type_class_ref(GST_TYPE_AUTOPLUG);
gstautoplug_class->autoplug_to_renderers = gst_static_autoplug_to_render;
}
@ -202,10 +203,10 @@ gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink)
if (!connected) {
GST_DEBUG (0,"gstpipeline: delaying pad connections for \"%s\" to \"%s\"\n",
GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink));
gtk_signal_connect(GTK_OBJECT(src),"new_pad",
GTK_SIGNAL_FUNC(gst_autoplug_pads_autoplug_func), sink);
gtk_signal_connect(GTK_OBJECT(src),"new_ghost_pad",
GTK_SIGNAL_FUNC(gst_autoplug_pads_autoplug_func), sink);
g_signal_connectc (G_OBJECT(src),"new_pad",
G_CALLBACK (gst_autoplug_pads_autoplug_func), sink, FALSE);
g_signal_connectc (G_OBJECT(src),"new_ghost_pad",
G_CALLBACK (gst_autoplug_pads_autoplug_func), sink, FALSE);
}
}

View file

@ -33,13 +33,13 @@ extern "C" {
#define GST_TYPE_STATIC_AUTOPLUG_RENDER \
(gst_static_autoplug_render_get_type())
#define GST_STATIC_AUTOPLUG_RENDER(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_STATIC_AUTOPLUG_RENDER,GstStaticAutoplugRender))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STATIC_AUTOPLUG_RENDER,GstStaticAutoplugRender))
#define GST_STATIC_AUTOPLUG_RENDER_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_STATIC_AUTOPLUG_RENDER,GstStaticAutoplugRenderClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STATIC_AUTOPLUG_RENDER,GstStaticAutoplugRenderClass))
#define GST_IS_STATIC_AUTOPLUG_RENDER(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_STATIC_AUTOPLUG_RENDER))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STATIC_AUTOPLUG_RENDER))
#define GST_IS_STATIC_AUTOPLUG_RENDER_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_STATIC_AUTOPLUG_RENDER))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STATIC_AUTOPLUG_RENDER))
typedef struct _GstStaticAutoplugRender GstStaticAutoplugRender;
typedef struct _GstStaticAutoplugRenderClass GstStaticAutoplugRenderClass;
@ -53,7 +53,7 @@ struct _GstStaticAutoplugRenderClass {
};
GtkType gst_static_autoplug_render_get_type (void);
GType gst_static_autoplug_render_get_type (void);
#ifdef __cplusplus
}

View file

@ -39,6 +39,7 @@ noinst_HEADERS = \
gstsinesrc.h
CFLAGS += -O2 -Wall
LDFLAGS += -lm
libgstelements_la_LIBADD = $(GHTTP_LIBS)
libgstelements_la_LDFLAGS = -version-info $(GST_LIBVERSION)

View file

@ -51,8 +51,8 @@ enum {
static void gst_disksink_class_init (GstDiskSinkClass *klass);
static void gst_disksink_init (GstDiskSink *disksink);
static void gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksink_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_disksink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static gboolean gst_disksink_open_file (GstDiskSink *sink);
static void gst_disksink_close_file (GstDiskSink *sink);
@ -64,23 +64,23 @@ static GstElementStateReturn gst_disksink_change_state (GstElement *element);
static GstElementClass *parent_class = NULL;
static guint gst_disksink_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_disksink_get_type (void)
{
static GtkType disksink_type = 0;
static GType disksink_type = 0;
if (!disksink_type) {
static const GtkTypeInfo disksink_info = {
"GstDiskSink",
static const GTypeInfo disksink_info = {
sizeof(GstDiskSinkClass), NULL,
NULL,
(GClassInitFunc)gst_disksink_class_init,
NULL,
NULL,
sizeof(GstDiskSink),
sizeof(GstDiskSinkClass),
(GtkClassInitFunc)gst_disksink_class_init,
(GtkObjectInitFunc)gst_disksink_init,
(GtkArgSetFunc)gst_disksink_set_arg,
(GtkArgGetFunc)gst_disksink_get_arg,
(GtkClassInitFunc)NULL, /* deprecated, do not use ! */
0,
(GInstanceInitFunc)gst_disksink_init,
};
disksink_type = gtk_type_unique (GST_TYPE_ELEMENT, &disksink_info);
disksink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstDiskSink", &disksink_info, 0);
}
return disksink_type;
}
@ -88,27 +88,25 @@ gst_disksink_get_type (void)
static void
gst_disksink_class_init (GstDiskSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstDiskSink::location", GST_TYPE_FILENAME,
GTK_ARG_READWRITE, ARG_LOCATION);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_string("location","location","location",
NULL,G_PARAM_READWRITE)); // CHECKME!
gst_disksink_signals[SIGNAL_HANDOFF] =
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstDiskSinkClass, handoff),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstDiskSinkClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gtk_object_class_add_signals (gtkobject_class, gst_disksink_signals,
LAST_SIGNAL);
gtkobject_class->set_arg = gst_disksink_set_arg;
gtkobject_class->get_arg = gst_disksink_get_arg;
gobject_class->set_property = gst_disksink_set_property;
gobject_class->get_property = gst_disksink_get_property;
gstelement_class->change_state = gst_disksink_change_state;
}
@ -126,21 +124,21 @@ gst_disksink_init (GstDiskSink *disksink)
}
static void
gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstDiskSink *sink;
/* it's not null if we got it, but it might not be ours */
sink = GST_DISKSINK (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATION:
/* the element must be stopped or paused in order to do this */
g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING)
|| (GST_STATE (sink) == GST_STATE_PAUSED));
if (sink->filename)
g_free (sink->filename);
sink->filename = g_strdup (GTK_VALUE_STRING (*arg));
sink->filename = g_strdup (g_value_get_string (value));
if ( (GST_STATE (sink) == GST_STATE_PAUSED)
&& (sink->filename != NULL))
{
@ -155,7 +153,7 @@ gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_disksink_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstDiskSink *sink;
@ -164,12 +162,12 @@ gst_disksink_get_arg (GtkObject *object, GtkArg *arg, guint id)
sink = GST_DISKSINK (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATION:
GTK_VALUE_STRING (*arg) = sink->filename;
g_value_set_string (value, sink->filename);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -237,7 +235,7 @@ gst_disksink_chain (GstPad *pad, GstBuffer *buf)
}
gst_buffer_unref (buf);
gtk_signal_emit (GTK_OBJECT (disksink), gst_disksink_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (disksink), gst_disksink_signals[SIGNAL_HANDOFF], 0,
disksink);
}

View file

@ -40,13 +40,13 @@ GstElementDetails gst_disksink_details;
#define GST_TYPE_DISKSINK \
(gst_disksink_get_type())
#define GST_DISKSINK(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_DISKSINK,GstDiskSink))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DISKSINK,GstDiskSink))
#define GST_DISKSINK_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSINK,GstDiskSinkClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSINK,GstDiskSinkClass))
#define GST_IS_DISKSINK(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_DISKSINK))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DISKSINK))
#define GST_IS_DISKSINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSINK))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSINK))
typedef struct _GstDiskSink GstDiskSink;
typedef struct _GstDiskSinkClass GstDiskSinkClass;
@ -71,7 +71,7 @@ struct _GstDiskSinkClass {
void (*handoff) (GstElement *element,GstPad *pad);
};
GtkType gst_disksink_get_type(void);
GType gst_disksink_get_type(void);
#ifdef __cplusplus

View file

@ -59,8 +59,8 @@ enum {
static void gst_disksrc_class_init (GstDiskSrcClass *klass);
static void gst_disksrc_init (GstDiskSrc *disksrc);
static void gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_disksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer * gst_disksrc_get (GstPad *pad);
static GstBuffer * gst_disksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);
@ -73,23 +73,23 @@ static void gst_disksrc_close_file (GstDiskSrc *src);
static GstElementClass *parent_class = NULL;
//static guint gst_disksrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_disksrc_get_type(void)
{
static GtkType disksrc_type = 0;
static GType disksrc_type = 0;
if (!disksrc_type) {
static const GtkTypeInfo disksrc_info = {
"GstDiskSrc",
static const GTypeInfo disksrc_info = {
sizeof(GstDiskSrcClass), NULL,
NULL,
(GClassInitFunc)gst_disksrc_class_init,
NULL,
NULL,
sizeof(GstDiskSrc),
sizeof(GstDiskSrcClass),
(GtkClassInitFunc)gst_disksrc_class_init,
(GtkObjectInitFunc)gst_disksrc_init,
(GtkArgSetFunc)gst_disksrc_set_arg,
(GtkArgGetFunc)gst_disksrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_disksrc_init,
};
disksrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &disksrc_info);
disksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstDiskSrc", &disksrc_info, 0);
}
return disksrc_type;
}
@ -97,25 +97,29 @@ gst_disksrc_get_type(void)
static void
gst_disksrc_class_init (GstDiskSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstDiskSrc::location", GST_TYPE_FILENAME,
GTK_ARG_READWRITE, ARG_LOCATION);
gtk_object_add_arg_type ("GstDiskSrc::bytesperread", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_BYTESPERREAD);
gtk_object_add_arg_type ("GstDiskSrc::offset", GTK_TYPE_LONG,
GTK_ARG_READWRITE, ARG_OFFSET);
gtk_object_add_arg_type ("GstDiskSrc::size", GTK_TYPE_LONG,
GTK_ARG_READABLE, ARG_SIZE);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_string("location","location","location",
NULL,G_PARAM_READWRITE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BYTESPERREAD,
g_param_spec_int("bytesperread","bytesperread","bytesperread",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OFFSET,
g_param_spec_long("offset","offset","offset",
G_MINLONG,G_MAXLONG,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SIZE,
g_param_spec_long("size","size","size",
G_MINLONG,G_MAXLONG,0,G_PARAM_READABLE)); // CHECKME
gtkobject_class->set_arg = gst_disksrc_set_arg;
gtkobject_class->get_arg = gst_disksrc_get_arg;
gobject_class->set_property = gst_disksrc_set_property;
gobject_class->get_property = gst_disksrc_get_property;
gstelement_class->change_state = gst_disksrc_change_state;
}
@ -142,7 +146,7 @@ gst_disksrc_init (GstDiskSrc *disksrc)
static void
gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstDiskSrc *src;
@ -151,7 +155,7 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_DISKSRC (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATION:
/* the element must be stopped or paused in order to do this */
g_return_if_fail ((GST_STATE (src) < GST_STATE_PLAYING)
@ -159,12 +163,12 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
if (src->filename) g_free (src->filename);
/* clear the filename if we get a NULL (is that possible?) */
if (GTK_VALUE_STRING (*arg) == NULL) {
if (g_value_get_string (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
src->filename = NULL;
/* otherwise set the new filename */
} else {
src->filename = g_strdup (GTK_VALUE_STRING (*arg));
src->filename = g_strdup (g_value_get_string (value));
}
if ((GST_STATE (src) == GST_STATE_PAUSED) && (src->filename != NULL))
{
@ -173,10 +177,10 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = GTK_VALUE_INT (*arg);
src->bytes_per_read = g_value_get_int (value);
break;
case ARG_OFFSET:
src->curoffset = GTK_VALUE_LONG (*arg);
src->curoffset = g_value_get_long (value);
src->new_seek = TRUE;
break;
default:
@ -185,7 +189,7 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstDiskSrc *src;
@ -194,21 +198,21 @@ gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_DISKSRC (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATION:
GTK_VALUE_STRING (*arg) = src->filename;
g_value_set_string (value, src->filename);
break;
case ARG_BYTESPERREAD:
GTK_VALUE_INT (*arg) = src->bytes_per_read;
g_value_set_int (value, src->bytes_per_read);
break;
case ARG_OFFSET:
GTK_VALUE_LONG (*arg) = src->curoffset;
g_value_set_long (value, src->curoffset);
break;
case ARG_SIZE:
GTK_VALUE_LONG (*arg) = src->size;
g_value_set_long (value, src->size);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -38,13 +38,13 @@ GstElementDetails gst_disksrc_details;
#define GST_TYPE_DISKSRC \
(gst_disksrc_get_type())
#define GST_DISKSRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_DISKSRC,GstDiskSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DISKSRC,GstDiskSrc))
#define GST_DISKSRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSRC,GstDiskSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSRC,GstDiskSrcClass))
#define GST_IS_DISKSRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_DISKSRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DISKSRC))
#define GST_IS_DISKSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSRC))
typedef enum {
GST_DISKSRC_OPEN = GST_ELEMENT_FLAG_LAST,
@ -81,7 +81,7 @@ struct _GstDiskSrcClass {
GstElementClass parent_class;
};
GtkType gst_disksrc_get_type(void);
GType gst_disksrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -42,7 +42,7 @@
struct _elements_entry {
gchar *name;
GtkType (*type) (void);
GType (*type) (void);
GstElementDetails *details;
gboolean (*factoryinit) (GstElementFactory *factory);
};

View file

@ -51,31 +51,31 @@ enum {
static void gst_fakesink_class_init (GstFakeSinkClass *klass);
static void gst_fakesink_init (GstFakeSink *fakesink);
static void gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesink_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fakesink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_fakesink_chain (GstPad *pad,GstBuffer *buf);
static GstElementClass *parent_class = NULL;
static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fakesink_get_type (void)
{
static GtkType fakesink_type = 0;
static GType fakesink_type = 0;
if (!fakesink_type) {
static const GtkTypeInfo fakesink_info = {
"GstFakeSink",
static const GTypeInfo fakesink_info = {
sizeof(GstFakeSinkClass), NULL,
NULL,
(GClassInitFunc)gst_fakesink_class_init,
NULL,
NULL,
sizeof(GstFakeSink),
sizeof(GstFakeSinkClass),
(GtkClassInitFunc)gst_fakesink_class_init,
(GtkObjectInitFunc)gst_fakesink_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_fakesink_init,
};
fakesink_type = gtk_type_unique (GST_TYPE_ELEMENT, &fakesink_info);
fakesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSink", &fakesink_info, 0);
}
return fakesink_type;
}
@ -83,28 +83,27 @@ gst_fakesink_get_type (void)
static void
gst_fakesink_class_init (GstFakeSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFakeSink::num_sources", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_NUM_SOURCES);
gtk_object_add_arg_type ("GstFakeSink::silent", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_SILENT);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_SOURCES,
g_param_spec_int("num_sources","num_sources","num_sources",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
g_param_spec_boolean("silent","silent","silent",
TRUE,G_PARAM_READWRITE)); // CHECKME
gst_fakesink_signals[SIGNAL_HANDOFF] =
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstFakeSinkClass, handoff),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSinkClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_fakesink_signals,
LAST_SIGNAL);
gtkobject_class->set_arg = gst_fakesink_set_arg;
gtkobject_class->get_arg = gst_fakesink_get_arg;
gobject_class->set_property = gst_fakesink_set_property;
gobject_class->get_property = gst_fakesink_get_property;
}
static void
@ -123,7 +122,7 @@ gst_fakesink_init (GstFakeSink *fakesink)
}
static void
gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFakeSink *sink;
gint new_numsinks;
@ -132,9 +131,9 @@ gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
/* it's not null if we got it, but it might not be ours */
sink = GST_FAKESINK (object);
switch(id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
new_numsinks = GTK_VALUE_INT (*arg);
new_numsinks = g_value_get_int (value);
while (sink->numsinkpads < new_numsinks) {
pad = gst_pad_new (g_strdup_printf ("sink%d", sink->numsinkpads), GST_PAD_SINK);
gst_pad_set_chain_function (pad, gst_fakesink_chain);
@ -144,7 +143,7 @@ gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_SILENT:
sink->silent = GTK_VALUE_BOOL (*arg);
sink->silent = g_value_get_boolean (value);
break;
default:
break;
@ -152,7 +151,7 @@ gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_fakesink_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFakeSink *sink;
@ -161,15 +160,15 @@ gst_fakesink_get_arg (GtkObject *object, GtkArg *arg, guint id)
sink = GST_FAKESINK (object);
switch (id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
GTK_VALUE_INT (*arg) = sink->numsinkpads;
g_value_set_int (value, sink->numsinkpads);
break;
case ARG_SILENT:
GTK_VALUE_BOOL (*arg) = sink->silent;
g_value_set_boolean (value, sink->silent);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -195,7 +194,7 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
if (!fakesink->silent)
g_print("fakesink: ******* (%s:%s)< (%d bytes) \n",GST_DEBUG_PAD_NAME(pad),GST_BUFFER_SIZE(buf));
gtk_signal_emit (GTK_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
buf);
gst_buffer_unref (buf);

View file

@ -40,13 +40,13 @@ GstElementDetails gst_fakesink_details;
#define GST_TYPE_FAKESINK \
(gst_fakesink_get_type())
#define GST_FAKESINK(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_FAKESINK,GstFakeSink))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESINK,GstFakeSink))
#define GST_FAKESINK_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESINK,GstFakeSinkClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESINK,GstFakeSinkClass))
#define GST_IS_FAKESINK(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_FAKESINK))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESINK))
#define GST_IS_FAKESINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
typedef struct _GstFakeSink GstFakeSink;
typedef struct _GstFakeSinkClass GstFakeSinkClass;
@ -66,7 +66,7 @@ struct _GstFakeSinkClass {
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
GtkType gst_fakesink_get_type(void);
GType gst_fakesink_get_type(void);
#ifdef __cplusplus

View file

@ -54,10 +54,10 @@ enum {
};
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
static GtkType
static GType
gst_fakesrc_output_get_type(void) {
static GtkType fakesrc_output_type = 0;
static GtkEnumValue fakesrc_output[] = {
static GType fakesrc_output_type = 0;
static GEnumValue fakesrc_output[] = {
{ FAKESRC_FIRST_LAST_LOOP, "1", "First-Last loop"},
{ FAKESRC_LAST_FIRST_LOOP, "2", "Last-First loop"},
{ FAKESRC_PING_PONG, "3", "Ping-Pong"},
@ -69,7 +69,7 @@ gst_fakesrc_output_get_type(void) {
{0, NULL, NULL},
};
if (!fakesrc_output_type) {
fakesrc_output_type = gtk_type_register_enum("GstFakeSrcOutput", fakesrc_output);
fakesrc_output_type = g_enum_register_static("GstFakeSrcOutput", fakesrc_output);
}
return fakesrc_output_type;
}
@ -77,8 +77,8 @@ gst_fakesrc_output_get_type(void) {
static void gst_fakesrc_class_init (GstFakeSrcClass *klass);
static void gst_fakesrc_init (GstFakeSrc *fakesrc);
static void gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fakesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer* gst_fakesrc_get (GstPad *pad);
static void gst_fakesrc_loop (GstElement *element);
@ -86,23 +86,24 @@ static void gst_fakesrc_loop (GstElement *element);
static GstElementClass *parent_class = NULL;
static guint gst_fakesrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fakesrc_get_type (void)
{
static GtkType fakesrc_type = 0;
static GType fakesrc_type = 0;
if (!fakesrc_type) {
static const GtkTypeInfo fakesrc_info = {
"GstFakeSrc",
sizeof(GstFakeSrc),
static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass),
(GtkClassInitFunc)gst_fakesrc_class_init,
(GtkObjectInitFunc)gst_fakesrc_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_fakesrc_class_init,
NULL,
NULL,
sizeof(GstFakeSrc),
0,
(GInstanceInitFunc)gst_fakesrc_init,
};
fakesrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &fakesrc_info);
fakesrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSrc", &fakesrc_info, 0);
}
return fakesrc_type;
}
@ -110,38 +111,42 @@ gst_fakesrc_get_type (void)
static void
gst_fakesrc_class_init (GstFakeSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFakeSrc::num_sources", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_NUM_SOURCES);
gtk_object_add_arg_type ("GstFakeSrc::loop_based", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_LOOP_BASED);
gtk_object_add_arg_type ("GstFakeSrc::output", GST_TYPE_FAKESRC_OUTPUT,
GTK_ARG_READWRITE, ARG_OUTPUT);
gtk_object_add_arg_type ("GstFakeSrc::pattern", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_PATTERN);
gtk_object_add_arg_type ("GstFakeSrc::num_buffers", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_NUM_BUFFERS);
gtk_object_add_arg_type ("GstFakeSrc::eos", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_EOS);
gtk_object_add_arg_type ("GstFakeSrc::silent", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_SILENT);
gtkobject_class->set_arg = gst_fakesrc_set_arg;
gtkobject_class->get_arg = gst_fakesrc_get_arg;
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_SOURCES,
g_param_spec_int("num_sources","num_sources","num_sources",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
g_param_spec_boolean("loop_based","loop_based","loop_based",
TRUE,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OUTPUT,
g_param_spec_enum("output","output","output",
GST_TYPE_FAKESRC_OUTPUT,FAKESRC_FIRST_LAST_LOOP,G_PARAM_READWRITE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_PATTERN,
g_param_spec_string("pattern","pattern","pattern",
NULL, G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_BUFFERS,
g_param_spec_int("num_buffers","num_buffers","num_buffers",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_EOS,
g_param_spec_boolean("eos","eos","eos",
TRUE,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
g_param_spec_boolean("silent","silent","silent",
TRUE,G_PARAM_READWRITE)); // CHECKME
gst_fakesrc_signals[SIGNAL_HANDOFF] =
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstFakeSrcClass, handoff),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSrcClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_fakesrc_signals,
LAST_SIGNAL);
gobject_class->set_property = gst_fakesrc_set_property;
gobject_class->get_property = gst_fakesrc_get_property;
}
static void
@ -192,7 +197,7 @@ gst_fakesrc_update_functions (GstFakeSrc *src)
}
static void
gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFakeSrc *src;
gint new_numsrcs;
@ -201,9 +206,9 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
/* it's not null if we got it, but it might not be ours */
src = GST_FAKESRC (object);
switch(id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
new_numsrcs = GTK_VALUE_INT (*arg);
new_numsrcs = g_value_get_int (value);
if (new_numsrcs > src->numsrcpads) {
while (src->numsrcpads != new_numsrcs) {
pad = gst_pad_new(g_strdup_printf("src%d",src->numsrcpads),GST_PAD_SRC);
@ -215,7 +220,7 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_LOOP_BASED:
src->loop_based = GTK_VALUE_BOOL (*arg);
src->loop_based = g_value_get_boolean (value);
gst_fakesrc_update_functions (src);
break;
case ARG_OUTPUT:
@ -223,14 +228,14 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
case ARG_PATTERN:
break;
case ARG_NUM_BUFFERS:
src->num_buffers = GTK_VALUE_INT (*arg);
src->num_buffers = g_value_get_int (value);
break;
case ARG_EOS:
src->eos = GTK_VALUE_BOOL (*arg);
src->eos = g_value_get_boolean (value);
GST_INFO (0, "will EOS on next buffer");
break;
case ARG_SILENT:
src->silent = GTK_VALUE_BOOL (*arg);
src->silent = g_value_get_boolean (value);
break;
default:
break;
@ -238,7 +243,7 @@ GST_INFO (0, "will EOS on next buffer");
}
static void
gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFakeSrc *src;
@ -247,29 +252,30 @@ gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_FAKESRC (object);
switch (id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
GTK_VALUE_INT (*arg) = src->numsrcpads;
g_value_set_int (value, src->numsrcpads);
break;
case ARG_LOOP_BASED:
GTK_VALUE_BOOL (*arg) = src->loop_based;
g_value_set_boolean (value, src->loop_based);
break;
case ARG_OUTPUT:
GTK_VALUE_INT (*arg) = src->output;
g_value_set_int (value, src->output);
break;
case ARG_PATTERN:
GTK_VALUE_STRING (*arg) = src->pattern;
g_value_set_string (value, src->pattern);
break;
case ARG_NUM_BUFFERS:
GTK_VALUE_INT (*arg) = src->num_buffers;
g_value_set_int (value, src->num_buffers);
break;
case ARG_EOS:
GTK_VALUE_BOOL (*arg) = src->eos;
g_value_set_boolean (value, src->eos);
break;
case ARG_SILENT:
GTK_VALUE_BOOL (*arg) = src->silent;
g_value_set_boolean (value, src->silent);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -314,7 +320,7 @@ gst_fakesrc_get(GstPad *pad)
g_print("fakesrc: ******* (%s:%s)> \n",GST_DEBUG_PAD_NAME(pad));
buf = gst_buffer_new();
gtk_signal_emit (GTK_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
buf);
return buf;
@ -364,7 +370,7 @@ gst_fakesrc_loop(GstElement *element)
if (!src->silent)
g_print("fakesrc: ******* (%s:%s)> \n",GST_DEBUG_PAD_NAME(pad));
gtk_signal_emit (GTK_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
buf);
gst_pad_push (pad, buf);

View file

@ -50,13 +50,13 @@ typedef enum {
#define GST_TYPE_FAKESRC \
(gst_fakesrc_get_type())
#define GST_FAKESRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
#define GST_FAKESRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
#define GST_IS_FAKESRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_FAKESRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESRC))
#define GST_IS_FAKESRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
typedef struct _GstFakeSrc GstFakeSrc;
typedef struct _GstFakeSrcClass GstFakeSrcClass;
@ -82,7 +82,7 @@ struct _GstFakeSrcClass {
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
GtkType gst_fakesrc_get_type(void);
GType gst_fakesrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -49,31 +49,31 @@ enum {
static void gst_fdsink_class_init (GstFdSinkClass *klass);
static void gst_fdsink_init (GstFdSink *fdsink);
static void gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fdsink_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fdsink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fdsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_fdsink_chain (GstPad *pad,GstBuffer *buf);
static GstElementClass *parent_class = NULL;
//static guint gst_fdsink_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fdsink_get_type (void)
{
static GtkType fdsink_type = 0;
static GType fdsink_type = 0;
if (!fdsink_type) {
static const GtkTypeInfo fdsink_info = {
"GstFdSink",
static const GTypeInfo fdsink_info = {
sizeof(GstFdSinkClass), NULL,
NULL,
(GClassInitFunc)gst_fdsink_class_init,
NULL,
NULL,
sizeof(GstFdSink),
sizeof(GstFdSinkClass),
(GtkClassInitFunc)gst_fdsink_class_init,
(GtkObjectInitFunc)gst_fdsink_init,
(GtkArgSetFunc)gst_fdsink_set_arg,
(GtkArgGetFunc)gst_fdsink_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_fdsink_init,
};
fdsink_type = gtk_type_unique (GST_TYPE_ELEMENT, &fdsink_info);
fdsink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSink", &fdsink_info, 0);
}
return fdsink_type;
}
@ -81,17 +81,18 @@ gst_fdsink_get_type (void)
static void
gst_fdsink_class_init (GstFdSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFdSink::fd", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FD);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FD,
g_param_spec_int("fd","fd","fd",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_fdsink_set_arg;
gtkobject_class->get_arg = gst_fdsink_get_arg;
gobject_class->set_property = gst_fdsink_set_property;
gobject_class->get_property = gst_fdsink_get_property;
}
static void
@ -126,7 +127,7 @@ gst_fdsink_chain (GstPad *pad, GstBuffer *buf)
}
static void
gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fdsink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFdSink *fdsink;
@ -135,9 +136,9 @@ gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id)
fdsink = GST_FDSINK (object);
switch(id) {
switch (prop_id) {
case ARG_FD:
fdsink->fd = GTK_VALUE_INT (*arg);
fdsink->fd = g_value_get_int (value);
break;
default:
break;
@ -145,7 +146,7 @@ gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_fdsink_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fdsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFdSink *fdsink;
@ -154,9 +155,9 @@ gst_fdsink_get_arg (GtkObject *object, GtkArg *arg, guint id)
fdsink = GST_FDSINK (object);
switch(id) {
switch (prop_id) {
case ARG_FD:
GTK_VALUE_INT (*arg) = fdsink->fd;
g_value_set_int (value, fdsink->fd);
break;
default:
break;

View file

@ -40,13 +40,13 @@ GstElementDetails gst_fdsink_details;
#define GST_TYPE_FDSINK \
(gst_fdsink_get_type())
#define GST_FDSINK(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_FDSINK,GstFdSink))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FDSINK,GstFdSink))
#define GST_FDSINK_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_FDSINK,GstFdSinkClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FDSINK,GstFdSinkClass))
#define GST_IS_FDSINK(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_FDSINK))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FDSINK))
#define GST_IS_FDSINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSINK))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSINK))
typedef struct _GstFdSink GstFdSink;
typedef struct _GstFdSinkClass GstFdSinkClass;
@ -63,7 +63,7 @@ struct _GstFdSinkClass {
GstElementClass parent_class;
};
GtkType gst_fdsink_get_type(void);
GType gst_fdsink_get_type(void);
#ifdef __cplusplus

View file

@ -57,8 +57,8 @@ enum {
static void gst_fdsrc_class_init (GstFdSrcClass *klass);
static void gst_fdsrc_init (GstFdSrc *fdsrc);
static void gst_fdsrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fdsrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fdsrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fdsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer * gst_fdsrc_get (GstPad *pad);
@ -66,23 +66,23 @@ static GstBuffer * gst_fdsrc_get (GstPad *pad);
static GstElementClass *parent_class = NULL;
//static guint gst_fdsrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fdsrc_get_type (void)
{
static GtkType fdsrc_type = 0;
static GType fdsrc_type = 0;
if (!fdsrc_type) {
static const GtkTypeInfo fdsrc_info = {
"GstFdSrc",
static const GTypeInfo fdsrc_info = {
sizeof(GstFdSrcClass), NULL,
NULL,
(GClassInitFunc)gst_fdsrc_class_init,
NULL,
NULL,
sizeof(GstFdSrc),
sizeof(GstFdSrcClass),
(GtkClassInitFunc)gst_fdsrc_class_init,
(GtkObjectInitFunc)gst_fdsrc_init,
(GtkArgSetFunc)gst_fdsrc_set_arg,
(GtkArgGetFunc)gst_fdsrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_fdsrc_init,
};
fdsrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &fdsrc_info);
fdsrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSrc", &fdsrc_info, 0);
}
return fdsrc_type;
}
@ -90,21 +90,24 @@ gst_fdsrc_get_type (void)
static void
gst_fdsrc_class_init (GstFdSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class(GST_TYPE_ELEMENT);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFdSrc::location", GST_TYPE_FILENAME,
GTK_ARG_WRITABLE, ARG_LOCATION);
gtk_object_add_arg_type ("GstFdSrc::bytesperread", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_BYTESPERREAD);
gtk_object_add_arg_type ("GstFdSrc::offset", GTK_TYPE_INT,
GTK_ARG_READABLE, ARG_OFFSET);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_string("location","location","location",
"",G_PARAM_WRITABLE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BYTESPERREAD,
g_param_spec_int("bytesperread","bytesperread","bytesperread",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OFFSET,
g_param_spec_int("offset","offset","offset",
G_MININT,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME
gtkobject_class->set_arg = gst_fdsrc_set_arg;
gtkobject_class->get_arg = gst_fdsrc_get_arg;
gobject_class->set_property = gst_fdsrc_set_property;
gobject_class->get_property = gst_fdsrc_get_property;
}
static void gst_fdsrc_init(GstFdSrc *fdsrc) {
@ -120,7 +123,7 @@ static void gst_fdsrc_init(GstFdSrc *fdsrc) {
static void
gst_fdsrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fdsrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFdSrc *src;
int fd;
@ -130,23 +133,23 @@ gst_fdsrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_FDSRC (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATION:
/* the element must not be playing in order to do this */
g_return_if_fail (GST_STATE (src) < GST_STATE_PLAYING);
/* if we get a NULL, consider it to be a fd of 0 */
if (GTK_VALUE_STRING (*arg) == NULL) {
if (g_value_get_string (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
src->fd = 0;
/* otherwise set the new filename */
} else {
if (sscanf (GTK_VALUE_STRING (*arg), "%d", &fd))
if (sscanf (g_value_get_string (value), "%d", &fd))
src->fd = fd;
}
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = GTK_VALUE_INT (*arg);
src->bytes_per_read = g_value_get_int (value);
break;
default:
break;
@ -154,7 +157,7 @@ gst_fdsrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_fdsrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fdsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFdSrc *src;
@ -163,15 +166,15 @@ gst_fdsrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_FDSRC (object);
switch (id) {
switch (prop_id) {
case ARG_BYTESPERREAD:
GTK_VALUE_INT (*arg) = src->bytes_per_read;
g_value_set_int (value, src->bytes_per_read);
break;
case ARG_OFFSET:
GTK_VALUE_INT (*arg) = src->curoffset;
g_value_set_int (value, src->curoffset);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -40,13 +40,13 @@ GstElementDetails gst_fdsrc_details;
#define GST_TYPE_FDSRC \
(gst_fdsrc_get_type())
#define GST_FDSRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_FDSRC,GstFdSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FDSRC,GstFdSrc))
#define GST_FDSRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_FDSRC,GstFdSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FDSRC,GstFdSrcClass))
#define GST_IS_FDSRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_FDSRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FDSRC))
#define GST_IS_FDSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSRC))
typedef struct _GstFdSrc GstFdSrc;
@ -70,7 +70,7 @@ struct _GstFdSrcClass {
GstElementClass parent_class;
};
GtkType gst_fdsrc_get_type(void);
GType gst_fdsrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -54,8 +54,8 @@ enum {
static void gst_httpsrc_class_init (GstHttpSrcClass *klass);
static void gst_httpsrc_init (GstHttpSrc *httpsrc);
static void gst_httpsrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_httpsrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_httpsrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_httpsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstElementStateReturn gst_httpsrc_change_state (GstElement *element);
static GstBuffer * gst_httpsrc_get (GstPad *pad);
@ -67,23 +67,23 @@ static void gst_httpsrc_close_url (GstHttpSrc *src);
static GstElementClass *parent_class = NULL;
//static guint gst_httpsrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_httpsrc_get_type (void)
{
static GtkType httpsrc_type = 0;
static GType httpsrc_type = 0;
if (!httpsrc_type) {
static const GtkTypeInfo httpsrc_info = {
"GstHttpSrc",
static const GTypeInfo httpsrc_info = {
sizeof(GstHttpSrcClass), NULL,
NULL,
(GClassInitFunc)gst_httpsrc_class_init,
NULL,
NULL,
sizeof(GstHttpSrc),
sizeof(GstHttpSrcClass),
(GtkClassInitFunc)gst_httpsrc_class_init,
(GtkObjectInitFunc)gst_httpsrc_init,
(GtkArgSetFunc)gst_httpsrc_set_arg,
(GtkArgGetFunc)gst_httpsrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_httpsrc_init,
};
httpsrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &httpsrc_info);
httpsrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstHttpSrc", &httpsrc_info, 0);
}
return httpsrc_type;
}
@ -91,22 +91,24 @@ gst_httpsrc_get_type (void)
static void
gst_httpsrc_class_init (GstHttpSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstHttpSrc::location", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_LOCATION);
gtk_object_add_arg_type ("GstHttpSrc::bytesperread", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_BYTESPERREAD);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_string("location","location","location",
NULL, G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BYTESPERREAD,
g_param_spec_int("bytesperread","bytesperread","bytesperread",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_httpsrc_set_arg;
gtkobject_class->get_arg = gst_httpsrc_get_arg;
gobject_class->set_property = gst_httpsrc_set_property;
gobject_class->get_property = gst_httpsrc_get_property;
gstelement_class->change_state = gst_httpsrc_change_state;
}
@ -197,7 +199,7 @@ gst_httpsrc_close_url (GstHttpSrc *src)
}
static void
gst_httpsrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_httpsrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstHttpSrc *src;
@ -206,23 +208,23 @@ gst_httpsrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_HTTPSRC (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATION:
/* the element must not be playing in order to do this */
g_return_if_fail (GST_STATE (src) < GST_STATE_PLAYING);
if (src->url) g_free (src->url);
/* clear the url if we get a NULL (is that possible?) */
if (GTK_VALUE_STRING (*arg) == NULL) {
if (g_value_get_string (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object),GST_STATE_NULL);
src->url = NULL;
/* otherwise set the new url */
} else {
src->url = g_strdup (GTK_VALUE_STRING (*arg));
src->url = g_strdup (g_value_get_string (value));
}
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = GTK_VALUE_INT (*arg);
src->bytes_per_read = g_value_get_int (value);
break;
default:
break;
@ -230,7 +232,7 @@ gst_httpsrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_httpsrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_httpsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstHttpSrc *httpsrc;
@ -239,15 +241,15 @@ gst_httpsrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
httpsrc = GST_HTTPSRC (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATION:
GTK_VALUE_STRING (*arg) = httpsrc->url;
g_value_set_string (value, httpsrc->url);
break;
case ARG_BYTESPERREAD:
GTK_VALUE_INT (*arg) = httpsrc->bytes_per_read;
g_value_set_int (value, httpsrc->bytes_per_read);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -42,13 +42,13 @@ GstElementDetails gst_httpsrc_details;
#define GST_TYPE_HTTPSRC \
(gst_httpsrc_get_type())
#define GST_HTTPSRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_HTTPSRC,GstHttpSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_HTTPSRC,GstHttpSrc))
#define GST_HTTPSRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_HTTPSRC,GstHttpSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_HTTPSRC,GstHttpSrcClass))
#define GST_IS_HTTPSRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_HTTPSRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_HTTPSRC))
#define GST_IS_HTTPSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_HTTPSRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_HTTPSRC))
typedef enum {
GST_HTTPSRC_OPEN = GST_ELEMENT_FLAG_LAST,
@ -76,7 +76,7 @@ struct _GstHttpSrcClass {
GstElementClass parent_class;
};
GtkType gst_httpsrc_get_type(void);
GType gst_httpsrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -51,31 +51,31 @@ enum {
static void gst_identity_class_init (GstIdentityClass *klass);
static void gst_identity_init (GstIdentity *identity);
static void gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_identity_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_identity_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_identity_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_identity_chain (GstPad *pad, GstBuffer *buf);
static GstElementClass *parent_class = NULL;
//static guint gst_identity_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_identity_get_type (void)
{
static GtkType identity_type = 0;
static GType identity_type = 0;
if (!identity_type) {
static const GtkTypeInfo identity_info = {
"GstIdentity",
static const GTypeInfo identity_info = {
sizeof(GstIdentityClass), NULL,
NULL,
(GClassInitFunc)gst_identity_class_init,
NULL,
NULL,
sizeof(GstIdentity),
sizeof(GstIdentityClass),
(GtkClassInitFunc)gst_identity_class_init,
(GtkObjectInitFunc)gst_identity_init,
(GtkArgSetFunc)gst_identity_set_arg,
(GtkArgGetFunc)gst_identity_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_identity_init,
};
identity_type = gtk_type_unique (GST_TYPE_ELEMENT, &identity_info);
identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIdentity", &identity_info, 0);
}
return identity_type;
}
@ -83,21 +83,24 @@ gst_identity_get_type (void)
static void
gst_identity_class_init (GstIdentityClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstIdentity::loop_based", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_LOOP_BASED);
gtk_object_add_arg_type ("GstIdentity::sleep_time", GTK_TYPE_UINT,
GTK_ARG_READWRITE, ARG_SLEEP_TIME);
gtk_object_add_arg_type ("GstIdentity::silent", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_SILENT);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
g_param_spec_boolean("loop_based","loop_based","loop_based",
TRUE,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SLEEP_TIME,
g_param_spec_uint("sleep_time","sleep_time","sleep_time",
0,G_MAXUINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
g_param_spec_boolean("silent","silent","silent",
TRUE,G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_identity_set_arg;
gtkobject_class->get_arg = gst_identity_get_arg;
gobject_class->set_property = gst_identity_set_property;
gobject_class->get_property = gst_identity_get_property;
}
static GstBufferPool*
@ -193,7 +196,7 @@ gst_identity_loop (GstElement *element)
}
static void
gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_identity_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstIdentity *identity;
@ -202,9 +205,9 @@ gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
identity = GST_IDENTITY (object);
switch(id) {
switch (prop_id) {
case ARG_LOOP_BASED:
identity->loop_based = GTK_VALUE_BOOL (*arg);
identity->loop_based = g_value_get_boolean (value);
if (identity->loop_based) {
gst_element_set_loop_function (GST_ELEMENT (identity), gst_identity_loop);
gst_pad_set_chain_function (identity->sinkpad, NULL);
@ -215,17 +218,17 @@ gst_identity_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_SLEEP_TIME:
identity->sleep_time = GTK_VALUE_UINT (*arg);
identity->sleep_time = g_value_get_uint (value);
break;
case ARG_SILENT:
identity->silent = GTK_VALUE_BOOL (*arg);
identity->silent = g_value_get_boolean (value);
break;
default:
break;
}
}
static void gst_identity_get_arg(GtkObject *object,GtkArg *arg,guint id) {
static void gst_identity_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) {
GstIdentity *identity;
/* it's not null if we got it, but it might not be ours */
@ -233,18 +236,18 @@ static void gst_identity_get_arg(GtkObject *object,GtkArg *arg,guint id) {
identity = GST_IDENTITY (object);
switch (id) {
switch (prop_id) {
case ARG_LOOP_BASED:
GTK_VALUE_BOOL (*arg) = identity->loop_based;
g_value_set_boolean (value, identity->loop_based);
break;
case ARG_SLEEP_TIME:
GTK_VALUE_UINT (*arg) = identity->sleep_time;
g_value_set_uint (value, identity->sleep_time);
break;
case ARG_SILENT:
GTK_VALUE_BOOL (*arg) = identity->silent;
g_value_set_boolean (value, identity->silent);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -40,13 +40,13 @@ GstElementDetails gst_identity_details;
#define GST_TYPE_IDENTITY \
(gst_identity_get_type())
#define GST_IDENTITY(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_IDENTITY,GstIdentity))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_IDENTITY,GstIdentity))
#define GST_IDENTITY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_IDENTITY,GstIdentityClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_IDENTITY,GstIdentityClass))
#define GST_IS_IDENTITY(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_IDENTITY))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_IDENTITY))
#define GST_IS_IDENTITY_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_IDENTITY))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_IDENTITY))
typedef struct _GstIdentity GstIdentity;
typedef struct _GstIdentityClass GstIdentityClass;
@ -67,7 +67,7 @@ struct _GstIdentityClass {
GstElementClass parent_class;
};
GtkType gst_identity_get_type(void);
GType gst_identity_get_type(void);
#ifdef __cplusplus

View file

@ -54,8 +54,8 @@ enum {
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
static void gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_multidisksrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer * gst_multidisksrc_get (GstPad *pad);
//static GstBuffer * gst_multidisksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);
@ -68,23 +68,23 @@ static void gst_multidisksrc_close_file (GstMultiDiskSrc *src);
static GstElementClass *parent_class = NULL;
static guint gst_multidisksrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_multidisksrc_get_type(void)
{
static GtkType multidisksrc_type = 0;
static GType multidisksrc_type = 0;
if (!multidisksrc_type) {
static const GtkTypeInfo multidisksrc_info = {
"GstMultiDiskSrc",
static const GTypeInfo multidisksrc_info = {
sizeof(GstMultiDiskSrcClass), NULL,
NULL,
(GClassInitFunc)gst_multidisksrc_class_init,
NULL,
NULL,
sizeof(GstMultiDiskSrc),
sizeof(GstMultiDiskSrcClass),
(GtkClassInitFunc)gst_multidisksrc_class_init,
(GtkObjectInitFunc)gst_multidisksrc_init,
(GtkArgSetFunc)gst_multidisksrc_set_arg,
(GtkArgGetFunc)gst_multidisksrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_multidisksrc_init,
};
multidisksrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &multidisksrc_info);
multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0);
}
return multidisksrc_type;
}
@ -92,26 +92,26 @@ gst_multidisksrc_get_type(void)
static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gst_multidisksrc_signals[NEW_FILE] =
gtk_signal_new ("new_file", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstMultiDiskSrcClass, new_file),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_multidisksrc_signals, LAST_SIGNAL);
g_signal_newc ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiDiskSrcClass, new_file), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_add_arg_type ("GstMultiDiskSrc::locations", GTK_TYPE_POINTER,
GTK_ARG_READWRITE, ARG_LOCATIONS);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATIONS,
g_param_spec_string("locations","locations","locations",
NULL, G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_multidisksrc_set_arg;
gtkobject_class->get_arg = gst_multidisksrc_get_arg;
gobject_class->set_property = gst_multidisksrc_set_property;
gobject_class->get_property = gst_multidisksrc_get_property;
gstelement_class->change_state = gst_multidisksrc_change_state;
}
@ -135,7 +135,7 @@ gst_multidisksrc_init (GstMultiDiskSrc *multidisksrc)
}
static void
gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstMultiDiskSrc *src;
@ -144,18 +144,18 @@ gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_MULTIDISKSRC (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATIONS:
/* the element must be stopped in order to do this */
g_return_if_fail (GST_STATE (src) < GST_STATE_PLAYING);
/* clear the filename if we get a NULL */
if (GTK_VALUE_POINTER (*arg) == NULL) {
if (g_value_get_pointer (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
src->listptr = NULL;
/* otherwise set the new filenames */
} else {
src->listptr = GTK_VALUE_POINTER(*arg);
src->listptr = g_value_get_pointer (value);
}
break;
default:
@ -164,7 +164,7 @@ gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_multidisksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstMultiDiskSrc *src;
@ -173,12 +173,12 @@ gst_multidisksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_MULTIDISKSRC (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATIONS:
GTK_VALUE_POINTER (*arg) = src->listptr;
g_value_set_pointer (value, src->listptr);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -215,7 +215,7 @@ gst_multidisksrc_get (GstPad *pad)
return NULL;
// emitted after the open, as the user may free the list and string from here
gtk_signal_emit(GTK_OBJECT(src), gst_multidisksrc_signals[NEW_FILE], list);
g_signal_emit(G_OBJECT(src), gst_multidisksrc_signals[NEW_FILE], 0, list);
/* create the buffer */
// FIXME: should eventually use a bufferpool for this

View file

@ -35,13 +35,13 @@ GstElementDetails gst_multidisksrc_details;
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())
#define GST_MULTIDISKSRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrc))
#define GST_MULTIDISKSRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrcClass))
#define GST_IS_MULTIDISKSRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_MULTIDISKSRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIDISKSRC))
#define GST_IS_MULTIDISKSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIDISKSRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIDISKSRC))
typedef enum {
GST_MULTIDISKSRC_OPEN = GST_ELEMENT_FLAG_LAST,
@ -75,7 +75,7 @@ struct _GstMultiDiskSrcClass {
void (*new_file) (GstMultiDiskSrc *multidisksrc, gchar *newfilename);
};
GtkType gst_multidisksrc_get_type(void);
GType gst_multidisksrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -54,8 +54,8 @@ enum {
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
static void gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_multidisksrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer * gst_multidisksrc_get (GstPad *pad);
//static GstBuffer * gst_multidisksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);
@ -68,23 +68,23 @@ static void gst_multidisksrc_close_file (GstMultiDiskSrc *src);
static GstElementClass *parent_class = NULL;
static guint gst_multidisksrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_multidisksrc_get_type(void)
{
static GtkType multidisksrc_type = 0;
static GType multidisksrc_type = 0;
if (!multidisksrc_type) {
static const GtkTypeInfo multidisksrc_info = {
"GstMultiDiskSrc",
static const GTypeInfo multidisksrc_info = {
sizeof(GstMultiDiskSrcClass), NULL,
NULL,
(GClassInitFunc)gst_multidisksrc_class_init,
NULL,
NULL,
sizeof(GstMultiDiskSrc),
sizeof(GstMultiDiskSrcClass),
(GtkClassInitFunc)gst_multidisksrc_class_init,
(GtkObjectInitFunc)gst_multidisksrc_init,
(GtkArgSetFunc)gst_multidisksrc_set_arg,
(GtkArgGetFunc)gst_multidisksrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_multidisksrc_init,
};
multidisksrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &multidisksrc_info);
multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0);
}
return multidisksrc_type;
}
@ -92,26 +92,26 @@ gst_multidisksrc_get_type(void)
static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gst_multidisksrc_signals[NEW_FILE] =
gtk_signal_new ("new_file", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstMultiDiskSrcClass, new_file),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_multidisksrc_signals, LAST_SIGNAL);
g_signal_newc ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiDiskSrcClass, new_file), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_add_arg_type ("GstMultiDiskSrc::locations", GTK_TYPE_POINTER,
GTK_ARG_READWRITE, ARG_LOCATIONS);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATIONS,
g_param_spec_string("locations","locations","locations",
NULL, G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_multidisksrc_set_arg;
gtkobject_class->get_arg = gst_multidisksrc_get_arg;
gobject_class->set_property = gst_multidisksrc_set_property;
gobject_class->get_property = gst_multidisksrc_get_property;
gstelement_class->change_state = gst_multidisksrc_change_state;
}
@ -135,7 +135,7 @@ gst_multidisksrc_init (GstMultiDiskSrc *multidisksrc)
}
static void
gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstMultiDiskSrc *src;
@ -144,18 +144,18 @@ gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_MULTIDISKSRC (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATIONS:
/* the element must be stopped in order to do this */
g_return_if_fail (GST_STATE (src) < GST_STATE_PLAYING);
/* clear the filename if we get a NULL */
if (GTK_VALUE_POINTER (*arg) == NULL) {
if (g_value_get_pointer (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
src->listptr = NULL;
/* otherwise set the new filenames */
} else {
src->listptr = GTK_VALUE_POINTER(*arg);
src->listptr = g_value_get_pointer (value);
}
break;
default:
@ -164,7 +164,7 @@ gst_multidisksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_multidisksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstMultiDiskSrc *src;
@ -173,12 +173,12 @@ gst_multidisksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_MULTIDISKSRC (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATIONS:
GTK_VALUE_POINTER (*arg) = src->listptr;
g_value_set_pointer (value, src->listptr);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -215,7 +215,7 @@ gst_multidisksrc_get (GstPad *pad)
return NULL;
// emitted after the open, as the user may free the list and string from here
gtk_signal_emit(GTK_OBJECT(src), gst_multidisksrc_signals[NEW_FILE], list);
g_signal_emit(G_OBJECT(src), gst_multidisksrc_signals[NEW_FILE], 0, list);
/* create the buffer */
// FIXME: should eventually use a bufferpool for this

View file

@ -35,13 +35,13 @@ GstElementDetails gst_multidisksrc_details;
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())
#define GST_MULTIDISKSRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrc))
#define GST_MULTIDISKSRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrcClass))
#define GST_IS_MULTIDISKSRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_MULTIDISKSRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIDISKSRC))
#define GST_IS_MULTIDISKSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIDISKSRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIDISKSRC))
typedef enum {
GST_MULTIDISKSRC_OPEN = GST_ELEMENT_FLAG_LAST,
@ -75,7 +75,7 @@ struct _GstMultiDiskSrcClass {
void (*new_file) (GstMultiDiskSrc *multidisksrc, gchar *newfilename);
};
GtkType gst_multidisksrc_get_type(void);
GType gst_multidisksrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -59,8 +59,8 @@ enum {
static void gst_pipefilter_class_init (GstPipefilterClass *klass);
static void gst_pipefilter_init (GstPipefilter *pipefilter);
static void gst_pipefilter_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_pipefilter_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_pipefilter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_pipefilter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer* gst_pipefilter_get (GstPad *pad);
static void gst_pipefilter_chain (GstPad *pad, GstBuffer *buf);
@ -71,23 +71,23 @@ static GstElementStateReturn gst_pipefilter_change_state (GstElement *element);
static GstElementClass *parent_class = NULL;
//static guint gst_pipefilter_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_pipefilter_get_type (void)
{
static GtkType pipefilter_type = 0;
static GType pipefilter_type = 0;
if (!pipefilter_type) {
static const GtkTypeInfo pipefilter_info = {
"GstPipefilter",
static const GTypeInfo pipefilter_info = {
sizeof(GstPipefilterClass), NULL,
NULL,
(GClassInitFunc)gst_pipefilter_class_init,
NULL,
NULL,
sizeof(GstPipefilter),
sizeof(GstPipefilterClass),
(GtkClassInitFunc)gst_pipefilter_class_init,
(GtkObjectInitFunc)gst_pipefilter_init,
(GtkArgSetFunc)gst_pipefilter_set_arg,
(GtkArgGetFunc)gst_pipefilter_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_pipefilter_init,
};
pipefilter_type = gtk_type_unique(GST_TYPE_ELEMENT,&pipefilter_info);
pipefilter_type = g_type_register_static(GST_TYPE_ELEMENT, "GstPipefilter", &pipefilter_info, 0);
}
return pipefilter_type;
}
@ -95,21 +95,22 @@ gst_pipefilter_get_type (void)
static void
gst_pipefilter_class_init (GstPipefilterClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class(GST_TYPE_ELEMENT);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
gstelement_class->change_state = gst_pipefilter_change_state;
gtk_object_add_arg_type("GstPipefilter::command", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_COMMAND);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_COMMAND,
g_param_spec_string("command","command","command",
NULL, G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_pipefilter_set_arg;
gtkobject_class->get_arg = gst_pipefilter_get_arg;
gobject_class->set_property = gst_pipefilter_set_property;
gobject_class->get_property = gst_pipefilter_get_property;
}
static void
@ -219,7 +220,7 @@ gst_pipefilter_chain (GstPad *pad,GstBuffer *buf)
}
static void
gst_pipefilter_set_arg (GtkObject *object,GtkArg *arg,guint id)
gst_pipefilter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstPipefilter *pipefilter;
@ -227,10 +228,10 @@ gst_pipefilter_set_arg (GtkObject *object,GtkArg *arg,guint id)
g_return_if_fail(GST_IS_PIPEFILTER(object));
pipefilter = GST_PIPEFILTER(object);
switch(id) {
switch (prop_id) {
case ARG_COMMAND:
pipefilter->orig_command = g_strdup(GTK_VALUE_STRING(*arg));
pipefilter->command = g_strsplit(GTK_VALUE_STRING(*arg), " ", 0);
pipefilter->orig_command = g_strdup(g_value_get_string (value));
pipefilter->command = g_strsplit(g_value_get_string (value), " ", 0);
break;
default:
break;
@ -238,7 +239,7 @@ gst_pipefilter_set_arg (GtkObject *object,GtkArg *arg,guint id)
}
static void
gst_pipefilter_get_arg (GtkObject *object,GtkArg *arg,guint id)
gst_pipefilter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstPipefilter *pipefilter;
@ -246,12 +247,12 @@ gst_pipefilter_get_arg (GtkObject *object,GtkArg *arg,guint id)
g_return_if_fail(GST_IS_PIPEFILTER(object));
pipefilter = GST_PIPEFILTER(object);
switch (id) {
switch (prop_id) {
case ARG_COMMAND:
GTK_VALUE_STRING(*arg) = pipefilter->orig_command;
g_value_set_string (value, pipefilter->orig_command);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -39,13 +39,13 @@ GstElementDetails gst_pipefilter_details;
#define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type())
#define GST_PIPEFILTER(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_PIPEFILTER,GstPipefilter))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PIPEFILTER,GstPipefilter))
#define GST_PIPEFILTER_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_PIPEFILTER,GstPipefilterClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PIPEFILTER,GstPipefilterClass))
#define GST_IS_PIPEFILTER(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_PIPEFILTER))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIPEFILTER))
#define GST_IS_PIPEFILTER_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPEFILTER))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPEFILTER))
typedef enum {
GST_PIPEFILTER_OPEN = GST_ELEMENT_FLAG_LAST,
@ -80,7 +80,7 @@ struct _GstPipefilterClass {
GstElementClass parent_class;
};
GtkType gst_pipefilter_get_type(void);
GType gst_pipefilter_get_type(void);
#ifdef __cplusplus

View file

@ -83,8 +83,8 @@ static GstPadTemplate *src_temp;
static void gst_sinesrc_class_init(GstSineSrcClass *klass);
static void gst_sinesrc_init(GstSineSrc *src);
static GstPadNegotiateReturn gst_sinesrc_negotiate (GstPad *pad, GstCaps **caps, gpointer *data);
static void gst_sinesrc_set_arg(GtkObject *object,GtkArg *arg,guint id);
static void gst_sinesrc_get_arg(GtkObject *object,GtkArg *arg,guint id);
static void gst_sinesrc_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_sinesrc_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
//static gboolean gst_sinesrc_change_state(GstElement *element,
// GstElementState state);
//static void gst_sinesrc_close_audio(GstSineSrc *src);
@ -92,58 +92,64 @@ static void gst_sinesrc_get_arg(GtkObject *object,GtkArg *arg,guint id);
static void gst_sinesrc_populate_sinetable(GstSineSrc *src);
static inline void gst_sinesrc_update_table_inc(GstSineSrc *src);
static inline void gst_sinesrc_update_vol_scale(GstSineSrc *src);
void gst_sinesrc_force_caps(GstSineSrc *src);
static void gst_sinesrc_force_caps(GstSineSrc *src);
static GstBuffer * gst_sinesrc_get(GstPad *pad);
static GstElementClass *parent_class = NULL;
//static guint gst_sinesrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_sinesrc_get_type(void) {
static GtkType sinesrc_type = 0;
static GType sinesrc_type = 0;
if (!sinesrc_type) {
static const GtkTypeInfo sinesrc_info = {
"GstSineSrc",
static const GTypeInfo sinesrc_info = {
sizeof(GstSineSrcClass), NULL,
NULL,
(GClassInitFunc)gst_sinesrc_class_init,
NULL,
NULL,
sizeof(GstSineSrc),
sizeof(GstSineSrcClass),
(GtkClassInitFunc)gst_sinesrc_class_init,
(GtkObjectInitFunc)gst_sinesrc_init,
(GtkArgSetFunc)gst_sinesrc_set_arg,
(GtkArgGetFunc)gst_sinesrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_sinesrc_init,
};
sinesrc_type = gtk_type_unique(GST_TYPE_ELEMENT,&sinesrc_info);
sinesrc_type = g_type_register_static(GST_TYPE_ELEMENT, "GstSineSrc", &sinesrc_info, 0);
}
return sinesrc_type;
}
static void
gst_sinesrc_class_init(GstSineSrcClass *klass) {
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class(GST_TYPE_ELEMENT);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
gtk_object_add_arg_type("GstSineSrc::volume", GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE, ARG_VOLUME);
gtk_object_add_arg_type("GstSineSrc::format", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FORMAT);
gtk_object_add_arg_type("GstSineSrc::samplerate", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_SAMPLERATE);
gtk_object_add_arg_type("GstSineSrc::tablesize", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_TABLESIZE);
gtk_object_add_arg_type("GstSineSrc::freq", GTK_TYPE_DOUBLE,
GTK_ARG_READWRITE, ARG_FREQ);
gtk_object_add_arg_type("GstSineSrc::buffersize", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_BUFFER_SIZE);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_VOLUME,
g_param_spec_double("volume","volume","volume",
0.0, 1.0, 0.0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FORMAT,
g_param_spec_int("format","format","format",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SAMPLERATE,
g_param_spec_int("samplerate","samplerate","samplerate",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_TABLESIZE,
g_param_spec_int("tablesize","tablesize","tablesize",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FREQ,
g_param_spec_double("freq","freq","freq",
0.0,G_MAXDOUBLE, 440.0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BUFFER_SIZE,
g_param_spec_int("buffersize","buffersize","buffersize",
0, G_MAXINT, 1024, G_PARAM_READWRITE));
gtkobject_class->set_arg = gst_sinesrc_set_arg;
gtkobject_class->get_arg = gst_sinesrc_get_arg;
gobject_class->set_property = gst_sinesrc_set_property;
gobject_class->get_property = gst_sinesrc_get_property;
// gstelement_class->change_state = gst_sinesrc_change_state;
}
@ -246,42 +252,40 @@ gst_sinesrc_get(GstPad *pad)
}
static void
gst_sinesrc_set_arg(GtkObject *object,GtkArg *arg,guint id) {
gst_sinesrc_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) {
GstSineSrc *src;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail(GST_IS_SINESRC(object));
src = GST_SINESRC(object);
switch (id) {
switch (prop_id) {
case ARG_VOLUME:
if (GTK_VALUE_DOUBLE(*arg) < 0.0 || GTK_VALUE_DOUBLE(*arg) > 1.0)
break;
src->volume = GTK_VALUE_DOUBLE(*arg);
src->volume = g_value_get_double (value);
gst_sinesrc_update_vol_scale(src);
break;
case ARG_FORMAT:
src->format = GTK_VALUE_INT(*arg);
src->format = g_value_get_int (value);
src->newcaps=TRUE;
break;
case ARG_SAMPLERATE:
src->samplerate = GTK_VALUE_INT(*arg);
src->samplerate = g_value_get_int (value);
src->newcaps=TRUE;
gst_sinesrc_update_table_inc(src);
break;
case ARG_FREQ: {
if (GTK_VALUE_DOUBLE(*arg) <= 0.0 || GTK_VALUE_DOUBLE(*arg) > src->samplerate/2)
if (g_value_get_double (value) <= 0.0 || g_value_get_double (value) > src->samplerate/2)
break;
src->freq = GTK_VALUE_DOUBLE(*arg);
src->freq = g_value_get_double (value);
gst_sinesrc_update_table_inc(src);
break;
case ARG_TABLESIZE:
src->table_size = GTK_VALUE_INT(*arg);
src->table_size = g_value_get_int (value);
gst_sinesrc_populate_sinetable(src);
gst_sinesrc_update_table_inc(src);
break;
case ARG_BUFFER_SIZE:
src->buffer_size = GTK_VALUE_INT(*arg);
src->buffer_size = g_value_get_int (value);
break;
}
default:
@ -290,34 +294,34 @@ gst_sinesrc_set_arg(GtkObject *object,GtkArg *arg,guint id) {
}
static void
gst_sinesrc_get_arg(GtkObject *object,GtkArg *arg,guint id) {
gst_sinesrc_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) {
GstSineSrc *src;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail(GST_IS_SINESRC(object));
src = GST_SINESRC(object);
switch (id) {
switch (prop_id) {
case ARG_VOLUME:
GTK_VALUE_DOUBLE(*arg) = src->volume;
g_value_set_double (value, src->volume);
break;
case ARG_FORMAT:
GTK_VALUE_INT(*arg) = src->format;
g_value_set_int (value, src->format);
break;
case ARG_SAMPLERATE:
GTK_VALUE_INT(*arg) = src->samplerate;
g_value_set_int (value, src->samplerate);
break;
case ARG_FREQ:
GTK_VALUE_DOUBLE(*arg) = src->freq;
g_value_set_double (value, src->freq);
break;
case ARG_TABLESIZE:
GTK_VALUE_INT(*arg) = src->table_size;
g_value_set_int (value, src->table_size);
break;
case ARG_BUFFER_SIZE:
GTK_VALUE_INT(*arg) = src->buffer_size;
g_value_set_int (value, src->buffer_size);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -372,7 +376,7 @@ gst_sinesrc_update_vol_scale(GstSineSrc *src)
src->vol_scale = 32767 * src->volume;
}
void
static void
gst_sinesrc_force_caps(GstSineSrc *src) {
GstCaps *caps;

View file

@ -39,13 +39,13 @@ GstElementDetails gst_sinesrc_details;
#define GST_TYPE_SINESRC \
(gst_sinesrc_get_type())
#define GST_SINESRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_SINESRC,GstSineSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SINESRC,GstSineSrc))
#define GST_SINESRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_SINESRC,GstSineSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SINESRC,GstSineSrcClass))
#define GST_IS_SINESRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_SINESRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SINESRC))
#define GST_IS_SINESRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_SINESRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SINESRC))
typedef struct _GstSineSrc GstSineSrc;
typedef struct _GstSineSrcClass GstSineSrcClass;
@ -85,7 +85,7 @@ struct _GstSineSrcClass {
GstElementClass parent_class;
};
GtkType gst_sinesrc_get_type(void);
GType gst_sinesrc_get_type(void);
gboolean gst_sinesrc_factory_init (GstElementFactory *factory);
#ifdef __cplusplus

View file

@ -63,7 +63,8 @@ static void gst_tee_init (GstTee *tee);
static GstPad* gst_tee_request_new_pad (GstElement *element, GstPadTemplate *temp);
static void gst_tee_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_tee_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_tee_chain (GstPad *pad, GstBuffer *buf);
@ -71,22 +72,22 @@ static GstElementClass *parent_class = NULL;
//static guint gst_tee_signals[LAST_SIGNAL] = { 0 };
static GstPadTemplate *gst_tee_src_template;
GtkType
GType
gst_tee_get_type(void) {
static GtkType tee_type = 0;
static GType tee_type = 0;
if (!tee_type) {
static const GtkTypeInfo tee_info = {
"GstTee",
static const GTypeInfo tee_info = {
sizeof(GstTeeClass), NULL,
NULL,
(GClassInitFunc)gst_tee_class_init,
NULL,
NULL,
sizeof(GstTee),
sizeof(GstTeeClass),
(GtkClassInitFunc)gst_tee_class_init,
(GtkObjectInitFunc)gst_tee_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_tee_init,
};
tee_type = gtk_type_unique (GST_TYPE_ELEMENT, &tee_info);
tee_type = g_type_register_static (GST_TYPE_ELEMENT, "GstTee", &tee_info, 0);
}
return tee_type;
}
@ -94,18 +95,20 @@ gst_tee_get_type(void) {
static void
gst_tee_class_init (GstTeeClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class(GST_TYPE_ELEMENT);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstTee::num_pads", GTK_TYPE_INT,
GTK_ARG_READABLE, ARG_NUM_PADS);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_PADS,
g_param_spec_int("num_pads","num_pads","num_pads",
G_MININT,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME
gtkobject_class->get_arg = gst_tee_get_arg;
gobject_class->set_property = gst_tee_set_property;
gobject_class->get_property = gst_tee_get_property;
gstelement_class->request_new_pad = gst_tee_request_new_pad;
}
@ -149,7 +152,7 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ)
}
static void
gst_tee_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstTee *tee;
@ -158,9 +161,28 @@ gst_tee_get_arg (GtkObject *object, GtkArg *arg, guint id)
tee = GST_TEE (object);
switch(id) {
switch (prop_id) {
// case ARG_NUM_PADS:
// g_value_set_int (value, tee->numsrcpads);
// break;
default:
break;
}
}
static void
gst_tee_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstTee *tee;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_TEE (object));
tee = GST_TEE (object);
switch (prop_id) {
case ARG_NUM_PADS:
GTK_VALUE_INT (*arg) = tee->numsrcpads;
g_value_set_int (value, tee->numsrcpads);
break;
default:
break;

View file

@ -36,13 +36,13 @@ extern GstElementDetails gst_tee_details;
#define GST_TYPE_TEE \
(gst_tee_get_type())
#define GST_TEE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_TEE,GstTee))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TEE,GstTee))
#define GST_TEE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_TEE,GstTeeClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TEE,GstTeeClass))
#define GST_IS_TEE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_TEE))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TEE))
#define GST_IS_TEE_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_TEE))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TEE))
typedef struct _GstTee GstTee;
typedef struct _GstTeeClass GstTeeClass;
@ -60,7 +60,7 @@ struct _GstTeeClass {
GstElementClass parent_class;
};
GtkType gst_tee_get_type (void);
GType gst_tee_get_type (void);
gboolean gst_tee_factory_init (GstElementFactory *factory);

294
gst/gobject2gtk.c Normal file
View file

@ -0,0 +1,294 @@
#include <stdio.h>
#include "gobject2gtk.h"
// GObject dummy implementation
static void
g_object_set_arg(GtkObject *object, GtkArg *arg, guint id)
{
((GObjectClass *)object->klass)->set_property((GObject *)object,id,arg,NULL);
}
static void
g_object_get_arg(GtkObject *object, GtkArg *arg, guint id)
{
((GObjectClass *)object->klass)->get_property((GObject *)object,id,arg,NULL);
}
static void
g_object_base_class_init (GObjectClass *klass)
{
GtkObjectClass *gtkobject_class;
gtkobject_class = (GtkObjectClass*) klass;
gtkobject_class->set_arg = g_object_set_arg;
gtkobject_class->get_arg = g_object_get_arg;
}
GType
g_object_get_type (void)
{
static GType object_type = 0;
if (!object_type) {
static const GtkTypeInfo object_info = {
"GObject",
sizeof(GObject),
sizeof(GObjectClass),
(GtkClassInitFunc)NULL,
(GtkObjectInitFunc)NULL,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)g_object_base_class_init,
};
object_type = gtk_type_unique(gtk_object_get_type(),&object_info);
}
return object_type;
}
guint
g_type_register_static (GtkType parent_type, gchar *type_name,
const GTypeInfo *info, guint flags)
{
GtkTypeInfo gtkinfo = {
type_name,
info->instance_size,
info->class_size,
info->class_init,
info->instance_init,
NULL,
NULL,
info->base_init,
};
return gtk_type_unique(parent_type,&gtkinfo);
}
gpointer
g_object_new(GtkType type,gpointer blah_varargs_stuff) {
return gtk_type_new(type);
}
void
g_object_class_install_property(GtkObjectClass *oclass,guint property_id,GParamSpec *pspec)
{
gchar *arg_fullname;
arg_fullname = g_strdup_printf("%s::%s",gtk_type_name(oclass->type),pspec->name);
//fprintf(stderr,"installing arg \"%s\" into class \"%s\"\n",arg_fullname,"");
gtk_object_add_arg_type(arg_fullname,pspec->value_type,pspec->flags,property_id);
g_free(pspec);
}
GParamSpec *
g_object_class_find_property(GtkObjectClass *class,gchar *name)
{
GtkArgInfo *info;
GParamSpec *spec;
//fprintf(stderr,"class name is %s\n",gtk_type_name(class->type));
gtk_object_arg_get_info(class->type,name,&info);
spec = g_new0(GParamSpec,1);
if (info) {
spec->name = name;
spec->value_type = info->type;
spec->flags = info->arg_flags;
} else {
spec->value_type = GTK_TYPE_NONE;
}
return spec;
}
GParamSpec **
g_object_class_list_properties(GtkObjectClass *oclass,guint *n_properties) {
GType type = G_OBJECT_CLASS_TYPE (oclass);
guint32 *flags;
GtkArg *args;
gint num_args;
GParamSpec **params;
int i;
args = gtk_object_query_args (type, &flags, &num_args);
params = g_new0(GParamSpec *,num_args);
for (i=0;i<num_args;i++) {
params[i] = g_new0(GParamSpec,1);
params[i]->name = args[i].name;
params[i]->value_type = args[i].type;
params[i]->flags = flags[i];
}
return params;
}
GParamSpec *
g_param_spec_boolean(gchar *name,gchar *nick,gchar *blurb,gboolean def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_BOOL;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_enum(gchar *name,gchar *nick,gchar *blurb,GtkType e,guint def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = e;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_int(gchar *name,gchar *nick,gchar *blurb,gint min,gint max,gint def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_INT;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_uint(gchar *name,gchar *nick,gchar *blurb,guint min,guint max,guint def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_UINT;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_long(gchar *name,gchar *nick,gchar *blurb,glong min,glong max,glong def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_LONG;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_ulong(gchar *name,gchar *nick,gchar *blurb,gulong min,gulong max,gulong def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_ULONG;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_float(gchar *name,gchar *nick,gchar *blurb,float min,float max,float def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_FLOAT;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_double(gchar *name,gchar *nick,gchar *blurb,double min,double max,double def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_DOUBLE;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_pointer(gchar *name,gchar *nick,gchar *blurb,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_POINTER;
spec->flags = flags;
return spec;
}
GParamSpec *
g_param_spec_string(gchar *name,gchar *nick,gchar *blurb,gchar *def,gint flags) {
GParamSpec *spec = g_new(GParamSpec,1);
spec->name = name;
spec->value_type = GTK_TYPE_STRING;
spec->flags = flags;
return spec;
}
guint
g_signal_newc (const gchar *name,
GtkType object_type,
GtkSignalRunType signal_flags,
guint function_offset,
gpointer accumulator, // GSignalAccumulator
gpointer accu_data,
GtkSignalMarshaller marshaller,
GType return_val,
guint nparams,
...)
{
GtkType *params;
guint i;
va_list args;
guint signal_id;
#define MAX_SIGNAL_PARAMS (31) // from gtksignal.c
g_return_val_if_fail (nparams < MAX_SIGNAL_PARAMS, 0);
if (nparams > 0)
{
params = g_new (GtkType, nparams);
va_start (args, nparams);
for (i = 0; i < nparams; i++)
params[i] = va_arg (args, GtkType);
va_end (args);
}
else
params = NULL;
signal_id = gtk_signal_newv (name,
signal_flags,
object_type,
function_offset,
marshaller,
return_val,
nparams,
params);
g_free (params);
// now register it.
gtk_object_class_add_signals(gtk_type_class(object_type), &signal_id, 1);
return signal_id;
}

326
gst/gobject2gtk.h Normal file
View file

@ -0,0 +1,326 @@
#include <gtk/gtk.h>
#define G_MAXUINT UINT_MAX
#define G_MAXULONG ULONG_MAX
#define g_object_ref(obj) gtk_object_ref((GtkObject *)(obj))
#define g_object_unref(obj) gtk_object_unref((GtkObject *)(obj))
// the helper macros for type checking
#define G_TYPE_CHECK_INSTANCE_CAST GTK_CHECK_CAST
#define G_TYPE_CHECK_INSTANCE_TYPE GTK_CHECK_TYPE
#define G_TYPE_CHECK_CLASS_CAST GTK_CHECK_CLASS_CAST
#define G_TYPE_CHECK_CLASS_TYPE GTK_CHECK_CLASS_TYPE
#define G_TYPE_FROM_CLASS(klass) (((GtkObjectClass *)(klass))->type)
#define G_OBJECT_GET_CLASS(object) (GTK_OBJECT(object)->klass)
#define G_OBJECT_TYPE GTK_OBJECT_TYPE
#define G_OBJECT_CLASS_TYPE(gclass) (gclass->type)
// types
#define G_TYPE_NONE GTK_TYPE_NONE
#define G_TYPE_CHAR GTK_TYPE_CHAR
#define G_TYPE_UCHAR GTK_TYPE_UCHAR
#define G_TYPE_BOOLEAN GTK_TYPE_BOOL
#define G_TYPE_INT GTK_TYPE_INT
#define G_TYPE_UINT GTK_TYPE_UINT
#define G_TYPE_LONG GTK_TYPE_LONG
#define G_TYPE_ULONG GTK_TYPE_ULONG
#define G_TYPE_ENUM GTK_TYPE_ENUM
#define G_TYPE_FLAGS GTK_TYPE_FLAGS
#define G_TYPE_FLOAT GTK_TYPE_FLOAT
#define G_TYPE_DOUBLE GTK_TYPE_DOUBLE
#define G_TYPE_STRING GTK_TYPE_STRING
#define G_TYPE_POINTER GTK_TYPE_POINTER
#define G_TYPE_BOXED GTK_TYPE_BOXED
#define G_TYPE_PARAM GTK_TYPE_PARAM
// marshallers
#define g_cclosure_marshal_VOID__VOID gtk_marshal_NONE__NONE
#define g_cclosure_marshal_VOID__BOOLEAN gtk_marshal_NONE__BOOL
#define g_cclosure_marshal_VOID__CHAR gtk_marshal_NONE__CHAR
#define g_cclosure_marshal_VOID__UCHAR gtk_marshal_NONE__UCHAR
#define g_cclosure_marshal_VOID__INT gtk_marshal_NONE__INT
#define g_cclosure_marshal_VOID__UINT gtk_marshal_NONE__UINT
#define g_cclosure_marshal_VOID__LONG gtk_marshal_NONE__LONG
#define g_cclosure_marshal_VOID__ULONG gtk_marshal_NONE__ULONG
#define g_cclosure_marshal_VOID__ENUM gtk_marshal_NONE__ENUM
#define g_cclosure_marshal_VOID__FLAGS gtk_marshal_NONE__FLAGS
#define g_cclosure_marshal_VOID__FLOAT gtk_marshal_NONE__FLOAT
#define g_cclosure_marshal_VOID__DOUBLE gtk_marshal_NONE__DOUBLE
#define g_cclosure_marshal_VOID__STRING gtk_marshal_NONE__STRING
#define g_cclosure_marshal_VOID__PARAM gtk_marshal_NONE__PARAM
#define g_cclosure_marshal_VOID__BOXED gtk_marshal_NONE__BOXED
#define g_cclosure_marshal_VOID__POINTER gtk_marshal_NONE__POINTER
#define g_cclosure_marshal_VOID__OBJECT gtk_marshal_NONE__OBJECT
#define g_cclosure_marshal_STRING__OBJECT_POINTER gtk_marshal_STRING__OBJECT_POINTER
#define g_cclosure_marshal_VOID__UINT_POINTER gtk_marshal_NONE__UINT_POINTER
#define gst_marshal_VOID__OBJECT_POINTER gtk_marshal_NONE__POINTER_POINTER
#define gst_marshal_VOID__INT_INT gtk_marshal_NONE__INT_INT
// args
//#define set_property set_arg
//#define get_property get_arg
#define g_object_get_property(obj,argname,pspec)\
G_STMT_START{ \
(pspec)->name = (gchar*)argname;\
gtk_object_getv ((obj),1,(pspec));\
}G_STMT_END
#define g_object_set gtk_object_set
// type system
#define GType GtkType
#define GTypeFlags guint
#define GClassInitFunc GtkClassInitFunc
#define GBaseInitFunc GtkClassInitFunc
#define GInstanceInitFunc GtkObjectInitFunc
//#define g_type_register_static gtk_type_unique
#define g_type_class_ref gtk_type_class
#define g_type_class_unref(c)
#define g_type_name(t) gtk_type_name(t)
#define g_type_from_name(t) gtk_type_from_name(t)
#define GEnumValue GtkEnumValue
#define g_enum_register_static gtk_type_register_enum
/*********************************
* FIXME API NOT in glib2.0
***********************************/
// type registration
typedef struct _GTypeInfo GTypeInfo;
struct _GTypeInfo
{
/* interface types, classed types, instantiated types */
guint16 class_size;
gpointer base_init;
gpointer base_finalize;
/* classed types, instantiated types */
gpointer class_init;
gpointer class_finalize;
gconstpointer class_data;
/* instantiated types */
guint16 instance_size;
guint16 n_preallocs;
gpointer instance_init;
/* value handling */
const gpointer value_table;
};
#define G_TYPE_FLAG_ABSTRACT 0
guint g_type_register_static (GtkType parent_type, gchar *type_name,
const GTypeInfo *info, guint flags);
// object creation
gpointer g_object_new(GtkType type,gpointer blah_varargs_stuff);
// signals
#define G_SIGNAL_RUN_LAST GTK_RUN_LAST
#define G_SIGNAL_RUN_FIRST GTK_RUN_FIRST
#define GCallback gpointer // FIXME?
#define G_CALLBACK(f) ((gpointer)(f))
guint
g_signal_newc (const gchar *signal_name,
GtkType object_type,
GtkSignalRunType signal_flags,
guint function_offset,
gpointer accumulator, // GSignalAccumulator
gpointer accu_data,
GtkSignalMarshaller marshaller,
GType return_type,
guint nparams,
...);
#define \
g_signal_emit(object,signal,detail,args...) \
gtk_signal_emit((GtkObject *)object,signal, ## args )
#define \
g_signal_connectc(object,name,func,func_data,swap) \
gtk_signal_connect((GtkObject *)object,name,func,func_data)
#define \
g_signal_emit_by_name(object,name,data,self) \
gtk_signal_emit_by_name ((GtkObject *)object,name,data,self)
#define \
g_signal_has_handler_pending(object,name,data,may_block) \
gtk_signal_handler_pending ((GtkObject *)object,name,may_block)
#define g_signal_lookup gtk_signal_lookup
#define g_signal_handler_block gtk_signal_handler_block
#define g_signal_handler_unblock gtk_signal_handler_unblock
// arguments/parameters
// first define GValue and GParamSpec
#define GValue GtkArg
#define GParamFlags gint
#define G_VALUE_TYPE(v) ((v)->type)
#define G_PARAM_READWRITE GTK_ARG_READWRITE
#define G_PARAM_READABLE GTK_ARG_READABLE
#define G_PARAM_WRITABLE GTK_ARG_WRITABLE
#define G_OBJECT_WARN_INVALID_PROPERTY_ID(a,b,c)
typedef struct _GParamSpec GParamSpec;
struct _GParamSpec {
gchar *name;
gint value_type;
gint flags;
};
#define g_value_init(value,t) ((value)->type = (t))
void g_object_class_install_property(GtkObjectClass *oclass,guint property_id,GParamSpec *pspec);
GParamSpec *g_object_class_find_property(GtkObjectClass *oclass,gchar *name);
GParamSpec **g_object_class_list_properties(GtkObjectClass *oclass,guint *n_properties);
#define G_IS_PARAM_SPEC_ENUM(pspec) (GTK_FUNDAMENTAL_TYPE(pspec->value_type) == GTK_TYPE_ENUM)
GParamSpec *g_param_spec_boolean(gchar *name,gchar *nick,gchar *blurb,gboolean def,gint flags);
GParamSpec *g_param_spec_int(gchar *name,gchar *nick,gchar *blurb,gint min,gint max,gint def,gint flags);
GParamSpec *g_param_spec_uint(gchar *name,gchar *nick,gchar *blurb,guint min,guint max,guint def,gint flags);
GParamSpec *g_param_spec_long(gchar *name,gchar *nick,gchar *blurb,glong min,glong max,glong def,gint flags);
GParamSpec *g_param_spec_ulong(gchar *name,gchar *nick,gchar *blurb,gulong min,gulong max,gulong def,gint flags);
GParamSpec *g_param_spec_float(gchar *name,gchar *nick,gchar *blurb,float min,float max,float def,gint flags);
GParamSpec *g_param_spec_double(gchar *name,gchar *nick,gchar *blurb,double min,double max,double def,gint flags);
GParamSpec *g_param_spec_enum(gchar *name,gchar *nick,gchar *blurb,GtkType e,guint def,gint flags);
GParamSpec *g_param_spec_pointer(gchar *name,gchar *nick,gchar *blurb,gint flags);
GParamSpec *g_param_spec_string(gchar *name,gchar *nick,gchar *blurb,gchar *def,gint flags);
#define g_value_get_boolean(value) GTK_VALUE_BOOL(*value)
#define g_value_set_boolean(value,data) (GTK_VALUE_BOOL(*value) = (data))
#define g_value_get_enum(value) GTK_VALUE_INT(*value)
#define g_value_set_enum(value,data) (GTK_VALUE_INT(*value) = (data))
#define g_value_get_int(value) GTK_VALUE_INT(*value)
#define g_value_set_int(value,data) (GTK_VALUE_INT(*value) = (data))
#define g_value_get_uint(value) GTK_VALUE_UINT(*value)
#define g_value_set_uint(value,data) (GTK_VALUE_UINT(*value) = (data))
#define g_value_get_long(value) GTK_VALUE_LONG(*value)
#define g_value_set_long(value,data) (GTK_VALUE_LONG(*value) = (data))
#define g_value_get_ulong(value) GTK_VALUE_ULONG(*value)
#define g_value_set_ulong(value,data) (GTK_VALUE_ULONG(*value) = (data))
#define g_value_get_float(value) GTK_VALUE_FLOAT(*value)
#define g_value_set_float(value,data) (GTK_VALUE_FLOAT(*value) = (data))
#define g_value_get_double(value) GTK_VALUE_DOUBLE(*value)
#define g_value_set_double(value,data) (GTK_VALUE_DOUBLE(*value) = (data))
#define g_value_get_string(value) GTK_VALUE_STRING(*value)
#define g_value_set_string(value,data) (GTK_VALUE_STRING(*value) = (data))
#define g_value_get_pointer(value) GTK_VALUE_POINTER(*value)
#define g_value_set_pointer(value,data) (GTK_VALUE_POINTER(*value) = (data))
// the object itself
//#define GObject GtkObject
//#define GObjectClass GtkObjectClass
#define G_OBJECT GTK_OBJECT
#define G_OBJECT_CLASS GTK_OBJECT_CLASS
#define G_TYPE_OBJECT \
(g_object_get_type())
//#define G_OBJECT(obj)
// (GTK_CHECK_CAST((obj),G_TYPE_OBJECT,GObject))
//#define G_OBJECT_CLASS(klass)
// (GTK_CHECK_CLASS_CAST((klass),G_TYPE_OBJECT,GObjectClass))
#define G_IS_OBJECT(obj) \
(GTK_CHECK_TYPE((obj),G_TYPE_OBJECT))
#define G_IS_OBJECT_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),G_TYPE_OBJECT))
typedef struct _GObject GObject;
typedef struct _GObjectClass GObjectClass;
struct _GObject {
/***** THE FOLLOWING IS A VERBATIM COPY FROM GTKOBJECT *****/
/* GtkTypeObject related fields: */
GtkObjectClass *klass;
/* 32 bits of flags. GtkObject only uses 4 of these bits and
* GtkWidget uses the rest. This is done because structs are
* aligned on 4 or 8 byte boundaries. If a new bitfield were
* used in GtkWidget much space would be wasted.
*/
guint32 flags;
/* reference count.
* refer to the file docs/refcounting.txt on this issue.
*/
guint ref_count;
/* A list of keyed data pointers, used for e.g. the list of signal
* handlers or an object's user_data.
*/
GData *object_data;
/***** END OF COPY FROM GTKOBJECT *****/
};
struct _GObjectClass {
/***** THE FOLLOWING IS A VERBATIM COPY FROM GTKOBJECT *****/
/* GtkTypeClass fields: */
GtkType type;
/* The signals this object class handles. "signals" is an
* array of signal ID's.
*/
guint *signals;
/* The number of signals listed in "signals".
*/
guint nsignals;
/* The number of arguments per class.
*/
guint n_args;
GSList *construct_args;
/* Non overridable class methods to set and get per class arguments */
void (*set_arg) (GtkObject *object,
GtkArg *arg,
guint arg_id);
void (*get_arg) (GtkObject *object,
GtkArg *arg,
guint arg_id);
/* The functions that will end an objects life time. In one way ore
* another all three of them are defined for all objects. If an
* object class overrides one of the methods in order to perform class
* specific destruction then it must still invoke its superclass'
* implementation of the method after it is finished with its
* own cleanup. (See the destroy function for GtkWidget for
* an example of how to do this).
*/
void (* shutdown) (GObject *object);
void (* destroy) (GObject *object);
void (* finalize) (GObject *object);
/***** END OF COPY FROM GTKOBJECT *****/
void (*set_property) (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
void (*get_property) (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
};
GType g_object_get_type (void);

View file

@ -57,20 +57,26 @@ void
gst_init (int *argc, char **argv[])
{
GstTrace *gst_trace;
gchar *display;
if (!g_thread_supported ()) g_thread_init (NULL);
/* Only initialise gtk fully if we have an X display.
* FIXME: this fails if the display is specified differently, eg, by
* a command line parameter. This is okay though, since this is only
* a quick hack and should be replaced when we move to gobject.*/
display = g_getenv("DISPLAY");
if (display == NULL) {
gtk_type_init ();
} else {
gtk_init (argc,argv);
#ifdef USE_GLIB2
g_type_init(0);
#else
{
gchar *display;
/* Only initialise gtk fully if we have an X display.
* FIXME: this fails if the display is specified differently, eg, by
* a command line parameter. This is okay though, since this is only
* a quick hack and should be replaced when we move to gobject.*/
display = g_getenv("DISPLAY");
if (display == NULL) {
gtk_type_init ();
} else {
gtk_init (argc,argv);
}
}
#endif
if (!gst_init_check (argc,argv)) {
exit (0); // FIXME!
@ -220,7 +226,7 @@ gst_init_check (int *argc,
/* check for ENV variables */
{
gchar *plugin_path = g_getenv("GST_PLUGIN_PATH");
const gchar *plugin_path = g_getenv("GST_PLUGIN_PATH");
gst_add_paths_func (plugin_path);
}
@ -270,7 +276,9 @@ gst_init_check (int *argc,
void
gst_main (void)
{
#ifndef USE_GLIB2
gtk_main ();
#endif
}
/**
@ -281,5 +289,7 @@ gst_main (void)
void
gst_main_quit (void)
{
#ifndef USE_GLIB2
gtk_main_quit ();
#endif
}

View file

@ -36,7 +36,6 @@
#include <gst/gstcpu.h>
#include <gst/gstclock.h>
#include <gst/gstelement.h>
#include <gst/gstextratypes.h>
#include <gst/gstbin.h>
#include <gst/gstpipeline.h>
#include <gst/gstthread.h>
@ -52,6 +51,7 @@
#include <gst/gstscheduler.h>
#include <gst/gstparse.h>
#include <gst/gstextratypes.h>
#ifdef __cplusplus
extern "C" {

View file

@ -44,22 +44,23 @@ static void gst_autoplug_init (GstAutoplug *autoplug);
static GstObjectClass *parent_class = NULL;
static guint gst_autoplug_signals[LAST_SIGNAL] = { 0 };
GtkType gst_autoplug_get_type(void)
GType gst_autoplug_get_type(void)
{
static GtkType autoplug_type = 0;
static GType autoplug_type = 0;
if (!autoplug_type) {
static const GtkTypeInfo autoplug_info = {
"GstAutoplug",
sizeof(GstAutoplug),
static const GTypeInfo autoplug_info = {
sizeof(GstAutoplugClass),
(GtkClassInitFunc)gst_autoplug_class_init,
(GtkObjectInitFunc)gst_autoplug_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_autoplug_class_init,
NULL,
NULL,
sizeof(GstAutoplug),
4,
(GInstanceInitFunc)gst_autoplug_init,
};
autoplug_type = gtk_type_unique (GST_TYPE_OBJECT, &autoplug_info);
autoplug_type = g_type_register_static (GST_TYPE_OBJECT, "GstAutoplug", &autoplug_info, 0);
}
return autoplug_type;
}
@ -67,21 +68,19 @@ GtkType gst_autoplug_get_type(void)
static void
gst_autoplug_class_init(GstAutoplugClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
gtkobject_class = (GtkObjectClass*) klass;
gobject_class = (GObjectClass*) klass;
gstobject_class = (GstObjectClass*) klass;
parent_class = gtk_type_class(GST_TYPE_OBJECT);
parent_class = g_type_class_ref (GST_TYPE_OBJECT);
gst_autoplug_signals[NEW_OBJECT] =
gtk_signal_new ("new_object", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstAutoplugClass, new_object),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("new_object", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstAutoplugClass, new_object), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
GST_TYPE_OBJECT);
gtk_object_class_add_signals (gtkobject_class, gst_autoplug_signals, LAST_SIGNAL);
}
static void gst_autoplug_init(GstAutoplug *autoplug)
@ -107,7 +106,7 @@ _gst_autoplug_initialize (void)
void
gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object)
{
gtk_signal_emit (GTK_OBJECT (autoplug), gst_autoplug_signals[NEW_OBJECT], object);
g_signal_emit (G_OBJECT (autoplug), gst_autoplug_signals[NEW_OBJECT], 0, object);
}
@ -132,7 +131,7 @@ gst_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps
va_start (args, sinkcaps);
oclass = GST_AUTOPLUG_CLASS (GTK_OBJECT (autoplug)->klass);
oclass = GST_AUTOPLUG_CLASS (G_OBJECT_GET_CLASS(autoplug));
if (oclass->autoplug_to_caps)
element = (oclass->autoplug_to_caps) (autoplug, srccaps, sinkcaps, args);
@ -162,7 +161,7 @@ gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *
va_start (args, target);
oclass = GST_AUTOPLUG_CLASS (GTK_OBJECT (autoplug)->klass);
oclass = GST_AUTOPLUG_CLASS (G_OBJECT_GET_CLASS(autoplug));
if (oclass->autoplug_to_renderers)
element = (oclass->autoplug_to_renderers) (autoplug, srccaps, target, args);
@ -183,7 +182,7 @@ gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *
* Returns: a new #GstAutoplugFactory.
*/
GstAutoplugFactory*
gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GtkType type)
gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GType type)
{
GstAutoplugFactory *factory;
@ -280,7 +279,7 @@ gst_autoplugfactory_create (GstAutoplugFactory *factory)
g_return_val_if_fail (factory != NULL, NULL);
g_return_val_if_fail (factory->type != 0, NULL);
new = GST_AUTOPLUG (gtk_type_new (factory->type));
new = GST_AUTOPLUG (g_object_new(factory->type,NULL));
return new;
}

View file

@ -33,13 +33,13 @@ extern "C" {
#define GST_TYPE_AUTOPLUG \
(gst_autoplug_get_type())
#define GST_AUTOPLUG(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_AUTOPLUG,GstAutoplug))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUG,GstAutoplug))
#define GST_AUTOPLUG_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUG,GstAutoplugClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUG,GstAutoplugClass))
#define GST_IS_AUTOPLUG(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_AUTOPLUG))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUG))
#define GST_IS_AUTOPLUG_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUG))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUG))
typedef struct _GstAutoplug GstAutoplug;
typedef struct _GstAutoplugClass GstAutoplugClass;
@ -72,10 +72,10 @@ typedef struct _GstAutoplugFactory GstAutoplugFactory;
struct _GstAutoplugFactory {
gchar *name; /* name of autoplugger */
gchar *longdesc; /* long description of the autoplugger (well, don't overdo it..) */
GtkType type; /* unique GtkType of the autoplugger */
GType type; /* unique GType of the autoplugger */
};
GtkType gst_autoplug_get_type (void);
GType gst_autoplug_get_type (void);
void gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object);
@ -88,7 +88,7 @@ GstElement* gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps
* creating autopluggers
*
*/
GstAutoplugFactory* gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GtkType type);
GstAutoplugFactory* gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GType type);
void gst_autoplugfactory_destroy (GstAutoplugFactory *factory);
GstAutoplugFactory* gst_autoplugfactory_find (const gchar *name);

View file

@ -38,13 +38,13 @@ GstElementDetails gst_bin_details = {
};
static void gst_bin_real_destroy (GtkObject *object);
static void gst_bin_real_destroy (GObject *object);
static GstElementStateReturn gst_bin_change_state (GstElement *element);
static GstElementStateReturn gst_bin_change_state_norecurse (GstBin *bin);
static gboolean gst_bin_change_state_type (GstBin *bin,
GstElementState state,
GtkType type);
GType type);
static gboolean gst_bin_iterate_func (GstBin *bin);
@ -72,23 +72,24 @@ static void gst_bin_init (GstBin *bin);
static GstElementClass *parent_class = NULL;
static guint gst_bin_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_bin_get_type (void)
{
static GtkType bin_type = 0;
static GType bin_type = 0;
if (!bin_type) {
static const GtkTypeInfo bin_info = {
"GstBin",
sizeof(GstBin),
static const GTypeInfo bin_info = {
sizeof(GstBinClass),
(GtkClassInitFunc)gst_bin_class_init,
(GtkObjectInitFunc)gst_bin_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_bin_class_init,
NULL,
NULL,
sizeof(GstBin),
8,
(GInstanceInitFunc)gst_bin_init,
};
bin_type = gtk_type_unique (GST_TYPE_ELEMENT, &bin_info);
bin_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBin", &bin_info, 0);
}
return bin_type;
}
@ -96,22 +97,21 @@ gst_bin_get_type (void)
static void
gst_bin_class_init (GstBinClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstobject_class = (GstObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gst_bin_signals[OBJECT_ADDED] =
gtk_signal_new ("object_added", GTK_RUN_FIRST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstBinClass, object_added),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("object_added", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GstBinClass, object_added), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_ELEMENT);
gtk_object_class_add_signals (gtkobject_class, gst_bin_signals, LAST_SIGNAL);
klass->change_state_type = gst_bin_change_state_type;
klass->iterate = gst_bin_iterate_func;
@ -123,7 +123,8 @@ gst_bin_class_init (GstBinClass *klass)
gstelement_class->change_state = gst_bin_change_state;
gtkobject_class->destroy = gst_bin_real_destroy;
// FIXME
// gobject_class->destroy = gst_bin_real_destroy;
}
static void
@ -295,7 +296,7 @@ gst_bin_add (GstBin *bin,
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, bin, "added child \"%s\"", GST_ELEMENT_NAME (element));
gtk_signal_emit (GTK_OBJECT (bin), gst_bin_signals[OBJECT_ADDED], element);
g_signal_emit (G_OBJECT (bin), gst_bin_signals[OBJECT_ADDED], 0, element);
}
/**
@ -377,7 +378,7 @@ gst_bin_change_state (GstElement *element)
// GST_DEBUG (GST_CAT_STATES,"setting state on '%s'\n",GST_ELEMENT_NAME (child));
switch (gst_element_set_state (child, GST_STATE_PENDING (element))) {
case GST_STATE_FAILURE:
GST_STATE_PENDING (element) = GST_STATE_NONE_PENDING;
GST_STATE_PENDING (element) = GST_STATE_VOID_PENDING;
GST_DEBUG (GST_CAT_STATES,"child '%s' failed to go to state %d(%s)\n", GST_ELEMENT_NAME (child),
GST_STATE_PENDING (element), gst_element_statename (GST_STATE_PENDING (element)));
return GST_STATE_FAILURE;
@ -413,7 +414,7 @@ gst_bin_change_state_norecurse (GstBin *bin)
static gboolean
gst_bin_change_state_type(GstBin *bin,
GstElementState state,
GtkType type)
GType type)
{
GList *children;
GstElement *child;
@ -431,7 +432,7 @@ gst_bin_change_state_type(GstBin *bin,
if (GST_IS_BIN (child)) {
if (!gst_bin_set_state_type (GST_BIN (child), state,type))
return FALSE;
} else if (GTK_CHECK_TYPE (child,type)) {
} else if (G_TYPE_CHECK_INSTANCE_TYPE (child,type)) {
if (!gst_element_set_state (child,state))
return FALSE;
}
@ -457,7 +458,7 @@ gst_bin_change_state_type(GstBin *bin,
gboolean
gst_bin_set_state_type (GstBin *bin,
GstElementState state,
GtkType type)
GType type)
{
GstBinClass *oclass;
@ -467,7 +468,7 @@ gst_bin_set_state_type (GstBin *bin,
g_return_val_if_fail (bin != NULL, FALSE);
g_return_val_if_fail (GST_IS_BIN (bin), FALSE);
oclass = GST_BIN_CLASS (GTK_OBJECT (bin)->klass);
oclass = GST_BIN_CLASS (G_OBJECT_GET_CLASS(bin));
if (oclass->change_state_type)
(oclass->change_state_type) (bin,state,type);
@ -475,7 +476,7 @@ gst_bin_set_state_type (GstBin *bin,
}
static void
gst_bin_real_destroy (GtkObject *object)
gst_bin_real_destroy (GObject *object)
{
GstBin *bin = GST_BIN (object);
GList *children, *orig;
@ -500,8 +501,9 @@ gst_bin_real_destroy (GtkObject *object)
g_cond_free (bin->eoscond);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
// FIXME!!!
// if (G_OBJECT_CLASS (parent_class)->destroy)
// G_OBJECT_CLASS (parent_class)->destroy (object);
}
/**
@ -666,7 +668,7 @@ gst_bin_iterate (GstBin *bin)
GST_DEBUG_ENTER("(\"%s\")",GST_ELEMENT_NAME (bin));
oclass = GST_BIN_CLASS (GTK_OBJECT (bin)->klass);
oclass = GST_BIN_CLASS (G_OBJECT_GET_CLASS(bin));
if (oclass->iterate)
eos = (oclass->iterate) (bin);

View file

@ -36,13 +36,13 @@ extern GstElementDetails gst_bin_details;
#define GST_TYPE_BIN \
(gst_bin_get_type())
#define GST_BIN(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_BIN,GstBin))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BIN,GstBin))
#define GST_BIN_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_BIN,GstBinClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BIN,GstBinClass))
#define GST_IS_BIN(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_BIN))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BIN))
#define GST_IS_BIN_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_BIN))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BIN))
typedef enum {
/* this bin is a manager of child elements, i.e. a pipeline or thread */
@ -94,7 +94,7 @@ struct _GstBinClass {
/* change the state of elements of the given type */
gboolean (*change_state_type) (GstBin *bin,
GstElementState state,
GtkType type);
GType type);
/* run a full iteration of operation */
gboolean (*iterate) (GstBin *bin);
};
@ -110,7 +110,7 @@ struct __GstBinChain {
};
GtkType gst_bin_get_type (void);
GType gst_bin_get_type (void);
GstElement* gst_bin_new (const gchar *name);
#define gst_bin_destroy(bin) gst_object_destroy(GST_OBJECT(bin))
@ -129,7 +129,7 @@ GList* gst_bin_get_list (GstBin *bin);
gboolean gst_bin_set_state_type (GstBin *bin,
GstElementState state,
GtkType type);
GType type);
gboolean gst_bin_iterate (GstBin *bin);

View file

@ -51,11 +51,11 @@ static void gst_element_class_init (GstElementClass *klass);
static void gst_element_init (GstElement *element);
static void gst_element_base_class_init (GstElementClass *klass);
static void gst_element_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_element_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_element_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_element_get_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_element_shutdown (GtkObject *object);
static void gst_element_real_destroy (GtkObject *object);
static void gst_element_shutdown (GObject *object);
static void gst_element_real_destroy (GObject *object);
static GstElementStateReturn gst_element_change_state (GstElement *element);
@ -67,21 +67,22 @@ GstElement* gst_element_restore_thyself (xmlNodePtr self, GstObject *parent)
static GstObjectClass *parent_class = NULL;
static guint gst_element_signals[LAST_SIGNAL] = { 0 };
GtkType gst_element_get_type(void) {
static GtkType element_type = 0;
GType gst_element_get_type(void) {
static GType element_type = 0;
if (!element_type) {
static const GtkTypeInfo element_info = {
"GstElement",
sizeof(GstElement),
static const GTypeInfo element_info = {
sizeof(GstElementClass),
(GtkClassInitFunc)gst_element_class_init,
(GtkObjectInitFunc)gst_element_init,
(GtkArgSetFunc)gst_element_set_arg,
(GtkArgGetFunc)gst_element_get_arg,
(GtkClassInitFunc)gst_element_base_class_init,
(GBaseInitFunc)gst_element_base_class_init,
NULL,
(GClassInitFunc)gst_element_class_init,
NULL,
NULL,
sizeof(GstElement),
0,
(GInstanceInitFunc)gst_element_init,
};
element_type = gtk_type_unique(GST_TYPE_OBJECT,&element_info);
element_type = g_type_register_static(GST_TYPE_OBJECT, "GstElement", &element_info, G_TYPE_FLAG_ABSTRACT);
}
return element_type;
}
@ -89,56 +90,56 @@ GtkType gst_element_get_type(void) {
static void
gst_element_class_init (GstElementClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
gtkobject_class = (GtkObjectClass*) klass;
gobject_class = (GObjectClass*) klass;
gstobject_class = (GstObjectClass*) klass;
parent_class = gtk_type_class(GST_TYPE_OBJECT);
parent_class = g_type_class_ref(GST_TYPE_OBJECT);
gst_element_signals[STATE_CHANGE] =
gtk_signal_new ("state_change", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass, state_change),
gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
g_signal_newc ("state_change", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, state_change), NULL, NULL,
g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1,
G_TYPE_INT);
gst_element_signals[NEW_PAD] =
gtk_signal_new ("new_pad", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass, new_pad),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("new_pad", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, new_pad), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_PAD);
gst_element_signals[PAD_REMOVED] =
gtk_signal_new ("pad_removed", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass, pad_removed),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("pad_removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, pad_removed), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_PAD);
gst_element_signals[NEW_GHOST_PAD] =
gtk_signal_new ("new_ghost_pad", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass, new_ghost_pad),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("new_ghost_pad", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, new_ghost_pad), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_PAD);
gst_element_signals[GHOST_PAD_REMOVED] =
gtk_signal_new ("ghost_pad_removed", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass, ghost_pad_removed),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("ghost_pad_removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, ghost_pad_removed), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_PAD);
gst_element_signals[ERROR] =
gtk_signal_new ("error", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass, error),
gtk_marshal_NONE__STRING, GTK_TYPE_NONE,1,
GTK_TYPE_STRING);
g_signal_newc ("error", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass, error), NULL, NULL,
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE,1,
G_TYPE_STRING);
gst_element_signals[EOS] =
gtk_signal_new ("eos", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstElementClass,eos),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
g_signal_newc ("eos", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass,eos), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gtk_object_class_add_signals (gtkobject_class, gst_element_signals, LAST_SIGNAL);
gtkobject_class->set_arg = GST_DEBUG_FUNCPTR(gst_element_set_arg);
gtkobject_class->get_arg = GST_DEBUG_FUNCPTR(gst_element_get_arg);
gtkobject_class->shutdown = GST_DEBUG_FUNCPTR(gst_element_shutdown);
gtkobject_class->destroy = GST_DEBUG_FUNCPTR(gst_element_real_destroy);
gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_element_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_element_get_property);
gobject_class->shutdown = GST_DEBUG_FUNCPTR(gst_element_shutdown);
// FIXME!
// gobject_class->destroy = GST_DEBUG_FUNCPTR(gst_element_real_destroy);
#ifndef GST_DISABLE_XML
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR(gst_element_save_thyself);
@ -152,12 +153,12 @@ gst_element_class_init (GstElementClass *klass)
static void
gst_element_base_class_init (GstElementClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*) klass;
gobject_class = (GObjectClass*) klass;
gtkobject_class->set_arg = GST_DEBUG_FUNCPTR(gst_element_set_arg);
gtkobject_class->get_arg = GST_DEBUG_FUNCPTR(gst_element_get_arg);
gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_element_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_element_get_property);
}
static void
@ -176,28 +177,28 @@ gst_element_init (GstElement *element)
static void
gst_element_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_element_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstElementClass *oclass = GST_ELEMENT_CLASS (object->klass);
GstElementClass *oclass = (GstElementClass *)G_OBJECT_GET_CLASS(object);
GST_SCHEDULE_LOCK_ELEMENT ( GST_ELEMENT_SCHED(object), GST_ELEMENT(object) );
if (oclass->set_arg)
(oclass->set_arg)(object,arg,id);
if (oclass->set_property)
(oclass->set_property)(object,prop_id,value,pspec);
GST_SCHEDULE_UNLOCK_ELEMENT ( GST_ELEMENT_SCHED(object), GST_ELEMENT(object) );
}
static void
gst_element_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_element_get_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstElementClass *oclass = GST_ELEMENT_CLASS (object->klass);
GstElementClass *oclass = (GstElementClass *)G_OBJECT_GET_CLASS(object);
GST_SCHEDULE_LOCK_ELEMENT (GST_ELEMENT_SCHED(object), GST_ELEMENT(object) );
if (oclass->get_arg)
(oclass->get_arg)(object,arg,id);
if (oclass->get_property)
(oclass->get_property)(object,prop_id,value,pspec);
GST_SCHEDULE_UNLOCK_ELEMENT (GST_ELEMENT_SCHED(object), GST_ELEMENT(object) );
}
@ -213,7 +214,7 @@ gst_element_get_arg (GtkObject *object, GtkArg *arg, guint id)
GstElement*
gst_element_new(void)
{
return GST_ELEMENT (gtk_type_new (GST_TYPE_ELEMENT));
return GST_ELEMENT (g_object_new(GST_TYPE_ELEMENT,NULL));
}
/**
@ -265,7 +266,7 @@ gst_element_set_parent (GstElement *element, GstObject *parent)
g_return_if_fail (GST_IS_ELEMENT (element));
g_return_if_fail (GST_OBJECT_PARENT (element) == NULL);
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
g_return_if_fail (GST_IS_OBJECT (parent));
g_return_if_fail ((gpointer)element != (gpointer)parent);
gst_object_set_parent (GST_OBJECT (element), parent);
@ -324,7 +325,7 @@ gst_element_add_pad (GstElement *element, GstPad *pad)
element->numsinkpads++;
/* emit the NEW_PAD signal */
gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[NEW_PAD], pad);
g_signal_emit (G_OBJECT (element), gst_element_signals[NEW_PAD], 0, pad);
}
/**
@ -352,7 +353,7 @@ gst_element_remove_pad (GstElement *element, GstPad *pad)
else
element->numsinkpads--;
gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[PAD_REMOVED], pad);
g_signal_emit (G_OBJECT (element), gst_element_signals[PAD_REMOVED], 0, pad);
gst_object_unparent (GST_OBJECT (pad));
}
@ -394,7 +395,7 @@ gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name)
GST_DEBUG(GST_CAT_ELEMENT_PADS,"added ghostpad %s:%s\n",GST_DEBUG_PAD_NAME(ghostpad));
/* emit the NEW_GHOST_PAD signal */
gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[NEW_GHOST_PAD], ghostpad);
g_signal_emit (G_OBJECT (element), gst_element_signals[NEW_GHOST_PAD], 0, ghostpad);
}
/**
@ -488,7 +489,7 @@ gst_element_get_padtemplate_list (GstElement *element)
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS(element));
if (oclass->elementfactory == NULL) return NULL;
@ -594,7 +595,7 @@ gst_element_request_pad (GstElement *element, GstPadTemplate *templ)
GstPad *newpad = NULL;
GstElementClass *oclass;
oclass = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS(element));
if (oclass->request_new_pad)
newpad = (oclass->request_new_pad)(element, templ);
@ -755,7 +756,7 @@ gst_element_error (GstElement *element, const gchar *error)
/* FIXME: this is not finished!!! */
gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[ERROR], error);
g_signal_emit (G_OBJECT (element), gst_element_signals[ERROR], 0, error);
}
@ -804,7 +805,7 @@ gst_element_set_state (GstElement *element, GstElementState state)
gst_element_statename(curpending));
/* call the state change function so it can set the state */
oclass = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS(element));
if (oclass->change_state)
return_val = (oclass->change_state)(element);
@ -836,7 +837,7 @@ gst_element_get_factory (GstElement *element)
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS(element));
return oclass->elementfactory;
}
@ -876,20 +877,20 @@ GST_ELEMENT_NAME(element),GST_ELEMENT_NAME(GST_ELEMENT_PARENT(element)),GST_ELEM
}
GST_STATE (element) = GST_STATE_PENDING (element);
GST_STATE_PENDING (element) = GST_STATE_NONE_PENDING;
GST_STATE_PENDING (element) = GST_STATE_VOID_PENDING;
// note: queues' state_change is a special case because it needs to lock
// for synchronization (from another thread). since this signal may block
// or (worse) make another state change, the queue needs to unlock before
// calling. thus, gstqueue.c::gst_queue_state_change() blocks, unblocks,
// unlocks, then emits this.
gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[STATE_CHANGE],
g_signal_emit (G_OBJECT (element), gst_element_signals[STATE_CHANGE], 0,
GST_STATE (element));
return GST_STATE_SUCCESS;
}
static void
gst_element_shutdown (GtkObject *object)
gst_element_shutdown (GObject *object)
{
GstElement *element = GST_ELEMENT (object);
@ -898,12 +899,12 @@ gst_element_shutdown (GtkObject *object)
if (GST_IS_BIN (GST_OBJECT_PARENT (element)))
gst_bin_remove (GST_BIN (GST_OBJECT_PARENT (element)), element);
if (GTK_OBJECT_CLASS (parent_class)->shutdown)
GTK_OBJECT_CLASS (parent_class)->shutdown (object);
if (G_OBJECT_CLASS (parent_class)->shutdown)
G_OBJECT_CLASS (parent_class)->shutdown (object);
}
static void
gst_element_real_destroy (GtkObject *object)
gst_element_real_destroy (GObject *object)
{
GstElement *element = GST_ELEMENT (object);
GList *pads;
@ -930,8 +931,9 @@ gst_element_real_destroy (GtkObject *object)
element->numsrcpads = 0;
element->numsinkpads = 0;
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
// FIXME!
// if (G_OBJECT_CLASS (parent_class)->destroy)
// G_OBJECT_CLASS (parent_class)->destroy (object);
}
/*
@ -967,7 +969,7 @@ gst_element_save_thyself (GstObject *object,
{
GList *pads;
GstElementClass *oclass;
GtkType type;
// GType type;
GstElement *element;
g_return_val_if_fail (object != NULL, parent);
@ -976,7 +978,7 @@ gst_element_save_thyself (GstObject *object,
element = GST_ELEMENT (object);
oclass = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS(element));
xmlNewChild(parent, NULL, "name", GST_ELEMENT_NAME(element));
@ -990,9 +992,10 @@ gst_element_save_thyself (GstObject *object,
// if (element->manager)
// xmlNewChild(parent, NULL, "manager", GST_ELEMENT_NAME(element->manager));
/* FIXME FIXME FIXME!
// output all args to the element
type = GTK_OBJECT_TYPE (element);
while (type != GTK_TYPE_INVALID) {
type = G_OBJECT_TYPE (element);
while (type != G_TYPE_INVALID) {
GtkArg *args;
guint32 *flags;
guint num_args,i;
@ -1000,51 +1003,51 @@ gst_element_save_thyself (GstObject *object,
args = gtk_object_query_args (type, &flags, &num_args);
for (i=0; i<num_args; i++) {
if ((args[i].type > GTK_TYPE_NONE) &&
if ((args[i].type > G_TYPE_NONE) &&
(flags[i] & GTK_ARG_READABLE)) {
xmlNodePtr arg;
gtk_object_getv (GTK_OBJECT (element), 1, &args[i]);
gtk_object_getv (G_OBJECT (element), 1, &args[i]);
arg = xmlNewChild (parent, NULL, "arg", NULL);
xmlNewChild (arg, NULL, "name", args[i].name);
switch (args[i].type) {
case GTK_TYPE_CHAR:
case G_TYPE_CHAR:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%c", GTK_VALUE_CHAR (args[i])));
g_strdup_printf ("%c", G_VALUE_CHAR (args[i])));
break;
case GTK_TYPE_UCHAR:
case G_TYPE_UCHAR:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%d", GTK_VALUE_UCHAR (args[i])));
g_strdup_printf ("%d", G_VALUE_UCHAR (args[i])));
break;
case GTK_TYPE_BOOL:
case G_TYPE_BOOL:
xmlNewChild (arg, NULL, "value",
GTK_VALUE_BOOL (args[i]) ? "true" : "false");
G_VALUE_BOOL (args[i]) ? "true" : "false");
break;
case GTK_TYPE_INT:
case G_TYPE_INT:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%d", GTK_VALUE_INT (args[i])));
g_strdup_printf ("%d", G_VALUE_INT (args[i])));
break;
case GTK_TYPE_LONG:
case G_TYPE_LONG:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%ld", GTK_VALUE_LONG (args[i])));
g_strdup_printf ("%ld", G_VALUE_LONG (args[i])));
break;
case GTK_TYPE_ULONG:
case G_TYPE_ULONG:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%lu", GTK_VALUE_ULONG (args[i])));
g_strdup_printf ("%lu", G_VALUE_ULONG (args[i])));
break;
case GTK_TYPE_FLOAT:
case G_TYPE_FLOAT:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%f", GTK_VALUE_FLOAT (args[i])));
g_strdup_printf ("%f", G_VALUE_FLOAT (args[i])));
break;
case GTK_TYPE_DOUBLE:
case G_TYPE_DOUBLE:
xmlNewChild (arg, NULL, "value",
g_strdup_printf ("%g", GTK_VALUE_DOUBLE (args[i])));
g_strdup_printf ("%g", G_VALUE_DOUBLE (args[i])));
break;
case GTK_TYPE_STRING:
xmlNewChild (arg, NULL, "value", GTK_VALUE_STRING (args[i]));
case G_TYPE_STRING:
xmlNewChild (arg, NULL, "value", G_VALUE_STRING (args[i]));
break;
default:
if (args[i].type == GST_TYPE_FILENAME) {
xmlNewChild (arg, NULL, "value", GTK_VALUE_STRING (args[i]));
xmlNewChild (arg, NULL, "value", G_VALUE_STRING (args[i]));
}
break;
}
@ -1052,6 +1055,7 @@ gst_element_save_thyself (GstObject *object,
}
type = gtk_type_parent (type);
}
*/
pads = GST_ELEMENT_PADS (element);
@ -1126,7 +1130,7 @@ gst_element_restore_thyself (xmlNodePtr self, GstObject *parent)
}
child = child->next;
}
gst_util_set_object_arg (GTK_OBJECT (element), name, value);
gst_util_set_object_arg (G_OBJECT (element), name, value);
}
children = children->next;
}
@ -1140,7 +1144,7 @@ gst_element_restore_thyself (xmlNodePtr self, GstObject *parent)
children = children->next;
}
oclass = GST_OBJECT_CLASS (GTK_OBJECT (element)->klass);
oclass = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS(element));
if (oclass->restore_thyself)
(oclass->restore_thyself) (GST_OBJECT (element), self);
@ -1219,7 +1223,7 @@ gst_element_signal_eos (GstElement *element)
g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_ELEMENT (element));
gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[EOS]);
g_signal_emit (G_OBJECT (element), gst_element_signals[EOS], 0);
GST_FLAG_SET(element,GST_ELEMENT_COTHREAD_STOPPING);
}
@ -1227,14 +1231,14 @@ gst_element_signal_eos (GstElement *element)
const gchar *gst_element_statename(int state) {
switch (state) {
#ifdef GST_DEBUG_COLOR
case GST_STATE_NONE_PENDING: return "NONE_PENDING";break;
case GST_STATE_VOID_PENDING: return "NONE_PENDING";break;
case GST_STATE_NULL: return "\033[01;37mNULL\033[00m";break;
case GST_STATE_READY: return "\033[01;31mREADY\033[00m";break;
case GST_STATE_PLAYING: return "\033[01;32mPLAYING\033[00m";break;
case GST_STATE_PAUSED: return "\033[01;33mPAUSED\033[00m";break;
default: return "\033[01;37;41mUNKNOWN!\033[00m";
#else
case GST_STATE_NONE_PENDING: return "NONE_PENDING";break;
case GST_STATE_VOID_PENDING: return "NONE_PENDING";break;
case GST_STATE_NULL: return "NULL";break;
case GST_STATE_READY: return "READY";break;
case GST_STATE_PLAYING: return "PLAYING";break;

View file

@ -43,7 +43,7 @@ extern "C" {
typedef enum {
GST_STATE_NONE_PENDING = 0,
GST_STATE_VOID_PENDING = 0,
GST_STATE_NULL = (1 << 0),
GST_STATE_READY = (1 << 1),
GST_STATE_PAUSED = (1 << 2),
@ -74,13 +74,13 @@ typedef enum {
#define GST_TYPE_ELEMENT \
(gst_element_get_type())
#define GST_ELEMENT(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_ELEMENT,GstElement))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT,GstElement))
#define GST_ELEMENT_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT,GstElementClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT,GstElementClass))
#define GST_IS_ELEMENT(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_ELEMENT))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT))
#define GST_IS_ELEMENT_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT))
typedef enum {
/* element is complex (for some def.) and generally require a cothread */
@ -164,12 +164,8 @@ struct _GstElementClass {
void (*eos) (GstElement *element);
/* local pointers for get/set */
void (*set_arg) (GtkObject *object,
GtkArg *arg,
guint arg_id);
void (*get_arg) (GtkObject *object,
GtkArg *arg,
guint arg_id);
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);
/* change the element state */
GstElementStateReturn (*change_state) (GstElement *element);
@ -188,7 +184,7 @@ struct _GstElementDetails {
struct _GstElementFactory {
gchar *name; /* name of element */
GtkType type; /* unique GtkType of element */
GType type; /* unique GType of element */
GstElementDetails *details; /* pointer to details struct */
@ -196,7 +192,7 @@ struct _GstElementFactory {
guint16 numpadtemplates;
};
GtkType gst_element_get_type (void);
GType gst_element_get_type (void);
GstElement* gst_element_new (void);
#define gst_element_destroy(element) gst_object_destroy (GST_OBJECT (element))
@ -248,7 +244,7 @@ GstElement* gst_element_restore_thyself (xmlNodePtr self, GstObject *parent);
* factories stuff
*
**/
GstElementFactory* gst_elementfactory_new (const gchar *name,GtkType type,
GstElementFactory* gst_elementfactory_new (const gchar *name,GType type,
GstElementDetails *details);
void gst_elementfactory_destroy (GstElementFactory *elementfactory);

View file

@ -98,7 +98,7 @@ gst_elementfactory_get_list (void)
/**
* gst_elementfactory_new:
* @name: name of new elementfactory
* @type: GtkType of new element
* @type: GType of new element
* @details: #GstElementDetails structure with element details
*
* Create a new elementfactory capable of insantiating objects of the
@ -107,7 +107,7 @@ gst_elementfactory_get_list (void)
* Returns: new elementfactory
*/
GstElementFactory*
gst_elementfactory_new (const gchar *name, GtkType type,
gst_elementfactory_new (const gchar *name, GType type,
GstElementDetails *details)
{
GstElementFactory *factory;
@ -159,11 +159,11 @@ gst_elementfactory_create (GstElementFactory *factory,
g_return_val_if_fail(factory->type != 0, NULL);
// create an instance of the element
element = GST_ELEMENT(gtk_type_new(factory->type));
element = GST_ELEMENT(g_object_new(factory->type,NULL));
g_assert(element != NULL);
// attempt to set the elemenfactory class pointer if necessary
oclass = GST_ELEMENT_CLASS(GTK_OBJECT(element)->klass);
oclass = GST_ELEMENT_CLASS(G_OBJECT_GET_CLASS(element));
if (oclass->elementfactory == NULL) {
GST_DEBUG (GST_CAT_ELEMENTFACTORY,"class %s\n", factory->name);
oclass->elementfactory = factory;

View file

@ -2,7 +2,7 @@
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstextratypes.c: Extra GtkTypes: filename type, etc.
* gstextratypes.c: Extra GTypes: filename type, etc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -22,25 +22,27 @@
#include "gst_private.h"
#include "gstextratypes.h"
#include <gst/gstobject.h>
#include <gst/gstextratypes.h>
GtkType
GType
gst_extra_get_filename_type (void)
{
static GtkType filename_type = 0;
static GType filename_type = 0;
if (!filename_type) {
static const GtkTypeInfo filename_info = {
"GstFilename",
0, //sizeof(GstElement),
static const GTypeInfo filename_info = {
0, //sizeof(GstElementClass),
(GtkClassInitFunc)NULL,
(GtkObjectInitFunc)NULL,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
0, //sizeof(GstElement),
0,
NULL,
};
filename_type = gtk_type_unique (GTK_TYPE_STRING, &filename_info);
filename_type = g_type_register_static (G_TYPE_STRING, "GstFilename", &filename_info, 0);
}
return filename_type;
}

View file

@ -2,7 +2,7 @@
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstextratypes.h: Header for extra GtkTypes
* gstextratypes.h: Header for extra GTypes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -24,16 +24,15 @@
#ifndef __GST_EXTRA_TYPES_H__
#define __GST_EXTRA_TYPES_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_FILENAME (gst_extra_get_filename_type())
GtkType gst_extra_get_filename_type(void);
GType gst_extra_get_filename_type(void);
#ifdef __cplusplus
}

76
gst/gstmarshal.c Normal file
View file

@ -0,0 +1,76 @@
#include <glib-object.h>
/* VOID:OBJECT,POINTER (gstmarshal.list:1) */
void
gst_marshal_VOID__OBJECT_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__OBJECT_POINTER) (gpointer data1,
gpointer arg_1,
gpointer arg_2,
gpointer data2);
register GMarshalFunc_VOID__OBJECT_POINTER callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure))
{
data1 = closure->data;
data2 = g_value_peek_pointer (param_values + 0);
}
else
{
data1 = g_value_peek_pointer (param_values + 0);
data2 = closure->data;
}
callback = (GMarshalFunc_VOID__OBJECT_POINTER) (marshal_data ? marshal_data : cc->callback);
callback (data1,
g_value_get_object (param_values + 1),
g_value_get_pointer (param_values + 2),
data2);
}
/* VOID:INT,INT (gstmarshal.list:2) */
void
gst_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1,
gint arg_1,
gint arg_2,
gpointer data2);
register GMarshalFunc_VOID__INT_INT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 3);
if (G_CCLOSURE_SWAP_DATA (closure))
{
data1 = closure->data;
data2 = g_value_peek_pointer (param_values + 0);
}
else
{
data1 = g_value_peek_pointer (param_values + 0);
data2 = closure->data;
}
callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
g_value_get_int (param_values + 1),
g_value_get_int (param_values + 2),
data2);
}

25
gst/gstmarshal.h Normal file
View file

@ -0,0 +1,25 @@
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* VOID:OBJECT,POINTER (gstmarshal.list:1) */
extern void gst_marshal_VOID__OBJECT_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data);
/* VOID:INT,INT (gstmarshal.list:2) */
extern void gst_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View file

@ -46,7 +46,7 @@ enum {
typedef struct _GstSignalObject GstSignalObject;
typedef struct _GstSignalObjectClass GstSignalObjectClass;
static GtkType gst_signal_object_get_type (void);
static GType gst_signal_object_get_type (void);
static void gst_signal_object_class_init (GstSignalObjectClass *klass);
static void gst_signal_object_init (GstSignalObject *object);
@ -55,35 +55,31 @@ static guint gst_signal_object_signals[SO_LAST_SIGNAL] = { 0 };
static void gst_object_class_init (GstObjectClass *klass);
static void gst_object_init (GstObject *object);
static void gst_object_real_destroy (GtkObject *gtk_object);
static void gst_object_shutdown (GtkObject *gtk_object);
static void gst_object_finalize (GtkObject *gtk_object);
static void gst_object_real_destroy (GObject *object);
static void gst_object_shutdown (GObject *object);
static void gst_object_finalize (GObject *object);
static GtkObjectClass *parent_class = NULL;
static GObjectClass *parent_class = NULL;
static guint gst_object_signals[LAST_SIGNAL] = { 0 };
void
gst_object_inititialize (void)
{
}
GtkType
GType
gst_object_get_type (void)
{
static GtkType object_type = 0;
static GType object_type = 0;
if (!object_type) {
static const GtkTypeInfo object_info = {
"GstObject",
sizeof(GstObject),
sizeof(GstObjectClass),
(GtkClassInitFunc)gst_object_class_init,
(GtkObjectInitFunc)gst_object_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
static const GTypeInfo object_info = {
sizeof (GstObjectClass),
NULL,
NULL,
(GClassInitFunc) gst_object_class_init,
NULL,
NULL,
sizeof (GstObject),
32,
(GInstanceInitFunc) gst_object_init,
};
object_type = gtk_type_unique(gtk_object_get_type(),&object_info);
object_type = g_type_register_static (G_TYPE_OBJECT, "GstObject", &object_info, G_TYPE_FLAG_ABSTRACT);
}
return object_type;
}
@ -91,47 +87,38 @@ gst_object_get_type (void)
static void
gst_object_class_init (GstObjectClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*) klass;
gobject_class = (GObjectClass*) klass;
parent_class = gtk_type_class (gtk_object_get_type ());
parent_class = g_type_class_ref (G_TYPE_OBJECT);
gst_object_signals[PARENT_SET] =
gtk_signal_new ("parent_set", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstObjectClass, parent_set),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GST_TYPE_OBJECT);
g_signal_newc("parent_set", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstObjectClass, parent_set), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,G_TYPE_NONE,1,
G_TYPE_OBJECT);
#ifndef GST_DISABLE_XML
gst_object_signals[OBJECT_SAVED] =
gtk_signal_new ("object_saved", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstObjectClass, object_saved),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc("object_saved", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstObjectClass, object_saved), NULL, NULL,
g_cclosure_marshal_VOID__POINTER,G_TYPE_NONE,1,
G_TYPE_POINTER);
#endif
gtk_object_class_add_signals (gtkobject_class, gst_object_signals, LAST_SIGNAL);
klass->path_string_separator = "/";
klass->signal_object = gtk_type_new (gst_signal_object_get_type ());
// FIXME!!!
// klass->signal_object = g_object_new(gst_signal_object_get_type (,NULL));
gtkobject_class->shutdown = gst_object_shutdown;
gtkobject_class->destroy = gst_object_real_destroy;
gtkobject_class->finalize = gst_object_finalize;
gobject_class->shutdown = gst_object_shutdown;
// gobject_class->destroy = gst_object_real_destroy;
gobject_class->finalize = gst_object_finalize;
}
static void
gst_object_init (GstObject *object)
{
GstObjectClass *oclass;
oclass = GST_OBJECT_CLASS (GTK_OBJECT (object)->klass);
object->lock = g_mutex_new();
#ifdef HAVE_ATOMIC_H
atomic_set(&(object->refcount),1);
#else
object->refcount = 1;
#endif
object->parent = NULL;
object->flags = 0;
@ -148,7 +135,7 @@ gst_object_init (GstObject *object)
GstObject*
gst_object_new (void)
{
return GST_OBJECT (gtk_type_new (gst_object_get_type ()));
return GST_OBJECT (g_object_new (gst_object_get_type (), NULL));
}
/**
@ -165,9 +152,9 @@ gst_object_ref (GstObject *object)
g_return_val_if_fail (GST_IS_OBJECT (object), NULL);
GST_DEBUG (GST_CAT_REFCOUNTING, "ref '%s' %d->%d\n",GST_OBJECT_NAME(object),
GTK_OBJECT(object)->ref_count,GTK_OBJECT(object)->ref_count+1);
G_OBJECT(object)->ref_count,G_OBJECT(object)->ref_count+1);
gtk_object_ref (GTK_OBJECT (object));
g_object_ref (G_OBJECT (object));
return object;
}
@ -186,9 +173,9 @@ gst_object_unref (GstObject *object)
g_return_if_fail (GST_IS_OBJECT (object));
GST_DEBUG (GST_CAT_REFCOUNTING, "unref '%s' %d->%d\n",GST_OBJECT_NAME(object),
GTK_OBJECT(object)->ref_count,GTK_OBJECT(object)->ref_count-1);
G_OBJECT(object)->ref_count,G_OBJECT(object)->ref_count-1);
gtk_object_unref (GTK_OBJECT (object));
g_object_unref (G_OBJECT (object));
}
#define gst_object_unref gst_object_unref
@ -227,46 +214,47 @@ gst_object_destroy (GstObject *object)
* invocations.
*/
gst_object_ref (object);
GTK_OBJECT (object)->klass->shutdown (GTK_OBJECT (object));
G_OBJECT_GET_CLASS (object)->shutdown (G_OBJECT (object));
gst_object_unref (object);
}
}
static void
gst_object_shutdown (GtkObject *object)
gst_object_shutdown (GObject *object)
{
GST_DEBUG (GST_CAT_REFCOUNTING, "shutdown '%s'\n",GST_OBJECT_NAME(object));
GST_FLAG_SET (GST_OBJECT (object), GST_DESTROYED);
parent_class->shutdown (GTK_OBJECT (object));
parent_class->shutdown (object);
}
/* finilize is called when the object has to free its resources */
static void
gst_object_real_destroy (GtkObject *gtk_object)
gst_object_real_destroy (GObject *g_object)
{
GST_DEBUG (GST_CAT_REFCOUNTING, "destroy '%s'\n",GST_OBJECT_NAME(gtk_object));
GST_DEBUG (GST_CAT_REFCOUNTING, "destroy '%s'\n",GST_OBJECT_NAME(g_object));
GST_OBJECT_PARENT (gtk_object) = NULL;
GST_OBJECT_PARENT (g_object) = NULL;
parent_class->destroy (gtk_object);
// FIXME!!
// parent_class->destroy (g_object);
}
/* finilize is called when the object has to free its resources */
static void
gst_object_finalize (GtkObject *gtk_object)
gst_object_finalize (GObject *object)
{
GstObject *object;
GstObject *gstobject;
object = GST_OBJECT (gtk_object);
gstobject = GST_OBJECT (object);
GST_DEBUG (GST_CAT_REFCOUNTING, "finalize '%s'\n",GST_OBJECT_NAME(object));
if (object->name != NULL)
g_free (object->name);
if (gstobject->name != NULL)
g_free (gstobject->name);
g_mutex_free (object->lock);
g_mutex_free (gstobject->lock);
parent_class->finalize (gtk_object);
parent_class->finalize (object);
}
/**
@ -333,7 +321,7 @@ gst_object_set_parent (GstObject *object, GstObject *parent)
gst_object_sink (object);
object->parent = parent;
gtk_signal_emit (GTK_OBJECT (object), gst_object_signals[PARENT_SET], parent);
g_signal_emit (G_OBJECT (object), gst_object_signals[PARENT_SET], 0, parent);
}
/**
@ -386,15 +374,16 @@ gst_object_ref (GstObject *object)
g_return_if_fail (object != NULL, NULL);
g_return_if_fail (GST_IS_OBJECT (object), NULL);
#ifdef HAVE_ATOMIC_H
g_return_if_fail (atomic_read (&(object->refcount)) > 0);
atomic_inc (&(object->refcount))
#else
//#ifdef HAVE_ATOMIC_H
// g_return_if_fail (atomic_read (&(object->refcount)) > 0);
// atomic_inc (&(object->refcount))
//#else
g_return_if_fail (object->refcount > 0);
GST_LOCK (object);
object->refcount++;
// object->refcount++;
g_object_ref((GObject *)object);
GST_UNLOCK (object);
#endif
//#endif
return object;
}
@ -436,7 +425,7 @@ gst_object_unref (GstObject *object)
object->refcount = 1;
#endif
/* destroy it */
gtk_object_destroy (GTK_OBJECT (object));
gtk_object_destroy (G_OBJECT (object));
/* drop the refcount back to zero */
#ifdef HAVE_ATOMIC_H
atomic_set (&(object->refcount),0);
@ -446,7 +435,7 @@ gst_object_unref (GstObject *object)
/* finalize the object */
// FIXME this is an evil hack that should be killed
// FIXMEFIXMEFIXMEFIXME
// gtk_object_finalize(GTK_OBJECT(object));
// gtk_object_finalize(G_OBJECT(object));
}
}
#endif /* gst_object_unref */
@ -498,13 +487,13 @@ gst_object_save_thyself (GstObject *object, xmlNodePtr parent)
g_return_val_if_fail (GST_IS_OBJECT (object), parent);
g_return_val_if_fail (parent != NULL, parent);
oclass = GST_OBJECT_CLASS (GTK_OBJECT (object)->klass);
oclass = (GstObjectClass *)G_OBJECT_GET_CLASS(object);
if (oclass->save_thyself)
oclass->save_thyself (object, parent);
#ifndef GST_DISABLE_XML
gtk_signal_emit (GTK_OBJECT (object), gst_object_signals[OBJECT_SAVED], parent);
g_signal_emit (G_OBJECT (object), gst_object_signals[OBJECT_SAVED], 0, parent);
#endif
return parent;
@ -556,7 +545,7 @@ gst_object_get_path_string (GstObject *object)
parents = parentage;
while (parents) {
if (GST_IS_OBJECT (parents->data)) {
GstObjectClass *oclass = GST_OBJECT_CLASS (GTK_OBJECT (parents->data)->klass);
GstObjectClass *oclass = (GstObjectClass *)G_OBJECT_GET_CLASS(parents->data);
component = gst_object_get_name (parents->data);
separator = oclass->path_string_separator;
@ -584,11 +573,11 @@ gst_object_get_path_string (GstObject *object)
struct _GstSignalObject {
GtkObject object;
GObject object;
};
struct _GstSignalObjectClass {
GtkObjectClass parent_class;
GObjectClass parent_class;
/* signals */
#ifndef GST_DISABLE_XML
@ -596,23 +585,24 @@ struct _GstSignalObjectClass {
#endif GST_DISABLE_XML
};
static GtkType
static GType
gst_signal_object_get_type (void)
{
static GtkType signal_object_type = 0;
static GType signal_object_type = 0;
if (!signal_object_type) {
static const GtkTypeInfo signal_object_info = {
"GstSignalObject",
sizeof(GstSignalObject),
static const GTypeInfo signal_object_info = {
sizeof(GstSignalObjectClass),
(GtkClassInitFunc)gst_signal_object_class_init,
(GtkObjectInitFunc)gst_signal_object_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_signal_object_class_init,
NULL,
NULL,
sizeof(GstSignalObject),
16,
(GInstanceInitFunc)gst_signal_object_init,
};
signal_object_type = gtk_type_unique(gtk_object_get_type(),&signal_object_info);
signal_object_type = g_type_register_static(G_TYPE_OBJECT, "GstSignalObject", &signal_object_info, 0);
}
return signal_object_type;
}
@ -620,19 +610,18 @@ gst_signal_object_get_type (void)
static void
gst_signal_object_class_init (GstSignalObjectClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*) klass;
gobject_class = (GObjectClass*) klass;
parent_class = gtk_type_class (gtk_object_get_type ());
parent_class = g_type_class_ref (G_TYPE_OBJECT);
#ifndef GST_DISABLE_XML
gst_signal_object_signals[SO_OBJECT_LOADED] =
gtk_signal_new ("object_loaded", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstSignalObjectClass, object_loaded),
gtk_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2,
GST_TYPE_OBJECT, GTK_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_signal_object_signals, LAST_SIGNAL);
g_signal_newc("object_loaded", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstObjectClass, parent_set), NULL, NULL,
gst_marshal_VOID__OBJECT_POINTER,G_TYPE_NONE,2,
G_TYPE_OBJECT,G_TYPE_POINTER);
#endif
}
@ -655,10 +644,10 @@ gst_signal_object_init (GstSignalObject *object)
guint
gst_class_signal_connect (GstObjectClass *klass,
const gchar *name,
GtkSignalFunc func,
gpointer func,
gpointer func_data)
{
return gtk_signal_connect (klass->signal_object, name, func, func_data);
return g_signal_connectc (klass->signal_object, name, func, func_data, FALSE);
}
#ifndef GST_DISABLE_XML
@ -677,9 +666,9 @@ gst_class_signal_emit_by_name (GstObject *object,
{
GstObjectClass *oclass;
oclass = GST_OBJECT_CLASS (GTK_OBJECT (object)->klass);
oclass = (GstObjectClass *)G_OBJECT_GET_CLASS(object);
gtk_signal_emit_by_name (oclass->signal_object, name, object, self);
g_signal_emit_by_name (oclass->signal_object, name, object, self);
}
#endif // GST_DISABLE_XML

View file

@ -24,16 +24,23 @@
#ifndef __GST_OBJECT_H__
#define __GST_OBJECT_H__
#include <gtk/gtk.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef USE_GLIB2
#include <glib-object.h>
#include <gst/gstmarshal.h>
#else
#include <gst/gobject2gtk.h>
#endif
#include <gst/gsttrace.h>
#include <parser.h>
#include <gst/gsttypes.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_ATOMIC_H
#include <asm/atomic.h>
#endif
@ -49,13 +56,13 @@ extern "C" {
#define GST_TYPE_OBJECT \
(gst_object_get_type())
#define GST_OBJECT(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_OBJECT,GstObject))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OBJECT,GstObject))
#define GST_OBJECT_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_OBJECT,GstObjectClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OBJECT,GstObjectClass))
#define GST_IS_OBJECT(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_OBJECT))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OBJECT))
#define GST_IS_OBJECT_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_OBJECT))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OBJECT))
//typedef struct _GstObject GstObject;
//typedef struct _GstObjectClass GstObjectClass;
@ -69,7 +76,7 @@ typedef enum
} GstObjectFlags;
struct _GstObject {
GtkObject object;
GObject object;
gchar *name;
/* have to have a refcount for the object */
@ -89,10 +96,10 @@ struct _GstObject {
};
struct _GstObjectClass {
GtkObjectClass parent_class;
GObjectClass parent_class;
gchar *path_string_separator;
GtkObject *signal_object;
GObject *signal_object;
/* signals */
void (*parent_set) (GstObject *object, GstObject *parent);
@ -127,8 +134,8 @@ struct _GstObjectClass {
#define GST_GET_LOCK(obj) (GST_OBJECT(obj)->lock)
/* normal GtkObject stuff */
GtkType gst_object_get_type (void);
/* normal GObject stuff */
GType gst_object_get_type (void);
GstObject* gst_object_new (void);
/* name routines */
@ -159,7 +166,7 @@ gchar * gst_object_get_path_string (GstObject *object);
guint gst_class_signal_connect (GstObjectClass *klass,
const gchar *name,
GtkSignalFunc func,
gpointer func,
gpointer func_data);
#ifndef GST_DISABLE_XML

View file

@ -40,22 +40,23 @@ static xmlNodePtr gst_pad_save_thyself (GstObject *object, xmlNodePtr parent);
static GstObject *pad_parent_class = NULL;
GtkType
GType
gst_pad_get_type(void) {
static GtkType pad_type = 0;
static GType pad_type = 0;
if (!pad_type) {
static const GtkTypeInfo pad_info = {
"GstPad",
sizeof(GstPad),
static const GTypeInfo pad_info = {
sizeof(GstPadClass),
(GtkClassInitFunc)gst_pad_class_init,
(GtkObjectInitFunc)gst_pad_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_pad_class_init,
NULL,
NULL,
sizeof(GstPad),
32,
(GInstanceInitFunc)gst_pad_init,
};
pad_type = gtk_type_unique(GST_TYPE_OBJECT,&pad_info);
pad_type = g_type_register_static(GST_TYPE_OBJECT, "GstPad", &pad_info, 0);
}
return pad_type;
}
@ -63,7 +64,7 @@ gst_pad_get_type(void) {
static void
gst_pad_class_init (GstPadClass *klass)
{
pad_parent_class = gtk_type_class(GST_TYPE_OBJECT);
pad_parent_class = g_type_class_ref(GST_TYPE_OBJECT);
}
static void
@ -94,36 +95,37 @@ enum {
/* FILL ME */
};
static void gst_real_pad_class_init (GstRealPadClass *klass);
static void gst_real_pad_init (GstRealPad *pad);
static void gst_real_pad_class_init (GstRealPadClass *klass);
static void gst_real_pad_init (GstRealPad *pad);
static void gst_real_pad_set_arg (GtkObject *object,GtkArg *arg,guint id);
static void gst_real_pad_get_arg (GtkObject *object,GtkArg *arg,guint id);
static void gst_real_pad_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_real_pad_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_real_pad_destroy (GtkObject *object);
static void gst_real_pad_destroy (GObject *object);
static void gst_pad_push_func (GstPad *pad, GstBuffer *buf);
static void gst_pad_push_func (GstPad *pad, GstBuffer *buf);
static GstPad *real_pad_parent_class = NULL;
static guint gst_real_pad_signals[REAL_LAST_SIGNAL] = { 0 };
GtkType
GType
gst_real_pad_get_type(void) {
static GtkType pad_type = 0;
static GType pad_type = 0;
if (!pad_type) {
static const GtkTypeInfo pad_info = {
"GstRealPad",
sizeof(GstRealPad),
static const GTypeInfo pad_info = {
sizeof(GstRealPadClass),
(GtkClassInitFunc)gst_real_pad_class_init,
(GtkObjectInitFunc)gst_real_pad_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_real_pad_class_init,
NULL,
NULL,
sizeof(GstRealPad),
32,
(GInstanceInitFunc)gst_real_pad_init,
};
pad_type = gtk_type_unique(GST_TYPE_PAD,&pad_info);
pad_type = g_type_register_static(GST_TYPE_PAD, "GstRealPad", &pad_info, 0);
}
return pad_type;
}
@ -131,47 +133,50 @@ gst_real_pad_get_type(void) {
static void
gst_real_pad_class_init (GstRealPadClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstobject_class = (GstObjectClass*)klass;
real_pad_parent_class = gtk_type_class(GST_TYPE_PAD);
real_pad_parent_class = g_type_class_ref(GST_TYPE_PAD);
// FIXME!
// gobject_class->destroy = GST_DEBUG_FUNCPTR(gst_real_pad_destroy);
gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_real_pad_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_real_pad_get_property);
gst_real_pad_signals[REAL_SET_ACTIVE] =
gtk_signal_new ("set_active", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, set_active),
gtk_marshal_NONE__BOOL, GTK_TYPE_NONE, 1,
GTK_TYPE_BOOL);
g_signal_newc ("set_active", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, set_active), NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
gst_real_pad_signals[REAL_CAPS_CHANGED] =
gtk_signal_new ("caps_changed", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, caps_changed),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("caps_changed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, caps_changed), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED] =
gtk_signal_new ("caps_nego_failed", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, caps_nego_failed),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("caps_nego_failed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gst_real_pad_signals[REAL_CONNECTED] =
gtk_signal_new ("connected", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, connected),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("connected", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, connected), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gst_real_pad_signals[REAL_DISCONNECTED] =
gtk_signal_new ("disconnected", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstRealPadClass, disconnected),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_real_pad_signals, REAL_LAST_SIGNAL);
g_signal_newc ("disconnected", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, disconnected), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_add_arg_type ("GstRealPad::active", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, REAL_ARG_ACTIVE);
gtkobject_class->destroy = GST_DEBUG_FUNCPTR(gst_real_pad_destroy);
gtkobject_class->set_arg = GST_DEBUG_FUNCPTR(gst_real_pad_set_arg);
gtkobject_class->get_arg = GST_DEBUG_FUNCPTR(gst_real_pad_get_arg);
// gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN,
// GTK_ARG_READWRITE, REAL_ARG_ACTIVE);
g_object_class_install_property (G_OBJECT_CLASS(klass), REAL_ARG_ACTIVE,
g_param_spec_boolean("active","Active","Whether the pad is active.",
TRUE,G_PARAM_READWRITE));
#ifndef GST_DISABLE_XML
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR(gst_pad_save_thyself);
@ -201,20 +206,20 @@ gst_real_pad_init (GstRealPad *pad)
}
static void
gst_real_pad_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_real_pad_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
g_return_if_fail(GST_IS_PAD(object));
switch (id) {
switch (prop_id) {
case REAL_ARG_ACTIVE:
if (GTK_VALUE_BOOL(*arg)) {
gst_info("gstpad: activating pad\n");
if (g_value_get_boolean(value)) {
GST_DEBUG(GST_CAT_PADS,"activating pad %s:%s\n",GST_DEBUG_PAD_NAME(object));
GST_FLAG_UNSET(object,GST_PAD_DISABLED);
} else {
gst_info("gstpad: de-activating pad\n");
GST_DEBUG(GST_CAT_PADS,"de-activating pad %s:%s\n",GST_DEBUG_PAD_NAME(object));
GST_FLAG_SET(object,GST_PAD_DISABLED);
}
gtk_signal_emit(GTK_OBJECT(object), gst_real_pad_signals[REAL_SET_ACTIVE],
g_signal_emit(G_OBJECT(object), gst_real_pad_signals[REAL_SET_ACTIVE], 0,
! GST_FLAG_IS_SET(object,GST_PAD_DISABLED));
break;
default:
@ -223,14 +228,14 @@ gst_real_pad_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_real_pad_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_real_pad_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_PAD (object));
switch (id) {
switch (prop_id) {
case REAL_ARG_ACTIVE:
GTK_VALUE_BOOL (*arg) = ! GST_FLAG_IS_SET (object, GST_PAD_DISABLED);
g_value_set_boolean(value, ! GST_FLAG_IS_SET (object, GST_PAD_DISABLED) );
break;
default:
break;
@ -256,7 +261,7 @@ gst_pad_new (gchar *name,
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (direction != GST_PAD_UNKNOWN, NULL);
pad = gtk_type_new (gst_real_pad_get_type ());
pad = g_object_new (gst_real_pad_get_type (), NULL);
gst_object_set_name (GST_OBJECT (pad), name);
GST_RPAD_DIRECTION(pad) = direction;
@ -585,8 +590,8 @@ gst_pad_disconnect (GstPad *srcpad,
GST_RPAD_PEER(realsink) = NULL;
/* fire off a signal to each of the pads telling them that they've been disconnected */
gtk_signal_emit(GTK_OBJECT(realsrc), gst_real_pad_signals[REAL_DISCONNECTED], realsink);
gtk_signal_emit(GTK_OBJECT(realsink), gst_real_pad_signals[REAL_DISCONNECTED], realsrc);
g_signal_emit(G_OBJECT(realsrc), gst_real_pad_signals[REAL_DISCONNECTED], 0, realsink);
g_signal_emit(G_OBJECT(realsink), gst_real_pad_signals[REAL_DISCONNECTED], 0, realsrc);
// now tell the scheduler
if (realsrc->sched)
@ -672,8 +677,8 @@ gst_pad_connect (GstPad *srcpad,
}
/* fire off a signal to each of the pads telling them that they've been connected */
gtk_signal_emit(GTK_OBJECT(realsrc), gst_real_pad_signals[REAL_CONNECTED], realsink);
gtk_signal_emit(GTK_OBJECT(realsink), gst_real_pad_signals[REAL_CONNECTED], realsrc);
g_signal_emit(G_OBJECT(realsrc), gst_real_pad_signals[REAL_CONNECTED], 0, realsink);
g_signal_emit(G_OBJECT(realsink), gst_real_pad_signals[REAL_CONNECTED], 0, realsrc);
// now tell the scheduler(s)
if (realsrc->sched)
@ -701,7 +706,7 @@ gst_pad_set_parent (GstPad *pad,
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (GST_PAD_PARENT (pad) == NULL);
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
g_return_if_fail (GST_IS_OBJECT (parent));
g_return_if_fail ((gpointer)pad != (gpointer)parent);
gst_object_set_parent (GST_OBJECT (pad), parent);
@ -1047,7 +1052,7 @@ gst_pad_get_bufferpool (GstPad *pad)
}
static void
gst_real_pad_destroy (GtkObject *object)
gst_real_pad_destroy (GObject *object)
{
GstPad *pad = GST_PAD (object);
@ -1080,8 +1085,9 @@ gst_real_pad_destroy (GtkObject *object)
g_list_free (GST_REAL_PAD(pad)->ghostpads);
}
if (GTK_OBJECT_CLASS (real_pad_parent_class)->destroy)
GTK_OBJECT_CLASS (real_pad_parent_class)->destroy (object);
// FIXME !!
// if (G_OBJECT_CLASS (real_pad_parent_class)->destroy)
// G_OBJECT_CLASS (real_pad_parent_class)->destroy (object);
}
@ -1298,10 +1304,10 @@ gst_pad_renegotiate (GstPad *pad)
if (!result) {
GST_DEBUG (GST_CAT_NEGOTIATION, "firing caps_nego_failed signal on %s:%s and %s:%s to give it a chance to succeed\n",
GST_DEBUG_PAD_NAME(currentpad),GST_DEBUG_PAD_NAME(otherpad));
gtk_signal_emit (GTK_OBJECT(currentpad),
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED],&result);
gtk_signal_emit (GTK_OBJECT(otherpad),
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED],&result);
g_signal_emit (G_OBJECT(currentpad),
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, &result);
g_signal_emit (G_OBJECT(otherpad),
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, &result);
if (result)
GST_DEBUG (GST_CAT_NEGOTIATION, "caps_nego_failed handler claims success at renego, believing\n");
}
@ -1323,10 +1329,10 @@ gst_pad_renegotiate (GstPad *pad)
GST_DEBUG (GST_CAT_NEGOTIATION, "firing caps_changed signal on %s:%s and %s:%s\n",
GST_DEBUG_PAD_NAME(currentpad),GST_DEBUG_PAD_NAME(otherpad));
gtk_signal_emit (GTK_OBJECT(currentpad),
gst_real_pad_signals[REAL_CAPS_CHANGED],GST_PAD_CAPS(currentpad));
gtk_signal_emit (GTK_OBJECT(otherpad),
gst_real_pad_signals[REAL_CAPS_CHANGED],GST_PAD_CAPS(otherpad));
g_signal_emit (G_OBJECT(currentpad),
gst_real_pad_signals[REAL_CAPS_CHANGED], 0, GST_PAD_CAPS(currentpad));
g_signal_emit (G_OBJECT(otherpad),
gst_real_pad_signals[REAL_CAPS_CHANGED], 0, GST_PAD_CAPS(otherpad));
}
return result;
@ -1577,23 +1583,24 @@ enum {
static GstObject *padtemplate_parent_class = NULL;
static guint gst_padtemplate_signals[TEMPL_LAST_SIGNAL] = { 0 };
GtkType
GType
gst_padtemplate_get_type (void)
{
static GtkType padtemplate_type = 0;
static GType padtemplate_type = 0;
if (!padtemplate_type) {
static const GtkTypeInfo padtemplate_info = {
"GstPadTemplate",
sizeof(GstPadTemplate),
static const GTypeInfo padtemplate_info = {
sizeof(GstPadTemplateClass),
(GtkClassInitFunc)gst_padtemplate_class_init,
(GtkObjectInitFunc)gst_padtemplate_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_padtemplate_class_init,
NULL,
NULL,
sizeof(GstPadTemplate),
32,
(GInstanceInitFunc)gst_padtemplate_init,
};
padtemplate_type = gtk_type_unique(GST_TYPE_OBJECT,&padtemplate_info);
padtemplate_type = g_type_register_static(GST_TYPE_OBJECT, "GstPadTemplate", &padtemplate_info, 0);
}
return padtemplate_type;
}
@ -1601,21 +1608,20 @@ gst_padtemplate_get_type (void)
static void
gst_padtemplate_class_init (GstPadTemplateClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstobject_class = (GstObjectClass*)klass;
padtemplate_parent_class = gtk_type_class(GST_TYPE_OBJECT);
padtemplate_parent_class = g_type_class_ref(GST_TYPE_OBJECT);
gst_padtemplate_signals[TEMPL_PAD_CREATED] =
gtk_signal_new ("pad_created", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstPadTemplateClass, pad_created),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
g_signal_newc ("pad_created", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstPadTemplateClass, pad_created), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
GST_TYPE_PAD);
gtk_object_class_add_signals (gtkobject_class, gst_padtemplate_signals, TEMPL_LAST_SIGNAL);
gstobject_class->path_string_separator = "*";
}
@ -1648,7 +1654,7 @@ gst_padtemplate_new (gchar *name_template,
g_return_val_if_fail (name_template != NULL, NULL);
new = gtk_type_new (gst_padtemplate_get_type ());
new = g_object_new(gst_padtemplate_get_type () ,NULL);
GST_PADTEMPLATE_NAME_TEMPLATE (new) = name_template;
GST_PADTEMPLATE_DIRECTION (new) = direction;
@ -1894,22 +1900,23 @@ static void gst_ghost_pad_init (GstGhostPad *pad);
static GstPad *ghost_pad_parent_class = NULL;
//static guint gst_ghost_pad_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_ghost_pad_get_type(void) {
static GtkType pad_type = 0;
static GType pad_type = 0;
if (!pad_type) {
static const GtkTypeInfo pad_info = {
"GstGhostPad",
sizeof(GstGhostPad),
static const GTypeInfo pad_info = {
sizeof(GstGhostPadClass),
(GtkClassInitFunc)gst_ghost_pad_class_init,
(GtkObjectInitFunc)gst_ghost_pad_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_ghost_pad_class_init,
NULL,
NULL,
sizeof(GstGhostPad),
8,
(GInstanceInitFunc)gst_ghost_pad_init,
};
pad_type = gtk_type_unique(GST_TYPE_PAD,&pad_info);
pad_type = g_type_register_static(GST_TYPE_PAD, "GstGhostPad", &pad_info, 0);
}
return pad_type;
}
@ -1917,11 +1924,11 @@ gst_ghost_pad_get_type(void) {
static void
gst_ghost_pad_class_init (GstGhostPadClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
ghost_pad_parent_class = gtk_type_class(GST_TYPE_PAD);
ghost_pad_parent_class = g_type_class_ref(GST_TYPE_PAD);
}
static void
@ -1948,7 +1955,7 @@ gst_ghost_pad_new (gchar *name,
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD(pad), NULL);
ghostpad = gtk_type_new (gst_ghost_pad_get_type ());
ghostpad = g_object_new(gst_ghost_pad_get_type () ,NULL);
gst_pad_set_name (GST_PAD (ghostpad), name);
GST_GPAD_REALPAD(ghostpad) = GST_PAD_REALIZE(pad);
GST_PAD_PADTEMPLATE(ghostpad) = GST_PAD_PADTEMPLATE(pad);

View file

@ -45,22 +45,22 @@ extern "C" {
#define GST_TYPE_PAD (gst_pad_get_type ())
#define GST_PAD(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PAD,GstPad))
#define GST_PAD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD,GstPadClass))
#define GST_IS_PAD(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_PAD))
#define GST_IS_PAD_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
#define GST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD,GstPad))
#define GST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD,GstPadClass))
#define GST_IS_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD))
#define GST_IS_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD))
#define GST_TYPE_REAL_PAD (gst_real_pad_get_type ())
#define GST_REAL_PAD(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_REAL_PAD,GstRealPad))
#define GST_REAL_PAD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD,GstRealPadClass))
#define GST_IS_REAL_PAD(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_REAL_PAD))
#define GST_IS_REAL_PAD_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD))
#define GST_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REAL_PAD,GstRealPad))
#define GST_REAL_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REAL_PAD,GstRealPadClass))
#define GST_IS_REAL_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REAL_PAD))
#define GST_IS_REAL_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REAL_PAD))
#define GST_TYPE_GHOST_PAD (gst_ghost_pad_get_type ())
#define GST_GHOST_PAD(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_GHOST_PAD,GstGhostPad))
#define GST_GHOST_PAD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD,GstGhostPadClass))
#define GST_IS_GHOST_PAD(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_GHOST_PAD))
#define GST_IS_GHOST_PAD_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
#define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD,GstGhostPad))
#define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD,GstGhostPadClass))
#define GST_IS_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD))
#define GST_IS_GHOST_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
//typedef struct _GstPad GstPad;
@ -74,7 +74,7 @@ typedef struct _GstGhostPadClass GstGhostPadClass;
typedef enum {
GST_REGION_NONE,
GST_REGION_VOID,
GST_REGION_OFFSET_LEN,
GST_REGION_TIME_LEN,
} GstRegionType;
@ -230,10 +230,10 @@ struct _GstGhostPadClass {
/***** PadTemplate *****/
#define GST_TYPE_PADTEMPLATE (gst_padtemplate_get_type ())
#define GST_PADTEMPLATE(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PADTEMPLATE,GstPadTemplate))
#define GST_PADTEMPLATE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PADTEMPLATE,GstPadTemplateClass))
#define GST_IS_PADTEMPLATE(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_PADTEMPLATE))
#define GST_IS_PADTEMPLATE_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_PADTEMPLATE))
#define GST_PADTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PADTEMPLATE,GstPadTemplate))
#define GST_PADTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PADTEMPLATE,GstPadTemplateClass))
#define GST_IS_PADTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PADTEMPLATE))
#define GST_IS_PADTEMPLATE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PADTEMPLATE))
typedef enum {
GST_PAD_ALWAYS,
@ -288,9 +288,9 @@ name (void) \
#define GST_PADTEMPLATE_GET(fact) (fact)()
GtkType gst_pad_get_type (void);
GtkType gst_real_pad_get_type (void);
GtkType gst_ghost_pad_get_type (void);
GType gst_pad_get_type (void);
GType gst_real_pad_get_type (void);
GType gst_ghost_pad_get_type (void);
GstPad* gst_pad_new (gchar *name, GstPadDirection direction);
#define gst_pad_destroy(pad) gst_object_destroy (GST_OBJECT (pad))
@ -378,7 +378,7 @@ GstPad * gst_ghost_pad_new (gchar *name,GstPad *pad);
/* templates and factories */
GtkType gst_padtemplate_get_type (void);
GType gst_padtemplate_get_type (void);
GstPadTemplate* gst_padtemplate_new (gchar *name_template,
GstPadDirection direction, GstPadPresence presence,

View file

@ -233,10 +233,9 @@ gst_parse_launch_cmdline(int argc,char *argv[],GstBin *parent,gst_parse_priv *pr
argname = arg;
pos[0] = '\0';
argval = pos+1;
DEBUG("attempting to set argument '%s' to '%s' on element '%s'\n",
GST_DEBUG(0,"attempting to set argument '%s' to '%s' on element '%s'\n",
argname,argval,GST_ELEMENT_NAME(previous));
//gtk_object_set(GTK_OBJECT(previous),argname,argval,NULL);
gst_util_set_object_arg (GTK_OBJECT(previous), argname, argval);
gst_util_set_object_arg (G_OBJECT(previous), argname, argval);
g_free(argname);
// element or argument, or beginning of bin or thread
@ -346,8 +345,8 @@ gst_parse_launch_cmdline(int argc,char *argv[],GstBin *parent,gst_parse_priv *pr
srcpadname,
GST_DEBUG_PAD_NAME(GST_PARSE_LISTPAD(sinkpads)));
gtk_signal_connect (GTK_OBJECT (previous), "new_pad", dynamic_connect, connect);
gtk_signal_connect (GTK_OBJECT (previous), "new_ghost_pad", dynamic_connect, connect);
g_signal_connectc (G_OBJECT (previous), "new_pad", dynamic_connect, connect, FALSE);
g_signal_connectc (G_OBJECT (previous), "new_ghost_pad", dynamic_connect, connect, FALSE);
}
else {
for (j=0; (j<numsrcpads) && (j<numsinkpads); j++){
@ -369,8 +368,7 @@ gst_parse_launch_cmdline(int argc,char *argv[],GstBin *parent,gst_parse_priv *pr
// thomas: if we're the first element, connect eos signal
if (elementcount == 1)
{
gtk_signal_connect (GTK_OBJECT (element), "eos",
GTK_SIGNAL_FUNC (have_eos), NULL);
g_signal_connectc (G_OBJECT (element), "eos", have_eos, NULL, FALSE);
}
// if we're the first element, ghost all the sinkpads

View file

@ -60,22 +60,23 @@ static GstElementStateReturn gst_pipeline_change_state (GstElement *element);
static GstBinClass *parent_class = NULL;
//static guint gst_pipeline_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_pipeline_get_type (void) {
static GtkType pipeline_type = 0;
static GType pipeline_type = 0;
if (!pipeline_type) {
static const GtkTypeInfo pipeline_info = {
"GstPipeline",
sizeof(GstPipeline),
static const GTypeInfo pipeline_info = {
sizeof(GstPipelineClass),
(GtkClassInitFunc)gst_pipeline_class_init,
(GtkObjectInitFunc)gst_pipeline_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_pipeline_class_init,
NULL,
NULL,
sizeof(GstPipeline),
0,
(GInstanceInitFunc)gst_pipeline_init,
};
pipeline_type = gtk_type_unique (gst_bin_get_type (), &pipeline_info);
pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0);
}
return pipeline_type;
}
@ -87,7 +88,7 @@ gst_pipeline_class_init (GstPipelineClass *klass)
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class(gst_bin_get_type());
parent_class = g_type_class_ref(gst_bin_get_type());
gstelement_class->change_state = gst_pipeline_change_state;
}

View file

@ -37,13 +37,13 @@ extern GstElementDetails gst_pipeline_details;
#define GST_TYPE_PIPELINE \
(gst_pipeline_get_type())
#define GST_PIPELINE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_PIPELINE,GstPipeline))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PIPELINE,GstPipeline))
#define GST_PIPELINE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_PIPELINE,GstPipelineClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PIPELINE,GstPipelineClass))
#define GST_IS_PIPELINE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_PIPELINE))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIPELINE))
#define GST_IS_PIPELINE_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPELINE))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPELINE))
typedef struct _GstPipeline GstPipeline;
typedef struct _GstPipelineClass GstPipelineClass;
@ -56,7 +56,7 @@ struct _GstPipelineClass {
GstBinClass parent_class;
};
GtkType gst_pipeline_get_type (void);
GType gst_pipeline_get_type (void);
GstElement* gst_pipeline_new (const guchar *name);
#define gst_pipeline_destroy(pipeline) gst_object_destroy(GST_OBJECT(pipeline))

View file

@ -70,8 +70,8 @@ enum {
static void gst_queue_class_init (GstQueueClass *klass);
static void gst_queue_init (GstQueue *queue);
static void gst_queue_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_queue_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_queue_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_queue_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static gboolean gst_queue_handle_eos (GstPad *pad);
static GstPadNegotiateReturn gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data);
@ -85,17 +85,17 @@ static void gst_queue_flush (GstQueue *queue);
static GstElementStateReturn gst_queue_change_state (GstElement *element);
static GtkType
static GType
queue_leaky_get_type(void) {
static GtkType queue_leaky_type = 0;
static GtkEnumValue queue_leaky[] = {
static GType queue_leaky_type = 0;
static GEnumValue queue_leaky[] = {
{ GST_QUEUE_NO_LEAK, "0", "Not Leaky" },
{ GST_QUEUE_LEAK_UPSTREAM, "1", "Leaky on Upstream" },
{ GST_QUEUE_LEAK_DOWNSTREAM, "2", "Leaky on Downstream" },
{ 0, NULL, NULL },
};
if (!queue_leaky_type) {
queue_leaky_type = gtk_type_register_enum("GstQueueLeaky", queue_leaky);
queue_leaky_type = g_enum_register_static("GstQueueLeaky", queue_leaky);
}
return queue_leaky_type;
}
@ -105,22 +105,23 @@ queue_leaky_get_type(void) {
static GstElementClass *parent_class = NULL;
//static guint gst_queue_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_queue_get_type(void) {
static GtkType queue_type = 0;
static GType queue_type = 0;
if (!queue_type) {
static const GtkTypeInfo queue_info = {
"GstQueue",
sizeof(GstQueue),
static const GTypeInfo queue_info = {
sizeof(GstQueueClass),
(GtkClassInitFunc)gst_queue_class_init,
(GtkObjectInitFunc)gst_queue_init,
(GtkArgSetFunc)gst_queue_set_arg,
(GtkArgGetFunc)gst_queue_get_arg,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_queue_class_init,
NULL,
NULL,
sizeof(GstQueue),
4,
(GInstanceInitFunc)gst_queue_init,
};
queue_type = gtk_type_unique (GST_TYPE_ELEMENT, &queue_info);
queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0);
}
return queue_type;
}
@ -128,25 +129,28 @@ gst_queue_get_type(void) {
static void
gst_queue_class_init (GstQueueClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstQueue::leaky", GST_TYPE_QUEUE_LEAKY,
GTK_ARG_READWRITE, ARG_LEAKY);
gtk_object_add_arg_type ("GstQueue::level", GTK_TYPE_INT,
GTK_ARG_READABLE, ARG_LEVEL);
gtk_object_add_arg_type ("GstQueue::max_level", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_MAX_LEVEL);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LEAKY,
g_param_spec_enum("leaky","Leaky","Where the queue leaks, if at all.",
GST_TYPE_QUEUE_LEAKY,GST_QUEUE_NO_LEAK,G_PARAM_READWRITE));
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LEVEL,
g_param_spec_int("level","Level","How many buffers are in the queue.",
0,G_MAXINT,0,G_PARAM_READABLE));
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MAX_LEVEL,
g_param_spec_int("max_level","Maximum Level","How many buffers the queue holds.",
0,G_MAXINT,100,G_PARAM_READWRITE));
gtkobject_class->set_arg = gst_queue_set_arg;
gtkobject_class->get_arg = gst_queue_get_arg;
gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_queue_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_queue_get_property);
gstelement_class->change_state = gst_queue_change_state;
gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_queue_change_state);
}
static void
@ -158,14 +162,14 @@ gst_queue_init (GstQueue *queue)
queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_chain));
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
gst_pad_set_eos_function (queue->sinkpad, gst_queue_handle_eos);
gst_pad_set_negotiate_function (queue->sinkpad, gst_queue_handle_negotiate_sink);
gst_pad_set_bufferpool_function (queue->sinkpad, gst_queue_get_bufferpool);
gst_pad_set_eos_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_handle_eos));
gst_pad_set_negotiate_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_handle_negotiate_sink));
gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR(gst_queue_get_bufferpool));
queue->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_pad_set_get_function (queue->srcpad, GST_DEBUG_FUNCPTR(gst_queue_get));
gst_element_add_pad (GST_ELEMENT (queue), queue->srcpad);
gst_pad_set_negotiate_function (queue->srcpad, gst_queue_handle_negotiate_src);
gst_pad_set_negotiate_function (queue->srcpad, GST_DEBUG_FUNCPTR(gst_queue_handle_negotiate_src));
queue->queue = NULL;
queue->level_buffers = 0;
@ -306,16 +310,16 @@ gst_queue_chain (GstPad *pad, GstBuffer *buf)
while (queue->level_buffers >= queue->size_buffers) {
// if there's a pending state change for this queue or its manager, switch
// back to iterator so bottom half of state change executes
if (GST_STATE_PENDING(queue) != GST_STATE_NONE_PENDING ||
// GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_NONE_PENDING)
if (GST_STATE_PENDING(queue) != GST_STATE_VOID_PENDING ||
// GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_VOID_PENDING)
GST_STATE_PENDING(GST_SCHED_PARENT(GST_ELEMENT_SCHED(GST_PAD_PARENT(GST_PAD_PEER(queue->sinkpad))))) !=
GST_STATE_NONE_PENDING)
GST_STATE_VOID_PENDING)
{
GST_DEBUG(GST_CAT_DATAFLOW,"interrupted!!\n");
if (GST_STATE_PENDING(queue) != GST_STATE_NONE_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(queue) != GST_STATE_NONE_PENDING)\n");
if (GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_NONE_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_NONE_PENDING\n");
if (GST_STATE_PENDING(queue) != GST_STATE_VOID_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(queue) != GST_STATE_VOID_PENDING)\n");
if (GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_VOID_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_VOID_PENDING\n");
GST_UNLOCK(queue);
cothread_switch(cothread_current_main());
}
@ -376,16 +380,16 @@ gst_queue_get (GstPad *pad)
// if there's a pending state change for this queue or its manager, switch
// back to iterator so bottom half of state change executes
if (GST_STATE_PENDING(queue) != GST_STATE_NONE_PENDING ||
// GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_NONE_PENDING)
if (GST_STATE_PENDING(queue) != GST_STATE_VOID_PENDING ||
// GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_VOID_PENDING)
GST_STATE_PENDING(GST_SCHED_PARENT(GST_ELEMENT_SCHED(GST_PAD_PARENT(GST_PAD_PEER(queue->srcpad))))) !=
GST_STATE_NONE_PENDING)
GST_STATE_VOID_PENDING)
{
GST_DEBUG(GST_CAT_DATAFLOW,"interrupted!!\n");
if (GST_STATE_PENDING(queue) != GST_STATE_NONE_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(queue) != GST_STATE_NONE_PENDING)\n");
if (GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_NONE_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_NONE_PENDING\n");
if (GST_STATE_PENDING(queue) != GST_STATE_VOID_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(queue) != GST_STATE_VOID_PENDING)\n");
if (GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_VOID_PENDING)
GST_DEBUG(GST_CAT_DATAFLOW,"GST_STATE_PENDING(GST_SCHEDULE(GST_ELEMENT(queue)->sched)->parent) != GST_STATE_VOID_PENDING\n");
GST_UNLOCK(queue);
cothread_switch(cothread_current_main());
}
@ -435,11 +439,11 @@ gst_queue_change_state (GstElement *element)
gst_queue_flush (queue);
}
/* if we haven't failed already, give the parent class a chance to ;-) */
// if we haven't failed already, give the parent class a chance to ;-)
if (GST_ELEMENT_CLASS (parent_class)->change_state)
{
gboolean valid_handler = FALSE;
guint state_change_id = gtk_signal_lookup("state_change", GTK_OBJECT_TYPE(element));
guint state_change_id = g_signal_lookup("state_change", G_OBJECT_TYPE(element));
// determine whether we need to block the parent (element) class'
// STATE_CHANGE signal so we can UNLOCK before returning. we block
@ -450,20 +454,20 @@ gst_queue_change_state (GstElement *element)
// if element change_state() emits other signals, they need to be blocked
// as well.
if (state_change_id &&
gtk_signal_handler_pending(GTK_OBJECT(element), state_change_id, FALSE))
g_signal_has_handler_pending(G_OBJECT(element), state_change_id, 0, FALSE))
valid_handler = TRUE;
if (valid_handler)
gtk_signal_handler_block(GTK_OBJECT(element), state_change_id);
g_signal_handler_block(G_OBJECT(element), state_change_id);
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element);
if (valid_handler)
gtk_signal_handler_unblock(GTK_OBJECT(element), state_change_id);
g_signal_handler_unblock(G_OBJECT(element), state_change_id);
// UNLOCK, *then* emit signal (if there's one there)
GST_UNLOCK(queue);
if (valid_handler)
gtk_signal_emit(GTK_OBJECT (element), state_change_id, GST_STATE(element));
g_signal_emit(G_OBJECT (element), state_change_id, 0, GST_STATE(element));
}
else
{
@ -476,7 +480,7 @@ gst_queue_change_state (GstElement *element)
static void
gst_queue_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_queue_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstQueue *queue;
@ -485,20 +489,21 @@ gst_queue_set_arg (GtkObject *object, GtkArg *arg, guint id)
queue = GST_QUEUE (object);
switch(id) {
switch (prop_id) {
case ARG_LEAKY:
queue->leaky = GTK_VALUE_INT (*arg);
queue->leaky = g_value_get_int(value);
break;
case ARG_MAX_LEVEL:
queue->size_buffers = GTK_VALUE_INT (*arg);
queue->size_buffers = g_value_get_int(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_queue_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_queue_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstQueue *queue;
@ -507,18 +512,18 @@ gst_queue_get_arg (GtkObject *object, GtkArg *arg, guint id)
queue = GST_QUEUE (object);
switch (id) {
switch (prop_id) {
case ARG_LEAKY:
GTK_VALUE_INT (*arg) = queue->leaky;
g_value_set_int(value, queue->leaky);
break;
case ARG_LEVEL:
GTK_VALUE_INT (*arg) = queue->level_buffers;
g_value_set_int(value, queue->level_buffers);
break;
case ARG_MAX_LEVEL:
GTK_VALUE_INT (*arg) = queue->size_buffers;
g_value_set_int(value, queue->size_buffers);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -39,13 +39,13 @@ GstElementDetails gst_queue_details;
#define GST_TYPE_QUEUE \
(gst_queue_get_type())
#define GST_QUEUE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_QUEUE,GstQueue))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QUEUE,GstQueue))
#define GST_QUEUE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_QUEUE,GstQueueClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QUEUE,GstQueueClass))
#define GST_IS_QUEUE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_QUEUE))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUEUE))
#define GST_IS_QUEUE_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE))
enum {
GST_QUEUE_NO_LEAK = 0,
@ -90,7 +90,7 @@ struct _GstQueueClass {
void (*high_watermark) (GstQueue *queue, gint level);
};
GtkType gst_queue_get_type (void);
GType gst_queue_get_type (void);
#ifdef __cplusplus
}

View file

@ -100,13 +100,13 @@ gst_schedule_src_wrapper (int argc,char *argv[])
pads = g_list_next(pads);
if (GST_RPAD_DIRECTION(realpad) == GST_PAD_SRC) {
GST_DEBUG (GST_CAT_DATAFLOW,"calling _getfunc for %s:%s\n",GST_DEBUG_PAD_NAME(realpad));
if (realpad->regiontype != GST_REGION_NONE) {
if (realpad->regiontype != GST_REGION_VOID) {
g_return_val_if_fail (GST_RPAD_GETREGIONFUNC(realpad) != NULL, 0);
// if (GST_RPAD_GETREGIONFUNC(realpad) == NULL)
// fprintf(stderr,"error, no getregionfunc in \"%s\"\n", name);
// else
buf = (GST_RPAD_GETREGIONFUNC(realpad))((GstPad*)realpad,realpad->regiontype,realpad->offset,realpad->len);
realpad->regiontype = GST_REGION_NONE;
realpad->regiontype = GST_REGION_VOID;
} else {
g_return_val_if_fail (GST_RPAD_GETFUNC(realpad) != NULL, 0);
// if (GST_RPAD_GETFUNC(realpad) == NULL)
@ -429,7 +429,7 @@ void gst_bin_schedule_func(GstBin *bin) {
GST_DEBUG (GST_CAT_SCHEDULING,"adding '%s' to chain\n",GST_ELEMENT_NAME(element));
chain->elements = g_list_prepend (chain->elements, element);
chain->num_elements++;
gtk_signal_connect (GTK_OBJECT (element), "eos", gst_scheduler_handle_eos, chain);
gtk_signal_connect (G_OBJECT (element), "eos", gst_scheduler_handle_eos, chain);
// set the cothreads flag as appropriate
if (GST_FLAG_IS_SET (element, GST_ELEMENT_USE_COTHREAD))
chain->need_cothreads = TRUE;
@ -479,7 +479,7 @@ void gst_bin_schedule_func(GstBin *bin) {
if ((GST_RPAD_DIRECTION(pad) == GST_PAD_SINK) &&
(GST_FLAG_IS_SET (peerparent, GST_ELEMENT_DECOUPLED))) {
chain->entries = g_list_prepend (chain->entries, peerparent);
gtk_signal_connect (GTK_OBJECT (peerparent), "eos", gst_scheduler_handle_eos, chain);
gtk_signal_connect (G_OBJECT (peerparent), "eos", gst_scheduler_handle_eos, chain);
GST_DEBUG (GST_CAT_SCHEDULING,"added '%s' as DECOUPLED entry into the chain\n",GST_ELEMENT_NAME(peerparent));
}
} else
@ -798,21 +798,22 @@ static void gst_schedule_init (GstSchedule *schedule);
static GstObjectClass *parent_class = NULL;
GtkType gst_schedule_get_type(void) {
static GtkType schedule_type = 0;
GType gst_schedule_get_type(void) {
static GType schedule_type = 0;
if (!schedule_type) {
static const GtkTypeInfo schedule_info = {
"GstSchedule",
sizeof(GstSchedule),
static const GTypeInfo schedule_info = {
sizeof(GstScheduleClass),
(GtkClassInitFunc)gst_schedule_class_init,
(GtkObjectInitFunc)gst_schedule_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_schedule_class_init,
NULL,
NULL,
sizeof(GstSchedule),
0,
(GInstanceInitFunc)gst_schedule_init,
};
schedule_type = gtk_type_unique(GST_TYPE_OBJECT,&schedule_info);
schedule_type = g_type_register_static(GST_TYPE_OBJECT, "GstSchedule", &schedule_info, 0);
}
return schedule_type;
}
@ -820,7 +821,7 @@ GtkType gst_schedule_get_type(void) {
static void
gst_schedule_class_init (GstScheduleClass *klass)
{
parent_class = gtk_type_class(GST_TYPE_OBJECT);
parent_class = g_type_class_ref(GST_TYPE_OBJECT);
}
static void
@ -840,7 +841,7 @@ gst_schedule_init (GstSchedule *schedule)
GstSchedule*
gst_schedule_new(GstElement *parent)
{
GstSchedule *sched = GST_SCHEDULE (gtk_type_new (GST_TYPE_SCHEDULE));
GstSchedule *sched = GST_SCHEDULE (g_object_new(GST_TYPE_SCHEDULE,NULL));
sched->parent = parent;
@ -1339,7 +1340,7 @@ GST_DEBUG(GST_CAT_SCHEDULING,"there are %d elements in this chain\n",chain->num_
// if it was, return to gstthread.c::gst_thread_main_loop() to
// execute the state change.
GST_DEBUG (GST_CAT_DATAFLOW,"cothread switch ended or interrupted\n");
if (GST_STATE_PENDING(GST_SCHEDULE(sched)->parent) != GST_STATE_NONE_PENDING)
if (GST_STATE_PENDING(GST_SCHEDULE(sched)->parent) != GST_STATE_VOID_PENDING)
{
GST_DEBUG (GST_CAT_DATAFLOW,"handle pending state %d\n",
GST_STATE_PENDING(GST_SCHEDULE(sched)->parent));

View file

@ -36,13 +36,13 @@ extern "C" {
#define GST_TYPE_SCHEDULE \
(gst_schedule_get_type())
#define GST_SCHEDULE(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_SCHEDULE,GstSchedule))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SCHEDULE,GstSchedule))
#define GST_SCHEDULE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_SCHEDULE,GstScheduleClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SCHEDULE,GstScheduleClass))
#define GST_IS_SCHEDULE(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_SCHEDULE))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SCHEDULE))
#define GST_IS_SCHEDULE_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_SCHEDULE))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SCHEDULE))
#define GST_SCHED_PARENT(sched) ((sched)->parent)
@ -126,7 +126,7 @@ struct _GstScheduleChain {
};
GtkType gst_schedule_get_type (void);
GType gst_schedule_get_type (void);
GstSchedule* gst_schedule_new (GstElement *parent);
void gst_schedule_add_element (GstSchedule *sched, GstElement *element);

View file

@ -61,10 +61,10 @@ enum {
static void gst_thread_class_init (GstThreadClass *klass);
static void gst_thread_init (GstThread *thread);
static void gst_thread_real_destroy (GtkObject *gtk_object);
static void gst_thread_real_destroy (GObject *object);
static void gst_thread_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_thread_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_thread_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_thread_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstElementStateReturn gst_thread_change_state (GstElement *element);
@ -80,22 +80,23 @@ static void* gst_thread_main_loop (void *arg);
static GstBinClass *parent_class = NULL;
//static guint gst_thread_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_thread_get_type(void) {
static GtkType thread_type = 0;
static GType thread_type = 0;
if (!thread_type) {
static const GtkTypeInfo thread_info = {
"GstThread",
sizeof(GstThread),
static const GTypeInfo thread_info = {
sizeof(GstThreadClass),
(GtkClassInitFunc)gst_thread_class_init,
(GtkObjectInitFunc)gst_thread_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_thread_class_init,
NULL,
NULL,
sizeof(GstThread),
4,
(GInstanceInitFunc)gst_thread_init,
};
thread_type = gtk_type_unique(GST_TYPE_BIN,&thread_info);
thread_type = g_type_register_static(GST_TYPE_BIN, "GstThread", &thread_info, 0);
}
return thread_type;
}
@ -103,22 +104,24 @@ gst_thread_get_type(void) {
static void
gst_thread_class_init (GstThreadClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
GstElementClass *gstelement_class;
GstBinClass *gstbin_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstobject_class = (GstObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
gstbin_class = (GstBinClass*)klass;
parent_class = gtk_type_class (GST_TYPE_BIN);
parent_class = g_type_class_ref (GST_TYPE_BIN);
gtk_object_add_arg_type ("GstThread::create_thread", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_CREATE_THREAD);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CREATE_THREAD,
g_param_spec_boolean("create_thread", "Create Thread", "Whether to create a thread.",
TRUE,G_PARAM_READWRITE));
gtkobject_class->destroy = gst_thread_real_destroy;
// FIXME!
// gobject_class->destroy = gst_thread_real_destroy;
#ifndef GST_DISABLE_XML
gstobject_class->save_thyself = gst_thread_save_thyself;
@ -129,8 +132,8 @@ gst_thread_class_init (GstThreadClass *klass)
// gstbin_class->schedule = gst_thread_schedule_dummy;
gtkobject_class->set_arg = gst_thread_set_arg;
gtkobject_class->get_arg = gst_thread_get_arg;
gobject_class->set_property = gst_thread_set_property;
gobject_class->get_property = gst_thread_get_property;
}
@ -158,33 +161,32 @@ gst_thread_init (GstThread *thread)
}
static void
gst_thread_real_destroy (GtkObject *gtk_object)
gst_thread_real_destroy (GObject *object)
{
GstThread *thread = GST_THREAD (gtk_object);
GstThread *thread = GST_THREAD (object);
GST_DEBUG (GST_CAT_REFCOUNTING,"destroy()\n");
g_mutex_free (thread->lock);
g_cond_free (thread->cond);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (gtk_object);
// FIXME!
// if (G_OBJECT_CLASS (parent_class)->destroy)
// G_OBJECT_CLASS (parent_class)->destroy (object);
gst_object_destroy (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
gst_object_unref (GST_OBJECT (GST_ELEMENT_SCHED (thread)));
}
static void
gst_thread_set_arg (GtkObject *object,
GtkArg *arg,
guint id)
gst_thread_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_THREAD (object));
switch(id) {
switch (prop_id) {
case ARG_CREATE_THREAD:
if (GTK_VALUE_BOOL (*arg)) {
if (g_value_get_boolean(value)) {
GST_INFO (GST_CAT_THREAD,"turning ON the creation of the thread");
GST_FLAG_SET (object, GST_THREAD_CREATE);
// GST_DEBUG (GST_CAT_THREAD,"flags are 0x%08x\n", GST_FLAGS (object));
@ -195,23 +197,23 @@ gst_thread_set_arg (GtkObject *object,
}
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_thread_get_arg (GtkObject *object,
GtkArg *arg,
guint id)
gst_thread_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_THREAD (object));
switch (id) {
switch (prop_id) {
case ARG_CREATE_THREAD:
GTK_VALUE_BOOL (*arg) = GST_FLAG_IS_SET (object, GST_THREAD_CREATE);
g_value_set_boolean(value, GST_FLAG_IS_SET (object, GST_THREAD_CREATE));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -468,7 +470,7 @@ gst_thread_change_state (GstElement *element)
static void gst_thread_update_state (GstThread *thread)
{
// check for state change
if (GST_STATE_PENDING(thread) != GST_STATE_NONE_PENDING) {
if (GST_STATE_PENDING(thread) != GST_STATE_VOID_PENDING) {
// punt and change state on all the children
if (GST_ELEMENT_CLASS (parent_class)->change_state)
GST_ELEMENT_CLASS (parent_class)->change_state (GST_ELEMENT(thread));

View file

@ -53,13 +53,13 @@ typedef enum {
#define GST_TYPE_THREAD \
(gst_thread_get_type())
#define GST_THREAD(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_THREAD,GstThread))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_THREAD,GstThread))
#define GST_THREAD_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_THREAD,GstThreadClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_THREAD,GstThreadClass))
#define GST_IS_THREAD(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_THREAD))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_THREAD))
#define GST_IS_THREAD_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_THREAD))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_THREAD))
typedef struct _GstThread GstThread;
typedef struct _GstThreadClass GstThreadClass;
@ -80,7 +80,7 @@ struct _GstThreadClass {
GstBinClass parent_class;
};
GtkType gst_thread_get_type (void);
GType gst_thread_get_type (void);
GstElement* gst_thread_new (const guchar *name);

View file

@ -55,31 +55,32 @@ enum {
static void gst_typefind_class_init (GstTypeFindClass *klass);
static void gst_typefind_init (GstTypeFind *typefind);
static void gst_typefind_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_typefind_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_typefind_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_typefind_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_typefind_chain (GstPad *pad, GstBuffer *buf);
static GstElementClass *parent_class = NULL;
static guint gst_typefind_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_typefind_get_type (void)
{
static GtkType typefind_type = 0;
static GType typefind_type = 0;
if (!typefind_type) {
static const GtkTypeInfo typefind_info = {
"GstTypeFind",
sizeof(GstTypeFind),
static const GTypeInfo typefind_info = {
sizeof(GstTypeFindClass),
(GtkClassInitFunc)gst_typefind_class_init,
(GtkObjectInitFunc)gst_typefind_init,
(GtkArgSetFunc)gst_typefind_set_arg,
(GtkArgGetFunc)gst_typefind_get_arg,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_typefind_class_init,
NULL,
NULL,
sizeof(GstTypeFind),
0,
(GInstanceInitFunc)gst_typefind_init,
};
typefind_type = gtk_type_unique (GST_TYPE_ELEMENT, &typefind_info);
typefind_type = g_type_register_static (GST_TYPE_ELEMENT, "GstTypeFind", &typefind_info, 0);
}
return typefind_type;
}
@ -87,25 +88,23 @@ gst_typefind_get_type (void)
static void
gst_typefind_class_init (GstTypeFindClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type("GstTypeFind::caps", GTK_TYPE_POINTER,
GTK_ARG_READABLE, ARG_CAPS);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CAPS,
g_param_spec_pointer("caps", "Caps", "Found capabilities", G_PARAM_READABLE));
gst_typefind_signals[HAVE_TYPE] =
gtk_signal_new ("have_type", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstTypeFindClass, have_type),
gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
g_signal_newc ("have_type", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindClass, have_type), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_typefind_signals,
LAST_SIGNAL);
gtkobject_class->set_arg = gst_typefind_set_arg;
gtkobject_class->get_arg = gst_typefind_get_arg;
gobject_class->set_property = gst_typefind_set_property;
gobject_class->get_property = gst_typefind_get_property;
}
static void
@ -117,7 +116,7 @@ gst_typefind_init (GstTypeFind *typefind)
}
static void
gst_typefind_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_typefind_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstTypeFind *typefind;
@ -126,14 +125,14 @@ gst_typefind_set_arg (GtkObject *object, GtkArg *arg, guint id)
typefind = GST_TYPEFIND (object);
switch(id) {
switch (prop_id) {
default:
break;
}
}
static void
gst_typefind_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_typefind_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstTypeFind *typefind;
@ -142,9 +141,9 @@ gst_typefind_get_arg (GtkObject *object, GtkArg *arg, guint id)
typefind = GST_TYPEFIND (object);
switch(id) {
switch (prop_id) {
case ARG_CAPS:
GTK_VALUE_POINTER (*arg) = typefind->caps;
g_value_set_pointer(value, typefind->caps);
break;
default:
break;
@ -189,7 +188,7 @@ gst_typefind_chain (GstPad *pad, GstBuffer *buf)
{ /* FIXME: this should all be in an _emit() wrapper eventually */
int oldstate = GST_STATE(typefind);
gst_object_ref (GST_OBJECT (typefind));
gtk_signal_emit (GTK_OBJECT (typefind), gst_typefind_signals[HAVE_TYPE],
g_signal_emit (G_OBJECT (typefind), gst_typefind_signals[HAVE_TYPE], 0,
typefind->caps);
if (GST_STATE(typefind) != oldstate) {
gst_object_unref (GST_OBJECT (typefind));

View file

@ -37,13 +37,13 @@ GstElementDetails gst_typefind_details;
#define GST_TYPE_TYPEFIND \
(gst_typefind_get_type())
#define GST_TYPEFIND(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_TYPEFIND,GstTypeFind))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TYPEFIND,GstTypeFind))
#define GST_TYPEFIND_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_TYPEFIND,GstTypeFindClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TYPEFIND,GstTypeFindClass))
#define GST_IS_TYPEFIND(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_TYPEFIND))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TYPEFIND))
#define GST_IS_TYPEFIND_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_TYPEFIND))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TYPEFIND))
typedef struct _GstTypeFind GstTypeFind;
typedef struct _GstTypeFindClass GstTypeFindClass;
@ -63,7 +63,7 @@ struct _GstTypeFindClass {
void (*have_type) (GstElement *element);
};
GtkType gst_typefind_get_type (void);
GType gst_typefind_get_type (void);
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstutils.c: Utility functions: gtk_get_arg stuff, etc.
* gstutils.c: Utility functions: gtk_get_property stuff, etc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -23,10 +23,11 @@
#include <stdio.h>
#include <string.h>
#include "gstextratypes.h"
#include "gst_private.h"
#include "gstutils.h"
#include "gstextratypes.h"
/**
* gst_util_get_int_arg:
* @object: the object to query
@ -37,13 +38,14 @@
* Returns: the property of the object
*/
gint
gst_util_get_int_arg (GtkObject *object,guchar *argname)
gst_util_get_int_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
return GTK_VALUE_INT(arg);
g_value_init (&value, G_TYPE_INT);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_int(&value);
}
/**
@ -56,13 +58,14 @@ gst_util_get_int_arg (GtkObject *object,guchar *argname)
* Returns: the property of the object
*/
gint
gst_util_get_bool_arg (GtkObject *object,guchar *argname)
gst_util_get_bool_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
return GTK_VALUE_BOOL(arg);
g_value_init (&value, G_TYPE_BOOLEAN);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_boolean(&value);
}
/**
@ -75,13 +78,14 @@ gst_util_get_bool_arg (GtkObject *object,guchar *argname)
* Returns: the property of the object
*/
glong
gst_util_get_long_arg (GtkObject *object,guchar *argname)
gst_util_get_long_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
return GTK_VALUE_LONG(arg);
g_value_init (&value, G_TYPE_LONG);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_long(&value);
}
/**
@ -94,13 +98,14 @@ gst_util_get_long_arg (GtkObject *object,guchar *argname)
* Returns: the property of the object
*/
gfloat
gst_util_get_float_arg (GtkObject *object,guchar *argname)
gst_util_get_float_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
return GTK_VALUE_FLOAT(arg);
g_value_init (&value, G_TYPE_FLOAT);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_float(&value);
}
/**
@ -113,13 +118,14 @@ gst_util_get_float_arg (GtkObject *object,guchar *argname)
* Returns: the property of the object
*/
gdouble
gst_util_get_double_arg (GtkObject *object,guchar *argname)
gst_util_get_double_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
return GTK_VALUE_DOUBLE(arg);
g_value_init (&value, G_TYPE_DOUBLE);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_double(&value);
}
/**
@ -131,14 +137,15 @@ gst_util_get_double_arg (GtkObject *object,guchar *argname)
*
* Returns: the property of the object
*/
guchar*
gst_util_get_string_arg (GtkObject *object,guchar *argname)
const gchar*
gst_util_get_string_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
return GTK_VALUE_STRING(arg);
g_value_init (&value, G_TYPE_STRING);
g_object_get_property(G_OBJECT(object),argname,&value);
return g_value_get_string(&value);
}
/**
@ -151,18 +158,18 @@ gst_util_get_string_arg (GtkObject *object,guchar *argname)
* Returns: the property of the object
*/
gpointer
gst_util_get_pointer_arg (GtkObject *object,guchar *argname)
gst_util_get_pointer_arg (GObject *object, const gchar *argname)
{
GtkArg arg;
GValue value = {0, };
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
g_value_init (&value, G_TYPE_POINTER);
g_object_get_property(G_OBJECT(object),argname,&value);
return GTK_VALUE_POINTER(arg);
return g_value_get_pointer(&value);
}
/**
* gst_util_get_widget_arg:
* gst_util_get_widget_property:
* @object: the object to query
* @argname: the name of the argument
*
@ -170,16 +177,18 @@ gst_util_get_pointer_arg (GtkObject *object,guchar *argname)
*
* Returns: the property of the object
*/
/* COMMENTED OUT BECAUSE WE HAVE NO MORE gtk.h
GtkWidget*
gst_util_get_widget_arg (GtkObject *object,guchar *argname)
gst_util_get_widget_property (GObject *object, const gchar *argname)
{
GtkArg arg;
arg.name = argname;
gtk_object_getv(GTK_OBJECT(object),1,&arg);
gtk_object_getv(G_OBJECT(object),1,&arg);
return GTK_WIDGET(GTK_VALUE_OBJECT(arg));
return GTK_WIDGET(G_VALUE_OBJECT(arg));
}
*/
/**
* gst_util_dump_mem:
@ -218,80 +227,82 @@ gst_util_dump_mem (guchar *mem, guint size)
* sets the argument with it.
*/
void
gst_util_set_object_arg (GtkObject *object, guchar *name, gchar *value)
gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value)
{
if (name && value) {
GtkType type = GTK_OBJECT_TYPE (object);
GtkArgInfo *info;
gchar *result;
GParamSpec *paramspec;
result = gtk_object_arg_get_info (type, name, &info);
paramspec = g_object_class_find_property(G_OBJECT_GET_CLASS(object),name);
if (result) {
g_print("gstutil: %s\n", result);
if (!paramspec) {
return;
}
else if (info->arg_flags & GTK_ARG_WRITABLE) {
switch (info->type) {
case GTK_TYPE_STRING:
gtk_object_set (GTK_OBJECT (object), name, value, NULL);
GST_DEBUG(0,"paramspec->flags is %d, paramspec->value_type is %d\n",
paramspec->flags,paramspec->value_type);
if (paramspec->flags & G_PARAM_WRITABLE) {
switch (paramspec->value_type) {
case G_TYPE_STRING:
g_object_set (G_OBJECT (object), name, value, NULL);
break;
case GTK_TYPE_ENUM:
case GTK_TYPE_INT: {
case G_TYPE_ENUM:
case G_TYPE_INT: {
gint i;
sscanf (value, "%d", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_LONG: {
case G_TYPE_LONG: {
glong i;
sscanf (value, "%ld", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_ULONG: {
case G_TYPE_ULONG: {
gulong i;
sscanf (value, "%lu", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_BOOL: {
case G_TYPE_BOOLEAN: {
gboolean i = FALSE;
if (!strncmp ("true", value, 4)) i = TRUE;
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_CHAR: {
case G_TYPE_CHAR: {
gchar i;
sscanf (value, "%c", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_UCHAR: {
case G_TYPE_UCHAR: {
guchar i;
sscanf (value, "%c", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_FLOAT: {
case G_TYPE_FLOAT: {
gfloat i;
sscanf (value, "%f", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_DOUBLE: {
case G_TYPE_DOUBLE: {
gfloat i;
sscanf (value, "%g", &i);
gtk_object_set (GTK_OBJECT (object), name, (gdouble)i, NULL);
g_object_set (G_OBJECT (object), name, (gdouble)i, NULL);
break;
}
default:
if (GTK_FUNDAMENTAL_TYPE(info->type) == GTK_TYPE_ENUM) {
if (G_IS_PARAM_SPEC_ENUM(paramspec)) {
gint i;
sscanf (value, "%d", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
g_object_set (G_OBJECT (object), name, i, NULL);
}
else if (info->type == GST_TYPE_FILENAME) {
gtk_object_set (GTK_OBJECT (object), name, value, NULL);
else if (paramspec->value_type == GST_TYPE_FILENAME) {
g_object_set (G_OBJECT (object), name, value, NULL);
}
break;
}

View file

@ -24,22 +24,23 @@
#ifndef __GST_UTILS_H__
#define __GST_UTILS_H__
#include <gtk/gtk.h>
#include <glib.h>
#include <gst/gstobject.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
gint gst_util_get_int_arg (GtkObject *object, guchar *argname);
gboolean gst_util_get_bool_arg (GtkObject *object, guchar *argname);
glong gst_util_get_long_arg (GtkObject *object, guchar *argname);
gfloat gst_util_get_float_arg (GtkObject *object, guchar *argname);
gdouble gst_util_get_double_arg (GtkObject *object, guchar *argname);
guchar* gst_util_get_string_arg (GtkObject *object, guchar *argname);
gpointer gst_util_get_pointer_arg (GtkObject *object, guchar *argname);
GtkWidget* gst_util_get_widget_arg (GtkObject *object, guchar *argname);
gint gst_util_get_int_arg (GObject *object, const gchar *argname);
gboolean gst_util_get_bool_arg (GObject *object, const gchar *argname);
glong gst_util_get_long_arg (GObject *object, const gchar *argname);
gfloat gst_util_get_float_arg (GObject *object, const gchar *argname);
gdouble gst_util_get_double_arg (GObject *object, const gchar *argname);
const gchar* gst_util_get_string_arg (GObject *object, const gchar *argname);
gpointer gst_util_get_pointer_arg (GObject *object, const gchar *argname);
//GtkWidget* gst_util_get_widget_property (GObject *object, const gchar *argname);
void gst_util_set_object_arg (GtkObject *object, guchar *name, gchar *value);
void gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value);
void gst_util_dump_mem (guchar *mem, guint size);

View file

@ -38,23 +38,24 @@ static void gst_xml_object_loaded (GstObject *private, GstObject *object, xmlNo
static GstObjectClass *parent_class = NULL;
static guint gst_xml_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_xml_get_type(void)
{
static GtkType xml_type = 0;
static GType xml_type = 0;
if (!xml_type) {
static const GtkTypeInfo xml_info = {
"GstXML",
sizeof(GstXML),
static const GTypeInfo xml_info = {
sizeof(GstXMLClass),
(GtkClassInitFunc)gst_xml_class_init,
(GtkObjectInitFunc)gst_xml_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_xml_class_init,
NULL,
NULL,
sizeof(GstXML),
0,
(GInstanceInitFunc)gst_xml_init,
};
xml_type = gtk_type_unique (GST_TYPE_OBJECT, &xml_info);
xml_type = g_type_register_static (GST_TYPE_OBJECT, "GstXml", &xml_info, 0);
}
return xml_type;
}
@ -62,19 +63,18 @@ gst_xml_get_type(void)
static void
gst_xml_class_init (GstXMLClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass *)klass;
gobject_class = (GObjectClass *)klass;
parent_class = gtk_type_class (GST_TYPE_OBJECT);
parent_class = g_type_class_ref (GST_TYPE_OBJECT);
gst_xml_signals[OBJECT_LOADED] =
gtk_signal_new ("object_loaded", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstXMLClass, object_loaded),
gtk_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2,
GST_TYPE_OBJECT, GTK_TYPE_POINTER);
g_signal_newc ("object_loaded", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstXMLClass, object_loaded), NULL, NULL,
gst_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2,
GST_TYPE_OBJECT, G_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_xml_signals, LAST_SIGNAL);
}
static void
@ -93,7 +93,7 @@ gst_xml_init(GstXML *xml)
GstXML*
gst_xml_new (void)
{
return GST_XML (gtk_type_new (GST_TYPE_XML));
return GST_XML (g_object_new(GST_TYPE_XML,NULL));
}
/**
@ -156,7 +156,7 @@ gst_xml_parse_doc (GstXML *xml, xmlDocPtr doc, const guchar *root)
return FALSE;
}
gst_class_signal_connect (GST_OBJECT_CLASS (GTK_OBJECT (xml)->klass),
gst_class_signal_connect (GST_OBJECT_CLASS (G_OBJECT_GET_CLASS(xml)),
"object_loaded", gst_xml_object_loaded, xml);
xml->ns = ns;
@ -240,7 +240,7 @@ gst_xml_object_loaded (GstObject *private, GstObject *object, xmlNodePtr self, g
GstXML *xml = GST_XML (data);
// FIXME check that this element was created from the same xmlDocPtr...
gtk_signal_emit (GTK_OBJECT (xml), gst_xml_signals[OBJECT_LOADED], object, self);
g_signal_emit (G_OBJECT (xml), gst_xml_signals[OBJECT_LOADED], 0, object, self);
}
/**

View file

@ -41,13 +41,13 @@ extern "C" {
#define GST_TYPE_XML \
(gst_xml_get_type())
#define GST_XML(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_XML,GstXML))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XML,GstXML))
#define GST_XML_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_XML,GstXMLClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_XML,GstXMLClass))
#define GST_IS_XML(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_XML))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XML))
#define GST_IS_XML_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_XML))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XML))
typedef struct _GstXML GstXML;
typedef struct _GstXMLClass GstXMLClass;
@ -68,7 +68,7 @@ struct _GstXMLClass {
void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self);
};
GtkType gst_xml_get_type (void);
GType gst_xml_get_type (void);
/* create an XML document out of a pipeline */

View file

@ -215,7 +215,7 @@ gst_play_frame_displayed (GstElement *element, GstPlay *play)
if (!stolen) {
gtk_widget_realize (priv->video_widget);
gtk_socket_steal (GTK_SOCKET (priv->video_widget),
gst_util_get_int_arg (GTK_OBJECT (priv->video_show), "xid"));
gst_util_get_int_arg (G_OBJECT (priv->video_show), "xid"));
gtk_widget_show (priv->video_widget);
stolen = TRUE;
}
@ -340,7 +340,7 @@ gst_play_have_type (GstElement *sink, GstCaps *caps, GstPlay *play)
gst_bin_add (GST_BIN (priv->pipeline), new_element);
gtk_object_set (GTK_OBJECT (priv->cache), "reset", TRUE, NULL);
gtk_object_set (G_OBJECT (priv->cache), "reset", TRUE, NULL);
gst_element_connect (priv->cache, "src", new_element, "sink");
@ -411,7 +411,7 @@ 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 (GTK_OBJECT (priv->src), "location", priv->uri, NULL);
gtk_object_set (G_OBJECT (priv->src), "location", priv->uri, NULL);
priv->cache = gst_elementfactory_make ("autoplugcache", "cache");
@ -582,7 +582,7 @@ gst_play_get_media_size (GstPlay *play)
priv = (GstPlayPrivate *)play->priv;
return gst_util_get_long_arg (GTK_OBJECT (priv->src), "size");
return gst_util_get_long_arg (G_OBJECT (priv->src), "size");
}
gulong
@ -596,7 +596,7 @@ gst_play_get_media_offset (GstPlay *play)
priv = (GstPlayPrivate *)play->priv;
if (priv->offset_element)
return gst_util_get_long_arg (GTK_OBJECT (priv->offset_element), "offset");
return gst_util_get_long_arg (G_OBJECT (priv->offset_element), "offset");
else
return 0;
}
@ -613,12 +613,12 @@ gst_play_get_media_total_time (GstPlay *play)
priv = (GstPlayPrivate *)play->priv;
if (priv->media_time_element) {
return gst_util_get_long_arg (GTK_OBJECT (priv->media_time_element), "media_time");
return gst_util_get_long_arg (G_OBJECT (priv->media_time_element), "media_time");
}
if (priv->bit_rate_element == NULL) return 0;
bit_rate = gst_util_get_long_arg (GTK_OBJECT (priv->bit_rate_element), "bit_rate");
bit_rate = gst_util_get_long_arg (G_OBJECT (priv->bit_rate_element), "bit_rate");
if (bit_rate)
total_time = (gst_play_get_media_size (play) * 8) / bit_rate;
@ -640,12 +640,12 @@ gst_play_get_media_current_time (GstPlay *play)
priv = (GstPlayPrivate *)play->priv;
if (priv->current_time_element) {
return gst_util_get_long_arg (GTK_OBJECT (priv->current_time_element), "current_time");
return gst_util_get_long_arg (G_OBJECT (priv->current_time_element), "current_time");
}
if (priv->bit_rate_element == NULL) return 0;
bit_rate = gst_util_get_long_arg (GTK_OBJECT (priv->bit_rate_element), "bit_rate");
bit_rate = gst_util_get_long_arg (G_OBJECT (priv->bit_rate_element), "bit_rate");
if (bit_rate)
current_time = (gst_play_get_media_offset (play) * 8) / bit_rate;

View file

@ -39,6 +39,7 @@ noinst_HEADERS = \
gstsinesrc.h
CFLAGS += -O2 -Wall
LDFLAGS += -lm
libgstelements_la_LIBADD = $(GHTTP_LIBS)
libgstelements_la_LDFLAGS = -version-info $(GST_LIBVERSION)

View file

@ -51,8 +51,8 @@ enum {
static void gst_disksink_class_init (GstDiskSinkClass *klass);
static void gst_disksink_init (GstDiskSink *disksink);
static void gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksink_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_disksink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static gboolean gst_disksink_open_file (GstDiskSink *sink);
static void gst_disksink_close_file (GstDiskSink *sink);
@ -64,23 +64,23 @@ static GstElementStateReturn gst_disksink_change_state (GstElement *element);
static GstElementClass *parent_class = NULL;
static guint gst_disksink_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_disksink_get_type (void)
{
static GtkType disksink_type = 0;
static GType disksink_type = 0;
if (!disksink_type) {
static const GtkTypeInfo disksink_info = {
"GstDiskSink",
static const GTypeInfo disksink_info = {
sizeof(GstDiskSinkClass), NULL,
NULL,
(GClassInitFunc)gst_disksink_class_init,
NULL,
NULL,
sizeof(GstDiskSink),
sizeof(GstDiskSinkClass),
(GtkClassInitFunc)gst_disksink_class_init,
(GtkObjectInitFunc)gst_disksink_init,
(GtkArgSetFunc)gst_disksink_set_arg,
(GtkArgGetFunc)gst_disksink_get_arg,
(GtkClassInitFunc)NULL, /* deprecated, do not use ! */
0,
(GInstanceInitFunc)gst_disksink_init,
};
disksink_type = gtk_type_unique (GST_TYPE_ELEMENT, &disksink_info);
disksink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstDiskSink", &disksink_info, 0);
}
return disksink_type;
}
@ -88,27 +88,25 @@ gst_disksink_get_type (void)
static void
gst_disksink_class_init (GstDiskSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstDiskSink::location", GST_TYPE_FILENAME,
GTK_ARG_READWRITE, ARG_LOCATION);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_string("location","location","location",
NULL,G_PARAM_READWRITE)); // CHECKME!
gst_disksink_signals[SIGNAL_HANDOFF] =
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstDiskSinkClass, handoff),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstDiskSinkClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gtk_object_class_add_signals (gtkobject_class, gst_disksink_signals,
LAST_SIGNAL);
gtkobject_class->set_arg = gst_disksink_set_arg;
gtkobject_class->get_arg = gst_disksink_get_arg;
gobject_class->set_property = gst_disksink_set_property;
gobject_class->get_property = gst_disksink_get_property;
gstelement_class->change_state = gst_disksink_change_state;
}
@ -126,21 +124,21 @@ gst_disksink_init (GstDiskSink *disksink)
}
static void
gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstDiskSink *sink;
/* it's not null if we got it, but it might not be ours */
sink = GST_DISKSINK (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATION:
/* the element must be stopped or paused in order to do this */
g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING)
|| (GST_STATE (sink) == GST_STATE_PAUSED));
if (sink->filename)
g_free (sink->filename);
sink->filename = g_strdup (GTK_VALUE_STRING (*arg));
sink->filename = g_strdup (g_value_get_string (value));
if ( (GST_STATE (sink) == GST_STATE_PAUSED)
&& (sink->filename != NULL))
{
@ -155,7 +153,7 @@ gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_disksink_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstDiskSink *sink;
@ -164,12 +162,12 @@ gst_disksink_get_arg (GtkObject *object, GtkArg *arg, guint id)
sink = GST_DISKSINK (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATION:
GTK_VALUE_STRING (*arg) = sink->filename;
g_value_set_string (value, sink->filename);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -237,7 +235,7 @@ gst_disksink_chain (GstPad *pad, GstBuffer *buf)
}
gst_buffer_unref (buf);
gtk_signal_emit (GTK_OBJECT (disksink), gst_disksink_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (disksink), gst_disksink_signals[SIGNAL_HANDOFF], 0,
disksink);
}

View file

@ -40,13 +40,13 @@ GstElementDetails gst_disksink_details;
#define GST_TYPE_DISKSINK \
(gst_disksink_get_type())
#define GST_DISKSINK(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_DISKSINK,GstDiskSink))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DISKSINK,GstDiskSink))
#define GST_DISKSINK_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSINK,GstDiskSinkClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSINK,GstDiskSinkClass))
#define GST_IS_DISKSINK(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_DISKSINK))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DISKSINK))
#define GST_IS_DISKSINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSINK))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSINK))
typedef struct _GstDiskSink GstDiskSink;
typedef struct _GstDiskSinkClass GstDiskSinkClass;
@ -71,7 +71,7 @@ struct _GstDiskSinkClass {
void (*handoff) (GstElement *element,GstPad *pad);
};
GtkType gst_disksink_get_type(void);
GType gst_disksink_get_type(void);
#ifdef __cplusplus

View file

@ -59,8 +59,8 @@ enum {
static void gst_disksrc_class_init (GstDiskSrcClass *klass);
static void gst_disksrc_init (GstDiskSrc *disksrc);
static void gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_disksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_disksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer * gst_disksrc_get (GstPad *pad);
static GstBuffer * gst_disksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);
@ -73,23 +73,23 @@ static void gst_disksrc_close_file (GstDiskSrc *src);
static GstElementClass *parent_class = NULL;
//static guint gst_disksrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_disksrc_get_type(void)
{
static GtkType disksrc_type = 0;
static GType disksrc_type = 0;
if (!disksrc_type) {
static const GtkTypeInfo disksrc_info = {
"GstDiskSrc",
static const GTypeInfo disksrc_info = {
sizeof(GstDiskSrcClass), NULL,
NULL,
(GClassInitFunc)gst_disksrc_class_init,
NULL,
NULL,
sizeof(GstDiskSrc),
sizeof(GstDiskSrcClass),
(GtkClassInitFunc)gst_disksrc_class_init,
(GtkObjectInitFunc)gst_disksrc_init,
(GtkArgSetFunc)gst_disksrc_set_arg,
(GtkArgGetFunc)gst_disksrc_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_disksrc_init,
};
disksrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &disksrc_info);
disksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstDiskSrc", &disksrc_info, 0);
}
return disksrc_type;
}
@ -97,25 +97,29 @@ gst_disksrc_get_type(void)
static void
gst_disksrc_class_init (GstDiskSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstDiskSrc::location", GST_TYPE_FILENAME,
GTK_ARG_READWRITE, ARG_LOCATION);
gtk_object_add_arg_type ("GstDiskSrc::bytesperread", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_BYTESPERREAD);
gtk_object_add_arg_type ("GstDiskSrc::offset", GTK_TYPE_LONG,
GTK_ARG_READWRITE, ARG_OFFSET);
gtk_object_add_arg_type ("GstDiskSrc::size", GTK_TYPE_LONG,
GTK_ARG_READABLE, ARG_SIZE);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOCATION,
g_param_spec_string("location","location","location",
NULL,G_PARAM_READWRITE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BYTESPERREAD,
g_param_spec_int("bytesperread","bytesperread","bytesperread",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OFFSET,
g_param_spec_long("offset","offset","offset",
G_MINLONG,G_MAXLONG,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SIZE,
g_param_spec_long("size","size","size",
G_MINLONG,G_MAXLONG,0,G_PARAM_READABLE)); // CHECKME
gtkobject_class->set_arg = gst_disksrc_set_arg;
gtkobject_class->get_arg = gst_disksrc_get_arg;
gobject_class->set_property = gst_disksrc_set_property;
gobject_class->get_property = gst_disksrc_get_property;
gstelement_class->change_state = gst_disksrc_change_state;
}
@ -142,7 +146,7 @@ gst_disksrc_init (GstDiskSrc *disksrc)
static void
gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstDiskSrc *src;
@ -151,7 +155,7 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_DISKSRC (object);
switch(id) {
switch (prop_id) {
case ARG_LOCATION:
/* the element must be stopped or paused in order to do this */
g_return_if_fail ((GST_STATE (src) < GST_STATE_PLAYING)
@ -159,12 +163,12 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
if (src->filename) g_free (src->filename);
/* clear the filename if we get a NULL (is that possible?) */
if (GTK_VALUE_STRING (*arg) == NULL) {
if (g_value_get_string (value) == NULL) {
gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL);
src->filename = NULL;
/* otherwise set the new filename */
} else {
src->filename = g_strdup (GTK_VALUE_STRING (*arg));
src->filename = g_strdup (g_value_get_string (value));
}
if ((GST_STATE (src) == GST_STATE_PAUSED) && (src->filename != NULL))
{
@ -173,10 +177,10 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = GTK_VALUE_INT (*arg);
src->bytes_per_read = g_value_get_int (value);
break;
case ARG_OFFSET:
src->curoffset = GTK_VALUE_LONG (*arg);
src->curoffset = g_value_get_long (value);
src->new_seek = TRUE;
break;
default:
@ -185,7 +189,7 @@ gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_disksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstDiskSrc *src;
@ -194,21 +198,21 @@ gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_DISKSRC (object);
switch (id) {
switch (prop_id) {
case ARG_LOCATION:
GTK_VALUE_STRING (*arg) = src->filename;
g_value_set_string (value, src->filename);
break;
case ARG_BYTESPERREAD:
GTK_VALUE_INT (*arg) = src->bytes_per_read;
g_value_set_int (value, src->bytes_per_read);
break;
case ARG_OFFSET:
GTK_VALUE_LONG (*arg) = src->curoffset;
g_value_set_long (value, src->curoffset);
break;
case ARG_SIZE:
GTK_VALUE_LONG (*arg) = src->size;
g_value_set_long (value, src->size);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

View file

@ -38,13 +38,13 @@ GstElementDetails gst_disksrc_details;
#define GST_TYPE_DISKSRC \
(gst_disksrc_get_type())
#define GST_DISKSRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_DISKSRC,GstDiskSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DISKSRC,GstDiskSrc))
#define GST_DISKSRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSRC,GstDiskSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DISKSRC,GstDiskSrcClass))
#define GST_IS_DISKSRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_DISKSRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DISKSRC))
#define GST_IS_DISKSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DISKSRC))
typedef enum {
GST_DISKSRC_OPEN = GST_ELEMENT_FLAG_LAST,
@ -81,7 +81,7 @@ struct _GstDiskSrcClass {
GstElementClass parent_class;
};
GtkType gst_disksrc_get_type(void);
GType gst_disksrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -42,7 +42,7 @@
struct _elements_entry {
gchar *name;
GtkType (*type) (void);
GType (*type) (void);
GstElementDetails *details;
gboolean (*factoryinit) (GstElementFactory *factory);
};

View file

@ -51,31 +51,31 @@ enum {
static void gst_fakesink_class_init (GstFakeSinkClass *klass);
static void gst_fakesink_init (GstFakeSink *fakesink);
static void gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesink_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fakesink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_fakesink_chain (GstPad *pad,GstBuffer *buf);
static GstElementClass *parent_class = NULL;
static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fakesink_get_type (void)
{
static GtkType fakesink_type = 0;
static GType fakesink_type = 0;
if (!fakesink_type) {
static const GtkTypeInfo fakesink_info = {
"GstFakeSink",
static const GTypeInfo fakesink_info = {
sizeof(GstFakeSinkClass), NULL,
NULL,
(GClassInitFunc)gst_fakesink_class_init,
NULL,
NULL,
sizeof(GstFakeSink),
sizeof(GstFakeSinkClass),
(GtkClassInitFunc)gst_fakesink_class_init,
(GtkObjectInitFunc)gst_fakesink_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_fakesink_init,
};
fakesink_type = gtk_type_unique (GST_TYPE_ELEMENT, &fakesink_info);
fakesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSink", &fakesink_info, 0);
}
return fakesink_type;
}
@ -83,28 +83,27 @@ gst_fakesink_get_type (void)
static void
gst_fakesink_class_init (GstFakeSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFakeSink::num_sources", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_NUM_SOURCES);
gtk_object_add_arg_type ("GstFakeSink::silent", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_SILENT);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_SOURCES,
g_param_spec_int("num_sources","num_sources","num_sources",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
g_param_spec_boolean("silent","silent","silent",
TRUE,G_PARAM_READWRITE)); // CHECKME
gst_fakesink_signals[SIGNAL_HANDOFF] =
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstFakeSinkClass, handoff),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSinkClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_fakesink_signals,
LAST_SIGNAL);
gtkobject_class->set_arg = gst_fakesink_set_arg;
gtkobject_class->get_arg = gst_fakesink_get_arg;
gobject_class->set_property = gst_fakesink_set_property;
gobject_class->get_property = gst_fakesink_get_property;
}
static void
@ -123,7 +122,7 @@ gst_fakesink_init (GstFakeSink *fakesink)
}
static void
gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFakeSink *sink;
gint new_numsinks;
@ -132,9 +131,9 @@ gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
/* it's not null if we got it, but it might not be ours */
sink = GST_FAKESINK (object);
switch(id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
new_numsinks = GTK_VALUE_INT (*arg);
new_numsinks = g_value_get_int (value);
while (sink->numsinkpads < new_numsinks) {
pad = gst_pad_new (g_strdup_printf ("sink%d", sink->numsinkpads), GST_PAD_SINK);
gst_pad_set_chain_function (pad, gst_fakesink_chain);
@ -144,7 +143,7 @@ gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_SILENT:
sink->silent = GTK_VALUE_BOOL (*arg);
sink->silent = g_value_get_boolean (value);
break;
default:
break;
@ -152,7 +151,7 @@ gst_fakesink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_fakesink_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFakeSink *sink;
@ -161,15 +160,15 @@ gst_fakesink_get_arg (GtkObject *object, GtkArg *arg, guint id)
sink = GST_FAKESINK (object);
switch (id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
GTK_VALUE_INT (*arg) = sink->numsinkpads;
g_value_set_int (value, sink->numsinkpads);
break;
case ARG_SILENT:
GTK_VALUE_BOOL (*arg) = sink->silent;
g_value_set_boolean (value, sink->silent);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -195,7 +194,7 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
if (!fakesink->silent)
g_print("fakesink: ******* (%s:%s)< (%d bytes) \n",GST_DEBUG_PAD_NAME(pad),GST_BUFFER_SIZE(buf));
gtk_signal_emit (GTK_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (fakesink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
buf);
gst_buffer_unref (buf);

View file

@ -40,13 +40,13 @@ GstElementDetails gst_fakesink_details;
#define GST_TYPE_FAKESINK \
(gst_fakesink_get_type())
#define GST_FAKESINK(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_FAKESINK,GstFakeSink))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESINK,GstFakeSink))
#define GST_FAKESINK_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESINK,GstFakeSinkClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESINK,GstFakeSinkClass))
#define GST_IS_FAKESINK(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_FAKESINK))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESINK))
#define GST_IS_FAKESINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
typedef struct _GstFakeSink GstFakeSink;
typedef struct _GstFakeSinkClass GstFakeSinkClass;
@ -66,7 +66,7 @@ struct _GstFakeSinkClass {
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
GtkType gst_fakesink_get_type(void);
GType gst_fakesink_get_type(void);
#ifdef __cplusplus

View file

@ -54,10 +54,10 @@ enum {
};
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
static GtkType
static GType
gst_fakesrc_output_get_type(void) {
static GtkType fakesrc_output_type = 0;
static GtkEnumValue fakesrc_output[] = {
static GType fakesrc_output_type = 0;
static GEnumValue fakesrc_output[] = {
{ FAKESRC_FIRST_LAST_LOOP, "1", "First-Last loop"},
{ FAKESRC_LAST_FIRST_LOOP, "2", "Last-First loop"},
{ FAKESRC_PING_PONG, "3", "Ping-Pong"},
@ -69,7 +69,7 @@ gst_fakesrc_output_get_type(void) {
{0, NULL, NULL},
};
if (!fakesrc_output_type) {
fakesrc_output_type = gtk_type_register_enum("GstFakeSrcOutput", fakesrc_output);
fakesrc_output_type = g_enum_register_static("GstFakeSrcOutput", fakesrc_output);
}
return fakesrc_output_type;
}
@ -77,8 +77,8 @@ gst_fakesrc_output_get_type(void) {
static void gst_fakesrc_class_init (GstFakeSrcClass *klass);
static void gst_fakesrc_init (GstFakeSrc *fakesrc);
static void gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fakesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer* gst_fakesrc_get (GstPad *pad);
static void gst_fakesrc_loop (GstElement *element);
@ -86,23 +86,24 @@ static void gst_fakesrc_loop (GstElement *element);
static GstElementClass *parent_class = NULL;
static guint gst_fakesrc_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fakesrc_get_type (void)
{
static GtkType fakesrc_type = 0;
static GType fakesrc_type = 0;
if (!fakesrc_type) {
static const GtkTypeInfo fakesrc_info = {
"GstFakeSrc",
sizeof(GstFakeSrc),
static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass),
(GtkClassInitFunc)gst_fakesrc_class_init,
(GtkObjectInitFunc)gst_fakesrc_init,
(GtkArgSetFunc)NULL,
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
NULL,
NULL,
(GClassInitFunc)gst_fakesrc_class_init,
NULL,
NULL,
sizeof(GstFakeSrc),
0,
(GInstanceInitFunc)gst_fakesrc_init,
};
fakesrc_type = gtk_type_unique (GST_TYPE_ELEMENT, &fakesrc_info);
fakesrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSrc", &fakesrc_info, 0);
}
return fakesrc_type;
}
@ -110,38 +111,42 @@ gst_fakesrc_get_type (void)
static void
gst_fakesrc_class_init (GstFakeSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFakeSrc::num_sources", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_NUM_SOURCES);
gtk_object_add_arg_type ("GstFakeSrc::loop_based", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_LOOP_BASED);
gtk_object_add_arg_type ("GstFakeSrc::output", GST_TYPE_FAKESRC_OUTPUT,
GTK_ARG_READWRITE, ARG_OUTPUT);
gtk_object_add_arg_type ("GstFakeSrc::pattern", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_PATTERN);
gtk_object_add_arg_type ("GstFakeSrc::num_buffers", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_NUM_BUFFERS);
gtk_object_add_arg_type ("GstFakeSrc::eos", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_EOS);
gtk_object_add_arg_type ("GstFakeSrc::silent", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_SILENT);
gtkobject_class->set_arg = gst_fakesrc_set_arg;
gtkobject_class->get_arg = gst_fakesrc_get_arg;
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_SOURCES,
g_param_spec_int("num_sources","num_sources","num_sources",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_LOOP_BASED,
g_param_spec_boolean("loop_based","loop_based","loop_based",
TRUE,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_OUTPUT,
g_param_spec_enum("output","output","output",
GST_TYPE_FAKESRC_OUTPUT,FAKESRC_FIRST_LAST_LOOP,G_PARAM_READWRITE)); // CHECKME!
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_PATTERN,
g_param_spec_string("pattern","pattern","pattern",
NULL, G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_BUFFERS,
g_param_spec_int("num_buffers","num_buffers","num_buffers",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_EOS,
g_param_spec_boolean("eos","eos","eos",
TRUE,G_PARAM_READWRITE)); // CHECKME
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SILENT,
g_param_spec_boolean("silent","silent","silent",
TRUE,G_PARAM_READWRITE)); // CHECKME
gst_fakesrc_signals[SIGNAL_HANDOFF] =
gtk_signal_new ("handoff", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstFakeSrcClass, handoff),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
g_signal_newc ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSrcClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_fakesrc_signals,
LAST_SIGNAL);
gobject_class->set_property = gst_fakesrc_set_property;
gobject_class->get_property = gst_fakesrc_get_property;
}
static void
@ -192,7 +197,7 @@ gst_fakesrc_update_functions (GstFakeSrc *src)
}
static void
gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFakeSrc *src;
gint new_numsrcs;
@ -201,9 +206,9 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
/* it's not null if we got it, but it might not be ours */
src = GST_FAKESRC (object);
switch(id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
new_numsrcs = GTK_VALUE_INT (*arg);
new_numsrcs = g_value_get_int (value);
if (new_numsrcs > src->numsrcpads) {
while (src->numsrcpads != new_numsrcs) {
pad = gst_pad_new(g_strdup_printf("src%d",src->numsrcpads),GST_PAD_SRC);
@ -215,7 +220,7 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
break;
case ARG_LOOP_BASED:
src->loop_based = GTK_VALUE_BOOL (*arg);
src->loop_based = g_value_get_boolean (value);
gst_fakesrc_update_functions (src);
break;
case ARG_OUTPUT:
@ -223,14 +228,14 @@ gst_fakesrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
case ARG_PATTERN:
break;
case ARG_NUM_BUFFERS:
src->num_buffers = GTK_VALUE_INT (*arg);
src->num_buffers = g_value_get_int (value);
break;
case ARG_EOS:
src->eos = GTK_VALUE_BOOL (*arg);
src->eos = g_value_get_boolean (value);
GST_INFO (0, "will EOS on next buffer");
break;
case ARG_SILENT:
src->silent = GTK_VALUE_BOOL (*arg);
src->silent = g_value_get_boolean (value);
break;
default:
break;
@ -238,7 +243,7 @@ GST_INFO (0, "will EOS on next buffer");
}
static void
gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fakesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFakeSrc *src;
@ -247,29 +252,30 @@ gst_fakesrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
src = GST_FAKESRC (object);
switch (id) {
switch (prop_id) {
case ARG_NUM_SOURCES:
GTK_VALUE_INT (*arg) = src->numsrcpads;
g_value_set_int (value, src->numsrcpads);
break;
case ARG_LOOP_BASED:
GTK_VALUE_BOOL (*arg) = src->loop_based;
g_value_set_boolean (value, src->loop_based);
break;
case ARG_OUTPUT:
GTK_VALUE_INT (*arg) = src->output;
g_value_set_int (value, src->output);
break;
case ARG_PATTERN:
GTK_VALUE_STRING (*arg) = src->pattern;
g_value_set_string (value, src->pattern);
break;
case ARG_NUM_BUFFERS:
GTK_VALUE_INT (*arg) = src->num_buffers;
g_value_set_int (value, src->num_buffers);
break;
case ARG_EOS:
GTK_VALUE_BOOL (*arg) = src->eos;
g_value_set_boolean (value, src->eos);
break;
case ARG_SILENT:
GTK_VALUE_BOOL (*arg) = src->silent;
g_value_set_boolean (value, src->silent);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -314,7 +320,7 @@ gst_fakesrc_get(GstPad *pad)
g_print("fakesrc: ******* (%s:%s)> \n",GST_DEBUG_PAD_NAME(pad));
buf = gst_buffer_new();
gtk_signal_emit (GTK_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
buf);
return buf;
@ -364,7 +370,7 @@ gst_fakesrc_loop(GstElement *element)
if (!src->silent)
g_print("fakesrc: ******* (%s:%s)> \n",GST_DEBUG_PAD_NAME(pad));
gtk_signal_emit (GTK_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF],
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
buf);
gst_pad_push (pad, buf);

View file

@ -50,13 +50,13 @@ typedef enum {
#define GST_TYPE_FAKESRC \
(gst_fakesrc_get_type())
#define GST_FAKESRC(obj) \
(GTK_CHECK_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
#define GST_FAKESRC_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
#define GST_IS_FAKESRC(obj) \
(GTK_CHECK_TYPE((obj),GST_TYPE_FAKESRC))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESRC))
#define GST_IS_FAKESRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
typedef struct _GstFakeSrc GstFakeSrc;
typedef struct _GstFakeSrcClass GstFakeSrcClass;
@ -82,7 +82,7 @@ struct _GstFakeSrcClass {
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
GtkType gst_fakesrc_get_type(void);
GType gst_fakesrc_get_type(void);
#ifdef __cplusplus
}

View file

@ -49,31 +49,31 @@ enum {
static void gst_fdsink_class_init (GstFdSinkClass *klass);
static void gst_fdsink_init (GstFdSink *fdsink);
static void gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fdsink_get_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_fdsink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_fdsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gst_fdsink_chain (GstPad *pad,GstBuffer *buf);
static GstElementClass *parent_class = NULL;
//static guint gst_fdsink_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gst_fdsink_get_type (void)
{
static GtkType fdsink_type = 0;
static GType fdsink_type = 0;
if (!fdsink_type) {
static const GtkTypeInfo fdsink_info = {
"GstFdSink",
static const GTypeInfo fdsink_info = {
sizeof(GstFdSinkClass), NULL,
NULL,
(GClassInitFunc)gst_fdsink_class_init,
NULL,
NULL,
sizeof(GstFdSink),
sizeof(GstFdSinkClass),
(GtkClassInitFunc)gst_fdsink_class_init,
(GtkObjectInitFunc)gst_fdsink_init,
(GtkArgSetFunc)gst_fdsink_set_arg,
(GtkArgGetFunc)gst_fdsink_get_arg,
(GtkClassInitFunc)NULL,
0,
(GInstanceInitFunc)gst_fdsink_init,
};
fdsink_type = gtk_type_unique (GST_TYPE_ELEMENT, &fdsink_info);
fdsink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSink", &fdsink_info, 0);
}
return fdsink_type;
}
@ -81,17 +81,18 @@ gst_fdsink_get_type (void)
static void
gst_fdsink_class_init (GstFdSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GObjectClass *gobject_class;
gtkobject_class = (GtkObjectClass*)klass;
gobject_class = (GObjectClass*)klass;
parent_class = gtk_type_class (GST_TYPE_ELEMENT);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gtk_object_add_arg_type ("GstFdSink::fd", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FD);
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FD,
g_param_spec_int("fd","fd","fd",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
gtkobject_class->set_arg = gst_fdsink_set_arg;
gtkobject_class->get_arg = gst_fdsink_get_arg;
gobject_class->set_property = gst_fdsink_set_property;
gobject_class->get_property = gst_fdsink_get_property;
}
static void
@ -126,7 +127,7 @@ gst_fdsink_chain (GstPad *pad, GstBuffer *buf)
}
static void
gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fdsink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GstFdSink *fdsink;
@ -135,9 +136,9 @@ gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id)
fdsink = GST_FDSINK (object);
switch(id) {
switch (prop_id) {
case ARG_FD:
fdsink->fd = GTK_VALUE_INT (*arg);
fdsink->fd = g_value_get_int (value);
break;
default:
break;
@ -145,7 +146,7 @@ gst_fdsink_set_arg (GtkObject *object, GtkArg *arg, guint id)
}
static void
gst_fdsink_get_arg (GtkObject *object, GtkArg *arg, guint id)
gst_fdsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GstFdSink *fdsink;
@ -154,9 +155,9 @@ gst_fdsink_get_arg (GtkObject *object, GtkArg *arg, guint id)
fdsink = GST_FDSINK (object);
switch(id) {
switch (prop_id) {
case ARG_FD:
GTK_VALUE_INT (*arg) = fdsink->fd;
g_value_set_int (value, fdsink->fd);
break;
default:
break;

Some files were not shown because too many files have changed in this diff Show more