[telepathy-gabble/master] GabbleMediaFactory: allow requesting initial audio/video the new way

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Sep 11 10:22:21 PDT 2009


We can't fully support InitialAudio/InitialVideo without a new
telepathy-glib release, but we can at least allow them in requests.
---
 src/media-factory.c                         |   10 +++++++++-
 tests/twisted/jingle/initial-audio-video.py |    6 ++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/media-factory.c b/src/media-factory.c
index 35dfc45..30738c5 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -378,6 +378,8 @@ static const gchar * const media_channel_fixed_properties[] = {
 static const gchar * const named_channel_allowed_properties[] = {
     TP_IFACE_CHANNEL ".TargetHandle",
     TP_IFACE_CHANNEL ".TargetID",
+    TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio",
+    TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo",
     GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialAudio",
     GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialVideo",
     NULL
@@ -389,6 +391,7 @@ static const gchar * const * video_allowed =
     named_channel_allowed_properties + 3;
 
 static const gchar * const audio_allowed[] = {
+    TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio",
     GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialAudio",
     NULL
 };
@@ -551,8 +554,13 @@ gabble_media_factory_requestotron (TpChannelManager *manager,
       TP_IFACE_CHANNEL ".TargetHandle", NULL);
 
   initial_audio = tp_asv_get_boolean (request_properties,
-      GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialAudio", NULL);
+      TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio", NULL);
   initial_video = tp_asv_get_boolean (request_properties,
+      TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo", NULL);
+
+  initial_audio = initial_audio || tp_asv_get_boolean (request_properties,
+      GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialAudio", NULL);
+  initial_video = initial_video || tp_asv_get_boolean (request_properties,
       GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialVideo", NULL);
 
   switch (handle_type)
diff --git a/tests/twisted/jingle/initial-audio-video.py b/tests/twisted/jingle/initial-audio-video.py
index 4c31a46..bf6f4a8 100644
--- a/tests/twisted/jingle/initial-audio-video.py
+++ b/tests/twisted/jingle/initial-audio-video.py
@@ -32,6 +32,8 @@ def outgoing(jp, q, bus, conn, stream):
     fixed, allowed = media_classes[0]
     assertContains(cs.INITIAL_AUDIO, allowed)
     assertContains(cs.INITIAL_VIDEO, allowed)
+    assertContains(cs.INITIAL_AUDIO.replace('.FUTURE.', '.'), allowed)
+    assertContains(cs.INITIAL_VIDEO.replace('.FUTURE.', '.'), allowed)
 
     check_neither(q, conn, bus, stream, remote_handle)
     check_iav(jt, q, conn, bus, stream, remote_handle, True, False)
@@ -76,8 +78,8 @@ def check_iav(jt, q, conn, bus, stream, remote_handle, initial_audio,
         cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAMED_MEDIA,
         cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
         cs.TARGET_HANDLE: remote_handle,
-        cs.INITIAL_AUDIO: initial_audio,
-        cs.INITIAL_VIDEO: initial_video,
+        cs.INITIAL_AUDIO.replace('.FUTURE.', '.'): initial_audio,
+        cs.INITIAL_VIDEO.replace('.FUTURE.', '.'): initial_video,
         })
     if initial_video and (not jt.jp.can_do_video()
             or (not initial_audio and not jt.jp.can_do_video_only ())):
-- 
1.5.6.5




More information about the telepathy-commits mailing list