[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "nat-traversal" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed May 18 12:03:30 CDT 2011


branch "nat-traversal" has been updated
       via  6337247bbe1fcc83a835af1e19bb9220ff955624 (commit)
      from  593969853b9dff2a4b1032ab431807c38e7e20f0 (commit)

Summary of changes:
 src/ICEConfiguration.cpp           |    8 ++++----
 src/NATConfig.cpp                  |   10 +++++-----
 src/NATModule.cpp                  |   18 +++++++++---------
 src/PJLibConfiguration.cpp         |    6 +++---
 src/PJMediaEndpoint.cpp            |    8 ++++----
 src/PJMediaEnvironment.cpp         |   18 +++++++++---------
 src/RTPICESession.cpp              |    4 ++--
 src/RtpStateReplicatorListener.cpp |    4 ++--
 src/SRTPConfiguration.cpp          |    4 ++--
 src/UDPTransport.cpp               |    3 ++-
 10 files changed, 42 insertions(+), 41 deletions(-)


- Log -----------------------------------------------------------------
commit 6337247bbe1fcc83a835af1e19bb9220ff955624
Author: Brent Eagles <beagles at digium.com>
Date:   Wed May 18 14:33:20 2011 -0230

    Fix gcc build errors

diff --git a/src/ICEConfiguration.cpp b/src/ICEConfiguration.cpp
index 2cdc1c7..52cc51b 100644
--- a/src/ICEConfiguration.cpp
+++ b/src/ICEConfiguration.cpp
@@ -24,7 +24,7 @@ ICEConfigurationPtr AsteriskSCF::PJMediaRTP::ICEConfiguration::create(const Ice:
         const string& propertyPrefix)
 {
     string prefix(propertyPrefix);
-    if (!prefix.empty() && prefix.back() != '.')
+    if (!prefix.empty() && *prefix.end() != '.')
     {
         prefix += '.';
     }
@@ -33,8 +33,8 @@ ICEConfigurationPtr AsteriskSCF::PJMediaRTP::ICEConfiguration::create(const Ice:
     return ICEConfigurationPtr(new ICEConfiguration(maxCandidates, maxCalls));
 }
 
-ICEConfiguration::ICEConfiguration(int maxCandidates, int maxCalls) :
-    mMaxCandidates(maxCandidates),
-    mMaxCalls(maxCalls)
+ICEConfiguration::ICEConfiguration(int maxCand, int maxClls) :
+    mMaxCandidates(maxCand),
+    mMaxCalls(maxClls)
 {
 }
diff --git a/src/NATConfig.cpp b/src/NATConfig.cpp
index 750118a..75b35a6 100644
--- a/src/NATConfig.cpp
+++ b/src/NATConfig.cpp
@@ -36,7 +36,7 @@ NATConfigPtr AsteriskSCF::PJMediaRTP::NATConfig::create(const Ice::PropertiesPtr
         const string& propertyPrefix)
 {
     string prefix(propertyPrefix);
-    if (!prefix.empty() && prefix.back() != '.')
+    if (!prefix.empty() && *prefix.end() != '.')
     {
         prefix += '.';
     }
@@ -55,7 +55,7 @@ NATConfigPtr AsteriskSCF::PJMediaRTP::NATConfig::create(const Ice::PropertiesPtr
     
     bool hasSTUN = true;
     Ice::Int portProperty = props->getPropertyAsIntWithDefault(prefix + "Media.STUN.Port", PJ_STUN_PORT);
-    if (portProperty > UINT_MAX)
+    if (static_cast<unsigned>(portProperty) > UINT_MAX)
     {
         logger(Warning) << "Property `Media.STUN.Port' is out of range for IP port numbers, defaulting to "
                         << PJ_STUN_PORT;
@@ -92,10 +92,10 @@ NATConfigPtr AsteriskSCF::PJMediaRTP::NATConfig::create(const Ice::PropertiesPtr
     return NATConfigPtr(new NATConfig(stunAddress, turnAddress, hasSTUN, hasTURN));
 }
 
-NATConfig::NATConfig(const AddressPtr& stunServer, const AddressPtr& turnServer,
+NATConfig::NATConfig(const AddressPtr& stun, const AddressPtr& turn,
         bool enableSTUN, bool enableTURN) :
-    mSTUNServer(stunServer),
-    mTURNServer(turnServer),
+    mSTUNServer(stun),
+    mTURNServer(turn),
     mSTUNEnabled(enableSTUN),
     mTURNEnabled(enableTURN)
 {
diff --git a/src/NATModule.cpp b/src/NATModule.cpp
index 2e5e373..06317b1 100644
--- a/src/NATModule.cpp
+++ b/src/NATModule.cpp
@@ -24,27 +24,27 @@ using namespace AsteriskSCF::PJMediaRTP;
 using namespace AsteriskSCF::System::V1;
 using namespace AsteriskSCF::PJUtil;
 
-NATModulePtr AsteriskSCF::PJMediaRTP::NATModule::create(const PJMediaEnvironmentPtr& environ,
+NATModulePtr AsteriskSCF::PJMediaRTP::NATModule::create(const PJMediaEnvironmentPtr& env,
     const PJMediaEndpointPtr& endpoint)
 {
     boost::shared_ptr<pj_ice_strans_cfg> transcfg(new pj_ice_strans_cfg);
     pj_ice_strans_cfg_default(transcfg.get());
-    pj_stun_config_init(&transcfg->stun_cfg, environ->poolFactory(), 0,
+    pj_stun_config_init(&transcfg->stun_cfg, env->poolFactory(), 0,
             pjmedia_endpt_get_ioqueue(endpoint->endpoint()), 0);
-    pj_status_t result = pj_timer_heap_create(environ->memoryPool(), environ->libConfig()->timerHeapSize(),
+    pj_status_t result = pj_timer_heap_create(env->memoryPool(), env->libConfig()->timerHeapSize(),
             &transcfg->stun_cfg.timer_heap);
     if (fail(result))
     {
         throw InternalInitializationException("Unable to initialize tier heap.");
     }
 
-    pj_strdup2(environ->memoryPool(), &transcfg->stun.server, environ->natConfig()->stunServer()->hostname().c_str());
-    transcfg->stun.port = environ->natConfig()->stunServer()->port();
-    transcfg->stun.max_host_cands = environ->ICEConfig()->maxCandidates();
-    if (environ->natConfig()->isTURNEnabled())
+    pj_strdup2(env->memoryPool(), &transcfg->stun.server, env->natConfig()->stunServer()->hostname().c_str());
+    transcfg->stun.port = static_cast<pj_uint16_t>(env->natConfig()->stunServer()->port());
+    transcfg->stun.max_host_cands = env->ICEConfig()->maxCandidates();
+    if (env->natConfig()->isTURNEnabled())
     {
-        pj_strdup2(environ->memoryPool(), &transcfg->turn.server, environ->natConfig()->turnServer()->hostname().c_str());
-        transcfg->turn.port = environ->natConfig()->turnServer()->port();
+        pj_strdup2(env->memoryPool(), &transcfg->turn.server, env->natConfig()->turnServer()->hostname().c_str());
+        transcfg->turn.port = static_cast<pj_uint16_t>(env->natConfig()->turnServer()->port());
     }
 
     NATModulePtr moduleObj(new NATModule(transcfg));
diff --git a/src/PJLibConfiguration.cpp b/src/PJLibConfiguration.cpp
index 62018ff..d8eeb49 100644
--- a/src/PJLibConfiguration.cpp
+++ b/src/PJLibConfiguration.cpp
@@ -24,7 +24,7 @@ PJLibConfigurationPtr AsteriskSCF::PJMediaRTP::PJLibConfiguration::create(const
         const string& propertyPrefix)
 {
     string prefix(propertyPrefix);
-    if (!prefix.empty() && prefix.back() != '.')
+    if (!prefix.empty() && *prefix.end() != '.')
     {
         prefix  += '.';
     }
@@ -32,7 +32,7 @@ PJLibConfigurationPtr AsteriskSCF::PJMediaRTP::PJLibConfiguration::create(const
     return PJLibConfigurationPtr(new PJLibConfiguration(timerHeapSize));
 }
 
-PJLibConfiguration::PJLibConfiguration(int timerHeapSize) :
-    mTimerHeapSize(timerHeapSize)
+PJLibConfiguration::PJLibConfiguration(int heapSize) :
+    mTimerHeapSize(heapSize)
 {
 }
diff --git a/src/PJMediaEndpoint.cpp b/src/PJMediaEndpoint.cpp
index 4794bfc..96d192c 100644
--- a/src/PJMediaEndpoint.cpp
+++ b/src/PJMediaEndpoint.cpp
@@ -28,10 +28,10 @@ PJMediaEndpoint::~PJMediaEndpoint()
     pjmedia_endpt_destroy(mEndpoint);
 }
 
-PJMediaEndpointPtr AsteriskSCF::PJMediaRTP::PJMediaEndpoint::create(const PJMediaEnvironmentPtr& environ)
+PJMediaEndpointPtr AsteriskSCF::PJMediaRTP::PJMediaEndpoint::create(const PJMediaEnvironmentPtr& env)
 {
     pjmedia_endpt* t;
-    pj_status_t result =  pjmedia_endpt_create(environ->poolFactory(), 0, 1, &t);
+    pj_status_t result =  pjmedia_endpt_create(env->poolFactory(), 0, 1, &t);
     if (fail(result))
     {
         throw InternalInitializationException("Unable to create media endpoint!");
@@ -39,7 +39,7 @@ PJMediaEndpointPtr AsteriskSCF::PJMediaRTP::PJMediaEndpoint::create(const PJMedi
     return PJMediaEndpointPtr(new PJMediaEndpoint(t));
 }
 
-PJMediaEndpoint::PJMediaEndpoint(pjmedia_endpt* endpoint) :
-    mEndpoint(endpoint)
+PJMediaEndpoint::PJMediaEndpoint(pjmedia_endpt* endpt) :
+    mEndpoint(endpt)
 {
 }
diff --git a/src/PJMediaEnvironment.cpp b/src/PJMediaEnvironment.cpp
index 2596180..7ef9540 100644
--- a/src/PJMediaEnvironment.cpp
+++ b/src/PJMediaEnvironment.cpp
@@ -15,7 +15,7 @@
  */
 
 #include "PJMediaEnvironment.h"
-#include <ICE/Properties.h>
+#include <Ice/Properties.h>
 #include <pjlib.h>
 #include <pjmedia.h>
 #include <pjnath.h>
@@ -36,14 +36,14 @@ PJMediaEnvironmentPtr AsteriskSCF::PJMediaRTP::PJMediaEnvironment::create(const
                 SRTPConfiguration::create(props, propertyPrefix)));
 }
 
-PJMediaEnvironment::PJMediaEnvironment(const PJLibConfigurationPtr& libConfig,
-        const ICEConfigurationPtr& iceConfig,
-        const NATConfigPtr& natConfig,
-        const SRTPConfigurationPtr& srtpConfig) :
-    mPJLibConfig(libConfig),
-    mICEConfig(iceConfig),
-    mNATConfig(natConfig),
-    mSRTPConfig(srtpConfig),
+PJMediaEnvironment::PJMediaEnvironment(const PJLibConfigurationPtr& libCfg,
+        const ICEConfigurationPtr& iceCfg,
+        const NATConfigPtr& natCfg,
+        const SRTPConfigurationPtr& srtpCfg) :
+    mPJLibConfig(libCfg),
+    mICEConfig(iceCfg),
+    mNATConfig(natCfg),
+    mSRTPConfig(srtpCfg),
     mCachingPool(new pj_caching_pool)
 {
     pj_caching_pool_init(mCachingPool.get(), & pj_pool_factory_default_policy, 0);
diff --git a/src/RTPICESession.cpp b/src/RTPICESession.cpp
index 48d064e..e7498f8 100644
--- a/src/RTPICESession.cpp
+++ b/src/RTPICESession.cpp
@@ -238,9 +238,9 @@ RTPSessionImpl::RTPSessionImpl(const Ice::ObjectAdapterPtr& adapter, const Forma
     mAdapter(adapter),
     mFormats(formats),
     mMediaEnvironment(environment),
+    mEndpoint(PJMediaEndpoint::create(environment)),
     mReplicator(replicator),
     mReplicaControl(replicaControl),
-    mEndpoint(PJMediaEndpoint::create(environment)),
     mId(id),
     mSessionStateItem(new RtpSessionStateItem)
 {
@@ -322,7 +322,7 @@ RTCPSessionPrx RTPSessionImpl::getRTCPSession(const Ice::Current&)
     return RTCPSessionPrx();
 }
 
-void RTPSessionImpl::release(const Ice::Current& current)
+void RTPSessionImpl::release(const Ice::Current&)
 {
     destroy();
 }
diff --git a/src/RtpStateReplicatorListener.cpp b/src/RtpStateReplicatorListener.cpp
index 2411c9c..00f1831 100644
--- a/src/RtpStateReplicatorListener.cpp
+++ b/src/RtpStateReplicatorListener.cpp
@@ -59,9 +59,9 @@ private:
 struct RtpStateReplicatorListenerImpl
 {
 public:
-    RtpStateReplicatorListenerImpl(const Ice::ObjectAdapterPtr& adapter, const PJMediaEnvironmentPtr& environ,
+    RtpStateReplicatorListenerImpl(const Ice::ObjectAdapterPtr& adapter, const PJMediaEnvironmentPtr& env,
             const RtpGeneralStateItemPtr& generalState)
-        : mId(IceUtil::generateUUID()), mAdapter(adapter), mEnvironment(environ), mGeneralState(generalState) 
+        : mId(IceUtil::generateUUID()), mAdapter(adapter), mEnvironment(env), mGeneralState(generalState) 
     {
     }
     
diff --git a/src/SRTPConfiguration.cpp b/src/SRTPConfiguration.cpp
index 74d3ab1..6b8e5a7 100644
--- a/src/SRTPConfiguration.cpp
+++ b/src/SRTPConfiguration.cpp
@@ -20,11 +20,11 @@
 using namespace std;
 using namespace AsteriskSCF::PJMediaRTP;
 
-SRTPConfigurationPtr AsteriskSCF::PJMediaRTP::SRTPConfiguration::create(const Ice::PropertiesPtr& props,
+SRTPConfigurationPtr AsteriskSCF::PJMediaRTP::SRTPConfiguration::create(const Ice::PropertiesPtr&,
         const string& propertyPrefix)
 {
     string prefix(propertyPrefix);
-    if (!prefix.empty() && prefix.back() != '.')
+    if (!prefix.empty() && *prefix.end() != '.')
     {
         prefix += '.';
     }
diff --git a/src/UDPTransport.cpp b/src/UDPTransport.cpp
index f33f218..9b60e97 100644
--- a/src/UDPTransport.cpp
+++ b/src/UDPTransport.cpp
@@ -29,7 +29,8 @@ using namespace AsteriskSCF::PJUtil;
 UDPTransportPtr AsteriskSCF::PJMediaRTP::UDPTransport::create(const PJMediaEndpointPtr& ep, long port)
 {
     pjmedia_transport* transport;
-    pj_status_t result = pjmedia_transport_udp_create2(ep->endpoint(), "RTP", 0, port, 0, &transport);
+    pj_status_t result = pjmedia_transport_udp_create2(ep->endpoint(), "RTP", 0, static_cast<unsigned>(port), 0,
+            &transport);
     if (fail(result))
     {
         throw InternalInitializationException("Unable to initialize UDP media transport on "

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


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list