[longomatch/redesign3] Start useing gsettings elements and fallback to gconf



commit 9ee4307b6e88feef65b4a2f54f8260d68d442272
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sun Aug 21 17:08:23 2011 +0200

    Start useing gsettings elements and fallback to gconf

 libcesarplayer/gst-camera-capturer.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/libcesarplayer/gst-camera-capturer.c b/libcesarplayer/gst-camera-capturer.c
index bf83cc0..3f45d5a 100644
--- a/libcesarplayer/gst-camera-capturer.c
+++ b/libcesarplayer/gst-camera-capturer.c
@@ -40,8 +40,10 @@
 #define AUDIOSRC "dshowaudiosrc"
 #else
 #define DVVIDEOSRC "dv1394src"
-#define RAWVIDEOSRC "gconfvideosrc"
-#define AUDIOSRC "gconfaudiosrc"
+#define RAWVIDEOSRC "gsettingsvideosrc"
+#define AUDIOSRC "gsettingsaudiosrc"
+#define RAWVIDEOSRC_GCONF "gconfvideosrc"
+#define AUDIOSRC_GCONF "gconfaudiosrc"
 #endif
 
 /* gtk+/gnome */
@@ -1063,9 +1065,19 @@ gst_camera_capturer_set_source (GstCameraCapturer * gcc,
     case GST_CAMERA_CAPTURE_SOURCE_TYPE_RAW:
     default:
     {
+      gchar *videosrc = RAWVIDEOSRC;
+
+#ifndef WIN32
+      GstElementFactory *fact = gst_element_factory_find(RAWVIDEOSRC);
+      if (fact == NULL)
+        videosrc = RAWVIDEOSRC_GCONF;
+      else
+        gst_object_unref (fact);
+#endif
+
       gchar *bin =
           g_strdup_printf ("%s name=device_source ! videorate ! "
-          "ffmpegcolorspace ! videoscale", RAWVIDEOSRC);
+          "ffmpegcolorspace ! videoscale", videosrc);
       gcc->priv->videosrc = gst_parse_bin_from_description (bin, TRUE, err);
       gcc->priv->device_source =
           gst_bin_get_by_name (GST_BIN (gcc->priv->videosrc), "device_source");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]