[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Sep 15 11:09:36 CDT 2010
branch "master" has been updated
via 3b87167160824ca5f5f68c0396bfc6aa95d638c1 (commit)
from 2d4dffbc88cfeaa15848db1c7b4adcf26787fba0 (commit)
Summary of changes:
src/RTPSink.cpp | 6 +++
test/TestRTPpjmedia.cpp | 98 +++++++++++++++++++++++-----------------------
2 files changed, 55 insertions(+), 49 deletions(-)
- Log -----------------------------------------------------------------
commit 3b87167160824ca5f5f68c0396bfc6aa95d638c1
Author: Joshua Colp <jcolp at digium.com>
Date: Wed Sep 15 13:15:37 2010 -0300
Move test case for no remote address to correct position, and also don't write frames out if no remote address has been set.
diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index 9d6745c..e51b776 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -71,6 +71,12 @@ StreamSinkRTPImpl::StreamSinkRTPImpl(RTPSessionImplPtr session) : mImpl(new Stre
*/
void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, const Ice::Current&)
{
+ // Don't even bother if no remote address information is present
+ if (mImpl->mRemoteAddress.empty() || !mImpl->mRemotePort)
+ {
+ return;
+ }
+
for (FrameSeq::const_iterator frame = frames.begin(); frame != frames.end(); ++frame)
{
AudioFormatPtr audioformat;
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index dc4229a..19d4a79 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -382,6 +382,55 @@ BOOST_AUTO_TEST_CASE(ConfirmBlankRemoteAddressonSinks)
}
/**
+ * Attempt to send a frame to an RTP session sink that has no destination yet
+ */
+BOOST_AUTO_TEST_CASE(TransmitFrametoEmptySink)
+{
+ bool graceful = false;
+
+ try
+ {
+ AudioFormatPtr format = new AudioFormat();
+ format->name = "test_format";
+ format->frameSize = 20;
+
+ AudioFramePtr frame = new AudioFrame();
+ frame->mediaformat = format;
+
+ /* Populate the payload with some useless data, but enough to confirm the payload passes unaltered. */
+ frame->payload.push_back('a');
+ frame->payload.push_back('b');
+ frame->payload.push_back('c');
+ frame->payload.push_back('d');
+ frame->payload.push_back('e');
+ frame->payload.push_back('f');
+ frame->payload.push_back('g');
+ frame->payload.push_back('h');
+ frame->payload.push_back('i');
+ frame->payload.push_back('j');
+
+ FrameSeq frames;
+ frames.push_back(frame);
+
+ StreamSinkSeq sinks = Testbed.session->getSinks();
+ StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(sinks.front());
+ sink->write(frames);
+
+ graceful = true;
+ }
+ catch (const Ice::Exception &e)
+ {
+ BOOST_TEST_MESSAGE(e.ice_name());
+ BOOST_TEST_MESSAGE(e.what());
+ }
+ catch (...)
+ {
+ }
+
+ BOOST_CHECK(graceful);
+}
+
+/**
* Check that we can set the remote address information properly
*/
BOOST_AUTO_TEST_CASE(ConfirmRemoteAddressSetting)
@@ -490,55 +539,6 @@ BOOST_AUTO_TEST_CASE(PushPayloadMappings)
}
/**
- * Attempt to send a frame to an RTP session sink that has no destination yet
- */
-BOOST_AUTO_TEST_CASE(TransmitFrametoEmptySink)
-{
- bool graceful = false;
-
- try
- {
- AudioFormatPtr format = new AudioFormat();
- format->name = "test_format";
- format->frameSize = 20;
-
- AudioFramePtr frame = new AudioFrame();
- frame->mediaformat = format;
-
- /* Populate the payload with some useless data, but enough to confirm the payload passes unaltered. */
- frame->payload.push_back('a');
- frame->payload.push_back('b');
- frame->payload.push_back('c');
- frame->payload.push_back('d');
- frame->payload.push_back('e');
- frame->payload.push_back('f');
- frame->payload.push_back('g');
- frame->payload.push_back('h');
- frame->payload.push_back('i');
- frame->payload.push_back('j');
-
- FrameSeq frames;
- frames.push_back(frame);
-
- StreamSinkSeq sinks = Testbed.session->getSinks();
- StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(sinks.front());
- sink->write(frames);
-
- graceful = true;
- }
- catch (const Ice::Exception &e)
- {
- BOOST_TEST_MESSAGE(e.ice_name());
- BOOST_TEST_MESSAGE(e.what());
- }
- catch (...)
- {
- }
-
- BOOST_CHECK(graceful);
-}
-
-/**
* Setup RTP loopback from the session to, well, the session
*/
BOOST_AUTO_TEST_CASE(SetupLoopback)
-----------------------------------------------------------------------
--
asterisk-scf/integration/media_rtp_pjmedia.git
More information about the asterisk-scf-commits
mailing list