[asterisk-scf-commits] asterisk-scf/release/media_rtp_pjmedia.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Apr 15 09:11:49 CDT 2011


branch "master" has been updated
       via  6359f9d3d8edea8e3b27dfa59bc81deb1a9d2fc0 (commit)
       via  d49f78113d8222ec5b2a7a530332ec78962c9031 (commit)
      from  85553b42ab3952da5bc79b551aa1f1010b0c6f85 (commit)

Summary of changes:
 src/MediaRTPpjmedia.cpp       |    6 +++---
 src/RTPSession.cpp            |    2 +-
 src/RTPSession.h              |    2 +-
 src/RTPSink.cpp               |    4 ++--
 src/RTPSource.cpp             |   11 +++++++----
 src/RTPSource.h               |    2 +-
 src/RtpStateReplicatorApp.cpp |    4 ++--
 test/TestRTPpjmedia.cpp       |   12 ++++++------
 8 files changed, 23 insertions(+), 20 deletions(-)


- Log -----------------------------------------------------------------
commit 6359f9d3d8edea8e3b27dfa59bc81deb1a9d2fc0
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Apr 14 14:42:03 2011 -0500

    Resolve another unused variable warning.

diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index 8bebcb7..3c0539a 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -218,7 +218,7 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
             {
                 source->mImpl->mSourceStateItem->mSink->write(frames);
             }
-            catch (const Ice::Exception& ex)
+            catch (const Ice::Exception&)
             {
                 lg(Error) << "Exception caught while attempting to write media to an RTP sink";
             }

commit d49f78113d8222ec5b2a7a530332ec78962c9031
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Apr 14 13:25:27 2011 -0500

    Minor fixes for various code constructs that trip up GCC with new warning
    options enabled (-Wextra, -Wconversion, -Wformat, and others).

diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
index f041e4f..3c1343e 100644
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@ -351,8 +351,8 @@ RTPSessionPrx RTPMediaServiceImpl::allocate(const FormatSeq& formats, const Ice:
 /**
  * Implementation of the IceBox::Service::start method.
  */
-void MediaRTPpjmediaApp::start(const std::string& name, const Ice::CommunicatorPtr& communicator,
-        const Ice::StringSeq& args)
+void MediaRTPpjmediaApp::start(const std::string&, const Ice::CommunicatorPtr& communicator,
+        const Ice::StringSeq&)
 {
     // we need a logger before we're ready to build the real communicator.
     // use the one we're provided to create the IceLogger.
@@ -490,7 +490,7 @@ void MediaRTPpjmediaApp::stop()
 
 extern "C"
 {
-ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new MediaRTPpjmediaApp;
 }
diff --git a/src/RTPSession.cpp b/src/RTPSession.cpp
index d4e0381..2ab6074 100644
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@ -342,7 +342,7 @@ FormatSeq RTPSessionImpl::getFormats()
 /**
  * API call which calls into RTPSourceImpl in order to setup transport.
  */
-void RTPSessionImpl::setRemoteDetails(const string& address, int port)
+void RTPSessionImpl::setRemoteDetails(const string& address, Ice::Int port)
 {
     mImpl->mStreamSource->setRemoteDetails(address, port);
 }
diff --git a/src/RTPSession.h b/src/RTPSession.h
index 4929906..a8e4b7a 100644
--- a/src/RTPSession.h
+++ b/src/RTPSession.h
@@ -56,7 +56,7 @@ public:
     pjmedia_transport* getTransport();
     AsteriskSCF::Media::V1::FormatSeq getFormats();
     void associatePayloads(const AsteriskSCF::Media::RTP::V1::PayloadMap&, const Ice::Current&);
-    void setRemoteDetails(const std::string& address, int port);
+    void setRemoteDetails(const std::string& address, Ice::Int port);
     AsteriskSCF::Media::V1::FormatPtr getFormat(int payload);
     int getPayload(const AsteriskSCF::Media::V1::FormatPtr& mediaformat);
     StreamSourceRTPImplPtr getSource();
diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index 2324799..fb612cb 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -115,8 +115,8 @@ void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, co
 
         /* Using the available information construct an RTP header that we can place at the front of our packet */
         pj_status_t status = pjmedia_rtp_encode_rtp(&mImpl->mOutgoingSession,
-                mImpl->mSession->getPayload((*frame)->mediaformat), 0, (*frame)->payload.size(),
-            (*frame)->payload.size(), &header, &header_len);
+						    mImpl->mSession->getPayload((*frame)->mediaformat), 0, (int) (*frame)->payload.size(),
+						    (int) (*frame)->payload.size(), &header, &header_len);
 
         if (status != PJ_SUCCESS)
         {
diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index 9d45920..8bebcb7 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -176,7 +176,10 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
     Ice::Byte* payload;
     unsigned int payload_size;
 
-    pj_status_t status = pjmedia_rtp_decode_rtp(&source->mImpl->mIncomingSession, packet, size, &header,
+    /* We have to cast 'size' to an 'int' here so the compiler won't warn about
+     * doing it implicitly.
+     */
+    pj_status_t status = pjmedia_rtp_decode_rtp(&source->mImpl->mIncomingSession, packet, (int) size, &header,
             (const void**)&payload, &payload_size);
 
     if (status != PJ_SUCCESS)
@@ -229,7 +232,7 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
 /**
  * API call which sets up our pjmedia transport and allows media to be sent and received.
  */
-void StreamSourceRTPImpl::setRemoteDetails(const string& address, int port)
+void StreamSourceRTPImpl::setRemoteDetails(const string& address, Ice::Int port)
 {
     pj_sockaddr_in sin;
 
@@ -238,7 +241,7 @@ void StreamSourceRTPImpl::setRemoteDetails(const string& address, int port)
     pj_strset(&tmpAddress, (char*)address.c_str(), address.size());
 
     /* Now for the next trick - convert into a pj_sockaddr_in so we can pass it to pjmedia_transport_attach */
-    pj_sockaddr_in_init(&sin, &tmpAddress, port);
+    pj_sockaddr_in_init(&sin, &tmpAddress, (pj_uint16_t) port);
 
     /* In case we were already attached go ahead and detach */
     pjmedia_transport_detach(mImpl->mSession->getTransport(), this);
diff --git a/src/RTPSource.h b/src/RTPSource.h
index d7373e7..d12bc48 100644
--- a/src/RTPSource.h
+++ b/src/RTPSource.h
@@ -29,7 +29,7 @@ public:
     void requestFormat(const AsteriskSCF::Media::V1::FormatPtr&, const Ice::Current&);
     std::string getLocalAddress(const Ice::Current&);
     Ice::Int getLocalPort(const Ice::Current&);
-    void setRemoteDetails(const std::string& address, int port);
+    void setRemoteDetails(const std::string& address, Ice::Int port);
     AsteriskSCF::Media::RTP::V1::RtpStreamSourceStateItemPtr getStateItem();
 
     /**
diff --git a/src/RtpStateReplicatorApp.cpp b/src/RtpStateReplicatorApp.cpp
index 91c0e37..78e8ae1 100644
--- a/src/RtpStateReplicatorApp.cpp
+++ b/src/RtpStateReplicatorApp.cpp
@@ -213,7 +213,7 @@ void RtpStateReplicatorService::initialize(const string& appName, const Ice::Com
     mAdapter->activate();
 }
 
-void RtpStateReplicatorService::start(const string &name, const Ice::CommunicatorPtr& ic, const Ice::StringSeq& args)
+void RtpStateReplicatorService::start(const string &name, const Ice::CommunicatorPtr& ic, const Ice::StringSeq&)
 {
     initialize(name, ic);
     // Plug into the Asterisk SCF discovery system so that the interfaces we provide
@@ -229,7 +229,7 @@ void RtpStateReplicatorService::stop()
 
 extern "C"
 {
-ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new RtpStateReplicatorService;
 }
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 7432c04..211297c 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -135,7 +135,7 @@ public:
 };
 static SharedTestData Testbed;
 
-void TestRtpReplicatorListener::stateRemoved(const Ice::StringSeq& items, const Ice::Current&)
+void TestRtpReplicatorListener::stateRemoved(const Ice::StringSeq&, const Ice::Current&)
 {
 }
 
@@ -1041,9 +1041,9 @@ BOOST_AUTO_TEST_CASE(ReleaseRTPSession)
     BOOST_CHECK(released);
 }
 
-void MediaRTPpjmediaTest::start(std::string const &name,
-    Ice::CommunicatorPtr const &communicator,
-    Ice::StringSeq const &args)
+void MediaRTPpjmediaTest::start(std::string const& name,
+    Ice::CommunicatorPtr const&,
+    Ice::StringSeq const& args)
 {
     std::vector<char const *> argv;
     argv.push_back(name.c_str());
@@ -1052,11 +1052,11 @@ void MediaRTPpjmediaTest::start(std::string const &name,
          ++i)
     {
         argv.push_back(i->c_str());
+	mCachedArgs.argc++;
     }
     // null terminated list
     argv.push_back((const char *) 0);
 
-    mCachedArgs.argc = argv.size() - 1;
     mCachedArgs.argv = (char**)&argv[0];
 
     int r = ::boost::unit_test::unit_test_main(&init_unit_test, mCachedArgs.argc, mCachedArgs.argv);
@@ -1069,7 +1069,7 @@ void MediaRTPpjmediaTest::stop()
 
 extern "C"
 {
-IceBox::Service* create(Ice::CommunicatorPtr communicator)
+IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new MediaRTPpjmediaTest;
 }

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


-- 
asterisk-scf/release/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list