[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "directmedia" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jul 28 15:39:06 CDT 2011


branch "directmedia" has been updated
       via  0d72a5accb9a61eb618f138e06371feeba799d9f (commit)
       via  82d492d4935250a028767f0027a84ac0e6edcb31 (commit)
       via  0829fde7d17b421e5629c68a623bbd1c994261f2 (commit)
       via  4f9a2af161c1737f8c211024c7eb4a5a92a1831a (commit)
       via  8b9f7f7c789d01a56bb3a2a1535b72a17f3d688a (commit)
      from  36db8f6907892ff78b3e7a6a1d1b777001e40371 (commit)

Summary of changes:
 src/BridgeImpl.cpp        |   50 ++++++++++++++++++++++++++++++++++++++++++++-
 src/MediaSplicer.cpp      |    6 ++--
 src/SessionOperations.cpp |   14 ++++++++++-
 src/SessionOperations.h   |   16 ++++++++++++++
 4 files changed, 80 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit 0d72a5accb9a61eb618f138e06371feeba799d9f
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Jul 28 17:38:41 2011 -0300

    When streams present in a bridge are changed completely reorganize media splices.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 9903c87..1039be3 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -509,6 +509,49 @@ private:
     BridgeImplPtr mBridge;
 };
 
+class UnplugMedia : public QueuedTask
+{
+public:
+    UnplugMedia(const BridgeImplPtr& bridge) :
+        QueuedTask("UnplugMedia"),
+        mBridge(bridge)
+        {
+        }
+
+protected:
+    bool executeImpl()
+    {
+        UnplugMediaOperation op;
+        mBridge->getSessions()->visitSessions(op);
+        return true;
+    }
+
+private:
+    BridgeImplPtr mBridge;
+};
+
+class SetupMedia : public QueuedTask
+{
+public:
+    SetupMedia(const BridgeImplPtr& bridge) :
+        QueuedTask("SetupMedia"),
+        mBridge(bridge)
+        {
+        }
+
+protected:
+    bool executeImpl()
+    {
+        SetupMediaOperation op;
+        mBridge->getSessions()->visitSessions(op);
+        return true;
+    }
+
+private:
+    BridgeImplPtr mBridge;
+};
+
+
 class AddToListeners : public QueuedTask
 {
 public:
@@ -689,10 +732,12 @@ void BridgeImpl::addSessions_async(const AMD_Bridge_addSessionsPtr& callback, co
 
         SessionsTrackerPtr tracker(new SessionsTracker);
         QueuedTasks tasks;
+        tasks.push_back(new UnplugMedia(this));
         tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, sessions, tracker));
         tasks.push_back(new AddToListeners(mListeners, tracker, getCookies()));
 	tasks.push_back(new SetAndGetSessionControllerTask(mObjAdapter, mSessions, sessions, this));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_addSessionsPtr>(callback, tracker));
+        tasks.push_back(new SetupMedia(this));
         tasks.push_back(new UpdateTask(this));
         ExecutorPtr executor(new Executor(tasks, mLogger));
         executor->start();
@@ -954,10 +999,12 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
             cookies = getCookies();
         }
         tasks.push_back(new RemoveSessionsNotify(mListeners, removeTracker, cookies));
+        tasks.push_back(new UnplugMedia(this));
         tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, newSessions, tracker));
         tasks.push_back(new AddToListeners(mListeners, tracker, cookies));
 	tasks.push_back(new SetAndGetSessionControllerTask(mObjAdapter, mSessions, newSessions, this));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_replaceSessionPtr>(callback, tracker));
+        tasks.push_back(new SetupMedia(this));
         tasks.push_back(new UpdateTask(this));
         ExecutorPtr executor(new Executor(tasks, mLogger));
         executor->start();
@@ -1165,9 +1212,11 @@ void BridgeImpl::getAddSessionsTasks(QueuedTasks& tasks,
         const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions)
 {
     SessionsTrackerPtr tracker(new SessionsTracker);
+    tasks.push_back(new UnplugMedia(this));
     tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, sessions, tracker));
     tasks.push_back(new AddToListeners(mListeners, tracker, getCookies()));
     tasks.push_back(new SetAndGetSessionControllerTask(mObjAdapter, mSessions, sessions, this));
+    tasks.push_back(new SetupMedia(this));
     tasks.push_back(new UpdateTask(this));
 }
 
diff --git a/src/SessionOperations.cpp b/src/SessionOperations.cpp
index 26074ed..00d3e70 100644
--- a/src/SessionOperations.cpp
+++ b/src/SessionOperations.cpp
@@ -23,6 +23,16 @@ using namespace AsteriskSCF::Replication::BridgeService::V1;
 using namespace AsteriskSCF;
 using namespace std;
 
+void UnplugMediaOperation::operator()(const SessionWrapperPtr& s)
+{
+    s->unplugMedia();
+}
+
+void SetupMediaOperation::operator()(const SessionWrapperPtr& s)
+{
+    s->setupMedia();
+}
+
 ConnectSessionOperation::ConnectSessionOperation(const SessionPrx& exclude, const Logger& logger) :
     mExclude(exclude->ice_getIdentity()),
     mLogger(logger)
diff --git a/src/SessionOperations.h b/src/SessionOperations.h
index b3b932d..69f79c7 100644
--- a/src/SessionOperations.h
+++ b/src/SessionOperations.h
@@ -27,6 +27,22 @@ namespace AsteriskSCF
 namespace BridgeService
 {
 
+class UnplugMediaOperation : public std::unary_function<SessionWrapperPtr, void>
+{
+public:
+    void operator()(const SessionWrapperPtr& wrapper);
+
+private:
+};
+
+class SetupMediaOperation : public std::unary_function<SessionWrapperPtr, void>
+{
+public:
+    void operator()(const SessionWrapperPtr& wrapper);
+
+private:
+};
+
 class ConnectSessionOperation : public std::unary_function<SessionWrapperPtr, void>
 {
 public:

commit 82d492d4935250a028767f0027a84ac0e6edcb31
Merge: 8b9f7f7 0829fde
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Jul 28 17:34:19 2011 -0300

    Merge branch 'sessioncontroller' into directmedia


commit 0829fde7d17b421e5629c68a623bbd1c994261f2
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Jul 28 16:53:14 2011 -0300

    General cleanup.

diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index f3e16a7..a6a0a1e 100755
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -90,9 +90,9 @@ public:
             const std::string& sessionId,
             const ReplicatorSmartPrx& replicator,
             const Logger& logger) :
-        mStreams(data->streams),
         mOutgoing(data->outgoingPairings),
         mIncoming(data->incomingPairings),
+        mStreams(data->streams),
         mPeer(data->peer), 
         mConnected(true),
         mBridgeId(bridgeId),
@@ -164,7 +164,7 @@ public:
     }
 
     void update(const MediaConnectorPtr& peer, const OutgoingPairings& outgoing,
-                const IncomingPairings& incoming, const std::map<std::string, std::string>& connections)
+                const IncomingPairings& incoming, const std::map<std::string, std::string>& newConnections)
     {
         mLogger(Debug) << FUNLOG << ": establishing a new peer connection.";
         SessionPairingPtr currentState;
@@ -173,7 +173,7 @@ public:
             mPeer = peer;
             mOutgoing = outgoing;
             mIncoming = incoming;
-            mConnections = connections;
+            mConnections = newConnections;
             currentState = createUpdate();
         }
         pushUpdate(currentState);
diff --git a/src/SessionOperations.cpp b/src/SessionOperations.cpp
index 75a74ab..26074ed 100644
--- a/src/SessionOperations.cpp
+++ b/src/SessionOperations.cpp
@@ -151,7 +151,7 @@ void AddStreamsOperation::added(const AsteriskSCF::Media::V1::StreamInformationD
     mCb->ice_response(streams);
 }
 
-void AddStreamsOperation::failed(const Ice::Exception& ex, const SessionWrapperPtr& session)
+void AddStreamsOperation::failed(const Ice::Exception&, const SessionWrapperPtr&)
 {
     // Since this failed tell the session that initiated this operation that no streams were added
     mCb->ice_response(AsteriskSCF::Media::V1::StreamInformationDict());
@@ -216,6 +216,6 @@ void RemoveStreamsOperation::removed(const SessionWrapperPtr& session)
     mSelf->setupMedia();
 }
 
-void RemoveStreamsOperation::failed(const Ice::Exception& ex, const SessionWrapperPtr& session)
+void RemoveStreamsOperation::failed(const Ice::Exception&, const SessionWrapperPtr&)
 {
 }

commit 8b9f7f7c789d01a56bb3a2a1535b72a17f3d688a
Author: Joshua Colp <jcolp at digium.com>
Date:   Thu Jul 28 14:41:50 2011 -0300

    Remove duplicate task.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index b446609..9903c87 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -690,7 +690,6 @@ void BridgeImpl::addSessions_async(const AMD_Bridge_addSessionsPtr& callback, co
         SessionsTrackerPtr tracker(new SessionsTracker);
         QueuedTasks tasks;
         tasks.push_back(new SetBridgeTask(mSessions, mPrx, mSessionListenerPrx, sessions, tracker));
-	tasks.push_back(new SetAndGetSessionControllerTask(mObjAdapter, mSessions, sessions, this));
         tasks.push_back(new AddToListeners(mListeners, tracker, getCookies()));
 	tasks.push_back(new SetAndGetSessionControllerTask(mObjAdapter, mSessions, sessions, this));
         tasks.push_back(new GenericAMDCallback<AMD_Bridge_addSessionsPtr>(callback, tracker));

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list