Commit 91429180 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

Remove gsettings plugin which was never ported

Don't think we need this any longer or want to
support it, and clearly no one has been missing
it all these years either, so let's just get rid
of it.
parent be03c0a7
......@@ -47,10 +47,6 @@ Makefile
tmp-orc.c
gst*orc.h
/ext/gsettings/org.freedesktop.gstreamer.default-elements.gschema.xml
/ext/gsettings/org.freedesktop.gstreamer-0.10.default-elements.gschema.valid
/ext/gsettings/org.freedesktop.gstreamer-0.10.default-elements.gschema.xml
/tests/check/orc
/tests/check/elements/videoframe-audiolevel
/tests/examples/codecparsers/parse-jpeg
......
......@@ -451,7 +451,6 @@ GST_PLUGINS_NONPORTED=" cdxaparse \
videomeasure \
linsys \
apexsink dc1394 \
gsettings \
musepack nas sdl timidity \
wininet \
xvid lv2 sndio libvisual"
......@@ -3185,15 +3184,6 @@ AG_GST_CHECK_FEATURE(SPANDSP, [Spandsp], spandsp, [
AC_SUBST(SPANDSP_CFLAGS)
AC_SUBST(SPANDSP_LIBS)
dnl *** GSettings ***
translit(dnm, m, l) AM_CONDITIONAL(USE_GSETTINGS, true)
AG_GST_CHECK_FEATURE(GSETTINGS, [GSettings plugin], gsettings, [
AG_GST_PKG_CHECK_MODULES(GSETTINGS, gio-2.0 >= 2.25.0)
if test "x$HAVE_GSETTINGS" = "xyes"; then
GLIB_GSETTINGS
fi
])
dnl *** sndio ***
translit(dnm, m, l) AM_CONDITIONAL(USE_SNDIO, true)
AG_GST_CHECK_FEATURE(SNDIO, [sndio audio], sndio, [
......@@ -3340,7 +3330,6 @@ AM_CONDITIONAL(USE_SPANDSP, false)
AM_CONDITIONAL(USE_SPC, false)
AM_CONDITIONAL(USE_SRTP, false)
AM_CONDITIONAL(USE_GME, false)
AM_CONDITIONAL(USE_GSETTINGS, false)
AM_CONDITIONAL(USE_XVID, false)
AM_CONDITIONAL(USE_DVB, false)
AM_CONDITIONAL(USE_WININET, false)
......@@ -3658,8 +3647,6 @@ ext/sndio/Makefile
ext/srtp/Makefile
ext/teletextdec/Makefile
ext/gme/Makefile
ext/gsettings/Makefile
ext/gsettings/org.freedesktop.gstreamer.default-elements.gschema.xml
ext/spc/Makefile
ext/timidity/Makefile
ext/webp/Makefile
......
......@@ -46388,16 +46388,6 @@
<DEFAULT>1024</DEFAULT>
</ARG>
<ARG>
<NAME>GstGSettingsAudioSink::profile</NAME>
<TYPE>GstGSettingsAudioSinkProfile</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>Profile</NICK>
<BLURB>Profile.</BLURB>
<DEFAULT>Sound Events</DEFAULT>
</ARG>
<ARG>
<NAME>Gstsolarize::silent</NAME>
<TYPE>gboolean</TYPE>
......@@ -46,12 +46,6 @@ GstGLStereoMix GstChildProxy
GstGLVideoMixer GstChildProxy
GstGLVideoMixerBin GstChildProxy
GstGSMEnc GstPreset
GstGSettingsAudioSink GstChildProxy
GstGSettingsAudioSrc GstChildProxy
GstGSettingsSwitchSink GstChildProxy
GstGSettingsSwitchSrc GstChildProxy
GstGSettingsVideoSink GstChildProxy
GstGSettingsVideoSrc GstChildProxy
GstGtkBaseSink GstNavigation
GstGtkGLSink GstNavigation
GstGtkSink GstNavigation
......
......@@ -382,12 +382,6 @@ else
TELETEXTDEC_DIR=
endif
if USE_GSETTINGS
GSETTINGS_DIR=gsettings
else
GSETTINGS_DIR=
endif
if USE_XVID
XVID_DIR=xvid
else
......@@ -454,7 +448,6 @@ SUBDIRS=\
$(FAAD_DIR) \
$(FLITE_DIR) \
$(FLUIDSYNTH_DIR) \
$(GSETTINGS_DIR) \
$(GSM_DIR) \
$(G729_DIR) \
$(KATE_DIR) \
......@@ -518,7 +511,6 @@ DIST_SUBDIRS = \
faad \
flite \
fluidsynth \
gsettings \
gsm \
hls \
ladspa \
......
gsettings_SCHEMAS = org.freedesktop.gstreamer-@GST_API_VERSION@.default-elements.gschema.xml
org.freedesktop.gstreamer-@GST_API_VERSION@.default-elements.gschema.xml: org.freedesktop.gstreamer.default-elements.gschema.xml
cp org.freedesktop.gstreamer.default-elements.gschema.xml org.freedesktop.gstreamer-@GST_API_VERSION@.default-elements.gschema.xml
if USE_GSETTINGS
@GSETTINGS_RULES@
endif
plugin_LTLIBRARIES = libgstgsettingselements.la
libgstgsettingselements_la_SOURCES = \
gstgsettingsaudiosink.c \
gstgsettingsaudiosrc.c \
gstgsettingsvideosink.c \
gstgsettingsvideosrc.c \
gstswitchsink.c \
gstswitchsrc.c \
plugin.c
libgstgsettingselements_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) $(GST_CFLAGS) $(GSETTINGS_CFLAGS) $(DIR_CFLAGS) \
-DGstSwitchSrc=GstGSettingsSwitchSrc \
-DGstSwitchSrcClass=GstGSettingsSwitchSrcClass \
-DGstSwitchSink=GstGSettingsSwitchSink \
-DGstSwitchSinkClass=GstGSettingsSwitchSinkClass
libgstgsettingselements_la_LIBADD = $(GST_LIBS) $(GSETTINGS_LIBS)
libgstgsettingselements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstgsettingselements_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = \
gstgsettingsaudiosink.h \
gstgsettingsaudiosrc.h \
gstgsettingsvideosink.h \
gstgsettingsvideosrc.h \
gstswitchsink.h \
gstswitchsrc.h \
gstgsettings.h
EXTRA_DIST = org.freedesktop.gstreamer.default-elements.gschema.xml
CLEANFILES = $(gsettings_SCHEMAS)
/* GStreamer
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_GSETTINGS_H__
#define __GST_GSETTINGS_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_GSETTINGS_SCHEMA "org.freedesktop.gstreamer-0.10.default-elements"
#define GST_GSETTINGS_PATH "/desktop/gstreamer/0.10/default-elements/"
#define GST_GSETTINGS_KEY_SOUNDS_AUDIOSINK "sounds-audiosink"
#define GST_GSETTINGS_KEY_MUSIC_AUDIOSINK "music-audiosink"
#define GST_GSETTINGS_KEY_CHAT_AUDIOSINK "chat-audiosink"
#define GST_GSETTINGS_KEY_AUDIOSRC "audiosrc"
#define GST_GSETTINGS_KEY_VIDEOSINK "videosink"
#define GST_GSETTINGS_KEY_VIDEOSRC "videosrc"
#define GST_GSETTINGS_KEY_VISUALIZATION "visualization"
G_END_DECLS
#endif /* __GST_GSETTINGS_H__ */
This diff is collapsed.
/* GStreamer
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_GSETTINGS_AUDIO_SINK_H__
#define __GST_GSETTINGS_AUDIO_SINK_H__
#include <gst/gst.h>
#include <gio/gio.h>
#include "gstswitchsink.h"
G_BEGIN_DECLS
#define GST_TYPE_GSETTINGS_AUDIO_SINK \
(gst_gsettings_audio_sink_get_type ())
#define GST_GSETTINGS_AUDIO_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GSETTINGS_AUDIO_SINK, \
GstGSettingsAudioSink))
#define GST_GSETTINGS_AUDIO_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GSETTINGS_AUDIO_SINK, \
GstGSettingsAudioSinkClass))
#define GST_IS_GSETTINGS_AUDIO_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GSETTINGS_AUDIO_SINK))
#define GST_IS_GSETTINGS_AUDIO_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GSETTINGS_AUDIO_SINK))
typedef enum
{
GST_GSETTINGS_AUDIOSINK_PROFILE_SOUNDS,
GST_GSETTINGS_AUDIOSINK_PROFILE_MUSIC,
GST_GSETTINGS_AUDIOSINK_PROFILE_CHAT,
GST_GSETTINGS_AUDIOSINK_PROFILE_NONE /* Internal value only */
} GstGSettingsAudioSinkProfile;
typedef struct _GstGSettingsAudioSink {
GstSwitchSink parent;
GSettings *settings;
GMainContext *context;
GMainLoop *loop;
gulong changed_id;
GstGSettingsAudioSinkProfile profile;
gchar *gsettings_str;
} GstGSettingsAudioSink;
typedef struct _GstGSettingsAudioSinkClass {
GstSwitchSinkClass parent_class;
} GstGSettingsAudioSinkClass;
GType gst_gsettings_audio_sink_get_type (void);
G_END_DECLS
#endif /* __GST_GSETTINGS_AUDIO_SINK_H__ */
/* GStreamer
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-gsettingsaudiosrc
*
* This element outputs sound to the audiosrc that has been configured in
* GSettings by the user.
*
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch gsettingsaudiosrc ! audioconvert ! audioresample ! autoaudiosink
* ]| Play from configured audiosrc
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gst/gst.h>
#include <gst/glib-compat-private.h>
#include <string.h>
#include "gstgsettingsaudiosrc.h"
#include "gstgsettings.h"
GST_BOILERPLATE (GstGSettingsAudioSrc, gst_gsettings_audio_src, GstSwitchSrc,
GST_TYPE_SWITCH_SRC);
static gboolean
gst_gsettings_audio_src_change_child (GstGSettingsAudioSrc * src)
{
gchar *new_string;
GError *err = NULL;
GstElement *new_kid;
GST_OBJECT_LOCK (src);
new_string =
g_settings_get_string (src->settings, GST_GSETTINGS_KEY_AUDIOSRC);
if (new_string != NULL && src->gsettings_str != NULL &&
(strlen (new_string) == 0 ||
strcmp (src->gsettings_str, new_string) == 0)) {
g_free (new_string);
GST_DEBUG_OBJECT (src,
"GSettings key was updated, but it didn't change. Ignoring");
GST_OBJECT_UNLOCK (src);
return TRUE;
}
GST_OBJECT_UNLOCK (src);
GST_DEBUG_OBJECT (src, "GSettings key changed from '%s' to '%s'",
GST_STR_NULL (src->gsettings_str), GST_STR_NULL (new_string));
if (new_string) {
new_kid = gst_parse_bin_from_description (new_string, TRUE, &err);
if (err) {
GST_ERROR_OBJECT (src, "error creating bin '%s': %s", new_string,
err->message);
g_error_free (err);
}
} else {
new_kid = NULL;
}
if (new_kid == NULL) {
GST_ELEMENT_ERROR (src, LIBRARY, SETTINGS, (NULL),
("Failed to render audio src from GSettings"));
goto fail;
}
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->gsettings_str);
src->gsettings_str = new_string;
return TRUE;
fail:
g_free (new_string);
return FALSE;
}
static void
on_changed (GSettings * settings, gchar * key, GstGSettingsAudioSrc * src)
{
if (!g_str_equal (key, "audiosrc"))
return;
gst_gsettings_audio_src_change_child (src);
}
static gboolean
gst_gsettings_audio_src_start (GstGSettingsAudioSrc * src)
{
GError *err = NULL;
GThread *thread;
src->loop = g_main_loop_new (src->context, FALSE);
thread =
g_thread_create ((GThreadFunc) g_main_loop_run, src->loop, FALSE, &err);
if (!thread) {
GST_ELEMENT_ERROR (src, CORE, STATE_CHANGE, (NULL),
("Failed to create new thread: %s", err->message));
g_error_free (err);
g_main_loop_unref (src->loop);
src->loop = NULL;
return FALSE;
}
g_main_context_push_thread_default (src->context);
src->settings = g_settings_new (GST_GSETTINGS_SCHEMA);
src->changed_id =
g_signal_connect_data (G_OBJECT (src->settings), "changed",
G_CALLBACK (on_changed), gst_object_ref (src),
(GClosureNotify) gst_object_unref, 0);
g_main_context_pop_thread_default (src->context);
return TRUE;
}
static gboolean
gst_gsettings_audio_src_reset (GstGSettingsAudioSrc * src)
{
gst_switch_src_set_child (GST_SWITCH_SRC (src), NULL);
if (src->changed_id) {
g_signal_handler_disconnect (src->settings, src->changed_id);
src->changed_id = 0;
}
if (src->loop) {
g_main_loop_quit (src->loop);
g_main_loop_unref (src->loop);
src->loop = NULL;
}
if (src->settings) {
g_object_unref (src->settings);
src->settings = NULL;
}
GST_OBJECT_LOCK (src);
g_free (src->gsettings_str);
src->gsettings_str = NULL;
GST_OBJECT_UNLOCK (src);
return TRUE;
}
static void
gst_gsettings_audio_src_finalize (GObject * object)
{
GstGSettingsAudioSrc *src = GST_GSETTINGS_AUDIO_SRC (object);
g_free (src->gsettings_str);
g_main_context_unref (src->context);
GST_CALL_PARENT (G_OBJECT_CLASS, finalize, ((GObject *) (src)));
}
static GstStateChangeReturn
gst_gsettings_audio_src_change_state (GstElement * element,
GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstGSettingsAudioSrc *src = GST_GSETTINGS_AUDIO_SRC (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_gsettings_audio_src_start (src))
return GST_STATE_CHANGE_FAILURE;
if (!gst_gsettings_audio_src_change_child (src)) {
gst_gsettings_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:
gst_gsettings_audio_src_reset (src);
break;
default:
break;
}
return ret;
}
static void
gst_gsettings_audio_src_init (GstGSettingsAudioSrc * src,
GstGSettingsAudioSrcClass * g_class)
{
src->context = g_main_context_new ();
gst_gsettings_audio_src_reset (src);
}
static void
gst_gsettings_audio_src_base_init (gpointer klass)
{
GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
gst_element_class_set_static_metadata (eklass, "GSettings audio src",
"Src/Audio",
"Audio src embedding the GSettings preferences for audio input",
"Sebastian Dröge <sebastian.droege@collabora.co.uk>");
}
static void
gst_gsettings_audio_src_class_init (GstGSettingsAudioSrcClass * klass)
{
GObjectClass *oklass = G_OBJECT_CLASS (klass);
GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
oklass->finalize = gst_gsettings_audio_src_finalize;
eklass->change_state = gst_gsettings_audio_src_change_state;
}
/* GStreamer
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_GSETTINGS_AUDIO_SRC_H__
#define __GST_GSETTINGS_AUDIO_SRC_H__
#include <gst/gst.h>
#include <gio/gio.h>
#include "gstswitchsrc.h"
G_BEGIN_DECLS
#define GST_TYPE_GSETTINGS_AUDIO_SRC \
(gst_gsettings_audio_src_get_type ())
#define GST_GSETTINGS_AUDIO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GSETTINGS_AUDIO_SRC, \
GstGSettingsAudioSrc))
#define GST_GSETTINGS_AUDIO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GSETTINGS_AUDIO_SRC, \
GstGSettingsAudioSrcClass))
#define GST_IS_GSETTINGS_AUDIO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GSETTINGS_AUDIO_SRC))
#define GST_IS_GSETTINGS_AUDIO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GSETTINGS_AUDIO_SRC))
typedef struct _GstGSettingsAudioSrc {
GstSwitchSrc parent;
GSettings *settings;
GMainContext *context;
GMainLoop *loop;
gulong changed_id;
gchar *gsettings_str;
} GstGSettingsAudioSrc;
typedef struct _GstGSettingsAudioSrcClass {
GstSwitchSrcClass parent_class;
} GstGSettingsAudioSrcClass;
GType gst_gsettings_audio_src_get_type (void);
G_END_DECLS
#endif /* __GST_GSETTINGS_AUDIO_SRC_H__ */
/* GStreamer
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-gsettingsvideosink
*
* This element outputs sound to the videosink that has been configured in
* GSettings by the user.
*
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch videotestsrc ! videoconvert ! videoscale ! gsettingsvideosink
* ]| Play on configured videosink
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gst/gst.h>
#include <gst/glib-compat-private.h>
#include <string.h>
#include "gstgsettingsvideosink.h"
#include "gstgsettings.h"
GST_BOILERPLATE (GstGSettingsVideoSink, gst_gsettings_video_sink, GstSwitchSink,
GST_TYPE_SWITCH_SINK);
static gboolean
gst_gsettings_video_sink_change_child (GstGSettingsVideoSink * sink)
{
gchar *new_string;
GError *err = NULL;
GstElement *new_kid;
GST_OBJECT_LOCK (sink);
new_string =
g_settings_get_string (sink->settings, GST_GSETTINGS_KEY_VIDEOSINK);
if (new_string != NULL && sink->gsettings_str != NULL &&
(strlen (new_string) == 0 ||
strcmp (sink->gsettings_str, new_string) == 0)) {
g_free (new_string);
GST_DEBUG_OBJECT (sink,
"GSettings key was updated, but it didn't change. Ignoring");
GST_OBJECT_UNLOCK (sink);
return TRUE;
}
GST_OBJECT_UNLOCK (sink);
GST_DEBUG_OBJECT (sink, "GSettings key changed from '%s' to '%s'",
GST_STR_NULL (sink->gsettings_str), GST_STR_NULL (new_string));
if (new_string) {
new_kid = gst_parse_bin_from_description (new_string, TRUE, &err);
if (err) {
GST_ERROR_OBJECT (sink, "error creating bin '%s': %s", new_string,
err->message);
g_error_free (err);
}
} else {
new_kid = NULL;
}
if (new_kid == NULL) {
GST_ELEMENT_ERROR (sink, LIBRARY, SETTINGS, (NULL),
("Failed to render video sink from GSettings"));
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->gsettings_str);
sink->gsettings_str = new_string;
return TRUE;
fail:
g_free (new_string);
return FALSE;
}
static void
on_changed (GSettings * settings, gchar * key, GstGSettingsVideoSink * sink)
{
if (!g_str_has_suffix (key, "videosink"))
return;
gst_gsettings_video_sink_change_child (sink);
}
static gboolean
gst_gsettings_video_sink_start (GstGSettingsVideoSink * sink)
{
GError *err = NULL;
GThread *thread;
sink->loop = g_main_loop_new (sink->context, FALSE);
thread =
g_thread_create ((GThreadFunc) g_main_loop_run, sink->loop, FALSE, &err);
if (!thread) {
GST_ELEMENT_ERROR (sink, CORE, STATE_CHANGE, (NULL),
("Failed to create new thread: %s", err->message));
g_error_free (err);
g_main_loop_unref (sink->loop);
sink->loop = NULL;
return FALSE;
}
g_main_context_push_thread_default (sink->context);
sink->settings = g_settings_new (GST_GSETTINGS_SCHEMA);
sink->changed_id =
g_signal_connect_data (G_OBJECT (sink->settings), "changed",
G_CALLBACK (on_changed), gst_object_ref (sink),
(GClosureNotify) gst_object_unref, 0);
g_main_context_pop_thread_default (sink->context);
return TRUE;
}
static gboolean
gst_gsettings_video_sink_reset (GstGSettingsVideoSink * sink)
{
gst_switch_sink_set_child (GST_SWITCH_SINK (sink), NULL);
if (sink->changed_id) {
g_signal_handler_disconnect (sink->settings, sink->changed_id);
sink->changed_id = 0;
}
if (sink->loop) {
g_main_loop_quit (sink->loop);
g_main_loop_unref (sink->loop);
sink->loop = NULL;
}
if (sink->settings) {
g_object_unref (sink->settings);
sink->settings = NULL;
}