[asterisk-scf-commits] asterisk-scf/integration/mediatransportudptl.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Sep 14 15:52:44 CDT 2011
branch "master" has been updated
via e61c003055af95a5f85e914bf5f8ca6f194b2a23 (commit)
via 4a19166ef5adbbab79d047e3b99206867e804032 (commit)
from c73458833b9606dcf0ec6e9e7cf266b99d4d7cc6 (commit)
Summary of changes:
src/Component.cpp | 2 +-
src/UDPTLSession.cpp | 7 +++++--
src/UDPTLSink.cpp | 45 ++++++++++++++++++++++++++++++++++++++++-----
src/UDPTLSink.h | 7 ++++++-
src/UDPTLSource.cpp | 14 +++++++++-----
src/UDPTLSource.h | 5 ++++-
6 files changed, 65 insertions(+), 15 deletions(-)
- Log -----------------------------------------------------------------
commit e61c003055af95a5f85e914bf5f8ca6f194b2a23
Author: Joshua Colp <jcolp at digium.com>
Date: Wed Sep 14 17:58:07 2011 -0300
Pass the UDPTL stack into the source and sink.
diff --git a/src/Component.cpp b/src/Component.cpp
index e4a9be8..cbf51e1 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -108,7 +108,7 @@ class Component : public AsteriskSCF::Component::Component
{
public:
Component() :
- AsteriskSCF::Component::Component(lg, AsteriskSCF::Media::RTP::V1::ComponentServiceDiscoveryCategory),
+ AsteriskSCF::Component::Component(lg, AsteriskSCF::Media::UDPTL::V1::ComponentServiceDiscoveryCategory),
mListeningToReplicator(false), mGeneralState(new UdptlGeneralStateItem()) { mGeneralState->key = IceUtil::generateUUID(); };
private:
diff --git a/src/UDPTLSession.cpp b/src/UDPTLSession.cpp
index 0a89ce9..4545629 100644
--- a/src/UDPTLSession.cpp
+++ b/src/UDPTLSession.cpp
@@ -412,8 +412,8 @@ UDPTLSessionPrx UDPTLSessionImpl::activate(const Ice::Identity& id, const Ice::I
mSessionAdapter.reset(new SessionAdapterImpl(this));
try
{
- mStreamSource = new StreamSourceUDPTLImpl(mSessionAdapter, mTransport, mId);
- mStreamSink = new StreamSinkUDPTLImpl(mSessionAdapter, mTransport, mId);
+ mStreamSource = new StreamSourceUDPTLImpl(mSessionAdapter, mTransport, mId, mUdptl);
+ mStreamSink = new StreamSinkUDPTLImpl(mSessionAdapter, mTransport, mId, mUdptl);
mStreamSourceProxy = StreamSourceUDPTLPrx::uncheckedCast(mAdapter->add(mStreamSource, sourceId));
mStreamSinkProxy = StreamSinkUDPTLPrx::uncheckedCast(mAdapter->add(mStreamSink, sinkId));
diff --git a/src/UDPTLSink.cpp b/src/UDPTLSink.cpp
index 4b3f42e..7731bd1 100644
--- a/src/UDPTLSink.cpp
+++ b/src/UDPTLSink.cpp
@@ -47,7 +47,8 @@ public:
*/
StreamSinkUDPTLImplPriv(const SessionAdapterPtr& sessionAdapter,
const PJMediaTransportPtr& transport,
- const std::string&);
+ const std::string&,
+ struct udptl *udptl);
/**
* A pointer to the UDPTL session we are associated with.
@@ -80,11 +81,13 @@ public:
*/
StreamSinkUDPTLImplPriv::StreamSinkUDPTLImplPriv(const SessionAdapterPtr& session,
const PJMediaTransportPtr& transport,
- const string& sessionId) :
+ const string& sessionId,
+ struct udptl *udptl) :
mSessionAdapter(session),
mTransport(transport),
mSinkStateItem(new UdptlStreamSinkStateItem),
- mSessionId(sessionId)
+ mSessionId(sessionId),
+ mUdptl(udptl)
{
mSinkStateItem->sessionId = sessionId;
mSinkStateItem->key = IceUtil::generateUUID();
@@ -96,8 +99,9 @@ StreamSinkUDPTLImplPriv::StreamSinkUDPTLImplPriv(const SessionAdapterPtr& sessio
*/
StreamSinkUDPTLImpl::StreamSinkUDPTLImpl(const SessionAdapterPtr& session,
const PJMediaTransportPtr& transport,
- const string& sessionId) :
- mImpl(new StreamSinkUDPTLImplPriv(session, transport, sessionId))
+ const string& sessionId,
+ struct udptl *udptl) :
+ mImpl(new StreamSinkUDPTLImplPriv(session, transport, sessionId, udptl))
{
}
diff --git a/src/UDPTLSink.h b/src/UDPTLSink.h
index 6fb5213..d609ded 100644
--- a/src/UDPTLSink.h
+++ b/src/UDPTLSink.h
@@ -13,6 +13,8 @@
#include <boost/shared_ptr.hpp>
#include <IceUtil/Handle.h>
+#include "udptl.h"
+
/**
* Forward definition for our private implementation of StreamSinkUDPTL.
*/
@@ -26,7 +28,8 @@ class StreamSinkUDPTLImpl : public AsteriskSCF::Media::UDPTL::V1::StreamSinkUDPT
public:
StreamSinkUDPTLImpl(const AsteriskSCF::UDPTL::SessionAdapterPtr& sessionAdapter,
const AsteriskSCF::UDPTL::PJMediaTransportPtr& transport,
- const std::string& sessionId);
+ const std::string& sessionId,
+ struct udptl*);
/**
* AsteriskSCF::Media::UDPTL::V1::StreamSinkUDPTL implementation.
diff --git a/src/UDPTLSource.cpp b/src/UDPTLSource.cpp
index 7ea4060..55d385e 100644
--- a/src/UDPTLSource.cpp
+++ b/src/UDPTLSource.cpp
@@ -57,7 +57,8 @@ public:
*/
StreamSourceUDPTLImplPriv(const SessionAdapterPtr& sessionAdapter,
const PJMediaTransportPtr& transport,
- const string& parentSessionId
+ const string& parentSessionId,
+ struct udptl *udptl
);
/**
@@ -93,11 +94,13 @@ public:
*/
StreamSourceUDPTLImplPriv::StreamSourceUDPTLImplPriv(const SessionAdapterPtr& session,
const PJMediaTransportPtr& transport,
- const string& sessionId) :
+ const string& sessionId,
+ struct udptl *udptl) :
mSessionAdapter(session),
mTransport(transport),
mSourceStateItem(new UdptlStreamSourceStateItem),
- mSessionId(sessionId)
+ mSessionId(sessionId),
+ mUdptl(udptl)
{
mSourceStateItem->sessionId = sessionId;
mSourceStateItem->key = IceUtil::generateUUID();
@@ -108,8 +111,9 @@ StreamSourceUDPTLImplPriv::StreamSourceUDPTLImplPriv(const SessionAdapterPtr& se
*/
StreamSourceUDPTLImpl::StreamSourceUDPTLImpl(const SessionAdapterPtr& session,
const PJMediaTransportPtr& transport,
- const string& sessionId) :
- mImpl(new StreamSourceUDPTLImplPriv(session, transport, sessionId))
+ const string& sessionId,
+ struct udptl *udptl) :
+ mImpl(new StreamSourceUDPTLImplPriv(session, transport, sessionId, udptl))
{
}
diff --git a/src/UDPTLSource.h b/src/UDPTLSource.h
index 64c58af..20c0679 100644
--- a/src/UDPTLSource.h
+++ b/src/UDPTLSource.h
@@ -13,6 +13,8 @@
#include <boost/shared_ptr.hpp>
#include <IceUtil/Handle.h>
+#include "udptl.h"
+
/**
* Forward definition for our private implementation of StreamSourceUDPTL.
*/
@@ -26,7 +28,8 @@ class StreamSourceUDPTLImpl : public AsteriskSCF::Media::UDPTL::V1::StreamSource
public:
StreamSourceUDPTLImpl(const AsteriskSCF::UDPTL::SessionAdapterPtr& sessionAdapter,
const AsteriskSCF::UDPTL::PJMediaTransportPtr& transport,
- const std::string& parentSessionId);
+ const std::string& parentSessionId,
+ struct udptl *udptl);
void addSink(const AsteriskSCF::Media::V1::StreamSinkPrx&, const Ice::Current&);
void removeSink(const AsteriskSCF::Media::V1::StreamSinkPrx&, const Ice::Current&);
commit 4a19166ef5adbbab79d047e3b99206867e804032
Author: Joshua Colp <jcolp at digium.com>
Date: Wed Sep 14 17:54:00 2011 -0300
Add replication for some UDPTL specific things.
diff --git a/src/UDPTLSession.cpp b/src/UDPTLSession.cpp
index 7c7056a..0a89ce9 100644
--- a/src/UDPTLSession.cpp
+++ b/src/UDPTLSession.cpp
@@ -477,6 +477,9 @@ public:
void update(const UdptlStreamSinkStateItemPtr& item)
{
mImpl->getSinkServant()->setSourceImpl(item->source);
+ mImpl->getSinkServant()->setFarMaxDatagramImpl(item->farMaxDatagram);
+ mImpl->getSinkServant()->setErrorCorrectionSchemeImpl(item->errorCorrectionScheme);
+ mImpl->getSourceServant()->setRemoteDetails(item->remoteAddress, item->remotePort);
}
void update(const UdptlStreamSourceStateItemPtr& item)
diff --git a/src/UDPTLSink.cpp b/src/UDPTLSink.cpp
index c848994..4b3f42e 100644
--- a/src/UDPTLSink.cpp
+++ b/src/UDPTLSink.cpp
@@ -198,6 +198,9 @@ Ice::Int StreamSinkUDPTLImpl::getRemotePort(const Ice::Current&)
void StreamSinkUDPTLImpl::setFarMaxDatagram(int datagram, const Ice::Current&)
{
udptl_set_far_max_datagram(mImpl->mUdptl, datagram);
+
+ mImpl->mSinkStateItem->farMaxDatagram = datagram;
+ mImpl->mSessionAdapter->replicateState(mImpl->mSinkStateItem);
}
/**
@@ -237,6 +240,9 @@ void StreamSinkUDPTLImpl::setErrorCorrectionScheme(ErrorCorrectionScheme scheme,
}
udptl_set_error_correction_scheme(mImpl->mUdptl, mode);
+
+ mImpl->mSinkStateItem->errorCorrectionScheme = scheme;
+ mImpl->mSessionAdapter->replicateState(mImpl->mSinkStateItem);
}
/**
@@ -278,3 +284,28 @@ void StreamSinkUDPTLImpl::setSourceImpl(const AsteriskSCF::Media::V1::StreamSour
{
mImpl->mSinkStateItem->source = proxy;
}
+
+void StreamSinkUDPTLImpl::setFarMaxDatagramImpl(int datagram)
+{
+ udptl_set_far_max_datagram(mImpl->mUdptl, datagram);
+}
+
+void StreamSinkUDPTLImpl::setErrorCorrectionSchemeImpl(ErrorCorrectionScheme scheme)
+{
+ enum t38_ec_modes mode;
+
+ if (scheme == FEC)
+ {
+ mode = UDPTL_ERROR_CORRECTION_FEC;
+ }
+ else if (scheme == REDUNDANCY)
+ {
+ mode = UDPTL_ERROR_CORRECTION_REDUNDANCY;
+ }
+ else
+ {
+ mode = UDPTL_ERROR_CORRECTION_NONE;
+ }
+
+ udptl_set_error_correction_scheme(mImpl->mUdptl, mode);
+}
diff --git a/src/UDPTLSink.h b/src/UDPTLSink.h
index 91e7b46..6fb5213 100644
--- a/src/UDPTLSink.h
+++ b/src/UDPTLSink.h
@@ -52,6 +52,8 @@ public:
AsteriskSCF::Replication::UDPTL::V1::UdptlStreamSinkStateItemPtr getStateItem();
void setRemoteDetailsImpl(const std::string& host, Ice::Int port);
void setSourceImpl(const AsteriskSCF::Media::V1::StreamSourcePrx& proxy);
+ void setFarMaxDatagramImpl(int datagram);
+ void setErrorCorrectionSchemeImpl(AsteriskSCF::Media::UDPTL::V1::ErrorCorrectionScheme scheme);
private:
/**
-----------------------------------------------------------------------
--
asterisk-scf/integration/mediatransportudptl.git
More information about the asterisk-scf-commits
mailing list