mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
Remove gconf elements and plugin
GConf was deprecated in favour of GSettings etc.
This commit is contained in:
parent
83678af5e0
commit
728732438b
33 changed files with 3 additions and 2760 deletions
15
Makefile.am
15
Makefile.am
|
@ -1,11 +1,5 @@
|
|||
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
|
||||
|
||||
if USE_GCONFTOOL
|
||||
GCONF_DIR = gconf
|
||||
else
|
||||
GCONF_DIR =
|
||||
endif
|
||||
|
||||
ALWAYS_SUBDIRS = \
|
||||
gst sys ext \
|
||||
tests \
|
||||
|
@ -15,14 +9,9 @@ ALWAYS_SUBDIRS = \
|
|||
m4 \
|
||||
pkgconfig
|
||||
|
||||
SUBDIRS = \
|
||||
$(ALWAYS_SUBDIRS) \
|
||||
$(GCONF_DIR)
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
$(ALWAYS_SUBDIRS) \
|
||||
gconf
|
||||
SUBDIRS = $(ALWAYS_SUBDIRS)
|
||||
|
||||
DIST_SUBDIRS = $(ALWAYS_SUBDIRS)
|
||||
|
||||
# include before EXTRA_DIST for win32 assignment
|
||||
include $(top_srcdir)/common/win32.mak
|
||||
|
|
|
@ -99,12 +99,6 @@ Version: == 1.1.2
|
|||
Plugins: flac (flacenc, flacdec)
|
||||
URL: http://flac.sourceforge.net/
|
||||
|
||||
Package: GConf
|
||||
Version: >= 2.0
|
||||
Plugins: gconfelements (gconfvideosink, gconfvideosrc, gconfaudiosink,
|
||||
gconfaudiosrc)
|
||||
URL: http://www.gnome.org/
|
||||
|
||||
Package: HAL
|
||||
Version: >= 0.5.6
|
||||
Plugins: halelements (halaudiosink, halaudiosrc)
|
||||
|
|
28
configure.ac
28
configure.ac
|
@ -130,10 +130,6 @@ AG_GST_CHECK_DOWHILE_MACROS
|
|||
AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
|
||||
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
|
||||
|
||||
dnl check for gconftool-2
|
||||
dnl this macro defines an am conditional, so it needs to be run always
|
||||
AM_GCONF_SOURCE_2
|
||||
|
||||
dnl check for documentation tools
|
||||
GTK_DOC_CHECK([1.3])
|
||||
AS_PATH_PYTHON([2.1])
|
||||
|
@ -266,19 +262,6 @@ fi
|
|||
AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_GTK_X11, test "x$HAVE_GTK_X11" = "xyes")
|
||||
|
||||
dnl should we install schemas ?
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true)
|
||||
AG_GST_CHECK_FEATURE(GCONFTOOL, [GConf schemas], , [
|
||||
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
|
||||
if test x$GCONFTOOL = xno; then
|
||||
AC_MSG_WARN(Not installing GConf schemas)
|
||||
HAVE_GCONFTOOL="no"
|
||||
else
|
||||
HAVE_GCONFTOOL="yes"
|
||||
fi
|
||||
AC_SUBST(HAVE_GCONFTOOL)
|
||||
])
|
||||
|
||||
dnl *** set variables based on configure arguments ***
|
||||
|
||||
dnl set license and copyright notice
|
||||
|
@ -753,12 +736,6 @@ AG_GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flac, [
|
|||
AG_GST_PKG_CHECK_MODULES(FLAC, flac >= 1.1.4)
|
||||
])
|
||||
|
||||
dnl *** GConf ***
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
|
||||
AG_GST_CHECK_FEATURE(GCONF, [GConf libraries], gconfelements, [
|
||||
AG_GST_PKG_CHECK_MODULES(GCONF, gconf-2.0)
|
||||
])
|
||||
|
||||
dnl *** GDK pixbuf ***
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_GDK_PIXBUF, true)
|
||||
AG_GST_CHECK_FEATURE(GDK_PIXBUF, [GDK pixbuf], gdkpixbuf, [
|
||||
|
@ -1046,8 +1023,6 @@ AM_CONDITIONAL(USE_DIRECTSOUND, false)
|
|||
AM_CONDITIONAL(USE_DV1394, false)
|
||||
AM_CONDITIONAL(USE_ESD, false)
|
||||
AM_CONDITIONAL(USE_FLAC, false)
|
||||
AM_CONDITIONAL(USE_GCONF, false)
|
||||
AM_CONDITIONAL(USE_GCONFTOOL, false)
|
||||
AM_CONDITIONAL(USE_GDK_PIXBUF, false)
|
||||
AM_CONDITIONAL(USE_GST_V4L2, false)
|
||||
AM_CONDITIONAL(USE_HAL, false)
|
||||
|
@ -1184,7 +1159,6 @@ ext/cairo/Makefile
|
|||
ext/dv/Makefile
|
||||
ext/esd/Makefile
|
||||
ext/flac/Makefile
|
||||
ext/gconf/Makefile
|
||||
ext/gdk_pixbuf/Makefile
|
||||
ext/hal/Makefile
|
||||
ext/jack/Makefile
|
||||
|
@ -1224,8 +1198,6 @@ tests/examples/spectrum/Makefile
|
|||
tests/examples/v4l2/Makefile
|
||||
tests/files/Makefile
|
||||
tests/icles/Makefile
|
||||
gconf/Makefile
|
||||
gconf/gstreamer.schemas
|
||||
common/Makefile
|
||||
common/m4/Makefile
|
||||
m4/Makefile
|
||||
|
|
|
@ -88,10 +88,6 @@ EXTRA_HFILES = \
|
|||
$(top_srcdir)/ext/flac/gstflacdec.h \
|
||||
$(top_srcdir)/ext/flac/gstflacenc.h \
|
||||
$(top_srcdir)/ext/flac/gstflactag.h \
|
||||
$(top_srcdir)/ext/gconf/gstgconfaudiosrc.h \
|
||||
$(top_srcdir)/ext/gconf/gstgconfaudiosink.h \
|
||||
$(top_srcdir)/ext/gconf/gstgconfvideosrc.h \
|
||||
$(top_srcdir)/ext/gconf/gstgconfvideosink.h \
|
||||
$(top_srcdir)/ext/gdk_pixbuf/gstgdkpixbufsink.h \
|
||||
$(top_srcdir)/ext/hal/gsthalaudiosink.h \
|
||||
$(top_srcdir)/ext/hal/gsthalaudiosrc.h \
|
||||
|
|
|
@ -81,10 +81,6 @@
|
|||
<xi:include href="xml/element-flvmux.xml" />
|
||||
<xi:include href="xml/element-flxdec.xml" />
|
||||
<xi:include href="xml/element-gamma.xml" />
|
||||
<xi:include href="xml/element-gconfaudiosrc.xml" />
|
||||
<xi:include href="xml/element-gconfaudiosink.xml" />
|
||||
<xi:include href="xml/element-gconfvideosrc.xml" />
|
||||
<xi:include href="xml/element-gconfvideosink.xml" />
|
||||
<xi:include href="xml/element-gdkpixbufsink.xml" />
|
||||
<xi:include href="xml/element-goom.xml" />
|
||||
<xi:include href="xml/element-goom2k1.xml" />
|
||||
|
@ -213,7 +209,6 @@
|
|||
<xi:include href="xml/plugin-flac.xml" />
|
||||
<xi:include href="xml/plugin-flv.xml" />
|
||||
<xi:include href="xml/plugin-flxdec.xml" />
|
||||
<xi:include href="xml/plugin-gconfelements.xml" />
|
||||
<xi:include href="xml/plugin-gdkpixbuf.xml" />
|
||||
<xi:include href="xml/plugin-goom.xml" />
|
||||
<xi:include href="xml/plugin-goom2k1.xml" />
|
||||
|
|
|
@ -927,62 +927,6 @@ GST_IS_GAMMA_CLASS
|
|||
gst_gamma_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-gconfaudiosrc</FILE>
|
||||
<TITLE>gconfaudiosrc</TITLE>
|
||||
GstGConfAudioSrc
|
||||
<SUBSECTION Standard>
|
||||
GstGConfAudioSrcClass
|
||||
GST_GCONF_AUDIO_SRC
|
||||
GST_IS_GCONF_AUDIO_SRC
|
||||
GST_TYPE_GCONF_AUDIO_SRC
|
||||
GST_GCONF_AUDIO_SRC_CLASS
|
||||
GST_IS_GCONF_AUDIO_SRC_CLASS
|
||||
gst_gconf_audio_src_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-gconfaudiosink</FILE>
|
||||
<TITLE>gconfaudiosink</TITLE>
|
||||
GstGConfAudioSink
|
||||
<SUBSECTION Standard>
|
||||
GstGConfAudioSinkClass
|
||||
GST_GCONF_AUDIO_SINK
|
||||
GST_IS_GCONF_AUDIO_SINK
|
||||
GST_TYPE_GCONF_AUDIO_SINK
|
||||
GST_GCONF_AUDIO_SINK_CLASS
|
||||
GST_IS_GCONF_AUDIO_SINK_CLASS
|
||||
gst_gconf_audio_sink_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-gconfvideosrc</FILE>
|
||||
<TITLE>gconfvideosrc</TITLE>
|
||||
GstGConfVideoSrc
|
||||
<SUBSECTION Standard>
|
||||
GstGConfVideoSrcClass
|
||||
GST_GCONF_VIDEO_SRC
|
||||
GST_IS_GCONF_VIDEO_SRC
|
||||
GST_TYPE_GCONF_VIDEO_SRC
|
||||
GST_GCONF_VIDEO_SRC_CLASS
|
||||
GST_IS_GCONF_VIDEO_SRC_CLASS
|
||||
gst_gconf_video_src_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-gconfvideosink</FILE>
|
||||
<TITLE>gconfvideosink</TITLE>
|
||||
GstGConfVideoSink
|
||||
<SUBSECTION Standard>
|
||||
GstGConfVideoSinkClass
|
||||
GST_GCONF_VIDEO_SINK
|
||||
GST_IS_GCONF_VIDEO_SINK
|
||||
GST_TYPE_GCONF_VIDEO_SINK
|
||||
GST_GCONF_VIDEO_SINK_CLASS
|
||||
GST_IS_GCONF_VIDEO_SINK_CLASS
|
||||
gst_gconf_video_sink_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-gdkpixbufsink</FILE>
|
||||
<TITLE>gdkpixbufsink</TITLE>
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<plugin>
|
||||
<name>gconfelements</name>
|
||||
<description>elements wrapping the GStreamer/GConf audio/video output settings</description>
|
||||
<filename>../../ext/gconf/.libs/libgstgconfelements.so</filename>
|
||||
<basename>libgstgconfelements.so</basename>
|
||||
<version>0.10.29.1</version>
|
||||
<license>LGPL</license>
|
||||
<source>gst-plugins-good</source>
|
||||
<package>GStreamer Good Plug-ins git</package>
|
||||
<origin>Unknown package origin</origin>
|
||||
<elements>
|
||||
<element>
|
||||
<name>gconfaudiosink</name>
|
||||
<longname>GConf audio sink</longname>
|
||||
<class>Sink/Audio</class>
|
||||
<description>Audio sink embedding the GConf-settings for audio output</description>
|
||||
<author>Jan Schmidt <thaytan@mad.scientist.com></author>
|
||||
<pads>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>gconfaudiosrc</name>
|
||||
<longname>GConf audio source</longname>
|
||||
<class>Source/Audio</class>
|
||||
<description>Audio source embedding the GConf-settings for audio input</description>
|
||||
<author>GStreamer maintainers <gstreamer-devel@lists.sourceforge.net></author>
|
||||
<pads>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>gconfvideosink</name>
|
||||
<longname>GConf video sink</longname>
|
||||
<class>Sink/Video</class>
|
||||
<description>Video sink embedding the GConf-settings for video output</description>
|
||||
<author>GStreamer maintainers <gstreamer-devel@lists.sourceforge.net></author>
|
||||
<pads>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>gconfvideosrc</name>
|
||||
<longname>GConf video source</longname>
|
||||
<class>Source/Video</class>
|
||||
<description>Video source embedding the GConf-settings for video input</description>
|
||||
<author>GStreamer maintainers <gstreamer-devel@lists.sourceforge.net></author>
|
||||
<pads>
|
||||
</pads>
|
||||
</element>
|
||||
</elements>
|
||||
</plugin>
|
|
@ -28,12 +28,6 @@ else
|
|||
FLAC_DIR =
|
||||
endif
|
||||
|
||||
if USE_GCONF
|
||||
GCONF_DIR = gconf
|
||||
else
|
||||
GCONF_DIR =
|
||||
endif
|
||||
|
||||
if USE_GDK_PIXBUF
|
||||
GDK_PIXBUF_DIR = gdk_pixbuf
|
||||
else
|
||||
|
@ -138,7 +132,6 @@ SUBDIRS = \
|
|||
$(DV1394_DIR) \
|
||||
$(ESD_DIR) \
|
||||
$(FLAC_DIR) \
|
||||
$(GCONF_DIR) \
|
||||
$(GDK_PIXBUF_DIR) \
|
||||
$(HAL_DIR) \
|
||||
$(JACK_DIR) \
|
||||
|
@ -162,7 +155,6 @@ DIST_SUBDIRS = \
|
|||
dv \
|
||||
esd \
|
||||
flac \
|
||||
gconf \
|
||||
gdk_pixbuf \
|
||||
hal \
|
||||
jack \
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
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
|
|
@ -1,304 +0,0 @@
|
|||
/* 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;
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/* 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 */
|
|
@ -1,310 +0,0 @@
|
|||
/* 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;
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/* 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__ */
|
|
@ -1,210 +0,0 @@
|
|||
/* 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;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/* 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__ */
|
|
@ -1,59 +0,0 @@
|
|||
/* 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)
|
|
@ -1,28 +0,0 @@
|
|||
/* 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__ */
|
|
@ -1,210 +0,0 @@
|
|||
/* 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;
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/* 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__ */
|
|
@ -1,209 +0,0 @@
|
|||
/* 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;
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/* 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__ */
|
|
@ -1,270 +0,0 @@
|
|||
/* 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_pad_template (eklass,
|
||||
gst_static_pad_template_get (&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;
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/* 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__ */
|
|
@ -1,262 +0,0 @@
|
|||
/* 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_pad_template (eklass,
|
||||
gst_static_pad_template_get (&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;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/* 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__ */
|
2
gconf/.gitignore
vendored
2
gconf/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
gstreamer-*.schemas
|
||||
gstreamer.schemas
|
|
@ -1,31 +0,0 @@
|
|||
GST_SCHEMA_FILES = gstreamer-@GST_MAJORMINOR@.schemas
|
||||
|
||||
if USE_GCONF
|
||||
schemadir = @GCONF_SCHEMA_FILE_DIR@
|
||||
schema_DATA = $(GST_SCHEMA_FILES)
|
||||
endif
|
||||
|
||||
gstreamer-@GST_MAJORMINOR@.schemas: gstreamer.schemas
|
||||
cp gstreamer.schemas gstreamer-@GST_MAJORMINOR@.schemas
|
||||
|
||||
if USE_GCONF
|
||||
if GCONF_SCHEMAS_INSTALL
|
||||
install-data-local:
|
||||
@GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) \
|
||||
--makefile-install-rule $(builddir)/$(schema_DATA) || \
|
||||
(echo ;\
|
||||
echo "*****************************************************"; \
|
||||
echo "Installation of schemas failed, install them manually"; \
|
||||
echo "*****************************************************";)
|
||||
@true
|
||||
else
|
||||
install-data-local:
|
||||
@echo "***************************************************************"
|
||||
@echo "Not installing schemas, disabled with --disable-schemas-install"
|
||||
@echo "***************************************************************"
|
||||
@true
|
||||
endif
|
||||
endif # USE_GCONF
|
||||
|
||||
CLEANFILES = $(GST_SCHEMA_FILES)
|
||||
EXTRA_DIST = $(GST_SCHEMA_FILES)
|
|
@ -1,191 +0,0 @@
|
|||
<gconfschemafile>
|
||||
<schemalist>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/audiosink</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/audiosink</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_AUDIOSINK@</default>
|
||||
<locale name="C">
|
||||
<short>default GStreamer audiosink</short>
|
||||
<long>GStreamer can play audio using any number of output elements. Some possible choices are osssink, esdsink and alsasink. The audiosink can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/audiosink_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/audiosink_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for default GStreamer audiosink</short>
|
||||
<long>Describes the selected output element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_AUDIOSINK@</default>
|
||||
<locale name="C">
|
||||
<short>GStreamer audiosink for Music and Movies</short>
|
||||
<long>GStreamer can play audio using any number of output elements. Some possible choices are osssink, esdsink and alsasink. The audiosink can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for GStreamer audiosink for Music and Movies</short>
|
||||
<long>Describes the selected output element for Music and Movies.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_AUDIOSINK@</default>
|
||||
<locale name="C">
|
||||
<short>GStreamer audiosink for Audio/Video Conferencing</short>
|
||||
<long>GStreamer can play audio using any number of output elements. Some possible choices are osssink, esdsink and alsasink. The audiosink can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for GStreamer audiosink for Audio/Video Conferencing</short>
|
||||
<long>Describes the selected output element for Audio/Video Conferencing.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/audiosink_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/audiosink_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for default GStreamer audiosink</short>
|
||||
<long>Describes the selected output element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_AUDIOSINK@</default>
|
||||
<locale name="C">
|
||||
<short>GStreamer audiosink for Music and Movies</short>
|
||||
<long>GStreamer can play audio using any number of output elements. Some possible choices are osssink, esdsink and alsasink. The audiosink can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/musicaudiosink_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for GStreamer audiosink for Music and Movies</short>
|
||||
<long>Describes the selected output element for Music and Movies.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_AUDIOSINK@</default>
|
||||
<locale name="C">
|
||||
<short>GStreamer audiosink for Audio/Video Conferencing</short>
|
||||
<long>GStreamer can play audio using any number of output elements. Some possible choices are osssink, esdsink and alsasink. The audiosink can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/chataudiosink_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for GStreamer audiosink for Audio/Video Conferencing</short>
|
||||
<long>Describes the selected output element for Audio/Video Conferencing.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/videosink</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/videosink</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_VIDEOSINK@</default>
|
||||
<locale name="C">
|
||||
<short>default GStreamer videosink</short>
|
||||
<long>GStreamer can play video using any number of output elements. Some possible choices are xvimagesink, ximagesink, sdlvideosink and aasink. The videosink can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/audiosrc</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/audiosrc</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_AUDIOSRC@</default>
|
||||
<locale name="C">
|
||||
<short>default GStreamer audio source</short>
|
||||
<long>GStreamer can record audio using any number of input elements. Some possible choices are osssrc, esdsrc and alsasrc. The audio source can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/audiosrc_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/audiosrc_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for default GStreamer audiosrc</short>
|
||||
<long>Describes the selected input element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/audiosrc_description</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/audiosrc_description</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>Default</default>
|
||||
<locale name="C">
|
||||
<short>description for default GStreamer audiosrc</short>
|
||||
<long>Describes the selected input element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/videosrc</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/videosrc</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_VIDEOSRC@</default>
|
||||
<locale name="C">
|
||||
<short>default GStreamer video source</short>
|
||||
<long>GStreamer can record video from any number of input elements. Some possible choices are v4lsrc and videotestsrc. The video source can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>/schemas/system/gstreamer/@GST_MAJORMINOR@/default/visualization</key>
|
||||
<applyto>/system/gstreamer/@GST_MAJORMINOR@/default/visualization</applyto>
|
||||
<owner>gstreamer</owner>
|
||||
<type>string</type>
|
||||
<default>@DEFAULT_VISUALIZER@</default>
|
||||
<locale name="C">
|
||||
<short>default GStreamer visualization plugin</short>
|
||||
<long>GStreamer can put visualization plugins in a pipeline to transform audio stream in video frames. Default is goom but more visualization plugins will be ported soon. The visualization plugin can be a partial pipeline instead of just one element.</long>
|
||||
</locale>
|
||||
</schema>
|
||||
</schemalist>
|
||||
</gconfschemafile>
|
|
@ -26,7 +26,6 @@ BuildRequires: gcc-c++
|
|||
@USE_ESD_TRUE@Provides: gstreamer-audiosrc
|
||||
@USE_ESD_TRUE@Provides: gstreamer-audiosink
|
||||
@USE_FLAC_TRUE@BuildRequires: flac-devel >= 1.0.3
|
||||
@USE_GCONF_TRUE@BuildRequires: GConf2-devel
|
||||
@USE_JPEG_TRUE@BuildRequires: libjpeg-devel
|
||||
@USE_LIBCACA_TRUE@BuildRequires: libcaca-devel
|
||||
@USE_LIBDV_TRUE@BuildRequires: libdv-devel
|
||||
|
@ -63,9 +62,7 @@ make %{?_smp_mflags}
|
|||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
|
||||
%makeinstall
|
||||
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
|
||||
|
||||
# Clean out files that should not be part of the rpm.
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-%{majorminor}/*.la
|
||||
|
@ -79,8 +76,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
|||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post
|
||||
@USE_GCONF_TRUE@export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
|
||||
@USE_GCONF_TRUE@gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/gstreamer-%{majorminor}.schemas > /dev/null
|
||||
|
||||
%files -f gst-plugins-good-%{majorminor}.lang
|
||||
%defattr(-, root, root)
|
||||
|
@ -153,7 +148,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||
@USE_LIBPNG_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstpng.so
|
||||
@USE_OSS_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstossaudio.so
|
||||
@USE_SPEEX_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstspeex.so
|
||||
@USE_GCONF_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstgconfelements.so
|
||||
@USE_HAL_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgsthalelements.so
|
||||
@USE_SHOUT2_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstshout2.so
|
||||
@USE_AALIB_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstaasink.so
|
||||
|
@ -163,9 +157,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||
@USE_SOUP_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstsouphttpsrc.so
|
||||
@USE_PULSE_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstpulse.so
|
||||
|
||||
# schema files
|
||||
@USE_GCONF_TRUE@%{_sysconfdir}/gconf/schemas/gstreamer-%{majorminor}.schemas
|
||||
|
||||
%changelog
|
||||
* Tue Jun 12 2007 Jan Schmidt <jan at fluendo dot com>
|
||||
- wavpack and qtdemux have moved from bad
|
||||
|
|
|
@ -9,7 +9,6 @@ EXTRA_DIST = \
|
|||
codeset.m4 \
|
||||
esd.m4 \
|
||||
freetype2.m4 \
|
||||
gconf-2.m4 \
|
||||
gettext.m4 \
|
||||
glibc21.m4 \
|
||||
glib.m4 \
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
dnl AM_GCONF_SOURCE_2
|
||||
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
|
||||
dnl (i.e. pass to gconftool-2
|
||||
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
|
||||
dnl you should install foo.schemas files
|
||||
dnl
|
||||
|
||||
AC_DEFUN([AM_GCONF_SOURCE_2],
|
||||
[
|
||||
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
|
||||
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
|
||||
else
|
||||
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(gconf-source,
|
||||
[ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
|
||||
|
||||
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
|
||||
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
|
||||
|
||||
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
|
||||
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(gconf-schema-file-dir,
|
||||
[ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
|
||||
|
||||
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
|
||||
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
|
||||
|
||||
AC_ARG_ENABLE(schemas-install,
|
||||
[ --disable-schemas-install Disable the schemas installation],
|
||||
[case "${enableval}" in
|
||||
yes) schemas_install=true ;;
|
||||
no) schemas_install=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --disable-schemas-install) ;;
|
||||
esac],[schemas_install=true])
|
||||
AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, test x$schemas_install = xtrue)
|
||||
])
|
|
@ -6,7 +6,6 @@ ext/libpng/gstpngdec.c
|
|||
ext/shout2/gstshout2.c
|
||||
ext/soup/gstsouphttpsrc.c
|
||||
ext/wavpack/gstwavpackparse.c
|
||||
gconf/gstreamer.schemas.in
|
||||
gst/avi/gstavidemux.c
|
||||
gst/avi/gstavimux.c
|
||||
gst/isomp4/qtdemux.c
|
||||
|
|
|
@ -12,7 +12,7 @@ TESTS_ENVIRONMENT = \
|
|||
GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/ext:$(top_builddir)/sys:$(GSTPB_PLUGINS_DIR):$(GST_PLUGINS_DIR) \
|
||||
GST_PLUGIN_LOADING_WHITELIST="gstreamer@$(GST_PLUGINS_DIR):gst-plugins-base@$(GSTPB_PLUGINS_DIR):gst-plugins-good@$(top_builddir)" \
|
||||
GST_STATE_IGNORE_ELEMENTS="aasink autoaudiosrc autoaudiosink autovideosrc autovideosink \
|
||||
cacasink cairotextoverlay gconfaudiosrc gconfvideosrc gconfaudiosink gconfvideosink \
|
||||
cacasink cairotextoverlay \
|
||||
halaudiosrc halaudiosink jackaudiosrc jackaudiosink \
|
||||
osssrc osssink osxaudiosink osxaudiosrc osxvideosrc osxvideosink \
|
||||
pulsesink pulsesrc pulsemixer v4l2src"
|
||||
|
|
Loading…
Reference in a new issue