aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-15 17:04:24 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-15 20:38:12 +0800
commit7e9166e6711d15a28bb679a1aeed3223134f2388 (patch)
tree706eb05ada9033547c199924b0868a2e03888c77 /src
parent8f7a0a9cce1f8e08d4a50cc181d8a11ce3b48ec1 (diff)
downloadgsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.tar
gsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.tar.gz
gsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.tar.bz2
gsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.tar.lz
gsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.tar.xz
gsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.tar.zst
gsoc2013-empathy-7e9166e6711d15a28bb679a1aeed3223134f2388.zip
Set stream-properties on GStreamer elements to set the media role
Diffstat (limited to 'src')
-rw-r--r--src/empathy-audio-sink.c10
-rw-r--r--src/empathy-audio-src.c9
-rw-r--r--src/empathy-av.c1
-rw-r--r--src/empathy-call.c1
4 files changed, 19 insertions, 2 deletions
diff --git a/src/empathy-audio-sink.c b/src/empathy-audio-sink.c
index e571b2426..f8b5d1c39 100644
--- a/src/empathy-audio-sink.c
+++ b/src/empathy-audio-sink.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <gst/audio/audio.h>
+#include <telepathy-glib/telepathy-glib.h>
#include "empathy-audio-sink.h"
@@ -231,6 +232,15 @@ empathy_audio_sink_request_new_pad (GstElement *element,
if (self->priv->sink == NULL)
goto error;
+ if (!tp_strdiff (sink_element, "pulsesink"))
+ {
+ GstStructure *props;
+
+ props = gst_structure_from_string ("props,media.role=phone", NULL);
+ g_object_set (self->priv->sink, "stream-properties", props, NULL);
+ gst_structure_free (props);
+ }
+
gst_bin_add (GST_BIN (bin), self->priv->sink);
if (!gst_element_link_many (audioconvert0, resample, audioconvert1,
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c
index 642628d7b..98ff24eca 100644
--- a/src/empathy-audio-src.c
+++ b/src/empathy-audio-src.c
@@ -394,6 +394,15 @@ empathy_audio_src_init (EmpathyGstAudioSrc *obj)
priv->src = gst_element_factory_make (src_element, NULL);
gst_bin_add (GST_BIN (obj), priv->src);
+ if (!tp_strdiff (src_element, "pulsesrc"))
+ {
+ GstStructure *props;
+
+ props = gst_structure_from_string ("props,media.role=phone", NULL);
+ g_object_set (priv->src, "stream-properties", props, NULL);
+ gst_structure_free (props);
+ }
+
priv->volume = gst_element_factory_make ("volume", NULL);
g_object_ref (priv->volume);
diff --git a/src/empathy-av.c b/src/empathy-av.c
index 6f8c5ba61..70acfc4f3 100644
--- a/src/empathy-av.c
+++ b/src/empathy-av.c
@@ -132,7 +132,6 @@ main (int argc,
empathy_gtk_init ();
g_set_application_name (_("Empathy Audio/Video Client"));
- g_setenv ("PULSE_PROP_media.role", "phone", TRUE);
/* Make empathy and empathy-av appear as the same app in gnome-shell */
gdk_set_program_class ("Empathy");
diff --git a/src/empathy-call.c b/src/empathy-call.c
index 1305645d5..1f60217db 100644
--- a/src/empathy-call.c
+++ b/src/empathy-call.c
@@ -150,7 +150,6 @@ main (int argc,
empathy_gtk_init ();
g_set_application_name (_("Empathy Audio/Video Client"));
- g_setenv ("PULSE_PROP_media.role", "phone", TRUE);
/* Make empathy and empathy-call appear as the same app in gnome-shell */
gdk_set_program_class ("Empathy");