[Telepathy-commits] [telepathy-qt4/master] StreamedMediaChannel: Added requestStreamDirection(bool send, bool receive) overload function.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Mar 11 08:56:03 PDT 2009


---
 TelepathyQt4/Client/streamed-media-channel.cpp |   21 +++++++++++++++++++++
 TelepathyQt4/Client/streamed-media-channel.h   |    2 ++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/Client/streamed-media-channel.cpp b/TelepathyQt4/Client/streamed-media-channel.cpp
index 04209ce..9646644 100644
--- a/TelepathyQt4/Client/streamed-media-channel.cpp
+++ b/TelepathyQt4/Client/streamed-media-channel.cpp
@@ -347,6 +347,27 @@ PendingOperation *MediaStream::requestStreamDirection(
             mPriv->channel->streamedMediaInterface()->RequestStreamDirection(mPriv->id, direction));
 }
 
+/**
+ * Request a change in the direction of this stream. In particular, this
+ * might be useful to stop sending media of a particular type, or inform the
+ * peer that you are no longer using media that is being sent to you.
+ *
+ * \return A PendingOperation which will emit PendingOperation::finished
+ *         when the call has finished.
+ * \sa requestStreamDirection(Telepathy::MediaStreamDirection direction)
+ */
+PendingOperation *MediaStream::requestStreamDirection(bool send, bool receive)
+{
+    uint dir = Telepathy::MediaStreamDirectionNone;
+    if (send) {
+        dir |= Telepathy::MediaStreamDirectionSend;
+    }
+    if (receive) {
+        dir |= Telepathy::MediaStreamDirectionReceive;
+    }
+    return requestStreamDirection((Telepathy::MediaStreamDirection) dir);
+}
+
 uint MediaStream::contactHandle() const
 {
     return mPriv->contactHandle;
diff --git a/TelepathyQt4/Client/streamed-media-channel.h b/TelepathyQt4/Client/streamed-media-channel.h
index 55dfc84..3e6cf23 100644
--- a/TelepathyQt4/Client/streamed-media-channel.h
+++ b/TelepathyQt4/Client/streamed-media-channel.h
@@ -94,6 +94,8 @@ public:
     PendingOperation *remove();
     PendingOperation *requestStreamDirection(
             Telepathy::MediaStreamDirection direction);
+    PendingOperation *requestStreamDirection(
+            bool send, bool receive);
 
 Q_SIGNALS:
     void removed(Telepathy::Client::MediaStream *stream);
-- 
1.5.6.5




More information about the telepathy-commits mailing list