mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
core is glib2 only now tried to convert to g_strdup_value_contents as much as i could misc other fixes
Original commit message from CVS: * core is glib2 only now * tried to convert to g_strdup_value_contents as much as i could * misc other fixes
This commit is contained in:
parent
27d973f2bf
commit
f7aa64cf33
11 changed files with 64 additions and 340 deletions
|
@ -9,7 +9,6 @@
|
||||||
#undef HAVE_LC_MESSAGES
|
#undef HAVE_LC_MESSAGES
|
||||||
#undef HAVE_STPCPY
|
#undef HAVE_STPCPY
|
||||||
|
|
||||||
#undef USE_GLIB2
|
|
||||||
#undef HAVE_LIBXML2
|
#undef HAVE_LIBXML2
|
||||||
|
|
||||||
#undef PLUGINS_DIR
|
#undef PLUGINS_DIR
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 48638606945e579672f97b09cb797de3e6aee9e7
|
Subproject commit c2d7711457d468d527890f2057883c133b50c3b7
|
83
configure.ac
83
configure.ac
|
@ -101,7 +101,7 @@ fi
|
||||||
|
|
||||||
AC_SUBST(HTML_DIR)
|
AC_SUBST(HTML_DIR)
|
||||||
|
|
||||||
AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
|
AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
|
||||||
gtk_doc_min_version=0.6
|
gtk_doc_min_version=0.6
|
||||||
if $HAVE_GTK_DOC ; then
|
if $HAVE_GTK_DOC ; then
|
||||||
gtk_doc_version=`gtkdoc-mkdb --version`
|
gtk_doc_version=`gtkdoc-mkdb --version`
|
||||||
|
@ -116,8 +116,8 @@ EOF
|
||||||
HAVE_GTK_DOC=false
|
HAVE_GTK_DOC=false
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
GTK_DOC_SCANOBJ=gtkdoc-scanobj
|
# don't you love undocumented command line options?
|
||||||
|
GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit"
|
||||||
AC_SUBST(HAVE_GTK_DOC)
|
AC_SUBST(HAVE_GTK_DOC)
|
||||||
AC_SUBST(GTK_DOC_SCANOBJ)
|
AC_SUBST(GTK_DOC_SCANOBJ)
|
||||||
|
|
||||||
|
@ -234,73 +234,26 @@ dnl Check for essential libraries first:
|
||||||
dnl ====================================
|
dnl ====================================
|
||||||
|
|
||||||
dnl Check for glib2
|
dnl Check for glib2
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_GLIB2, true)
|
PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
|
||||||
GST_CHECK_FEATURE(GLIB2, [use of glib-2.0 and GObject], , [
|
HAVE_GLIB2=yes,HAVE_GLIB2=no)
|
||||||
PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
|
GLIB_LIBS=$GLIB2_LIBS
|
||||||
HAVE_GLIB2=yes,HAVE_GLIB2=no)
|
GLIB_CFLAGS=$GLIB2_CFLAGS
|
||||||
GLIB_LIBS=$GLIB2_LIBS
|
AC_SUBST(GLIB_LIBS)
|
||||||
GLIB_CFLAGS=$GLIB2_CFLAGS
|
AC_SUBST(GLIB_CFLAGS)
|
||||||
AC_SUBST(GLIB_LIBS)
|
|
||||||
AC_SUBST(GLIB_CFLAGS)
|
|
||||||
# glib2 is now the default. so if we don't have it here, then use glib1
|
|
||||||
if test "x$HAVE_GLIB2" = "xno"; then
|
|
||||||
AC_MSG_WARN([no glib2 found, falling back to glib1])
|
|
||||||
fi
|
|
||||||
], enabled, [
|
|
||||||
AC_DEFINE(USE_GLIB2)
|
|
||||||
GST_EXT_CFLAGS="$GST_EXT_CFLAGS -DUSE_GLIB2"
|
|
||||||
])
|
|
||||||
AC_SUBST(USE_GLIB2)
|
|
||||||
|
|
||||||
if test x$USE_GLIB2 = xno; then
|
if test "x$HAVE_GLIB2" = "xno"; then
|
||||||
GST_PKG_DEPS="glib >= 1.2.0, gtk+ >= 1.2.0"
|
AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
|
||||||
|
|
||||||
dnl Check for glib and gtk
|
|
||||||
AM_PATH_GLIB(1.2.0,,
|
|
||||||
AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
|
|
||||||
glib gmodule gthread)
|
|
||||||
AM_PATH_GTK(1.2.0,,
|
|
||||||
AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
|
|
||||||
HAVE_GTK=yes
|
|
||||||
|
|
||||||
GLIB_LIBS="$GLIB_LIBS $GTK_LIBS"
|
|
||||||
GLIB_CFLAGS="$GLIB_CFLAGS $GTK_CFLAGS"
|
|
||||||
else
|
|
||||||
GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
|
|
||||||
|
|
||||||
if $HAVE_GTK_DOC; then
|
|
||||||
AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
|
|
||||||
if $HAVE_GTK_DOC; then
|
|
||||||
# don't you love undocumented command line options?
|
|
||||||
GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit"
|
|
||||||
else
|
|
||||||
GTK_DOC_SCANOBJ=false
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
|
||||||
AC_SUBST(GST_PKG_DEPS)
|
AC_SUBST(GST_PKG_DEPS)
|
||||||
|
|
||||||
dnl Check for libxml
|
LIBXML_PKG=', libxml-2.0'
|
||||||
if test x$USE_GLIB2 = xno; then
|
PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
|
||||||
LIBXML_PKG=', libxml >= 1.8.1'
|
if test "x$HAVE_LIBXML2" = "xyes"; then
|
||||||
AC_PATH_PROG(XML_CONFIG, xml-config, no)
|
AC_DEFINE(HAVE_LIBXML2)
|
||||||
if test x$XML_CONFIG = xno; then
|
|
||||||
AC_MSG_ERROR(Couldn't find xml-config -- Need version 1.8.1 or better of libxml)
|
|
||||||
fi
|
|
||||||
XML_LIBS="`xml-config --libs`"
|
|
||||||
XML_CFLAGS="`xml-config --cflags`"
|
|
||||||
AC_CHECK_LIB(xml, xmlDocGetRootElement, :,
|
|
||||||
[ AC_MSG_ERROR(Need version 1.8.1 or better of libxml) ],
|
|
||||||
$XML_LIBS)
|
|
||||||
else
|
else
|
||||||
LIBXML_PKG=', libxml-2.0'
|
AC_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
|
||||||
PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
|
|
||||||
if test "x$HAVE_LIBXML2" = "xyes"; then
|
|
||||||
AC_DEFINE(HAVE_LIBXML2)
|
|
||||||
else
|
|
||||||
AC_ERROR(Need libxml2 for glib2 builds)
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
AC_SUBST(LIBXML_PKG)
|
AC_SUBST(LIBXML_PKG)
|
||||||
AC_SUBST(XML_LIBS)
|
AC_SUBST(XML_LIBS)
|
||||||
|
|
|
@ -10,14 +10,6 @@ endif
|
||||||
|
|
||||||
#GST_INSTRUMENT_FLAGS = -finstrument-functions -DGST_ENABLE_FUNC_INSTRUMENTATION
|
#GST_INSTRUMENT_FLAGS = -finstrument-functions -DGST_ENABLE_FUNC_INSTRUMENTATION
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
if GST_DISABLE_LOADSAVE
|
if GST_DISABLE_LOADSAVE
|
||||||
GST_LOADSAVE_SRC =
|
GST_LOADSAVE_SRC =
|
||||||
else
|
else
|
||||||
|
@ -50,7 +42,7 @@ else
|
||||||
GST_TRACE_SRC = gsttrace.c
|
GST_TRACE_SRC = gsttrace.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_libgst_la_SOURCES = gstcpuid_i386.s gstmarshal.list gobject2gtk.c gobject2gtk.h gstxml.c gsttypefind.c gstparse.c gstautoplug.c gsttrace.c
|
EXTRA_libgst_la_SOURCES = gstcpuid_i386.s gstmarshal.list gstxml.c gsttypefind.c gstparse.c gstautoplug.c gsttrace.c
|
||||||
|
|
||||||
SUBDIRS = . types elements $(GST_AUTOPLUG_DIRS) schedulers
|
SUBDIRS = . types elements $(GST_AUTOPLUG_DIRS) schedulers
|
||||||
DIST_SUBDIRS = types elements autoplug schedulers
|
DIST_SUBDIRS = types elements autoplug schedulers
|
||||||
|
@ -58,7 +50,7 @@ DIST_SUBDIRS = types elements autoplug schedulers
|
||||||
libgst_la_SOURCES = \
|
libgst_la_SOURCES = \
|
||||||
cothreads.c \
|
cothreads.c \
|
||||||
gst.c \
|
gst.c \
|
||||||
$(GST_OBJECT_MODEL_SRC) \
|
gstmarshal.c \
|
||||||
gstobject.c \
|
gstobject.c \
|
||||||
$(GST_AUTOPLUG_SRC) \
|
$(GST_AUTOPLUG_SRC) \
|
||||||
gstbin.c \
|
gstbin.c \
|
||||||
|
@ -91,14 +83,6 @@ libgst_la_SOURCES = \
|
||||||
$(GST_LOADSAVE_SRC)
|
$(GST_LOADSAVE_SRC)
|
||||||
|
|
||||||
|
|
||||||
##### Oh this sucks so badly. This isn't funny. #####
|
|
||||||
|
|
||||||
# the compiler shoots cothreads.c in the head at -O6
|
|
||||||
# FIXME: these manual rules break the dependency generation, so we have a
|
|
||||||
# nasty hack here.
|
|
||||||
#LTCOMPILE2=$(LTCOMPILE) -O2
|
|
||||||
#COMPILE2=$(COMPILE) -O2
|
|
||||||
|
|
||||||
# FIXME this only lists the x86 arch file, we really should merge them all
|
# FIXME this only lists the x86 arch file, we really should merge them all
|
||||||
cothreads.lo: $(srcdir)/cothreads.c $(srcdir)/cothreads.h $(srcdir)/gst_private.h \
|
cothreads.lo: $(srcdir)/cothreads.c $(srcdir)/cothreads.h $(srcdir)/gst_private.h \
|
||||||
$(top_builddir)/config.h $(srcdir)/gstinfo.c $(srcdir)/gstarch.h
|
$(top_builddir)/config.h $(srcdir)/gstinfo.c $(srcdir)/gstarch.h
|
||||||
|
@ -107,39 +91,9 @@ cothreads.o: $(srcdir)/cothreads.c $(srcdir)/cothreads.h $(srcdir)/gst_private.h
|
||||||
$(top_builddir)/config.h $(srcdir)/gstinfo.c $(srcdir)/gstarch.h
|
$(top_builddir)/config.h $(srcdir)/gstinfo.c $(srcdir)/gstarch.h
|
||||||
$(COMPILE) -O2 -c $<
|
$(COMPILE) -O2 -c $<
|
||||||
|
|
||||||
# NOTDEPEND.cothreads.lo: cothreads.c
|
|
||||||
# NOTDEPEND $(LTCOMPILE2) -c $<
|
|
||||||
# NOTDEPEND.cothreads.o: cothreads.c
|
|
||||||
# NOTDEPEND $(COMPILE2) -c $<
|
|
||||||
|
|
||||||
#cothreads.lo: cothreads.c
|
|
||||||
# @echo '$(LTCOMPILE2) -c $<'; \
|
|
||||||
# $(LTCOMPILE2) -Wp,-MD,.deps/$(*F).pp -c $<
|
|
||||||
# @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
|
||||||
# < .deps/$(*F).pp > .deps/$(*F).P; \
|
|
||||||
# tr ' ' '\012' < .deps/$(*F).pp \
|
|
||||||
# | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
|
||||||
# >> .deps/$(*F).P; \
|
|
||||||
# rm -f .deps/$(*F).pp
|
|
||||||
#cothreads.o: cothreads.c
|
|
||||||
# @echo '$(COMPILE2) -c $<'; \
|
|
||||||
# $(COMPILE2) -Wp,-MD,.deps/$(*F).pp -c $<
|
|
||||||
# @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
|
||||||
# < .deps/$(*F).pp > .deps/$(*F).P; \
|
|
||||||
# tr ' ' '\012' < .deps/$(*F).pp \
|
|
||||||
# | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
|
||||||
# >> .deps/$(*F).P; \
|
|
||||||
# rm -f .deps/$(*F).pp
|
|
||||||
|
|
||||||
##### end immense suckage #####
|
|
||||||
|
|
||||||
##### Other built sources #####
|
##### Other built sources #####
|
||||||
|
|
||||||
if USE_GLIB2
|
|
||||||
BUILT_SOURCES = gstmarshal.h gstmarshal.c
|
BUILT_SOURCES = gstmarshal.h gstmarshal.c
|
||||||
else
|
|
||||||
BUILT_SOURCES =
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Generate both marshal files together. Makes dependency work easier.
|
# Generate both marshal files together. Makes dependency work easier.
|
||||||
gstmarshal.h: gstmarshal.list
|
gstmarshal.h: gstmarshal.list
|
||||||
|
@ -165,7 +119,7 @@ libgstinclude_HEADERS = \
|
||||||
cothreads.h \
|
cothreads.h \
|
||||||
gst.h \
|
gst.h \
|
||||||
gstconfig.h \
|
gstconfig.h \
|
||||||
$(GST_OBJECT_MODEL_HDR) \
|
gstmarshal.h \
|
||||||
gstobject.h \
|
gstobject.h \
|
||||||
gsttypes.h \
|
gsttypes.h \
|
||||||
gstautoplug.h \
|
gstautoplug.h \
|
||||||
|
@ -208,12 +162,7 @@ libgst_la_CFLAGS = -D_GNU_SOURCE -DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" \
|
||||||
$(LIBGST_CFLAGS) \
|
$(LIBGST_CFLAGS) \
|
||||||
-D_GNU_SOURCE \
|
-D_GNU_SOURCE \
|
||||||
-DG_LOG_DOMAIN=g_log_domain_gstreamer \
|
-DG_LOG_DOMAIN=g_log_domain_gstreamer \
|
||||||
-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" \
|
-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\"
|
||||||
-W -Wpointer-arith -Wbad-function-cast \
|
|
||||||
-Wcast-align -Wsign-compare \
|
|
||||||
-Wmissing-prototypes -Wmissing-declarations \
|
|
||||||
-Wnested-externs \
|
|
||||||
-Winline -Wno-unused
|
|
||||||
|
|
||||||
libgst_la_LIBADD = $(LIBGST_LIBS)
|
libgst_la_LIBADD = $(LIBGST_LIBS)
|
||||||
|
|
||||||
|
|
26
gst/gst.c
26
gst/gst.c
|
@ -76,23 +76,7 @@ gst_init (int *argc, char **argv[])
|
||||||
if (!g_thread_supported ())
|
if (!g_thread_supported ())
|
||||||
g_thread_init (NULL);
|
g_thread_init (NULL);
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
g_type_init();
|
g_type_init();
|
||||||
#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)) {
|
if (!gst_init_check (argc,argv)) {
|
||||||
exit (0); /* FIXME! */
|
exit (0); /* FIXME! */
|
||||||
|
@ -336,9 +320,7 @@ gst_init_check (int *argc,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
static GSList *mainloops = NULL;
|
static GSList *mainloops = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_main:
|
* gst_main:
|
||||||
|
@ -348,16 +330,12 @@ static GSList *mainloops = NULL;
|
||||||
void
|
void
|
||||||
gst_main (void)
|
gst_main (void)
|
||||||
{
|
{
|
||||||
#ifdef USE_GLIB2
|
|
||||||
GMainLoop *loop;
|
GMainLoop *loop;
|
||||||
|
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
mainloops = g_slist_prepend (mainloops, loop);
|
mainloops = g_slist_prepend (mainloops, loop);
|
||||||
|
|
||||||
g_main_loop_run (loop);
|
g_main_loop_run (loop);
|
||||||
#else
|
|
||||||
gtk_main ();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -368,7 +346,6 @@ gst_main (void)
|
||||||
void
|
void
|
||||||
gst_main_quit (void)
|
gst_main_quit (void)
|
||||||
{
|
{
|
||||||
#ifdef USE_GLIB2
|
|
||||||
if (!mainloops)
|
if (!mainloops)
|
||||||
g_warning ("Quit more loops than there are");
|
g_warning ("Quit more loops than there are");
|
||||||
else {
|
else {
|
||||||
|
@ -376,9 +353,6 @@ gst_main_quit (void)
|
||||||
mainloops = g_slist_delete_link (mainloops, mainloops);
|
mainloops = g_slist_delete_link (mainloops, mainloops);
|
||||||
g_main_loop_quit (loop);
|
g_main_loop_quit (loop);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
gtk_main_quit ();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1484,7 +1484,6 @@ gst_element_save_thyself (GstObject *object,
|
||||||
/* if (element->manager) */
|
/* if (element->manager) */
|
||||||
/* xmlNewChild(parent, NULL, "manager", GST_ELEMENT_NAME(element->manager)); */
|
/* xmlNewChild(parent, NULL, "manager", GST_ELEMENT_NAME(element->manager)); */
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
/* params */
|
/* params */
|
||||||
specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &nspecs);
|
specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (object), &nspecs);
|
||||||
|
|
||||||
|
@ -1509,7 +1508,6 @@ gst_element_save_thyself (GstObject *object,
|
||||||
g_value_unset(&value);
|
g_value_unset(&value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
pads = GST_ELEMENT_PADS (element);
|
pads = GST_ELEMENT_PADS (element);
|
||||||
|
|
||||||
|
|
|
@ -26,12 +26,8 @@
|
||||||
|
|
||||||
#include <gst/gstconfig.h>
|
#include <gst/gstconfig.h>
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
#include <glib-object.h> /* note that this gets wrapped in __GST_OBJECT_H__ */
|
#include <glib-object.h> /* note that this gets wrapped in __GST_OBJECT_H__ */
|
||||||
#include <gst/gstmarshal.h>
|
#include <gst/gstmarshal.h>
|
||||||
#else
|
|
||||||
#include <gst/gobject2gtk.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ATOMIC_H
|
#ifdef HAVE_ATOMIC_H
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
|
|
110
gst/gstutils.c
110
gst/gstutils.c
|
@ -496,98 +496,42 @@ gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
|
||||||
void
|
void
|
||||||
gst_print_element_args (GString * buf, gint indent, GstElement * element)
|
gst_print_element_args (GString * buf, gint indent, GstElement * element)
|
||||||
{
|
{
|
||||||
gint num_properties;
|
|
||||||
gint px;
|
|
||||||
guint width;
|
guint width;
|
||||||
|
GValue value = { 0, }; /* the important thing is that value.type = 0 */
|
||||||
|
gchar *str = 0;
|
||||||
|
GParamSpec *spec, **specs, **walk;
|
||||||
|
|
||||||
GParamSpec **property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (element),
|
specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (element), NULL);
|
||||||
&num_properties);
|
|
||||||
|
|
||||||
width = 0;
|
width = 0;
|
||||||
for (px = 0; px < num_properties; px++) {
|
for (walk = specs; *walk; walk++) {
|
||||||
GParamSpec *param = property_specs[px];
|
spec = *walk;
|
||||||
|
if (width < strlen (spec->name))
|
||||||
if (width < strlen (param->name))
|
width = strlen (spec->name);
|
||||||
width = strlen (param->name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (px = 0; px < num_properties; px++) {
|
for (walk = specs; *walk; walk++) {
|
||||||
GParamSpec *param = property_specs[px];
|
spec = *walk;
|
||||||
GValue value;
|
|
||||||
|
if (spec->flags & G_PARAM_READABLE) {
|
||||||
ZERO (value);
|
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (spec));
|
||||||
|
g_object_get_property (G_OBJECT (element), spec->name, &value);
|
||||||
g_value_init (&value, param->value_type);
|
str = g_strdup_value_contents (&value);
|
||||||
g_object_get_property (G_OBJECT (element), param->name, &value);
|
g_value_unset(&value);
|
||||||
|
} else {
|
||||||
|
str = g_strdup ("Parameter not readable.");
|
||||||
|
}
|
||||||
|
|
||||||
string_append_indent (buf, indent);
|
string_append_indent (buf, indent);
|
||||||
g_string_append (buf, param->name);
|
g_string_append (buf, spec->name);
|
||||||
string_append_indent (buf, 2 + width - strlen (param->name));
|
string_append_indent (buf, 2 + width - strlen (spec->name));
|
||||||
|
g_string_append (buf, str);
|
||||||
if (G_IS_PARAM_SPEC_ENUM (param)) {
|
|
||||||
GEnumValue *values;
|
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
|
|
||||||
#else
|
|
||||||
values = gtk_type_enum_get_values (param->value_type);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_string_append_printf (buf, "%s (%s)",
|
|
||||||
values[g_value_get_enum (&value)].value_nick,
|
|
||||||
g_type_name (G_VALUE_TYPE (&value)));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch (G_VALUE_TYPE (&value)) {
|
|
||||||
case G_TYPE_STRING:
|
|
||||||
g_string_append_printf (buf, "\"%s\"", g_value_get_string (&value));
|
|
||||||
break;
|
|
||||||
case G_TYPE_BOOLEAN:
|
|
||||||
g_string_append (buf, g_value_get_boolean (&value) ? "TRUE" : "FALSE");
|
|
||||||
break;
|
|
||||||
case G_TYPE_ULONG:{
|
|
||||||
gulong val = g_value_get_ulong (&value);
|
|
||||||
|
|
||||||
g_string_append_printf (buf, "%lu (0x%lx)", val, val);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case G_TYPE_LONG:{
|
|
||||||
glong val = g_value_get_long (&value);
|
|
||||||
|
|
||||||
g_string_append_printf (buf, "%ld (0x%lx)", val, val);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case G_TYPE_UINT:{
|
|
||||||
guint val = g_value_get_uint (&value);
|
|
||||||
|
|
||||||
g_string_append_printf (buf, "%u (0x%x)", val, val);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case G_TYPE_INT:{
|
|
||||||
gint val = g_value_get_int (&value);
|
|
||||||
|
|
||||||
g_string_append_printf (buf, "%d (0x%x)", val, val);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case G_TYPE_FLOAT:
|
|
||||||
g_string_append_printf (buf, "%f", g_value_get_float (&value));
|
|
||||||
break;
|
|
||||||
case G_TYPE_DOUBLE:
|
|
||||||
g_string_append_printf (buf, "%f", g_value_get_double (&value));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_string_append_printf (buf, "unknown value_type %d", G_VALUE_TYPE (&value));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_string_append_c (buf, '\n');
|
g_string_append_c (buf, '\n');
|
||||||
|
|
||||||
if (G_VALUE_TYPE (&value)) {
|
g_free (str);
|
||||||
g_value_unset (&value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
g_free (property_specs);
|
|
||||||
|
g_free (specs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,11 +84,7 @@ int main(int argc,char *argv[]) {
|
||||||
GEnumValue *values;
|
GEnumValue *values;
|
||||||
gint j;
|
gint j;
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
|
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
|
||||||
#else
|
|
||||||
values = gtk_type_enum_get_values (param->value_type);
|
|
||||||
#endif
|
|
||||||
for (j=0;values[j].value_name;j++) {
|
for (j=0;values[j].value_name;j++) {
|
||||||
gchar *value = g_strdup_printf("%d",values[j].value);
|
gchar *value = g_strdup_printf("%d",values[j].value);
|
||||||
optionnode = xmlNewChild (argnode, NULL, "option", value);
|
optionnode = xmlNewChild (argnode, NULL, "option", value);
|
||||||
|
|
|
@ -314,11 +314,8 @@ print_element_info (GstElementFactory *factory)
|
||||||
|
|
||||||
printf("Enum \"%s\" (default %d)", g_type_name (G_VALUE_TYPE (&value)),
|
printf("Enum \"%s\" (default %d)", g_type_name (G_VALUE_TYPE (&value)),
|
||||||
g_value_get_enum (&value));
|
g_value_get_enum (&value));
|
||||||
#ifdef USE_GLIB2
|
|
||||||
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
|
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
|
||||||
#else
|
|
||||||
values = gtk_type_enum_get_values (param->value_type);
|
|
||||||
#endif
|
|
||||||
while (values[j].value_name) {
|
while (values[j].value_name) {
|
||||||
printf("\n (%d): \t%s", values[j].value, values[j].value_nick);
|
printf("\n (%d): \t%s", values[j].value, values[j].value_nick);
|
||||||
j++;
|
j++;
|
||||||
|
@ -340,11 +337,7 @@ print_element_info (GstElementFactory *factory)
|
||||||
guint *signals;
|
guint *signals;
|
||||||
guint nsignals;
|
guint nsignals;
|
||||||
gint i;
|
gint i;
|
||||||
#ifdef USE_GLIB2
|
|
||||||
GSignalQuery *query;
|
GSignalQuery *query;
|
||||||
#else
|
|
||||||
GtkSignalQuery *query;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printf("\nElement Signals:\n");
|
printf("\nElement Signals:\n");
|
||||||
|
|
||||||
|
@ -356,18 +349,11 @@ print_element_info (GstElementFactory *factory)
|
||||||
const GType *param_types;
|
const GType *param_types;
|
||||||
gint j;
|
gint j;
|
||||||
|
|
||||||
#ifdef USE_GLIB2
|
|
||||||
query = g_new0(GSignalQuery,1);
|
query = g_new0(GSignalQuery,1);
|
||||||
g_signal_query (signals[i], query);
|
g_signal_query (signals[i], query);
|
||||||
n_params = query->n_params;
|
n_params = query->n_params;
|
||||||
return_type = query->return_type;
|
return_type = query->return_type;
|
||||||
param_types = query->param_types;
|
param_types = query->param_types;
|
||||||
#else
|
|
||||||
query = gtk_signal_query (signals[i]);
|
|
||||||
n_params = query->nparams;
|
|
||||||
return_type = query->return_val;
|
|
||||||
param_types = query->params;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printf (" \"%s\" :\t %s user_function (%s* object, \n", query->signal_name, g_type_name (return_type),
|
printf (" \"%s\" :\t %s user_function (%s* object, \n", query->signal_name, g_type_name (return_type),
|
||||||
g_type_name (G_OBJECT_TYPE (element)));
|
g_type_name (G_OBJECT_TYPE (element)));
|
||||||
|
|
|
@ -42,95 +42,26 @@ idle_func (gpointer data)
|
||||||
return busy;
|
return busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: write more outputs for ParamSpecs*/
|
|
||||||
static void
|
static void
|
||||||
property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec)
|
property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
#ifdef USE_GLIB2
|
GValue value = { 0, }; /* the important thing is that value.type = 0 */
|
||||||
if (G_IS_PARAM_SPEC_STRING (pspec))
|
gchar *str = 0;
|
||||||
{
|
|
||||||
gchar *str;
|
|
||||||
g_object_get (orig, pspec->name, &str, NULL);
|
|
||||||
g_print ("%s: %s = \"%s\"\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
|
||||||
g_free (str);
|
|
||||||
} else if (G_IS_PARAM_SPEC_CHAR (pspec)) {
|
|
||||||
gchar str;
|
|
||||||
g_object_get (orig, pspec->name, &str, NULL);
|
|
||||||
g_print ("%s: %s = \"%c\"\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
|
||||||
} else if (G_IS_PARAM_SPEC_INT (pspec)) {
|
|
||||||
gint i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = %d\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else if (G_IS_PARAM_SPEC_INT64 (pspec)) {
|
|
||||||
gint64 i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = %lld\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else if (G_IS_PARAM_SPEC_UINT (pspec)) {
|
|
||||||
guint i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = %u\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else if (G_IS_PARAM_SPEC_UINT (pspec)) {
|
|
||||||
guint64 i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = %llu\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else if (G_IS_PARAM_SPEC_ENUM (pspec)) {
|
|
||||||
guint64 i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = \"%llu\"\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else if (G_IS_PARAM_SPEC_FLOAT (pspec)) {
|
|
||||||
gfloat i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = %f\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else if (G_IS_PARAM_SPEC_DOUBLE (pspec)) {
|
|
||||||
gdouble i;
|
|
||||||
g_object_get (orig, pspec->name, &i, NULL);
|
|
||||||
g_print ("%s: %s = %f\n", GST_OBJECT_NAME (orig), pspec->name, i);
|
|
||||||
} else {
|
|
||||||
g_print ("%s: changed \"%s\"\n", GST_OBJECT_NAME (orig), pspec->name);
|
|
||||||
}
|
|
||||||
#endif /* USE_GLIB2 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
print_props (gpointer data, gpointer user_data)
|
|
||||||
{
|
|
||||||
GstPropsEntry *entry = (GstPropsEntry *)data;
|
|
||||||
GstElement *element = GST_ELEMENT (user_data);
|
|
||||||
|
|
||||||
g_print ("deprecated: %s: %s: ", gst_element_get_name (element),
|
|
||||||
g_quark_to_string (entry->propid));
|
|
||||||
switch (entry->propstype) {
|
|
||||||
case GST_PROPS_INT_ID:
|
|
||||||
g_print ("%d\n", entry->data.int_data);
|
|
||||||
break;
|
|
||||||
case GST_PROPS_STRING_ID:
|
|
||||||
g_print ("%s\n", entry->data.string_data.string);
|
|
||||||
break;
|
|
||||||
case GST_PROPS_FLOAT_ID:
|
|
||||||
g_print ("%f\n", entry->data.float_data);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_print ("unknown\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
event_func (GstElement *element, GstEvent *event)
|
|
||||||
{
|
|
||||||
GstProps *props;
|
|
||||||
|
|
||||||
if (event == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (GST_EVENT_TYPE (event) == GST_EVENT_INFO) {
|
if (pspec->flags & G_PARAM_READABLE) {
|
||||||
props = GST_EVENT_INFO_PROPS (event);
|
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||||
|
g_object_get_property (G_OBJECT (orig), pspec->name, &value);
|
||||||
g_list_foreach (props->properties, print_props, GST_EVENT_SRC (event));
|
str = g_strdup_value_contents (&value);
|
||||||
|
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
||||||
|
g_free (str);
|
||||||
|
g_value_unset(&value);
|
||||||
|
} else {
|
||||||
|
g_warning ("Parameter not readable. What's up with that?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElement*
|
static GstElement*
|
||||||
xmllaunch_parse_cmdline (const gchar *argv[])
|
xmllaunch_parse_cmdline (const gchar **argv)
|
||||||
{
|
{
|
||||||
GstElement *pipeline = NULL, *e;
|
GstElement *pipeline = NULL, *e;
|
||||||
GstXML *xml;
|
GstXML *xml;
|
||||||
|
@ -141,7 +72,7 @@ xmllaunch_parse_cmdline (const gchar *argv[])
|
||||||
gint i = 0;
|
gint i = 0;
|
||||||
|
|
||||||
if (!(arg = argv[0])) {
|
if (!(arg = argv[0])) {
|
||||||
g_print ("usage: gst-xmllaunch <file.xml> [ element.property=value ... ]\n", arg[0]);
|
g_print ("usage: gst-xmllaunch <file.xml> [ element.property=value ... ]\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,8 +165,6 @@ main(int argc, char *argv[])
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_signal_connect (G_OBJECT (pipeline), "event", G_CALLBACK (event_func), NULL);
|
|
||||||
|
|
||||||
g_signal_connect (pipeline, "deep_notify", G_CALLBACK (property_change_callback), NULL);
|
g_signal_connect (pipeline, "deep_notify", G_CALLBACK (property_change_callback), NULL);
|
||||||
|
|
||||||
#ifndef GST_DISABLE_LOADSAVE
|
#ifndef GST_DISABLE_LOADSAVE
|
||||||
|
|
Loading…
Reference in a new issue