diff options
Diffstat (limited to 'ext/gconf')
-rw-r--r-- | ext/gconf/Makefile.am | 27 | ||||
-rw-r--r-- | ext/gconf/Makefile.in | 888 | ||||
-rw-r--r-- | ext/gconf/gstgconf.c | 304 | ||||
-rw-r--r-- | ext/gconf/gstgconf.h | 66 | ||||
-rw-r--r-- | ext/gconf/gstgconfaudiosink.c | 310 | ||||
-rw-r--r-- | ext/gconf/gstgconfaudiosink.h | 62 | ||||
-rw-r--r-- | ext/gconf/gstgconfaudiosrc.c | 210 | ||||
-rw-r--r-- | ext/gconf/gstgconfaudiosrc.h | 57 | ||||
-rw-r--r-- | ext/gconf/gstgconfelements.c | 59 | ||||
-rw-r--r-- | ext/gconf/gstgconfelements.h | 28 | ||||
-rw-r--r-- | ext/gconf/gstgconfvideosink.c | 210 | ||||
-rw-r--r-- | ext/gconf/gstgconfvideosink.h | 64 | ||||
-rw-r--r-- | ext/gconf/gstgconfvideosrc.c | 209 | ||||
-rw-r--r-- | ext/gconf/gstgconfvideosrc.h | 58 | ||||
-rw-r--r-- | ext/gconf/gstswitchsink.c | 269 | ||||
-rw-r--r-- | ext/gconf/gstswitchsink.h | 62 | ||||
-rw-r--r-- | ext/gconf/gstswitchsrc.c | 261 | ||||
-rw-r--r-- | ext/gconf/gstswitchsrc.h | 57 |
18 files changed, 3201 insertions, 0 deletions
diff --git a/ext/gconf/Makefile.am b/ext/gconf/Makefile.am new file mode 100644 index 0000000..0f1cffb --- /dev/null +++ b/ext/gconf/Makefile.am @@ -0,0 +1,27 @@ +plugin_LTLIBRARIES = libgstgconfelements.la + +libgstgconfelements_la_SOURCES = \ + gstgconfaudiosink.c \ + gstgconfaudiosrc.c \ + gstgconfelements.c \ + gstgconfvideosink.c \ + gstgconfvideosrc.c \ + gstswitchsink.c \ + gstswitchsrc.c \ + gstgconf.c + +DIR_CFLAGS = -DGST_GCONF_DIR=\"/system/gstreamer/@GST_MAJORMINOR@\" +libgstgconfelements_la_CFLAGS = $(GST_CFLAGS) $(GCONF_CFLAGS) $(DIR_CFLAGS) +libgstgconfelements_la_LIBADD = $(GST_LIBS) $(GCONF_LIBS) +libgstgconfelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstgconfelements_la_LIBTOOLFLAGS = --tag=disable-static + +noinst_HEADERS = \ + gstgconfaudiosink.h \ + gstgconfaudiosrc.h \ + gstgconfelements.h \ + gstgconfvideosink.h \ + gstgconfvideosrc.h \ + gstswitchsink.h \ + gstswitchsrc.h \ + gstgconf.h diff --git a/ext/gconf/Makefile.in b/ext/gconf/Makefile.in new file mode 100644 index 0000000..ebcd7e1 --- /dev/null +++ b/ext/gconf/Makefile.in @@ -0,0 +1,888 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = ext/gconf +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-gcc-inline-assembly.m4 \ + $(top_srcdir)/common/m4/as-objc.m4 \ + $(top_srcdir)/common/m4/as-python.m4 \ + $(top_srcdir)/common/m4/as-scrub-include.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-dowhile.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-gettext.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst-x11.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/orc.m4 $(top_srcdir)/common/m4/pkg.m4 \ + $(top_srcdir)/m4/aalib.m4 $(top_srcdir)/m4/esd.m4 \ + $(top_srcdir)/m4/gconf-2.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-fionread.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(plugindir)" +LTLIBRARIES = $(plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgstgconfelements_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstgconfelements_la_OBJECTS = \ + libgstgconfelements_la-gstgconfaudiosink.lo \ + libgstgconfelements_la-gstgconfaudiosrc.lo \ + libgstgconfelements_la-gstgconfelements.lo \ + libgstgconfelements_la-gstgconfvideosink.lo \ + libgstgconfelements_la-gstgconfvideosrc.lo \ + libgstgconfelements_la-gstswitchsink.lo \ + libgstgconfelements_la-gstswitchsrc.lo \ + libgstgconfelements_la-gstgconf.lo +libgstgconfelements_la_OBJECTS = $(am_libgstgconfelements_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +libgstgconfelements_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) \ + $(libgstgconfelements_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libgstgconfelements_la_SOURCES) +DIST_SOURCES = $(libgstgconfelements_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +AALIB_CFLAGS = @AALIB_CFLAGS@ +AALIB_CONFIG = @AALIB_CONFIG@ +AALIB_LIBS = @AALIB_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +ANNODEX_CFLAGS = @ANNODEX_CFLAGS@ +ANNODEX_LIBS = @ANNODEX_LIBS@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ2_LIBS = @BZ2_LIBS@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_GOBJECT_CFLAGS = @CAIRO_GOBJECT_CFLAGS@ +CAIRO_GOBJECT_LIBS = @CAIRO_GOBJECT_LIBS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DIRECTSOUND_CFLAGS = @DIRECTSOUND_CFLAGS@ +DIRECTSOUND_LDFLAGS = @DIRECTSOUND_LDFLAGS@ +DIRECTSOUND_LIBS = @DIRECTSOUND_LIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DV1394_CFLAGS = @DV1394_CFLAGS@ +DV1394_LIBS = @DV1394_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +FLAC_CFLAGS = @FLAC_CFLAGS@ +FLAC_LIBS = @FLAC_LIBS@ +GCONFTOOL = @GCONFTOOL@ +GCONF_CFLAGS = @GCONF_CFLAGS@ +GCONF_LIBS = @GCONF_LIBS@ +GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ +GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GLIB_REQ = @GLIB_REQ@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPB_PREFIX = @GSTPB_PREFIX@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CONTROLLER_CFLAGS = @GST_CONTROLLER_CFLAGS@ +GST_CONTROLLER_LIBS = @GST_CONTROLLER_LIBS@ +GST_CXXFLAGS = @GST_CXXFLAGS@ +GST_GDP_CFLAGS = @GST_GDP_CFLAGS@ +GST_GDP_LIBS = @GST_GDP_LIBS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_MAJORMINOR = @GST_MAJORMINOR@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PLUGINS_ALL = @GST_PLUGINS_ALL@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_SELECTED = @GST_PLUGINS_SELECTED@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GST_PREFIX = @GST_PREFIX@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_X11_CFLAGS = @GTK_X11_CFLAGS@ +GTK_X11_LIBS = @GTK_X11_LIBS@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +HAVE_AVC1394 = @HAVE_AVC1394@ +HAVE_BZ2 = @HAVE_BZ2@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DIRECTSOUND = @HAVE_DIRECTSOUND@ +HAVE_GCONFTOOL = @HAVE_GCONFTOOL@ +HAVE_ROM1394 = @HAVE_ROM1394@ +HAVE_SPEEX = @HAVE_SPEEX@ +HAVE_X = @HAVE_X@ +HAVE_XSHM = @HAVE_XSHM@ +HAVE_ZLIB = @HAVE_ZLIB@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +JACK_0_120_1_CFLAGS = @JACK_0_120_1_CFLAGS@ +JACK_0_120_1_LIBS = @JACK_0_120_1_LIBS@ +JACK_1_9_7_CFLAGS = @JACK_1_9_7_CFLAGS@ +JACK_1_9_7_LIBS = @JACK_1_9_7_LIBS@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LIBS = @JACK_LIBS@ +JPEG_LIBS = @JPEG_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCACA_CFLAGS = @LIBCACA_CFLAGS@ +LIBCACA_LIBS = @LIBCACA_LIBS@ +LIBDV_CFLAGS = @LIBDV_CFLAGS@ +LIBDV_LIBS = @LIBDV_LIBS@ +LIBICONV = @LIBICONV@ +LIBIEC61883_CFLAGS = @LIBIEC61883_CFLAGS@ +LIBIEC61883_LIBS = @LIBIEC61883_LIBS@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@ +LIBV4L2_LIBS = @LIBV4L2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJC_LDFLAGS = @OBJC_LDFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORCC = @ORCC@ +ORCC_FLAGS = @ORCC_FLAGS@ +ORC_CFLAGS = @ORC_CFLAGS@ +ORC_LIBS = @ORC_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +POSUB = @POSUB@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PULSE_0_9_20_CFLAGS = @PULSE_0_9_20_CFLAGS@ +PULSE_0_9_20_LIBS = @PULSE_0_9_20_LIBS@ +PULSE_1_0_CFLAGS = @PULSE_1_0_CFLAGS@ +PULSE_1_0_LIBS = @PULSE_1_0_LIBS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RAW1394_CFLAGS = @RAW1394_CFLAGS@ +RAW1394_LIBS = @RAW1394_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SHOUT2_CFLAGS = @SHOUT2_CFLAGS@ +SHOUT2_LIBS = @SHOUT2_LIBS@ +SOUP_CFLAGS = @SOUP_CFLAGS@ +SOUP_LIBS = @SOUP_LIBS@ +SPEEX_CFLAGS = @SPEEX_CFLAGS@ +SPEEX_LIBS = @SPEEX_LIBS@ +STRIP = @STRIP@ +TAGLIB_CFLAGS = @TAGLIB_CFLAGS@ +TAGLIB_CXXFLAGS = @TAGLIB_CXXFLAGS@ +TAGLIB_LIBS = @TAGLIB_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WAVPACK_CFLAGS = @WAVPACK_CFLAGS@ +WAVPACK_LIBS = @WAVPACK_LIBS@ +WIN32_LIBS = @WIN32_LIBS@ +XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ +XDAMAGE_LIBS = @XDAMAGE_LIBS@ +XFIXES_CFLAGS = @XFIXES_CFLAGS@ +XFIXES_LIBS = @XFIXES_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +XSHM_LIBS = @XSHM_LIBS@ +XVIDEO_LIBS = @XVIDEO_LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +plugin_LTLIBRARIES = libgstgconfelements.la +libgstgconfelements_la_SOURCES = \ + gstgconfaudiosink.c \ + gstgconfaudiosrc.c \ + gstgconfelements.c \ + gstgconfvideosink.c \ + gstgconfvideosrc.c \ + gstswitchsink.c \ + gstswitchsrc.c \ + gstgconf.c + +DIR_CFLAGS = -DGST_GCONF_DIR=\"/system/gstreamer/@GST_MAJORMINOR@\" +libgstgconfelements_la_CFLAGS = $(GST_CFLAGS) $(GCONF_CFLAGS) $(DIR_CFLAGS) +libgstgconfelements_la_LIBADD = $(GST_LIBS) $(GCONF_LIBS) +libgstgconfelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstgconfelements_la_LIBTOOLFLAGS = --tag=disable-static +noinst_HEADERS = \ + gstgconfaudiosink.h \ + gstgconfaudiosrc.h \ + gstgconfelements.h \ + gstgconfvideosink.h \ + gstgconfvideosrc.h \ + gstswitchsink.h \ + gstswitchsrc.h \ + gstgconf.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ext/gconf/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/gconf/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)" + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ + } + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libgstgconfelements.la: $(libgstgconfelements_la_OBJECTS) $(libgstgconfelements_la_DEPENDENCIES) $(EXTRA_libgstgconfelements_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstgconfelements_la_LINK) -rpath $(plugindir) $(libgstgconfelements_la_OBJECTS) $(libgstgconfelements_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstgconf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstgconfaudiosink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstgconfaudiosrc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstgconfelements.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstgconfvideosink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstgconfvideosrc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstswitchsink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgconfelements_la-gstswitchsrc.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgstgconfelements_la-gstgconfaudiosink.lo: gstgconfaudiosink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstgconfaudiosink.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstgconfaudiosink.Tpo -c -o libgstgconfelements_la-gstgconfaudiosink.lo `test -f 'gstgconfaudiosink.c' || echo '$(srcdir)/'`gstgconfaudiosink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstgconfaudiosink.Tpo $(DEPDIR)/libgstgconfelements_la-gstgconfaudiosink.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgconfaudiosink.c' object='libgstgconfelements_la-gstgconfaudiosink.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstgconfaudiosink.lo `test -f 'gstgconfaudiosink.c' || echo '$(srcdir)/'`gstgconfaudiosink.c + +libgstgconfelements_la-gstgconfaudiosrc.lo: gstgconfaudiosrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstgconfaudiosrc.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstgconfaudiosrc.Tpo -c -o libgstgconfelements_la-gstgconfaudiosrc.lo `test -f 'gstgconfaudiosrc.c' || echo '$(srcdir)/'`gstgconfaudiosrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstgconfaudiosrc.Tpo $(DEPDIR)/libgstgconfelements_la-gstgconfaudiosrc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgconfaudiosrc.c' object='libgstgconfelements_la-gstgconfaudiosrc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstgconfaudiosrc.lo `test -f 'gstgconfaudiosrc.c' || echo '$(srcdir)/'`gstgconfaudiosrc.c + +libgstgconfelements_la-gstgconfelements.lo: gstgconfelements.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstgconfelements.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstgconfelements.Tpo -c -o libgstgconfelements_la-gstgconfelements.lo `test -f 'gstgconfelements.c' || echo '$(srcdir)/'`gstgconfelements.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstgconfelements.Tpo $(DEPDIR)/libgstgconfelements_la-gstgconfelements.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgconfelements.c' object='libgstgconfelements_la-gstgconfelements.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstgconfelements.lo `test -f 'gstgconfelements.c' || echo '$(srcdir)/'`gstgconfelements.c + +libgstgconfelements_la-gstgconfvideosink.lo: gstgconfvideosink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstgconfvideosink.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstgconfvideosink.Tpo -c -o libgstgconfelements_la-gstgconfvideosink.lo `test -f 'gstgconfvideosink.c' || echo '$(srcdir)/'`gstgconfvideosink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstgconfvideosink.Tpo $(DEPDIR)/libgstgconfelements_la-gstgconfvideosink.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgconfvideosink.c' object='libgstgconfelements_la-gstgconfvideosink.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstgconfvideosink.lo `test -f 'gstgconfvideosink.c' || echo '$(srcdir)/'`gstgconfvideosink.c + +libgstgconfelements_la-gstgconfvideosrc.lo: gstgconfvideosrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstgconfvideosrc.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstgconfvideosrc.Tpo -c -o libgstgconfelements_la-gstgconfvideosrc.lo `test -f 'gstgconfvideosrc.c' || echo '$(srcdir)/'`gstgconfvideosrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstgconfvideosrc.Tpo $(DEPDIR)/libgstgconfelements_la-gstgconfvideosrc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgconfvideosrc.c' object='libgstgconfelements_la-gstgconfvideosrc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstgconfvideosrc.lo `test -f 'gstgconfvideosrc.c' || echo '$(srcdir)/'`gstgconfvideosrc.c + +libgstgconfelements_la-gstswitchsink.lo: gstswitchsink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstswitchsink.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstswitchsink.Tpo -c -o libgstgconfelements_la-gstswitchsink.lo `test -f 'gstswitchsink.c' || echo '$(srcdir)/'`gstswitchsink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstswitchsink.Tpo $(DEPDIR)/libgstgconfelements_la-gstswitchsink.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstswitchsink.c' object='libgstgconfelements_la-gstswitchsink.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstswitchsink.lo `test -f 'gstswitchsink.c' || echo '$(srcdir)/'`gstswitchsink.c + +libgstgconfelements_la-gstswitchsrc.lo: gstswitchsrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstswitchsrc.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstswitchsrc.Tpo -c -o libgstgconfelements_la-gstswitchsrc.lo `test -f 'gstswitchsrc.c' || echo '$(srcdir)/'`gstswitchsrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstswitchsrc.Tpo $(DEPDIR)/libgstgconfelements_la-gstswitchsrc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstswitchsrc.c' object='libgstgconfelements_la-gstswitchsrc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstswitchsrc.lo `test -f 'gstswitchsrc.c' || echo '$(srcdir)/'`gstswitchsrc.c + +libgstgconfelements_la-gstgconf.lo: gstgconf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -MT libgstgconfelements_la-gstgconf.lo -MD -MP -MF $(DEPDIR)/libgstgconfelements_la-gstgconf.Tpo -c -o libgstgconfelements_la-gstgconf.lo `test -f 'gstgconf.c' || echo '$(srcdir)/'`gstgconf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgconfelements_la-gstgconf.Tpo $(DEPDIR)/libgstgconfelements_la-gstgconf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgconf.c' object='libgstgconfelements_la-gstgconf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgconfelements_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgconfelements_la_CFLAGS) $(CFLAGS) -c -o libgstgconfelements_la-gstgconf.lo `test -f 'gstgconf.c' || echo '$(srcdir)/'`gstgconf.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(plugindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pluginLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/ext/gconf/gstgconf.c b/ext/gconf/gstgconf.c new file mode 100644 index 0000000..eee80c9 --- /dev/null +++ b/ext/gconf/gstgconf.c @@ -0,0 +1,304 @@ +/* GStreamer + * nf_get_default_audio_sink + * Copyright (C) <2002> Thomas Vander Stichele <thomas@apestaart.org> + * Copyright (C) <2006> Jürg Billeter <j@bitron.ch> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * this library handles interaction with GConf + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gst/gst.h> + +#include "gstgconf.h" +#include "gstgconfelements.h" /* for debug category */ + +#ifndef GST_GCONF_DIR +#error "GST_GCONF_DIR is not defined !" +#endif + +static GConfClient *_gst_gconf_client = NULL; /* GConf connection */ + + +/* internal functions */ + +static GConfClient * +gst_gconf_get_client (void) +{ + if (!_gst_gconf_client) + _gst_gconf_client = gconf_client_get_default (); + + return _gst_gconf_client; +} + +/* external functions */ + +/** + * gst_gconf_get_string: + * @key: a #gchar corresponding to the key you want to get. + * + * Get GConf key @key's string value. + * + * Returns: a newly allocated #gchar string containing @key's value, + * or NULL in the case of an error.. + */ +gchar * +gst_gconf_get_string (const gchar * key) +{ + GError *error = NULL; + gchar *value = NULL; + gchar *full_key; + + if (!g_str_has_prefix (key, GST_GCONF_DIR)) + full_key = g_strdup_printf ("%s/%s", GST_GCONF_DIR, key); + else + full_key = g_strdup (key); + + value = gconf_client_get_string (gst_gconf_get_client (), full_key, &error); + g_free (full_key); + + if (error) { + g_warning ("gst_gconf_get_string: error: %s\n", error->message); + g_error_free (error); + return NULL; + } + + return value; +} + +const gchar * +gst_gconf_get_key_for_sink_profile (GstGConfProfile profile) +{ + switch (profile) { + case GCONF_PROFILE_SOUNDS: + return GST_GCONF_DIR "/" GST_GCONF_AUDIOSINK_KEY; + case GCONF_PROFILE_MUSIC: + return GST_GCONF_DIR "/" GST_GCONF_MUSIC_AUDIOSINK_KEY; + case GCONF_PROFILE_CHAT: + return GST_GCONF_DIR "/" GST_GCONF_CHAT_AUDIOSINK_KEY; + default: + break; + } + + g_return_val_if_reached (GST_GCONF_DIR "/" GST_GCONF_AUDIOSINK_KEY); +} + +/** + * gst_gconf_set_string: + * @key: a #gchar corresponding to the key you want to set. + * @value: a #gchar containing key value. + * + * Set GConf key @key to string value @value. + */ +void +gst_gconf_set_string (const gchar * key, const gchar * value) +{ + GError *error = NULL; + gchar *full_key; + + if (!g_str_has_prefix (key, GST_GCONF_DIR)) + full_key = g_strdup_printf ("%s/%s", GST_GCONF_DIR, key); + else + full_key = g_strdup (key); + + gconf_client_set_string (gst_gconf_get_client (), full_key, value, &error); + if (error) { + GST_ERROR ("gst_gconf_set_string: error: %s\n", error->message); + g_error_free (error); + } + g_free (full_key); +} + +/** + * gst_gconf_render_bin_from_key: + * @key: a #gchar string corresponding to a GConf key. + * + * Render bin from GConf key @key. + * + * Returns: a #GstElement containing the rendered bin. + */ +GstElement * +gst_gconf_render_bin_from_key (const gchar * key) +{ + GstElement *bin = NULL; + gchar *value; + + value = gst_gconf_get_string (key); + + GST_LOG ("%s = %s", GST_STR_NULL (key), GST_STR_NULL (value)); + + if (value) { + GError *err = NULL; + + bin = gst_parse_bin_from_description (value, TRUE, &err); + if (err) { + GST_ERROR ("gconf: error creating bin '%s': %s", value, err->message); + g_error_free (err); + } + + g_free (value); + } + return bin; +} + +/** + * gst_gconf_render_bin_with_default: + * @bin: a #gchar string describing the pipeline to construct. + * @default_sink: an element to use as default if the given pipeline fails to construct. + * + * Render bin from description @bin using @default_sink element as a fallback. + * + * Returns: a #GstElement containing the rendered bin. + */ +GstElement * +gst_gconf_render_bin_with_default (const gchar * bin, + const gchar * default_sink) +{ + GstElement *ret = NULL; + GError *err = NULL; + + if (bin != NULL) + ret = gst_parse_bin_from_description (bin, TRUE, &err); + + if (ret == NULL || err != NULL) { + if (err) { + GST_DEBUG ("Could not create audio sink from GConf settings: %s", + err->message); + g_error_free (err); + } else { + GST_DEBUG ("Could not create audio sink from GConf settings"); + } + + ret = gst_element_factory_make (default_sink, NULL); + + if (!ret) + g_warning + ("Could not build GConf audio sink and the replacement %s doesn't work", + DEFAULT_AUDIOSINK); + } + + return ret; +} + +/** + * gst_gconf_get_default_video_sink: + * + * Render video output bin from GStreamer GConf key : "default/videosink". + * If key is invalid, the default video sink for the platform is used + * (typically xvimagesink or ximagesink). + * + * Returns: a #GstElement containing the video output bin, or NULL if + * everything failed. + */ +GstElement * +gst_gconf_get_default_video_sink (void) +{ + GstElement *ret = gst_gconf_render_bin_from_key (GST_GCONF_VIDEOSINK_KEY); + + if (!ret) { + ret = gst_element_factory_make (DEFAULT_VIDEOSINK, NULL); + + if (!ret) + g_warning ("No GConf default video sink key and %s doesn't work", + DEFAULT_VIDEOSINK); + } + + return ret; +} + +/** + * gst_gconf_get_default_audio_src: + * + * Render audio acquisition bin from GStreamer GConf key : "default/audiosrc". + * If key is invalid, the default audio source for the plaform is used. + * (typically osssrc or sunaudiosrc). + * + * Returns: a #GstElement containing the audio source bin, or NULL if + * everything failed. + */ +GstElement * +gst_gconf_get_default_audio_src (void) +{ + GstElement *ret = gst_gconf_render_bin_from_key (GST_GCONF_AUDIOSRC_KEY); + + if (!ret) { + ret = gst_element_factory_make (DEFAULT_AUDIOSRC, NULL); + + if (!ret) + g_warning ("No GConf default audio src key and %s doesn't work", + DEFAULT_AUDIOSRC); + } + + return ret; +} + +/** + * gst_gconf_get_default_video_src: + * + * Render video acquisition bin from GStreamer GConf key : + * "default/videosrc". If key is invalid, the default video source + * for the platform is used (typically videotestsrc). + * + * Returns: a #GstElement containing the video source bin, or NULL if + * everything failed. + */ +GstElement * +gst_gconf_get_default_video_src (void) +{ + GstElement *ret = gst_gconf_render_bin_from_key (GST_GCONF_VIDEOSRC_KEY); + + if (!ret) { + ret = gst_element_factory_make (DEFAULT_VIDEOSRC, NULL); + + if (!ret) + g_warning ("No GConf default video src key and %s doesn't work", + DEFAULT_VIDEOSRC); + } + + return ret; +} + +/** + * gst_gconf_get_default_visualization_element: + * + * Render visualization bin from GStreamer GConf key : "default/visualization". + * If key is invalid, the default visualization element is used. + * + * Returns: a #GstElement containing the visualization bin, or NULL if + * everything failed. + */ +GstElement * +gst_gconf_get_default_visualization_element (void) +{ + GstElement *ret = gst_gconf_render_bin_from_key ("default/visualization"); + + if (!ret) { + ret = gst_element_factory_make (DEFAULT_VISUALIZER, NULL); + + if (!ret) + g_warning + ("No GConf default visualization plugin key and %s doesn't work", + DEFAULT_VISUALIZER); + } + + return ret; +} diff --git a/ext/gconf/gstgconf.h b/ext/gconf/gstgconf.h new file mode 100644 index 0000000..b1153e9 --- /dev/null +++ b/ext/gconf/gstgconf.h @@ -0,0 +1,66 @@ +/* GStreamer + * Copyright (C) <2002> Thomas Vander Stichele <thomas@apestaart.org> + * Copyright (C) <2006> Jürg Billeter <j@bitron.ch> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef GST_GCONF_H +#define GST_GCONF_H + +/* + * this library handles interaction with GConf + */ + +#include <gst/gst.h> +#include <gconf/gconf-client.h> + +G_BEGIN_DECLS + +#define GST_GCONF_AUDIOSRC_KEY "default/audiosrc" +#define GST_GCONF_AUDIOSINK_KEY "default/audiosink" +#define GST_GCONF_MUSIC_AUDIOSINK_KEY "default/musicaudiosink" +#define GST_GCONF_CHAT_AUDIOSINK_KEY "default/chataudiosink" +#define GST_GCONF_VIDEOSRC_KEY "default/videosrc" +#define GST_GCONF_VIDEOSINK_KEY "default/videosink" + +typedef enum +{ + GCONF_PROFILE_SOUNDS, + GCONF_PROFILE_MUSIC, + GCONF_PROFILE_CHAT, + GCONF_PROFILE_NONE /* Internal value only */ +} GstGConfProfile; + +gchar * gst_gconf_get_string (const gchar *key); +void gst_gconf_set_string (const gchar *key, + const gchar *value); + +const gchar * gst_gconf_get_key_for_sink_profile (GstGConfProfile profile); + +GstElement * gst_gconf_render_bin_from_key (const gchar *key); +GstElement * gst_gconf_render_bin_with_default (const gchar *bin, + const gchar *default_sink); + +GstElement * gst_gconf_get_default_video_sink (void); +GstElement * gst_gconf_get_default_audio_sink (int profile); +GstElement * gst_gconf_get_default_video_src (void); +GstElement * gst_gconf_get_default_audio_src (void); +GstElement * gst_gconf_get_default_visualization_element (void); + +G_END_DECLS + +#endif /* GST_GCONF_H */ diff --git a/ext/gconf/gstgconfaudiosink.c b/ext/gconf/gstgconfaudiosink.c new file mode 100644 index 0000000..d60f2be --- /dev/null +++ b/ext/gconf/gstgconfaudiosink.c @@ -0,0 +1,310 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * (c) 2006 Jürg Billeter <j@bitron.ch> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/** + * SECTION:element-gconfaudiosink + * + * This element outputs sound to the audiosink that has been configured in + * GConf by the user. + * + * <refsect2> + * <title>Example launch line</title> + * |[ + * gst-launch filesrc location=foo.ogg ! decodebin ! audioconvert ! audioresample ! gconfaudiosink + * ]| Play on configured audiosink + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <string.h> + +#include "gstgconfelements.h" +#include "gstgconfaudiosink.h" + +static void gst_gconf_audio_sink_dispose (GObject * object); +static void gst_gconf_audio_sink_finalize (GstGConfAudioSink * sink); +static void cb_change_child (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data); +static GstStateChangeReturn +gst_gconf_audio_sink_change_state (GstElement * element, + GstStateChange transition); +static void gst_gconf_switch_profile (GstGConfAudioSink * sink, + GstGConfProfile profile); + +enum +{ + PROP_0, + PROP_PROFILE +}; + +GST_BOILERPLATE (GstGConfAudioSink, gst_gconf_audio_sink, GstSwitchSink, + GST_TYPE_SWITCH_SINK); + +static void gst_gconf_audio_sink_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_gconf_audio_sink_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +static void +gst_gconf_audio_sink_base_init (gpointer klass) +{ + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + gst_element_class_set_details_simple (eklass, "GConf audio sink", + "Sink/Audio", + "Audio sink embedding the GConf-settings for audio output", + "Jan Schmidt <thaytan@mad.scientist.com>"); +} + +#define GST_TYPE_GCONF_PROFILE (gst_gconf_profile_get_type()) +static GType +gst_gconf_profile_get_type (void) +{ + static GType gconf_profile_type = 0; + static const GEnumValue gconf_profiles[] = { + {GCONF_PROFILE_SOUNDS, "Sound Events", "sounds"}, + {GCONF_PROFILE_MUSIC, "Music and Movies", "music"}, + {GCONF_PROFILE_CHAT, "Audio/Video Conferencing", "chat"}, + {0, NULL, NULL} + }; + + if (!gconf_profile_type) { + gconf_profile_type = + g_enum_register_static ("GstGConfProfile", gconf_profiles); + } + return gconf_profile_type; +} + +static void +gst_gconf_audio_sink_class_init (GstGConfAudioSinkClass * klass) +{ + GObjectClass *oklass = G_OBJECT_CLASS (klass); + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + oklass->set_property = gst_gconf_audio_sink_set_property; + oklass->get_property = gst_gconf_audio_sink_get_property; + oklass->dispose = gst_gconf_audio_sink_dispose; + oklass->finalize = (GObjectFinalizeFunc) gst_gconf_audio_sink_finalize; + eklass->change_state = gst_gconf_audio_sink_change_state; + + g_object_class_install_property (oklass, PROP_PROFILE, + g_param_spec_enum ("profile", "Profile", "Profile", + GST_TYPE_GCONF_PROFILE, GCONF_PROFILE_SOUNDS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gst_gconf_audio_sink_reset (GstGConfAudioSink * sink) +{ + gst_switch_sink_set_child (GST_SWITCH_SINK (sink), NULL); + + g_free (sink->gconf_str); + sink->gconf_str = NULL; +} + +static void +gst_gconf_audio_sink_init (GstGConfAudioSink * sink, + GstGConfAudioSinkClass * g_class) +{ + gst_gconf_audio_sink_reset (sink); + + sink->client = gconf_client_get_default (); + gconf_client_add_dir (sink->client, GST_GCONF_DIR "/default", + GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); + + gst_gconf_switch_profile (sink, GCONF_PROFILE_SOUNDS); +} + +static void +gst_gconf_audio_sink_dispose (GObject * object) +{ + GstGConfAudioSink *sink = GST_GCONF_AUDIO_SINK (object); + + if (sink->client) { + gst_gconf_switch_profile (sink, GCONF_PROFILE_NONE); + g_object_unref (G_OBJECT (sink->client)); + sink->client = NULL; + } + + GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); +} + +static void +gst_gconf_audio_sink_finalize (GstGConfAudioSink * sink) +{ + g_free (sink->gconf_str); + + GST_CALL_PARENT (G_OBJECT_CLASS, finalize, ((GObject *) (sink))); +} + +static gboolean +do_change_child (GstGConfAudioSink * sink) +{ + const gchar *key; + gchar *new_gconf_str; + GstElement *new_kid; + + if (sink->profile == GCONF_PROFILE_NONE) + return FALSE; /* Can't switch to a 'NONE' sink */ + + key = gst_gconf_get_key_for_sink_profile (sink->profile); + new_gconf_str = gst_gconf_get_string (key); + + GST_LOG_OBJECT (sink, "old gconf string: %s", GST_STR_NULL (sink->gconf_str)); + GST_LOG_OBJECT (sink, "new gconf string: %s", GST_STR_NULL (new_gconf_str)); + + if (new_gconf_str != NULL && sink->gconf_str != NULL && + (strlen (new_gconf_str) == 0 || + strcmp (sink->gconf_str, new_gconf_str) == 0)) { + g_free (new_gconf_str); + GST_DEBUG_OBJECT (sink, + "GConf key was updated, but it didn't change. Ignoring"); + return TRUE; + } + + GST_DEBUG_OBJECT (sink, "GConf key changed: '%s' to '%s'", + GST_STR_NULL (sink->gconf_str), GST_STR_NULL (new_gconf_str)); + + GST_DEBUG_OBJECT (sink, "Creating new child for profile %d", sink->profile); + new_kid = + gst_gconf_render_bin_with_default (new_gconf_str, DEFAULT_AUDIOSINK); + + if (new_kid == NULL) { + GST_ELEMENT_ERROR (sink, LIBRARY, SETTINGS, (NULL), + ("Failed to render audio sink from GConf")); + goto fail; + } + + if (!gst_switch_sink_set_child (GST_SWITCH_SINK (sink), new_kid)) { + GST_WARNING_OBJECT (sink, "Failed to update child element"); + goto fail; + } + + g_free (sink->gconf_str); + sink->gconf_str = new_gconf_str; + + GST_DEBUG_OBJECT (sink, "done changing gconf audio sink"); + + return TRUE; + +fail: + g_free (new_gconf_str); + return FALSE; +} + +static void +gst_gconf_switch_profile (GstGConfAudioSink * sink, GstGConfProfile profile) +{ + if (sink->client == NULL) + return; + + if (sink->notify_id) { + GST_DEBUG_OBJECT (sink, "Unsubscribing old key %s for profile %d", + gst_gconf_get_key_for_sink_profile (sink->profile), sink->profile); + gconf_client_notify_remove (sink->client, sink->notify_id); + sink->notify_id = 0; + } + + sink->profile = profile; + if (profile != GCONF_PROFILE_NONE) { + const gchar *key = gst_gconf_get_key_for_sink_profile (sink->profile); + + GST_DEBUG_OBJECT (sink, "Subscribing to key %s for profile %d", + key, profile); + sink->notify_id = gconf_client_notify_add (sink->client, key, + cb_change_child, sink, NULL, NULL); + } +} + +static void +gst_gconf_audio_sink_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstGConfAudioSink *sink; + + sink = GST_GCONF_AUDIO_SINK (object); + + switch (prop_id) { + case PROP_PROFILE: + gst_gconf_switch_profile (sink, g_value_get_enum (value)); + break; + default: + break; + } +} + +static void +gst_gconf_audio_sink_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstGConfAudioSink *sink; + + sink = GST_GCONF_AUDIO_SINK (object); + + switch (prop_id) { + case PROP_PROFILE: + g_value_set_enum (value, sink->profile); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +cb_change_child (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data) +{ + do_change_child (GST_GCONF_AUDIO_SINK (data)); +} + +static GstStateChangeReturn +gst_gconf_audio_sink_change_state (GstElement * element, + GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstGConfAudioSink *sink = GST_GCONF_AUDIO_SINK (element); + + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + if (!do_change_child (sink)) { + gst_gconf_audio_sink_reset (sink); + return GST_STATE_CHANGE_FAILURE; + } + break; + default: + break; + } + + ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state, + (element, transition), GST_STATE_CHANGE_SUCCESS); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + gst_gconf_audio_sink_reset (sink); + break; + default: + break; + } + + return ret; +} diff --git a/ext/gconf/gstgconfaudiosink.h b/ext/gconf/gstgconfaudiosink.h new file mode 100644 index 0000000..2d730f3 --- /dev/null +++ b/ext/gconf/gstgconfaudiosink.h @@ -0,0 +1,62 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_GCONF_AUDIO_SINK_H__ +#define __GST_GCONF_AUDIO_SINK_H__ + +#include <gst/gst.h> +#include <gconf/gconf-client.h> +#include "gstswitchsink.h" + +G_BEGIN_DECLS + +#define GST_TYPE_GCONF_AUDIO_SINK \ + (gst_gconf_audio_sink_get_type ()) +#define GST_GCONF_AUDIO_SINK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GCONF_AUDIO_SINK, \ + GstGConfAudioSink)) +#define GST_GCONF_AUDIO_SINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GCONF_AUDIO_SINK, \ + GstGConfAudioSinkClass)) +#define GST_IS_GCONF_AUDIO_SINK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GCONF_AUDIO_SINK)) +#define GST_IS_GCONF_AUDIO_SINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GCONF_AUDIO_SINK)) + +typedef struct _GstGConfAudioSink { + GstSwitchSink parent; + + /* explicit pointers to stuff used */ + GConfClient *client; + GstGConfProfile profile; + guint notify_id; + + /* Current gconf string */ + gchar *gconf_str; +} GstGConfAudioSink; + +typedef struct _GstGConfAudioSinkClass { + GstSwitchSinkClass parent_class; +} GstGConfAudioSinkClass; + +GType gst_gconf_audio_sink_get_type (void); + +G_END_DECLS + +#endif /* __GST_GCONF_AUDIO_SINK_H__ */ diff --git a/ext/gconf/gstgconfaudiosrc.c b/ext/gconf/gstgconfaudiosrc.c new file mode 100644 index 0000000..2fdd61f --- /dev/null +++ b/ext/gconf/gstgconfaudiosrc.c @@ -0,0 +1,210 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * (c) 2005 Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/** + * SECTION:element-gconfaudiosrc + * @see_also: #GstAlsaSrc, #GstAutoAudioSrc + * + * This element records sound from the audiosink that has been configured in + * GConf by the user. + * + * <refsect2> + * <title>Example launch line</title> + * |[ + * gst-launch gconfaudiosrc ! audioconvert ! wavenc ! filesink location=record.wav + * ]| Record from configured audioinput + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <string.h> + +#include "gstgconfelements.h" +#include "gstgconfaudiosrc.h" + +static void gst_gconf_audio_src_dispose (GObject * object); +static void gst_gconf_audio_src_finalize (GstGConfAudioSrc * src); +static void cb_toggle_element (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data); +static GstStateChangeReturn +gst_gconf_audio_src_change_state (GstElement * element, + GstStateChange transition); + +GST_BOILERPLATE (GstGConfAudioSrc, gst_gconf_audio_src, GstSwitchSrc, + GST_TYPE_SWITCH_SRC); + +static void +gst_gconf_audio_src_base_init (gpointer klass) +{ + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + gst_element_class_set_details_simple (eklass, "GConf audio source", + "Source/Audio", + "Audio source embedding the GConf-settings for audio input", + "GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>"); +} + +static void +gst_gconf_audio_src_class_init (GstGConfAudioSrcClass * klass) +{ + GObjectClass *oklass = G_OBJECT_CLASS (klass); + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + oklass->dispose = gst_gconf_audio_src_dispose; + oklass->finalize = (GObjectFinalizeFunc) gst_gconf_audio_src_finalize; + eklass->change_state = gst_gconf_audio_src_change_state; +} + +/* + * Hack to make negotiation work. + */ + +static gboolean +gst_gconf_audio_src_reset (GstGConfAudioSrc * src) +{ + gst_switch_src_set_child (GST_SWITCH_SRC (src), NULL); + + g_free (src->gconf_str); + src->gconf_str = NULL; + return TRUE; +} + +static void +gst_gconf_audio_src_init (GstGConfAudioSrc * src, + GstGConfAudioSrcClass * g_class) +{ + gst_gconf_audio_src_reset (src); + + src->client = gconf_client_get_default (); + gconf_client_add_dir (src->client, GST_GCONF_DIR, + GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); + src->gconf_notify_id = gconf_client_notify_add (src->client, + GST_GCONF_DIR "/" GST_GCONF_AUDIOSRC_KEY, + cb_toggle_element, src, NULL, NULL); +} + +static void +gst_gconf_audio_src_dispose (GObject * object) +{ + GstGConfAudioSrc *src = GST_GCONF_AUDIO_SRC (object); + + if (src->client) { + if (src->gconf_notify_id) { + gconf_client_notify_remove (src->client, src->gconf_notify_id); + src->gconf_notify_id = 0; + } + + g_object_unref (G_OBJECT (src->client)); + src->client = NULL; + } + + GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); +} + +static void +gst_gconf_audio_src_finalize (GstGConfAudioSrc * src) +{ + g_free (src->gconf_str); + + GST_CALL_PARENT (G_OBJECT_CLASS, finalize, ((GObject *) (src))); +} + +static gboolean +do_toggle_element (GstGConfAudioSrc * src) +{ + GstElement *new_kid; + gchar *new_gconf_str; + + new_gconf_str = gst_gconf_get_string (GST_GCONF_AUDIOSRC_KEY); + if (new_gconf_str != NULL && src->gconf_str != NULL && + (strlen (new_gconf_str) == 0 || + strcmp (src->gconf_str, new_gconf_str) == 0)) { + g_free (new_gconf_str); + GST_DEBUG_OBJECT (src, "GConf key was updated, but it didn't change"); + return TRUE; + } + + GST_DEBUG_OBJECT (src, "GConf key changed: '%s' to '%s'", + GST_STR_NULL (src->gconf_str), GST_STR_NULL (new_gconf_str)); + + GST_DEBUG_OBJECT (src, "Creating new kid"); + if (!(new_kid = gst_gconf_get_default_audio_src ())) { + GST_ELEMENT_ERROR (src, LIBRARY, SETTINGS, (NULL), + ("Failed to render audio src from GConf")); + return FALSE; + } + + if (!gst_switch_src_set_child (GST_SWITCH_SRC (src), new_kid)) { + GST_WARNING_OBJECT (src, "Failed to update child element"); + goto fail; + } + + g_free (src->gconf_str); + src->gconf_str = new_gconf_str; + + GST_DEBUG_OBJECT (src, "done changing gconf audio src"); + + return TRUE; +fail: + g_free (new_gconf_str); + return FALSE; +} + +static void +cb_toggle_element (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data) +{ + do_toggle_element (GST_GCONF_AUDIO_SRC (data)); +} + +static GstStateChangeReturn +gst_gconf_audio_src_change_state (GstElement * element, + GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstGConfAudioSrc *src = GST_GCONF_AUDIO_SRC (element); + + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + if (!do_toggle_element (src)) { + gst_gconf_audio_src_reset (src); + return GST_STATE_CHANGE_FAILURE; + } + break; + default: + break; + } + + ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state, + (element, transition), GST_STATE_CHANGE_SUCCESS); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + if (!gst_gconf_audio_src_reset (src)) + ret = GST_STATE_CHANGE_FAILURE; + break; + default: + break; + } + + return ret; +} diff --git a/ext/gconf/gstgconfaudiosrc.h b/ext/gconf/gstgconfaudiosrc.h new file mode 100644 index 0000000..40fb94b --- /dev/null +++ b/ext/gconf/gstgconfaudiosrc.h @@ -0,0 +1,57 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * (c) 2005 Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_GCONF_AUDIO_SRC_H__ +#define __GST_GCONF_AUDIO_SRC_H__ + +#include <gst/gst.h> +#include <gconf/gconf-client.h> + +#include "gstswitchsrc.h" + +G_BEGIN_DECLS + +#define GST_TYPE_GCONF_AUDIO_SRC (gst_gconf_audio_src_get_type ()) +#define GST_GCONF_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GCONF_AUDIO_SRC, GstGConfAudioSrc)) +#define GST_GCONF_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GCONF_AUDIO_SRC, GstGConfAudioSrcClass)) +#define GST_IS_GCONF_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GCONF_AUDIO_SRC)) +#define GST_IS_GCONF_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GCONF_AUDIO_SRC)) + +typedef struct _GstGConfAudioSrc { + GstSwitchSrc parent; + + /* explicit pointers to stuff used */ + GConfClient *client; + + guint gconf_notify_id; + + /* Current gconf string */ + gchar *gconf_str; +} GstGConfAudioSrc; + +typedef struct _GstGConfAudioSrcClass { + GstSwitchSrcClass parent_class; +} GstGConfAudioSrcClass; + +GType gst_gconf_audio_src_get_type (void); + +G_END_DECLS + +#endif /* __GST_GCONF_AUDIO_SRC_H__ */ diff --git a/ext/gconf/gstgconfelements.c b/ext/gconf/gstgconfelements.c new file mode 100644 index 0000000..06f0113 --- /dev/null +++ b/ext/gconf/gstgconfelements.c @@ -0,0 +1,59 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gst/gst.h> + +#include "gstgconfelements.h" + +#include "gstgconfaudiosink.h" +#include "gstgconfaudiosrc.h" +#include "gstgconfvideosink.h" +#include "gstgconfvideosrc.h" + +GST_DEBUG_CATEGORY (gconf_debug); + +static gboolean +plugin_init (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (gconf_debug, "gconf", 0, + "GConf/GStreamer audio/video output wrapper elements"); + + if (!gst_element_register (plugin, "gconfvideosink", + GST_RANK_NONE, GST_TYPE_GCONF_VIDEO_SINK) || + !gst_element_register (plugin, "gconfvideosrc", + GST_RANK_NONE, GST_TYPE_GCONF_VIDEO_SRC) || + !gst_element_register (plugin, "gconfaudiosink", + GST_RANK_NONE, GST_TYPE_GCONF_AUDIO_SINK) || + !gst_element_register (plugin, "gconfaudiosrc", + GST_RANK_NONE, GST_TYPE_GCONF_AUDIO_SRC)) { + return FALSE; + } + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "gconfelements", + "elements wrapping the GStreamer/GConf audio/video output settings", + plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/ext/gconf/gstgconfelements.h b/ext/gconf/gstgconfelements.h new file mode 100644 index 0000000..872b2f2 --- /dev/null +++ b/ext/gconf/gstgconfelements.h @@ -0,0 +1,28 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_GCONF_ELEMENTS_H__ +#define __GST_GCONF_ELEMENTS_H__ + +#include "gstgconf.h" + +GST_DEBUG_CATEGORY_EXTERN (gconf_debug); +#define GST_CAT_DEFAULT gconf_debug + +#endif /* __GST_GCONF_ELEMENTS_H__ */ diff --git a/ext/gconf/gstgconfvideosink.c b/ext/gconf/gstgconfvideosink.c new file mode 100644 index 0000000..10fe90d --- /dev/null +++ b/ext/gconf/gstgconfvideosink.c @@ -0,0 +1,210 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/** + * SECTION:element-gconfvideosink + * + * This element outputs video to the videosink that has been configured in + * GConf by the user. + * + * <refsect2> + * <title>Example launch line</title> + * |[ + * gst-launch filesrc location=foo.ogg ! decodebin ! ffmpegcolorspace ! gconfvideosink + * ]| Play on configured videosink + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <string.h> + +#include "gstgconfelements.h" +#include "gstgconfvideosink.h" + +static void gst_gconf_video_sink_dispose (GObject * object); +static void gst_gconf_video_sink_finalize (GstGConfVideoSink * sink); +static void cb_toggle_element (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data); +static GstStateChangeReturn +gst_gconf_video_sink_change_state (GstElement * element, + GstStateChange transition); + +GST_BOILERPLATE (GstGConfVideoSink, gst_gconf_video_sink, GstSwitchSink, + GST_TYPE_SWITCH_SINK); + +static void +gst_gconf_video_sink_base_init (gpointer klass) +{ + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + gst_element_class_set_details_simple (eklass, "GConf video sink", + "Sink/Video", + "Video sink embedding the GConf-settings for video output", + "GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>"); +} + +static void +gst_gconf_video_sink_class_init (GstGConfVideoSinkClass * klass) +{ + GObjectClass *oklass = G_OBJECT_CLASS (klass); + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + oklass->dispose = gst_gconf_video_sink_dispose; + oklass->finalize = (GObjectFinalizeFunc) gst_gconf_video_sink_finalize; + eklass->change_state = gst_gconf_video_sink_change_state; +} + +/* + * Hack to make negotiation work. + */ + +static void +gst_gconf_video_sink_reset (GstGConfVideoSink * sink) +{ + gst_switch_sink_set_child (GST_SWITCH_SINK (sink), NULL); + + g_free (sink->gconf_str); + sink->gconf_str = NULL; +} + +static void +gst_gconf_video_sink_init (GstGConfVideoSink * sink, + GstGConfVideoSinkClass * g_class) +{ + gst_gconf_video_sink_reset (sink); + + sink->client = gconf_client_get_default (); + gconf_client_add_dir (sink->client, GST_GCONF_DIR, + GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); + sink->notify_id = gconf_client_notify_add (sink->client, + GST_GCONF_DIR "/" GST_GCONF_VIDEOSINK_KEY, + cb_toggle_element, sink, NULL, NULL); +} + +static void +gst_gconf_video_sink_dispose (GObject * object) +{ + GstGConfVideoSink *sink = GST_GCONF_VIDEO_SINK (object); + + if (sink->client) { + if (sink->notify_id != 0) + gconf_client_notify_remove (sink->client, sink->notify_id); + + g_object_unref (G_OBJECT (sink->client)); + sink->client = NULL; + } + + GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); +} + +static void +gst_gconf_video_sink_finalize (GstGConfVideoSink * sink) +{ + g_free (sink->gconf_str); + + GST_CALL_PARENT (G_OBJECT_CLASS, finalize, ((GObject *) (sink))); +} + +static gboolean +do_change_child (GstGConfVideoSink * sink) +{ + gchar *new_gconf_str; + GstElement *new_kid; + + new_gconf_str = gst_gconf_get_string (GST_GCONF_VIDEOSINK_KEY); + + GST_LOG_OBJECT (sink, "old gconf string: %s", GST_STR_NULL (sink->gconf_str)); + GST_LOG_OBJECT (sink, "new gconf string: %s", GST_STR_NULL (new_gconf_str)); + + if (new_gconf_str != NULL && sink->gconf_str != NULL && + (strlen (new_gconf_str) == 0 || + strcmp (sink->gconf_str, new_gconf_str) == 0)) { + g_free (new_gconf_str); + GST_DEBUG_OBJECT (sink, + "GConf key was updated, but it didn't change. Ignoring"); + return TRUE; + } + + GST_DEBUG_OBJECT (sink, "GConf key changed: '%s' to '%s'", + GST_STR_NULL (sink->gconf_str), GST_STR_NULL (new_gconf_str)); + + GST_DEBUG_OBJECT (sink, "Creating new kid"); + if (!(new_kid = gst_gconf_get_default_video_sink ())) { + GST_ELEMENT_ERROR (sink, LIBRARY, SETTINGS, (NULL), + ("Failed to render video sink from GConf")); + return FALSE; + } + + if (!gst_switch_sink_set_child (GST_SWITCH_SINK (sink), new_kid)) { + GST_WARNING_OBJECT (sink, "Failed to update child element"); + goto fail; + } + + g_free (sink->gconf_str); + sink->gconf_str = new_gconf_str; + + GST_DEBUG_OBJECT (sink, "done changing gconf video sink"); + + return TRUE; + +fail: + g_free (new_gconf_str); + return FALSE; +} + +static void +cb_toggle_element (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data) +{ + do_change_child (GST_GCONF_VIDEO_SINK (data)); +} + +static GstStateChangeReturn +gst_gconf_video_sink_change_state (GstElement * element, + GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstGConfVideoSink *sink = GST_GCONF_VIDEO_SINK (element); + + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + if (!do_change_child (sink)) { + gst_gconf_video_sink_reset (sink); + return GST_STATE_CHANGE_FAILURE; + } + break; + default: + break; + } + + ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state, + (element, transition), GST_STATE_CHANGE_SUCCESS); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + gst_gconf_video_sink_reset (sink); + break; + default: + break; + } + + return ret; +} diff --git a/ext/gconf/gstgconfvideosink.h b/ext/gconf/gstgconfvideosink.h new file mode 100644 index 0000000..faaa0a8 --- /dev/null +++ b/ext/gconf/gstgconfvideosink.h @@ -0,0 +1,64 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_GCONF_VIDEO_SINK_H__ +#define __GST_GCONF_VIDEO_SINK_H__ + +#include <gst/gst.h> +#include <gconf/gconf-client.h> + +#include "gstswitchsink.h" + +G_BEGIN_DECLS + +#define GST_TYPE_GCONF_VIDEO_SINK \ + (gst_gconf_video_sink_get_type ()) +#define GST_GCONF_VIDEO_SINK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GCONF_VIDEO_SINK, \ + GstGConfVideoSink)) +#define GST_GCONF_VIDEO_SINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GCONF_VIDEO_SINK, \ + GstGConfVideoSinkClass)) +#define GST_IS_GCONF_VIDEO_SINK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GCONF_VIDEO_SINK)) +#define GST_IS_GCONF_VIDEO_SINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GCONF_VIDEO_SINK)) + +typedef struct _GstGConfVideoSink { + GstSwitchSink parent; + + /* explicit pointers to stuff used */ + GConfClient *client; + + /* gconf notify id */ + guint notify_id; + + /* Current gconf string */ + gchar *gconf_str; +} GstGConfVideoSink; + +typedef struct _GstGConfVideoSinkClass { + GstSwitchSinkClass parent_class; +} GstGConfVideoSinkClass; + +GType gst_gconf_video_sink_get_type (void); + +G_END_DECLS + +#endif /* __GST_GCONF_VIDEO_SINK_H__ */ diff --git a/ext/gconf/gstgconfvideosrc.c b/ext/gconf/gstgconfvideosrc.c new file mode 100644 index 0000000..2d9d5df --- /dev/null +++ b/ext/gconf/gstgconfvideosrc.c @@ -0,0 +1,209 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * (c) 2005 Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/** + * SECTION:element-gconfvideosrc + * @see_also: #GstAlsaSrc, #GstAutoVideoSrc + * + * This element records video from the videosink that has been configured in + * GConf by the user. + * + * <refsect2> + * <title>Example launch line</title> + * |[ + * gst-launch gconfvideosrc ! theoraenc ! oggmux ! filesink location=record.ogg + * ]| Record from configured videoinput + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <string.h> + +#include "gstgconfelements.h" +#include "gstgconfvideosrc.h" + +static void gst_gconf_video_src_dispose (GObject * object); +static void gst_gconf_video_src_finalize (GstGConfVideoSrc * src); +static void cb_toggle_element (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data); +static GstStateChangeReturn +gst_gconf_video_src_change_state (GstElement * element, + GstStateChange transition); + +GST_BOILERPLATE (GstGConfVideoSrc, gst_gconf_video_src, GstSwitchSrc, + GST_TYPE_SWITCH_SRC); + +static void +gst_gconf_video_src_base_init (gpointer klass) +{ + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + gst_element_class_set_details_simple (eklass, "GConf video source", + "Source/Video", + "Video source embedding the GConf-settings for video input", + "GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>"); +} + +static void +gst_gconf_video_src_class_init (GstGConfVideoSrcClass * klass) +{ + GObjectClass *oklass = G_OBJECT_CLASS (klass); + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + + oklass->dispose = gst_gconf_video_src_dispose; + oklass->finalize = (GObjectFinalizeFunc) gst_gconf_video_src_finalize; + eklass->change_state = gst_gconf_video_src_change_state; +} + +/* + * Hack to make negotiation work. + */ + +static gboolean +gst_gconf_video_src_reset (GstGConfVideoSrc * src) +{ + gst_switch_src_set_child (GST_SWITCH_SRC (src), NULL); + + g_free (src->gconf_str); + src->gconf_str = NULL; + + return TRUE; +} + +static void +gst_gconf_video_src_init (GstGConfVideoSrc * src, + GstGConfVideoSrcClass * g_class) +{ + gst_gconf_video_src_reset (src); + + src->client = gconf_client_get_default (); + gconf_client_add_dir (src->client, GST_GCONF_DIR, + GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); + src->notify_id = gconf_client_notify_add (src->client, + GST_GCONF_DIR "/" GST_GCONF_VIDEOSRC_KEY, + cb_toggle_element, src, NULL, NULL); +} + +static void +gst_gconf_video_src_dispose (GObject * object) +{ + GstGConfVideoSrc *src = GST_GCONF_VIDEO_SRC (object); + + if (src->client) { + if (src->notify_id != 0) + gconf_client_notify_remove (src->client, src->notify_id); + + g_object_unref (G_OBJECT (src->client)); + src->client = NULL; + } + + GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); +} + +static void +gst_gconf_video_src_finalize (GstGConfVideoSrc * src) +{ + g_free (src->gconf_str); + + GST_CALL_PARENT (G_OBJECT_CLASS, finalize, ((GObject *) (src))); +} + +static gboolean +do_toggle_element (GstGConfVideoSrc * src) +{ + GstElement *new_kid; + gchar *new_gconf_str; + + new_gconf_str = gst_gconf_get_string (GST_GCONF_VIDEOSRC_KEY); + if (new_gconf_str != NULL && src->gconf_str != NULL && + (strlen (new_gconf_str) == 0 || + strcmp (src->gconf_str, new_gconf_str) == 0)) { + g_free (new_gconf_str); + GST_DEBUG_OBJECT (src, "GConf key was updated, but it didn't change"); + return TRUE; + } + + GST_DEBUG_OBJECT (src, "GConf key changed: '%s' to '%s'", + GST_STR_NULL (src->gconf_str), GST_STR_NULL (new_gconf_str)); + + GST_DEBUG_OBJECT (src, "Creating new kid"); + if (!(new_kid = gst_gconf_get_default_video_src ())) { + GST_ELEMENT_ERROR (src, LIBRARY, SETTINGS, (NULL), + ("Failed to render video src from GConf")); + return FALSE; + } + + if (!gst_switch_src_set_child (GST_SWITCH_SRC (src), new_kid)) { + GST_WARNING_OBJECT (src, "Failed to update child element"); + goto fail; + } + + g_free (src->gconf_str); + src->gconf_str = new_gconf_str; + + GST_DEBUG_OBJECT (src, "done changing gconf video src"); + + return TRUE; +fail: + g_free (new_gconf_str); + return FALSE; +} + +static void +cb_toggle_element (GConfClient * client, + guint connection_id, GConfEntry * entry, gpointer data) +{ + do_toggle_element (GST_GCONF_VIDEO_SRC (data)); +} + +static GstStateChangeReturn +gst_gconf_video_src_change_state (GstElement * element, + GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstGConfVideoSrc *src = GST_GCONF_VIDEO_SRC (element); + + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + if (!do_toggle_element (src)) { + gst_gconf_video_src_reset (src); + return GST_STATE_CHANGE_FAILURE; + } + break; + default: + break; + } + + ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state, + (element, transition), GST_STATE_CHANGE_SUCCESS); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + if (!gst_gconf_video_src_reset (src)) + ret = GST_STATE_CHANGE_FAILURE; + break; + default: + break; + } + + return ret; +} diff --git a/ext/gconf/gstgconfvideosrc.h b/ext/gconf/gstgconfvideosrc.h new file mode 100644 index 0000000..5c8300d --- /dev/null +++ b/ext/gconf/gstgconfvideosrc.h @@ -0,0 +1,58 @@ +/* GStreamer + * (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * (c) 2005 Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_GCONF_VIDEO_SRC_H__ +#define __GST_GCONF_VIDEO_SRC_H__ + +#include <gst/gst.h> +#include <gconf/gconf-client.h> + +#include "gstswitchsrc.h" + +G_BEGIN_DECLS + +#define GST_TYPE_GCONF_VIDEO_SRC (gst_gconf_video_src_get_type ()) +#define GST_GCONF_VIDEO_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GCONF_VIDEO_SRC, GstGConfVideoSrc)) +#define GST_GCONF_VIDEO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GCONF_VIDEO_SRC, GstGConfVideoSrcClass)) +#define GST_IS_GCONF_VIDEO_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GCONF_VIDEO_SRC)) +#define GST_IS_GCONF_VIDEO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GCONF_VIDEO_SRC)) + +typedef struct _GstGConfVideoSrc { + GstSwitchSrc parent; + + /* explicit pointers to stuff used */ + GConfClient *client; + + /* gconf key notification id */ + guint notify_id; + + /* Current gconf string */ + gchar *gconf_str; +} GstGConfVideoSrc; + +typedef struct _GstGConfVideoSrcClass { + GstSwitchSrcClass parent_class; +} GstGConfVideoSrcClass; + +GType gst_gconf_video_src_get_type (void); + +G_END_DECLS + +#endif /* __GST_GCONF_VIDEO_SRC_H__ */ diff --git a/ext/gconf/gstswitchsink.c b/ext/gconf/gstswitchsink.c new file mode 100644 index 0000000..da31df2 --- /dev/null +++ b/ext/gconf/gstswitchsink.c @@ -0,0 +1,269 @@ +/* GStreamer + * Copyright (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * Copyright (c) 2006 Jürg Billeter <j@bitron.ch> + * Copyright (c) 2007 Jan Schmidt <thaytan@noraisin.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <string.h> + +#include "gstswitchsink.h" + +GST_DEBUG_CATEGORY_STATIC (switch_debug); +#define GST_CAT_DEFAULT switch_debug + +static void gst_switch_sink_dispose (GObject * object); +static GstStateChangeReturn +gst_switch_sink_change_state (GstElement * element, GstStateChange transition); + +enum +{ + PROP_0 +}; + +GST_BOILERPLATE (GstSwitchSink, gst_switch_sink, GstBin, GST_TYPE_BIN); + +static void +gst_switch_sink_base_init (gpointer klass) +{ + GST_DEBUG_CATEGORY_INIT (switch_debug, "switchsink", 0, "switchsink element"); +} + +static void +gst_switch_sink_class_init (GstSwitchSinkClass * klass) +{ + GObjectClass *oklass = G_OBJECT_CLASS (klass); + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + GstPadTemplate *child_pad_templ; + + oklass->dispose = gst_switch_sink_dispose; + eklass->change_state = gst_switch_sink_change_state; + + /* Provide a default pad template if the child didn't */ + child_pad_templ = gst_element_class_get_pad_template (eklass, "sink"); + if (child_pad_templ == NULL) { + gst_element_class_add_static_pad_template (eklass, &sink_template); + } +} + +static gboolean +gst_switch_sink_reset (GstSwitchSink * sink) +{ + /* this will install fakesink if no other child has been set, + * otherwise we rely on the subclass to know when to unset its + * custom kid */ + if (sink->kid == NULL) { + return gst_switch_sink_set_child (sink, NULL); + } + + return TRUE; +} + +static void +gst_switch_sink_init (GstSwitchSink * sink, GstSwitchSinkClass * g_class) +{ + GstElementClass *eklass = GST_ELEMENT_GET_CLASS (sink); + GstPadTemplate *templ; + + templ = gst_element_class_get_pad_template (eklass, "sink"); + sink->pad = gst_ghost_pad_new_no_target_from_template ("sink", templ); + gst_element_add_pad (GST_ELEMENT (sink), sink->pad); + + gst_switch_sink_reset (sink); + + GST_OBJECT_FLAG_SET (sink, GST_ELEMENT_IS_SINK); +} + +static void +gst_switch_sink_dispose (GObject * object) +{ + GstSwitchSink *sink = GST_SWITCH_SINK (object); + GstObject *new_kid, *kid; + + GST_OBJECT_LOCK (sink); + new_kid = GST_OBJECT_CAST (sink->new_kid); + sink->new_kid = NULL; + + kid = GST_OBJECT_CAST (sink->kid); + sink->kid = NULL; + GST_OBJECT_UNLOCK (sink); + + gst_object_replace (&new_kid, NULL); + gst_object_replace (&kid, NULL); + + GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); +} + +static gboolean +gst_switch_sink_commit_new_kid (GstSwitchSink * sink) +{ + GstPad *targetpad; + GstState kid_state; + GstElement *new_kid, *old_kid; + gboolean is_fakesink = FALSE; + GstBus *bus; + + /* need locking around member accesses */ + GST_OBJECT_LOCK (sink); + /* If we're currently changing state, set the child to the next state + * we're transitioning too, rather than our current state which is + * about to change */ + if (GST_STATE_NEXT (sink) != GST_STATE_VOID_PENDING) + kid_state = GST_STATE_NEXT (sink); + else + kid_state = GST_STATE (sink); + + new_kid = sink->new_kid ? gst_object_ref (sink->new_kid) : NULL; + sink->new_kid = NULL; + GST_OBJECT_UNLOCK (sink); + + /* Fakesink by default if NULL is passed as the new child */ + if (new_kid == NULL) { + GST_DEBUG_OBJECT (sink, "Replacing kid with fakesink"); + new_kid = gst_element_factory_make ("fakesink", "testsink"); + if (new_kid == NULL) { + GST_ERROR_OBJECT (sink, "Failed to create fakesink"); + return FALSE; + } + /* Add a reference, as it would if the element came from sink->new_kid */ + gst_object_ref (new_kid); + g_object_set (new_kid, "sync", TRUE, NULL); + is_fakesink = TRUE; + } else { + GST_DEBUG_OBJECT (sink, "Setting new kid"); + } + + /* set temporary bus of our own to catch error messages from the child + * (could we just set our own bus on it, or would the state change messages + * from the not-yet-added element confuse the state change algorithm? Let's + * play it safe for now) */ + bus = gst_bus_new (); + gst_element_set_bus (new_kid, bus); + gst_object_unref (bus); + + if (gst_element_set_state (new_kid, kid_state) == GST_STATE_CHANGE_FAILURE) { + GstMessage *msg; + + /* check if child posted an error message and if so re-post it on our bus + * so that the application gets to see a decent error and not our generic + * fallback error message which is completely indecipherable to the user */ + msg = gst_bus_pop_filtered (GST_ELEMENT_BUS (new_kid), GST_MESSAGE_ERROR); + if (msg) { + GST_INFO_OBJECT (sink, "Forwarding kid error: %" GST_PTR_FORMAT, msg); + gst_element_post_message (GST_ELEMENT (sink), msg); + } + GST_ELEMENT_ERROR (sink, CORE, STATE_CHANGE, (NULL), + ("Failed to set state on new child.")); + gst_element_set_bus (new_kid, NULL); + gst_object_unref (new_kid); + return FALSE; + } + gst_element_set_bus (new_kid, NULL); + gst_bin_add (GST_BIN (sink), new_kid); + + /* Now, replace the existing child */ + GST_OBJECT_LOCK (sink); + old_kid = sink->kid; + sink->kid = new_kid; + /* Mark whether a custom kid or fakesink has been installed */ + sink->have_kid = !is_fakesink; + GST_OBJECT_UNLOCK (sink); + + /* kill old element */ + if (old_kid) { + GST_DEBUG_OBJECT (sink, "Removing old kid %" GST_PTR_FORMAT, old_kid); + gst_element_set_state (old_kid, GST_STATE_NULL); + gst_bin_remove (GST_BIN (sink), old_kid); + gst_object_unref (old_kid); + /* Don't lose the SINK flag */ + GST_OBJECT_FLAG_SET (sink, GST_ELEMENT_IS_SINK); + } + + /* re-attach ghostpad */ + GST_DEBUG_OBJECT (sink, "Creating new ghostpad"); + targetpad = gst_element_get_static_pad (sink->kid, "sink"); + gst_ghost_pad_set_target (GST_GHOST_PAD (sink->pad), targetpad); + gst_object_unref (targetpad); + GST_DEBUG_OBJECT (sink, "done changing child of switchsink"); + + /* FIXME: Push new-segment info and pre-roll buffer(s) into the kid */ + + return TRUE; +} + +gboolean +gst_switch_sink_set_child (GstSwitchSink * sink, GstElement * new_kid) +{ + GstState cur, next; + GstElement **p_kid; + + /* Nothing to do if clearing the child and we've already installed fakesink */ + if (new_kid == NULL && sink->kid != NULL && sink->have_kid == FALSE) + return TRUE; + + /* Store the new kid to be committed later */ + GST_OBJECT_LOCK (sink); + cur = GST_STATE (sink); + next = GST_STATE_NEXT (sink); + p_kid = &sink->new_kid; + gst_object_replace ((GstObject **) p_kid, (GstObject *) new_kid); + GST_OBJECT_UNLOCK (sink); + if (new_kid) + gst_object_unref (new_kid); + + /* Sometime, it would be lovely to allow sink changes even when + * already running, but this involves sending an appropriate new-segment + * and possibly prerolling etc */ + /* FIXME: Block the pad and replace the kid when it completes */ + if (cur > GST_STATE_READY || next == GST_STATE_PAUSED) { + GST_DEBUG_OBJECT (sink, + "Switch-sink is already running. Ignoring change of child."); + gst_object_unref (new_kid); + return TRUE; + } + + return gst_switch_sink_commit_new_kid (sink); +} + +static GstStateChangeReturn +gst_switch_sink_change_state (GstElement * element, GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstSwitchSink *sink = GST_SWITCH_SINK (element); + + ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state, + (element, transition), GST_STATE_CHANGE_SUCCESS); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + if (!gst_switch_sink_reset (sink)) + ret = GST_STATE_CHANGE_FAILURE; + break; + default: + break; + } + + return ret; +} diff --git a/ext/gconf/gstswitchsink.h b/ext/gconf/gstswitchsink.h new file mode 100644 index 0000000..556e755 --- /dev/null +++ b/ext/gconf/gstswitchsink.h @@ -0,0 +1,62 @@ +/* GStreamer + * Copyright (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * Copyright (c) 2007 Jan Schmidt <thaytan@mad.scientist.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_SWITCH_SINK_H__ +#define __GST_SWITCH_SINK_H__ + +#include <gst/gst.h> + +G_BEGIN_DECLS + +#define GST_TYPE_SWITCH_SINK \ + (gst_switch_sink_get_type ()) +#define GST_SWITCH_SINK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SWITCH_SINK, \ + GstSwitchSink)) +#define GST_SWITCH_SINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SWITCH_SINK, \ + GstSwitchSinkClass)) +#define GST_IS_SWITCH_SINK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SWITCH_SINK)) +#define GST_IS_SWITCH_SINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SWITCH_SINK)) + +typedef struct _GstSwitchSink { + GstBin parent; + + GstElement *kid; + GstElement *new_kid; + GstPad *pad; + + /* If a custom child has been set... */ + gboolean have_kid; +} GstSwitchSink; + +typedef struct _GstSwitchSinkClass { + GstBinClass parent_class; +} GstSwitchSinkClass; + +GType gst_switch_sink_get_type (void); + +gboolean gst_switch_sink_set_child (GstSwitchSink *ssink, GstElement *new_kid); + +G_END_DECLS + +#endif /* __GST_SWITCH_SINK_H__ */ diff --git a/ext/gconf/gstswitchsrc.c b/ext/gconf/gstswitchsrc.c new file mode 100644 index 0000000..664e0bd --- /dev/null +++ b/ext/gconf/gstswitchsrc.c @@ -0,0 +1,261 @@ +/* GStreamer + * Copyright (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * Copyright (c) 2006 Jürg Billeter <j@bitron.ch> + * Copyright (c) 2007 Jan Schmidt <thaytan@noraisin.net> + * Copyright (c) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <string.h> + +#include "gstswitchsrc.h" + +GST_DEBUG_CATEGORY_STATIC (switch_debug); +#define GST_CAT_DEFAULT switch_debug + +static void gst_switch_src_dispose (GObject * object); +static GstStateChangeReturn +gst_switch_src_change_state (GstElement * element, GstStateChange transition); + +GST_BOILERPLATE (GstSwitchSrc, gst_switch_src, GstBin, GST_TYPE_BIN); + +static void +gst_switch_src_base_init (gpointer klass) +{ + GST_DEBUG_CATEGORY_INIT (switch_debug, "switchsrc", 0, "switchsrc element"); +} + +static void +gst_switch_src_class_init (GstSwitchSrcClass * klass) +{ + GObjectClass *oklass = G_OBJECT_CLASS (klass); + GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + GstPadTemplate *child_pad_templ; + + oklass->dispose = gst_switch_src_dispose; + eklass->change_state = gst_switch_src_change_state; + + /* Provide a default pad template if the child didn't */ + child_pad_templ = gst_element_class_get_pad_template (eklass, "src"); + if (child_pad_templ == NULL) { + gst_element_class_add_static_pad_template (eklass, &src_template); + } +} + +static gboolean +gst_switch_src_reset (GstSwitchSrc * src) +{ + /* this will install fakesrc if no other child has been set, + * otherwise we rely on the subclass to know when to unset its + * custom kid */ + if (src->kid == NULL) { + return gst_switch_src_set_child (src, NULL); + } + + return TRUE; +} + +static void +gst_switch_src_init (GstSwitchSrc * src, GstSwitchSrcClass * g_class) +{ + GstElementClass *eklass = GST_ELEMENT_GET_CLASS (src); + GstPadTemplate *templ; + + templ = gst_element_class_get_pad_template (eklass, "src"); + src->pad = gst_ghost_pad_new_no_target_from_template ("src", templ); + gst_element_add_pad (GST_ELEMENT (src), src->pad); + + gst_switch_src_reset (src); + + GST_OBJECT_FLAG_SET (src, GST_ELEMENT_IS_SOURCE); +} + +static void +gst_switch_src_dispose (GObject * object) +{ + GstSwitchSrc *src = GST_SWITCH_SRC (object); + GstObject *new_kid, *kid; + + GST_OBJECT_LOCK (src); + new_kid = GST_OBJECT_CAST (src->new_kid); + src->new_kid = NULL; + + kid = GST_OBJECT_CAST (src->kid); + src->kid = NULL; + GST_OBJECT_UNLOCK (src); + + gst_object_replace (&new_kid, NULL); + gst_object_replace (&kid, NULL); + + GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); +} + +static gboolean +gst_switch_src_commit_new_kid (GstSwitchSrc * src) +{ + GstPad *targetpad; + GstState kid_state; + GstElement *new_kid, *old_kid; + gboolean is_fakesrc = FALSE; + GstBus *bus; + + /* need locking around member accesses */ + GST_OBJECT_LOCK (src); + /* If we're currently changing state, set the child to the next state + * we're transitioning too, rather than our current state which is + * about to change */ + if (GST_STATE_NEXT (src) != GST_STATE_VOID_PENDING) + kid_state = GST_STATE_NEXT (src); + else + kid_state = GST_STATE (src); + + new_kid = src->new_kid ? gst_object_ref (src->new_kid) : NULL; + src->new_kid = NULL; + GST_OBJECT_UNLOCK (src); + + /* Fakesrc by default if NULL is passed as the new child */ + if (new_kid == NULL) { + GST_DEBUG_OBJECT (src, "Replacing kid with fakesrc"); + new_kid = gst_element_factory_make ("fakesrc", "testsrc"); + if (new_kid == NULL) { + GST_ERROR_OBJECT (src, "Failed to create fakesrc"); + return FALSE; + } + /* Add a reference, as it would if the element came from src->new_kid */ + gst_object_ref (new_kid); + is_fakesrc = TRUE; + } else { + GST_DEBUG_OBJECT (src, "Setting new kid"); + } + + /* set temporary bus of our own to catch error messages from the child + * (could we just set our own bus on it, or would the state change messages + * from the not-yet-added element confuse the state change algorithm? Let's + * play it safe for now) */ + bus = gst_bus_new (); + gst_element_set_bus (new_kid, bus); + gst_object_unref (bus); + + if (gst_element_set_state (new_kid, kid_state) == GST_STATE_CHANGE_FAILURE) { + GstMessage *msg; + + /* check if child posted an error message and if so re-post it on our bus + * so that the application gets to see a decent error and not our generic + * fallback error message which is completely indecipherable to the user */ + msg = gst_bus_pop_filtered (GST_ELEMENT_BUS (new_kid), GST_MESSAGE_ERROR); + if (msg) { + GST_INFO_OBJECT (src, "Forwarding kid error: %" GST_PTR_FORMAT, msg); + gst_element_post_message (GST_ELEMENT (src), msg); + } + GST_ELEMENT_ERROR (src, CORE, STATE_CHANGE, (NULL), + ("Failed to set state on new child.")); + gst_element_set_bus (new_kid, NULL); + gst_object_unref (new_kid); + return FALSE; + } + gst_element_set_bus (new_kid, NULL); + gst_bin_add (GST_BIN (src), new_kid); + + /* Now, replace the existing child */ + GST_OBJECT_LOCK (src); + old_kid = src->kid; + src->kid = new_kid; + /* Mark whether a custom kid or fakesrc has been installed */ + src->have_kid = !is_fakesrc; + GST_OBJECT_UNLOCK (src); + + /* kill old element */ + if (old_kid) { + GST_DEBUG_OBJECT (src, "Removing old kid %" GST_PTR_FORMAT, old_kid); + gst_element_set_state (old_kid, GST_STATE_NULL); + gst_bin_remove (GST_BIN (src), old_kid); + gst_object_unref (old_kid); + /* Don't lose the SOURCE flag */ + GST_OBJECT_FLAG_SET (src, GST_ELEMENT_IS_SOURCE); + } + + /* re-attach ghostpad */ + GST_DEBUG_OBJECT (src, "Creating new ghostpad"); + targetpad = gst_element_get_static_pad (src->kid, "src"); + gst_ghost_pad_set_target (GST_GHOST_PAD (src->pad), targetpad); + gst_object_unref (targetpad); + GST_DEBUG_OBJECT (src, "done changing child of switchsrc"); + + return TRUE; +} + +gboolean +gst_switch_src_set_child (GstSwitchSrc * src, GstElement * new_kid) +{ + GstState cur, next; + GstElement **p_kid; + + /* Nothing to do if clearing the child and we've already installed fakesrc */ + if (new_kid == NULL && src->kid != NULL && src->have_kid == FALSE) + return TRUE; + + /* Store the new kid to be committed later */ + GST_OBJECT_LOCK (src); + cur = GST_STATE (src); + next = GST_STATE_NEXT (src); + p_kid = &src->new_kid; + gst_object_replace ((GstObject **) p_kid, (GstObject *) new_kid); + GST_OBJECT_UNLOCK (src); + if (new_kid) + gst_object_unref (new_kid); + + /* Sometime, it would be lovely to allow src changes even when + * already running */ + /* FIXME: Block the pad and replace the kid when it completes */ + if (cur > GST_STATE_READY || next == GST_STATE_PAUSED) { + GST_DEBUG_OBJECT (src, + "Switch-src is already running. Ignoring change of child."); + gst_object_unref (new_kid); + return TRUE; + } + + return gst_switch_src_commit_new_kid (src); +} + +static GstStateChangeReturn +gst_switch_src_change_state (GstElement * element, GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstSwitchSrc *src = GST_SWITCH_SRC (element); + + ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state, + (element, transition), GST_STATE_CHANGE_SUCCESS); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + if (!gst_switch_src_reset (src)) + ret = GST_STATE_CHANGE_FAILURE; + break; + default: + break; + } + + return ret; +} diff --git a/ext/gconf/gstswitchsrc.h b/ext/gconf/gstswitchsrc.h new file mode 100644 index 0000000..6c550ad --- /dev/null +++ b/ext/gconf/gstswitchsrc.h @@ -0,0 +1,57 @@ +/* GStreamer + * + * Copyright (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + * Copyright (c) 2005 Tim-Philipp Müller <tim centricular net> + * Copyright (c) 2007 Jan Schmidt <thaytan@mad.scientist.com> + * Copyright (c) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_SWITCH_SRC_H__ +#define __GST_SWITCH_SRC_H__ + +#include <gst/gst.h> + +G_BEGIN_DECLS + +#define GST_TYPE_SWITCH_SRC (gst_switch_src_get_type ()) +#define GST_SWITCH_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SWITCH_SRC, GstSwitchSrc)) +#define GST_SWITCH_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SWITCH_SRC, GstSwitchSrcClass)) +#define GST_IS_SWITCH_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SWITCH_SRC)) +#define GST_IS_SWITCH_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SWITCH_SRC)) + +typedef struct _GstSwitchSrc { + GstBin parent; + + GstElement *kid; + GstElement *new_kid; + GstPad *pad; + + /* If a custom child has been set... */ + gboolean have_kid; +} GstSwitchSrc; + +typedef struct _GstSwitchSrcClass { + GstBinClass parent_class; +} GstSwitchSrcClass; + +GType gst_switch_src_get_type (void); +gboolean gst_switch_src_set_child (GstSwitchSrc *ssrc, GstElement *new_kid); + +G_END_DECLS + +#endif /* __GST_SWITCH_SRC_H__ */ |