aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-01 20:14:09 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-15 20:02:21 +0800
commit2f459725f01467f9352335024b4b51e02fe73a59 (patch)
treeb206ac97c670716bd4e8cb67b18cc2f6362100f0
parent37b150da114880f2af274733ba32580d0a90902f (diff)
downloadgsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.tar
gsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.tar.gz
gsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.tar.bz2
gsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.tar.lz
gsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.tar.xz
gsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.tar.zst
gsoc2013-empathy-2f459725f01467f9352335024b4b51e02fe73a59.zip
VideoSrc: add API to change the input device
-rw-r--r--src/empathy-video-src.c13
-rw-r--r--src/empathy-video-src.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c
index e249633c7..4017990a2 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 fae5563eb..a65276321 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__*/