[Telepathy-commits] [telepathy-qt4/master] *added requestStreams()
Jan
jan.oelze at basyskom.de
Tue Feb 17 07:03:25 PST 2009
Signed-off-by: Stefan Eilers <stefan at eilers-online.net>
---
TelepathyQt4/Prototype/StreamedMediaChannel.cpp | 35 +++++++++++++++++++++++
TelepathyQt4/Prototype/StreamedMediaChannel.h | 2 +
2 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt4/Prototype/StreamedMediaChannel.cpp b/TelepathyQt4/Prototype/StreamedMediaChannel.cpp
index 1eb8518..41922a9 100644
--- a/TelepathyQt4/Prototype/StreamedMediaChannel.cpp
+++ b/TelepathyQt4/Prototype/StreamedMediaChannel.cpp
@@ -247,6 +247,41 @@ bool StreamedMediaChannel::requestChannel( QList<Telepathy::MediaStreamType> typ
return true;
}
+bool StreamedMediaChannel::requestStreams( TpPrototype::Contact* contact, QList<Telepathy::MediaStreamType> types )
+{
+ Q_ASSERT( d->m_pStreamedMediaInterface );
+
+ if ( !d->m_pStreamedMediaInterface )
+ {
+ return false;
+ }
+
+ QList<uint> stream_types;
+ foreach( uint type, types )
+ {
+ stream_types << type;
+ }
+
+
+ QDBusPendingReply<Telepathy::MediaStreamInfoList> request_streams_reply = d->m_pStreamedMediaInterface->RequestStreams( d->m_pContact->telepathyHandle(),
+ stream_types );
+ request_streams_reply.waitForFinished();
+
+ if ( !request_streams_reply.isValid() )
+ {
+ QDBusError error = request_streams_reply.error();
+
+ qWarning() << "RequestStreams: error type:" << error.type()
+ << "error name:" << error.name()
+ << "error message:" << error.message();
+
+ return false;
+ }
+
+ // Fall through..
+ return true;
+}
+
bool StreamedMediaChannel::addContactsToGroup( QList<QPointer<TpPrototype::Contact> > contacts )
{
QList<uint> handle_list = d->handleListForContacts( contacts );
diff --git a/TelepathyQt4/Prototype/StreamedMediaChannel.h b/TelepathyQt4/Prototype/StreamedMediaChannel.h
index 854edb6..8a98173 100644
--- a/TelepathyQt4/Prototype/StreamedMediaChannel.h
+++ b/TelepathyQt4/Prototype/StreamedMediaChannel.h
@@ -131,6 +131,8 @@ public:
*/
bool requestChannel( QList<Telepathy::MediaStreamType> types );
+ bool requestStreams( TpPrototype::Contact* contact, QList<Telepathy::MediaStreamType> types );
+
/**
* Add contacts to the group.
* Multiple contacts may sharing the same stream. Use this function to invite a contact to this group. The contact will
--
1.5.6.5
More information about the telepathy-commits
mailing list