[asterisk-scf-commits] asterisk-scf/release/test_channel.git branch "fileplayback_endpoint" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Jan 3 19:17:37 UTC 2011


branch "fileplayback_endpoint" has been updated
       via  f6fee09b60934bc83a37b0acfb49a7cc2bea1c8a (commit)
      from  a881e011306db9ce9b170cb937481be007fa6730 (commit)

Summary of changes:
 src/FilePlaybackSessionEndpoint.cpp |   17 ++++++++++++++---
 src/FilePlaybackSessionEndpoint.h   |    3 ++-
 src/MediaEchoThread.cpp             |    8 --------
 3 files changed, 16 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit f6fee09b60934bc83a37b0acfb49a7cc2bea1c8a
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Jan 3 15:46:38 2011 -0330

    Resolve some issues pointed out in review feedback.

diff --git a/src/FilePlaybackSessionEndpoint.cpp b/src/FilePlaybackSessionEndpoint.cpp
index 76d9b3c..8c40467 100644
--- a/src/FilePlaybackSessionEndpoint.cpp
+++ b/src/FilePlaybackSessionEndpoint.cpp
@@ -577,6 +577,9 @@ public:
         mLogger(Debug) << __FILE__ << ':' << __LINE__ << ' ' << __FUNCTION__ << 
             " for " << AsteriskSCF::FilePlayback::getId(current);
         IceUtil::Mutex::Lock lock(mMutex);
+        //
+        // TODO: implement copy over to source to implement an "echo"
+        //
         mReceivedFrames.insert(mReceivedFrames.end(), frames.begin(), frames.end());
     }
 
@@ -648,22 +651,27 @@ public:
 
     void setController(const AsteriskSCF::RemoteControl::V1::SinkControllerPrx& controller, const Ice::Current& current)
     {
+        // TODO: 
     }
 
     void startRecording(const Ice::Current& current)
     {
+        // TODO: 
     }
 
     void stopRecording(const Ice::Current& current)
     {
+        // TODO: 
     }
 
     void copyToSink(const AsteriskSCF::Media::V1::StreamSinkPrx& destinationSink, const Ice::Current& current)
     {
+        // TODO: 
     }
     
     void reset(const Ice::Current& current)
     {
+        // TODO: 
     }
 
     void destroy(const Ice::Current& current)
@@ -731,6 +739,8 @@ public:
             mSourceControlPrx->destroy();
             mAdapter->remove(mSinkPrx->ice_getIdentity());
             mAdapter->remove(mSourcePrx->ice_getIdentity());
+            mSinkControlPrx = 0;
+            mSourceControlPrx = 0;
         }
         catch(const Ice::Exception& ex)
         {
@@ -1129,7 +1139,8 @@ AsteriskSCF::SessionCommunications::V1::SessionSeq AsteriskSCF::FilePlayback::Fi
     return result;
 }
 
-void AsteriskSCF::FilePlayback::FilePlaybackEndpointImpl::addDefaultSessionListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current)
+void AsteriskSCF::FilePlayback::FilePlaybackEndpointImpl::addDefaultSessionListener(
+  const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current)
 {
     mLogger(Debug) << __FILE__ << ':' << __LINE__ << ' ' << __FUNCTION__ << " for " << AsteriskSCF::FilePlayback::getId(current);
     if(!listener)
@@ -1146,7 +1157,8 @@ void AsteriskSCF::FilePlayback::FilePlaybackEndpointImpl::addDefaultSessionListe
     }
 }
 
-void AsteriskSCF::FilePlayback::FilePlaybackEndpointImpl::removeDefaultSessionListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current)
+void AsteriskSCF::FilePlayback::FilePlaybackEndpointImpl::removeDefaultSessionListener(
+  const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current)
 {
     mLogger(Debug) << __FILE__ << ':' << __LINE__ << ' ' << __FUNCTION__ << " for " << AsteriskSCF::FilePlayback::getId(current);
     std::cerr << __FUNCTION__ << ":" << current.adapter->getCommunicator()->identityToString(current.id) << std::endl;
@@ -1192,7 +1204,6 @@ AsteriskSCF::FilePlayback::FilePlaybackEndpoint::FilePlaybackEndpoint(const Ice:
 
 AsteriskSCF::FilePlayback::FilePlaybackEndpoint::~FilePlaybackEndpoint()
 {
-    delete mImpl;
 }
 
 AsteriskSCF::SessionCommunications::V1::SessionPrx AsteriskSCF::FilePlayback::FilePlaybackEndpoint::createSession(const std::string& destination, 
diff --git a/src/FilePlaybackSessionEndpoint.h b/src/FilePlaybackSessionEndpoint.h
index b41c404..46a96cd 100644
--- a/src/FilePlaybackSessionEndpoint.h
+++ b/src/FilePlaybackSessionEndpoint.h
@@ -21,6 +21,7 @@
 #include <RemoteControl.h>
 #include <string>
 #include <Ice/Ice.h>
+#include <boost/shared_ptr.hpp>
 
 namespace AsteriskSCF
 {
@@ -42,7 +43,7 @@ namespace FilePlayback
         void addDefaultSessionListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current);
         void removeDefaultSessionListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current);
     private:
-        FilePlaybackEndpointImpl* mImpl;
+        boost::shared_ptr<FilePlaybackEndpointImpl> mImpl;
         std::string mId;
     };
 } // End of namespace FileplayBack
diff --git a/src/MediaEchoThread.cpp b/src/MediaEchoThread.cpp
index dcd2ee7..ed0a3cd 100644
--- a/src/MediaEchoThread.cpp
+++ b/src/MediaEchoThread.cpp
@@ -40,30 +40,25 @@ void MediaEchoThread::run()
     // is done without holding the lock. A useful improvement might be to add
     // an upper limit to the number of frames that can be "queued".
     //
-    std::cerr << "entering thread" << std::endl;
     bool done = false;
     AsteriskSCF::Media::V1::FrameSeq currentFrames;
     size_t numberOfFramesWritten = 0;
     AsteriskSCF::Media::V1::StreamSinkPrx sink;
     while(!done)
     {
-        std::cerr << "looping" << std::endl;
         {
             IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
             if(mFrames.size() == 0 || mSink == 0)
             {
-                std::cerr << "no frames or no sink... continuing to wait" << std::endl;
                 mMonitor.wait();
             }
             if(mDone)
             {
-                std::cerr << "this thread is done" << std::endl;
                 done = true;
                 break;
             }
 
             sink = mSink;
-            std::cerr << "not done yet " << std::endl;
             if(numberOfFramesWritten != 0)
             {
                 mFrames.erase(mFrames.begin(), mFrames.begin() + numberOfFramesWritten);
@@ -73,7 +68,6 @@ void MediaEchoThread::run()
         }
 
         AsteriskSCF::Media::V1::FrameSeq::iterator current = currentFrames.begin();
-        std::cerr << "writing " << currentFrames.size() << " frames" << std::endl;
         while(current != currentFrames.end() && sink != 0)
         {
             AsteriskSCF::Media::V1::FrameSeq buf(current, current+1);
@@ -97,14 +91,12 @@ void MediaEchoThread::run()
             ++numberOfFramesWritten;
             ++current;
         }
-        std::cerr << "done .. going back to wait loop" << std::endl;
     }
 }
 
 void MediaEchoThread::pushFrames(const AsteriskSCF::Media::V1::FrameSeq& newFrames)
 {
     IceUtil::Monitor<IceUtil::Mutex>::Lock lock(mMonitor);
-    std::cerr << "pushing " << newFrames.size() << " frames" << std::endl;
     mFrames.insert(mFrames.end(), newFrames.begin(), newFrames.end());
     if(!mPaused && mSink != 0)
     {

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


-- 
asterisk-scf/release/test_channel.git



More information about the asterisk-scf-commits mailing list