diff options
author | Christian Schaller <uraeus@gnome.org> | 2005-05-06 11:41:28 +0000 |
---|---|---|
committer | Christian Schaller <uraeus@gnome.org> | 2005-05-06 11:41:28 +0000 |
commit | 086b25d40a8fc3606d70c32af7f6af178e2d804d (patch) | |
tree | 2b138bca28d921d8798599f2c745d8014ec631ba /gst-libs/gst/gconf | |
parent | 4cb81e7ecbdc6376e5c676dcffa11758434acd1e (diff) | |
download | gst-plugins-bad-086b25d40a8fc3606d70c32af7f6af178e2d804d.tar.gz gst-plugins-bad-086b25d40a8fc3606d70c32af7f6af178e2d804d.tar.bz2 gst-plugins-bad-086b25d40a8fc3606d70c32af7f6af178e2d804d.zip |
remove gst-libs from gst-plugins module as it is in gst-plugins-base now
Original commit message from CVS:
remove gst-libs from gst-plugins module as it is in gst-plugins-base now
Diffstat (limited to 'gst-libs/gst/gconf')
-rw-r--r-- | gst-libs/gst/gconf/Makefile.am | 20 | ||||
-rw-r--r-- | gst-libs/gst/gconf/gconf.c | 318 | ||||
-rw-r--r-- | gst-libs/gst/gconf/gconf.h | 47 | ||||
-rw-r--r-- | gst-libs/gst/gconf/test-gconf.c | 36 |
4 files changed, 0 insertions, 421 deletions
diff --git a/gst-libs/gst/gconf/Makefile.am b/gst-libs/gst/gconf/Makefile.am deleted file mode 100644 index f816f946..00000000 --- a/gst-libs/gst/gconf/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -librarydir = $(libdir) - -library_LTLIBRARIES = libgstgconf-@GST_MAJORMINOR@.la - -libgstgconf_@GST_MAJORMINOR@_la_SOURCES = gconf.c - -libgstgconf_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/gconf -libgstgconf_@GST_MAJORMINOR@include_HEADERS = gconf.h - -noinst_PROGRAMS = test-gconf - -# add define for GST_GCONF_DIR -DIR_CFLAGS=-DGST_GCONF_DIR=\"/system/gstreamer/@GST_MAJORMINOR@\" - -test_gconf_CFLAGS = $(GST_CFLAGS) $(GCONF_CFLAGS) $(DIR_CFLAGS) -test_gconf_LDADD = $(GST_LIBS) $(GCONF_LIBS) libgstgconf-@GST_MAJORMINOR@.la - -libgstgconf_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) $(GCONF_LIBS) -libgstgconf_@GST_MAJORMINOR@_la_CFLAGS = $(GST_CFLAGS) $(GCONF_CFLAGS) $(DIR_CFLAGS) -libgstgconf_@GST_MAJORMINOR@_la_LDFLAGS = @GST_PLUGINS_LT_LDFLAGS@ -version-info @GST_PLUGINS_LIBVERSION@ diff --git a/gst-libs/gst/gconf/gconf.c b/gst-libs/gst/gconf/gconf.c deleted file mode 100644 index de3182f0..00000000 --- a/gst-libs/gst/gconf/gconf.c +++ /dev/null @@ -1,318 +0,0 @@ -/* GStreamer - * Copyright (C) <2002> Thomas Vander Stichele <thomas@apestaart.org> - * - * 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 "gconf.h" - -#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; -} - -/* go through a bin, finding the one pad that is unconnected in the given - * * direction, and return that pad */ -static GstPad * -gst_bin_find_unconnected_pad (GstBin * bin, GstPadDirection direction) -{ - GstPad *pad = NULL; - GList *elements = NULL; - const GList *pads = NULL; - GstElement *element = NULL; - - elements = (GList *) gst_bin_get_list (bin); - /* traverse all elements looking for unconnected pads */ - while (elements && pad == NULL) { - element = GST_ELEMENT (elements->data); - pads = gst_element_get_pad_list (element); - while (pads) { - /* check if the direction matches */ - if (GST_PAD_DIRECTION (GST_PAD (pads->data)) == direction) { - if (GST_PAD_PEER (GST_PAD (pads->data)) == NULL) { - /* found it ! */ - pad = GST_PAD (pads->data); - } - } - if (pad) - break; /* found one already */ - pads = g_list_next (pads); - } - elements = g_list_next (elements); - } - return pad; -} - -/* 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 = g_strdup_printf ("%s/%s", GST_GCONF_DIR, 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; -} - -/** - * 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 = g_strdup_printf ("%s/%s", GST_GCONF_DIR, 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_description: - * @description: a #gchar string describing the bin. - * - * Render bin from description @description. - * - * Returns: a #GstElement containing the rendered bin. - */ -GstElement * -gst_gconf_render_bin_from_description (const gchar * description) -{ - GstElement *bin = NULL; - GstPad *pad = NULL; - GError *error = NULL; - gchar *desc = NULL; - - /* parse the pipeline to a bin */ - desc = g_strdup_printf ("bin.( %s )", description); - bin = GST_ELEMENT (gst_parse_launch (desc, &error)); - g_free (desc); - if (error) { - GST_ERROR ("gstgconf: error parsing pipeline %s\n%s\n", - description, error->message); - g_error_free (error); - return NULL; - } - - /* find pads and ghost them if necessary */ - if ((pad = gst_bin_find_unconnected_pad (GST_BIN (bin), GST_PAD_SRC))) { - gst_element_add_ghost_pad (bin, pad, "src"); - } - if ((pad = gst_bin_find_unconnected_pad (GST_BIN (bin), GST_PAD_SINK))) { - gst_element_add_ghost_pad (bin, pad, "sink"); - } - return bin; -} - -/** - * 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); - if (value) - bin = gst_gconf_render_bin_from_description (value); - g_free (value); - return bin; -} - -/** - * gst_gconf_get_default_audio_sink: - * - * Render audio output bin from GStreamer GConf key : "default/audiosink". - * If key is invalid, the default audio sink for the platform is used - * (typically osssink or sunaudiosink). - * - * Returns: a #GstElement containing the audio output bin, or NULL if - * everything failed. - */ -GstElement * -gst_gconf_get_default_audio_sink (void) -{ - GstElement *ret = gst_gconf_render_bin_from_key ("default/audiosink"); - - if (!ret) { - ret = gst_element_factory_make (DEFAULT_AUDIOSINK, NULL); - - if (!ret) - g_warning ("No GConf default audio sink key and %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 ("default/videosink"); - - 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 ("default/audiosrc"); - - 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 ("default/videosrc"); - - if (!ret) { - ret = gst_element_factory_make (DEFAULT_VIDEOSRC, NULL); - - if (!ret) - g_warning ("No GConf default video src key and %s doesn't work", - DEFAULT_VIDEOSRC); - } - - return ret; -} - -/** - * gst_gconf_get_default_visualization_element: - * - * Render visualization bin from GStreamer GConf key : "default/visualization". - * If key is invalid, the default visualization element is used. - * - * Returns: a #GstElement containing the visualization bin, or NULL if - * everything failed. - */ -GstElement * -gst_gconf_get_default_visualization_element (void) -{ - GstElement *ret = gst_gconf_render_bin_from_key ("default/visualization"); - - if (!ret) { - ret = gst_element_factory_make (DEFAULT_VISUALIZER, NULL); - - if (!ret) - g_warning - ("No GConf default visualization plugin key and %s doesn't work", - DEFAULT_VISUALIZER); - } - - return ret; -} diff --git a/gst-libs/gst/gconf/gconf.h b/gst-libs/gst/gconf/gconf.h deleted file mode 100644 index 7dce40b8..00000000 --- a/gst-libs/gst/gconf/gconf.h +++ /dev/null @@ -1,47 +0,0 @@ -/* GStreamer - * Copyright (C) <2002> Thomas Vander Stichele <thomas@apestaart.org> - * - * 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 - -gchar * gst_gconf_get_string (const gchar *key); -void gst_gconf_set_string (const gchar *key, - const gchar *value); - -GstElement * gst_gconf_render_bin_from_key (const gchar *key); -GstElement * gst_gconf_render_bin_from_description (const gchar *description); - -GstElement * gst_gconf_get_default_video_sink (void); -GstElement * gst_gconf_get_default_audio_sink (void); -GstElement * gst_gconf_get_default_video_src (void); -GstElement * gst_gconf_get_default_audio_src (void); -GstElement * gst_gconf_get_default_visualization_element (void); - -G_END_DECLS - -#endif /* GST_GCONF_H */ diff --git a/gst-libs/gst/gconf/test-gconf.c b/gst-libs/gst/gconf/test-gconf.c deleted file mode 100644 index bfc8cabc..00000000 --- a/gst-libs/gst/gconf/test-gconf.c +++ /dev/null @@ -1,36 +0,0 @@ -/* GStreamer - * Copyright (C) <2002> Thomas Vander Stichele <thomas@apestaart.org> - * - * 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. - */ - -#include "gconf.h" - -int -main (int argc, char *argv[]) -{ - gst_init (&argc, &argv); - - printf ("Default video sink : %s\n", - gst_gconf_get_string ("default/videosink")); - printf ("Default audio sink : %s\n", - gst_gconf_get_string ("default/audiosink")); - printf ("Default video src : %s\n", - gst_gconf_get_string ("default/videosrc")); - printf ("Default audio src : %s\n", - gst_gconf_get_string ("default/audiosrc")); - return 0; -} |