[empathy] VideoSrc: add API to change the input device



commit 2f459725f01467f9352335024b4b51e02fe73a59
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon Aug 1 13:14:09 2011 +0100

    VideoSrc: add API to change the input device

 src/empathy-video-src.c |   13 +++++++++++++
 src/empathy-video-src.h |    3 +++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c
index e249633..4017990 100644
--- a/src/empathy-video-src.c
+++ b/src/empathy-video-src.c
@@ -361,3 +361,16 @@ out:
   return result;
 }
 
+void
+empathy_video_src_change_device (EmpathyGstVideoSrc *self,
+    const gchar *device)
+{
+  EmpathyGstVideoSrcPrivate *priv = EMPATHY_GST_VIDEO_SRC_GET_PRIVATE (self);
+  GstState state;
+
+  gst_element_get_state (priv->src, &state, NULL, 0);
+
+  gst_element_set_state (priv->src, GST_STATE_NULL);
+  g_object_set (priv->src, "device", device, NULL);
+  gst_element_set_state (priv->src, state);
+}
diff --git a/src/empathy-video-src.h b/src/empathy-video-src.h
index fae5563..a652763 100644
--- a/src/empathy-video-src.h
+++ b/src/empathy-video-src.h
@@ -81,6 +81,9 @@ void empathy_video_src_set_channel (GstElement *src,
 guint empathy_video_src_get_channel (GstElement *src,
   EmpathyGstVideoSrcChannel channel);
 
+void empathy_video_src_change_device (EmpathyGstVideoSrc *self,
+  const gchar *device);
+
 G_END_DECLS
 
 #endif /* #ifndef __EMPATHY_GST_VIDEO_SRC_H__*/



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