[telepathy-qt4/master] StreamedMediaChannel: Added handlerStreamingRequired method.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Apr 21 10:01:58 PDT 2009


Added StreamedMediaChannel::handlerStreamingRequired method that indicates
whether media handler streaming is required for this channel.
---
 TelepathyQt4/streamed-media-channel.cpp |   16 ++++++++++++++++
 TelepathyQt4/streamed-media-channel.h   |    2 ++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/streamed-media-channel.cpp b/TelepathyQt4/streamed-media-channel.cpp
index f1a6c8a..b265dba 100644
--- a/TelepathyQt4/streamed-media-channel.cpp
+++ b/TelepathyQt4/streamed-media-channel.cpp
@@ -648,6 +648,22 @@ PendingMediaStreams *StreamedMediaChannel::requestStreams(
             contact, types);
 }
 
+/**
+ * Check whether media handler streaming is required for this channel.
+ *
+ * \return \c true if required, \c false otherwise.
+ */
+bool StreamedMediaChannel::handlerStreamingRequired() const
+{
+    if (!isReady()) {
+        warning() << "Trying to check if handler streaming is required, "
+                     "but channel is not ready. Use becomeReady()";
+    }
+
+    return interfaces().contains(
+            TELEPATHY_INTERFACE_CHANNEL_INTERFACE_MEDIA_SIGNALLING);
+}
+
 void StreamedMediaChannel::gotStreams(QDBusPendingCallWatcher *watcher)
 {
     QDBusPendingReply<MediaStreamInfoList> reply = *watcher;
diff --git a/TelepathyQt4/streamed-media-channel.h b/TelepathyQt4/streamed-media-channel.h
index 3d1b582..5009704 100644
--- a/TelepathyQt4/streamed-media-channel.h
+++ b/TelepathyQt4/streamed-media-channel.h
@@ -150,6 +150,8 @@ public:
             const ContactPtr &contact,
             QList<MediaStreamType> types);
 
+    bool handlerStreamingRequired() const;
+
 Q_SIGNALS:
     void streamAdded(const Tp::MediaStreamPtr &stream);
     void streamRemoved(const Tp::MediaStreamPtr &stream);
-- 
1.5.6.5




More information about the telepathy-commits mailing list