[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
Wed Sep 14 10:55:54 CDT 2011


branch "master" has been updated
       via  415cb5b5543d7f509877a4ada82178e04d9de1c4 (commit)
       via  4f6dd4e1e5a1e9dea43bd9a6601d011c5c809fbd (commit)
       via  67eae33ba196a1d4e85049fdda006c7cdd381d77 (commit)
       via  9a520629a795d2d952fdd209f9662e92df784a9e (commit)
       via  a543a39849ddd8588c4e5d42e53e6607ba802f24 (commit)
      from  0eb5fdfd846526651cc995531ce88f213ca91143 (commit)

Summary of changes:
 src/RTPSink.cpp         |   65 +++++++++++++++++++++++++++--
 src/RTPSink.h           |    7 +++
 src/RTPSource.cpp       |   40 ++++++++++++++++--
 src/RTPSource.h         |    7 +++
 test/TestRTPpjmedia.cpp |  105 ++++++++++++++++++++++++++++------------------
 5 files changed, 173 insertions(+), 51 deletions(-)


- Log -----------------------------------------------------------------
commit 415cb5b5543d7f509877a4ada82178e04d9de1c4
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Sep 14 10:56:51 2011 -0500

    Fix tests so they pass properly.

diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 121bcb3..6e2edec 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -180,11 +180,6 @@ public:
      * Condition used to signal test thread that state was set.
      */
     boost::condition mCondition;
-
-    /**
-     * Operations for our test format. Necessary for encoding/decoding frames
-     */
-    FormatOperationsServicePrx mFormatOperationsService;
 };
 static SharedTestData Testbed;
 
@@ -294,40 +289,6 @@ private:
     StreamSourcePrx mSource;
 };
 
-class TestFormatOperations : public FormatOperationsService
-{
-    bool checkCompatible(
-            const FormatPtr& format1,
-            const FormatPtr& format2,
-            const Ice::Current&)
-    {
-        return format1 == format2;
-    }
-
-    FramePayloadPtr decodePayload(
-            const Ice::ByteSeq& toDecode,
-            const Ice::Current&)
-    {
-        Ice::ByteSeq bytePayload;
-        std::copy(toDecode.begin(), toDecode.end(), std::back_inserter(bytePayload));
-        return new ByteSeqPayload(bytePayload);
-    }
-
-    Ice::ByteSeq encodePayload(
-            const FramePayloadPtr& toEncode,
-            const Ice::Current&)
-    {
-        ByteSeqPayloadPtr bytePayload = ByteSeqPayloadPtr::dynamicCast(toEncode);
-    
-        if (!bytePayload)
-        {
-            return Ice::ByteSeq();
-        }
-    
-        return bytePayload->payload;
-    }
-};
-
 /**
  * A global fixture for Ice initialization.
  * Provides setup/teardown for the entire set of tests.
@@ -361,8 +322,6 @@ struct GlobalIceFixture
             Testbed.mInformationListenerProxy = RTCP::V1::InformationListenerPrx::uncheckedCast(Testbed.adapter->addWithUUID(
                                                                                                     Testbed.mInformationListener));
 
-            Testbed.mFormatOperationsService = FormatOperationsServicePrx::uncheckedCast(Testbed.adapter->addWithUUID(new TestFormatOperations));
-
             Testbed.adapter->activate();
 
             Testbed.locator = ServiceLocatorPrx::checkedCast(Testbed.communicator->stringToProxy("LocatorService:tcp -p 4411"));
@@ -519,7 +478,7 @@ BOOST_AUTO_TEST_CASE(AllocateRTPSession)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
-        format->operations = Testbed.mFormatOperationsService;
+        format->sampleSize = 8;
 
         FormatSeq formats;
         formats.push_back(format);
@@ -836,7 +795,7 @@ BOOST_AUTO_TEST_CASE(TransmitFrametoEmptySink)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
-        format->operations = Testbed.mFormatOperationsService;
+        format->sampleSize = 8;
 
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
@@ -967,7 +926,7 @@ BOOST_AUTO_TEST_CASE(PushPayloadMappings)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
-        format->operations = Testbed.mFormatOperationsService;
+        format->sampleSize = 8;
 
         /* I'm just going to go ahead and use payload 98 for it since
          * that is dynamic.
@@ -1158,7 +1117,7 @@ BOOST_AUTO_TEST_CASE(TransmitandReceiveFrame)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
-        format->operations = Testbed.mFormatOperationsService;
+        format->sampleSize = 8;
 
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
@@ -1235,7 +1194,7 @@ BOOST_AUTO_TEST_CASE(TransmitFrameWithUnsupportedMediaFormat)
         AudioFormatPtr format = new AudioFormat();
         format->name = "tacos";
         format->frameSize = 20;
-        format->operations = Testbed.mFormatOperationsService;
+        format->sampleSize = 8;
 
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
@@ -1298,7 +1257,7 @@ BOOST_AUTO_TEST_CASE(ReceiveUnknownRTPPacket)
         AudioFormatPtr format = new AudioFormat();
         format->name = "zombies";
         format->frameSize = 20;
-        format->operations = Testbed.mFormatOperationsService;
+        format->sampleSize = 8;
 
         FormatSeq formats;
         formats.push_back(format);

commit 4f6dd4e1e5a1e9dea43bd9a6601d011c5c809fbd
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 19:47:35 2011 -0500

    Switch to using a local set of functions for decoding/encoding audio.

diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index 48d2bc6..8364d18 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -23,6 +23,8 @@
 #include <Ice/Ice.h>
 #include <IceUtil/UUID.h>
 
+#include <boost/asio/detail/socket_ops.hpp>
+
 #include <AsteriskSCF/Media/MediaIf.h>
 #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
 #include <AsteriskSCF/System/Component/ReplicaIf.h>
@@ -125,7 +127,15 @@ void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, co
             throw UnsupportedMediaFormatException();
         }
 
-        Ice::ByteSeq framePayload = (*frame)->mediaFormat->operations->encodePayload((*frame)->payload);
+        Ice::ByteSeq framePayload;
+        if (audioformat)
+        {
+            framePayload = encodeAudioPayload((*frame)->payload, audioformat);
+        }
+        else if (videoformat)
+        {
+            framePayload = encodeVideoPayload((*frame)->payload, videoformat);
+        }
 
         /* 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,
@@ -260,3 +270,46 @@ void StreamSinkRTPImpl::setSourceImpl(const AsteriskSCF::Media::V1::StreamSource
 {
     mImpl->mSinkStateItem->source = proxy;
 }
+
+Ice::ByteSeq StreamSinkRTPImpl::encodeAudioPayload(const FramePayloadPtr& toEncode, const AudioFormatPtr& audioFormat)
+{
+    if (audioFormat->sampleSize == 8)
+    {
+        ByteSeqPayloadPtr bytePayload = ByteSeqPayloadPtr::dynamicCast(toEncode);
+
+        if (!bytePayload)
+        {
+            throw UnsupportedMediaFormatException();
+        }
+        return bytePayload->payload;
+    }
+    else if (audioFormat->sampleSize == 16)
+    {
+        ShortSeqPayloadPtr shortPayload = ShortSeqPayloadPtr::dynamicCast(toEncode);
+
+        if (!shortPayload)
+        {
+            throw UnsupportedMediaFormatException();
+        }
+
+        std::transform(shortPayload->payload.begin(), shortPayload->payload.end(),
+                shortPayload->payload.begin(), boost::asio::detail::socket_ops::host_to_network_short);
+
+        Ice::ByteSeq bytes((Ice::Byte*) &shortPayload->payload.front(),
+                (Ice::Byte*) &shortPayload->payload[shortPayload->payload.size()]);
+
+        return bytes;
+    }
+    return Ice::ByteSeq();
+}
+
+Ice::ByteSeq StreamSinkRTPImpl::encodeVideoPayload(const FramePayloadPtr& toEncode, const VideoFormatPtr&)
+{
+    ByteSeqPayloadPtr bytePayload = ByteSeqPayloadPtr::dynamicCast(toEncode);
+
+    if (!bytePayload)
+    {
+        throw UnsupportedMediaFormatException();
+    }
+    return bytePayload->payload;
+}
diff --git a/src/RTPSink.h b/src/RTPSink.h
index 2036a14..e2ffd9f 100644
--- a/src/RTPSink.h
+++ b/src/RTPSink.h
@@ -46,6 +46,13 @@ public:
     AsteriskSCF::Replication::MediaRTPPJMedia::V1::RtpStreamSinkStateItemPtr getStateItem();
     void setRemoteDetailsImpl(const std::string& host, Ice::Int port);
     void setSourceImpl(const AsteriskSCF::Media::V1::StreamSourcePrx& proxy);
+    Ice::ByteSeq encodeAudioPayload(
+            const AsteriskSCF::Media::V1::FramePayloadPtr& framePayload,
+            const AsteriskSCF::Media::V1::AudioFormatPtr& audioFormat);
+
+    Ice::ByteSeq encodeVideoPayload(
+            const AsteriskSCF::Media::V1::FramePayloadPtr& framePayload,
+            const AsteriskSCF::Media::V1::VideoFormatPtr&);
 
 private:
     /**
diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index 969ce7b..793f662 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -25,6 +25,7 @@
 #include <IceUtil/Timer.h>
 
 #include <boost/thread.hpp>
+#include <boost/asio/detail/socket_ops.hpp>
 
 #include <AsteriskSCF/Media/MediaIf.h>
 #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
@@ -418,7 +419,7 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
         AudioFramePtr frame = new AudioFrame();
 
         Ice::ByteSeq bytePayload(payload, payload + payload_size);
-        frame->payload = mediaformat->operations->decodePayload(bytePayload);
+        frame->payload = source->decodeAudioPayload(bytePayload, audioformat);
 
         // Populate the common data
         frame->mediaFormat = mediaformat;
@@ -433,7 +434,7 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
         VideoFramePtr frame = new VideoFrame();
 
         Ice::ByteSeq bytePayload(payload, payload + payload_size);
-        frame->payload = mediaformat->operations->decodePayload(bytePayload);
+        frame->payload = source->decodeVideoPayload(bytePayload, videoformat);
 
         frame->mediaFormat = mediaformat;
         frame->timestamp = header->ts;
@@ -614,3 +615,28 @@ void StreamSourceRTPImpl::setSinksImpl(const AsteriskSCF::Media::V1::StreamSinkS
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
     mImpl->mSourceStateItem->sinks = sinks;
 }
+
+FramePayloadPtr StreamSourceRTPImpl::decodeAudioPayload(const Ice::ByteSeq& toDecode, const AudioFormatPtr& audioFormat)
+{
+    if (audioFormat->sampleSize == 8)
+    {
+        return new ByteSeqPayload(toDecode);
+    }
+    else if (audioFormat->sampleSize == 16)
+    {
+        Ice::ShortSeq shortPayload((Ice::Short*) &toDecode.front(),
+                (Ice::Short*) &toDecode[toDecode.size()]);
+
+        std::transform(shortPayload.begin(), shortPayload.end(),
+                shortPayload.begin(), boost::asio::detail::socket_ops::network_to_host_short);
+
+        return new ShortSeqPayload(shortPayload);
+    }
+    return 0;
+}
+
+FramePayloadPtr StreamSourceRTPImpl::decodeVideoPayload(const Ice::ByteSeq& toDecode, const VideoFormatPtr&)
+{
+    //Assume for now video payloads use 8-bit samples...
+    return new ByteSeqPayload(toDecode);
+}
diff --git a/src/RTPSource.h b/src/RTPSource.h
index aeeff2c..0fe640d 100644
--- a/src/RTPSource.h
+++ b/src/RTPSource.h
@@ -46,6 +46,13 @@ public:
     AsteriskSCF::Replication::MediaRTPPJMedia::V1::RtpStreamSourceStateItemPtr getStateItem();
 
     void setSinkImpl(const AsteriskSCF::Media::V1::StreamSinkPrx& proxy);
+    AsteriskSCF::Media::V1::FramePayloadPtr decodeAudioPayload(
+            const Ice::ByteSeq&,
+            const AsteriskSCF::Media::V1::AudioFormatPtr&);
+
+    AsteriskSCF::Media::V1::FramePayloadPtr decodeVideoPayload(
+            const Ice::ByteSeq&,
+            const AsteriskSCF::Media::V1::VideoFormatPtr&);
 
     /**
      * Private implementation data for StreamSourceRTPImpl.

commit 67eae33ba196a1d4e85049fdda006c7cdd381d77
Merge: 9a52062 0eb5fdf
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Sep 13 14:10:18 2011 -0500

    Merge branch 'master' into resampling


commit 9a520629a795d2d952fdd209f9662e92df784a9e
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 22 16:49:45 2011 -0500

    Adjust the RTP test to accommodate the need for FormatOperationsService.

diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 24a6500..1f75514 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -179,6 +179,11 @@ public:
      * Condition used to signal test thread that state was set.
      */
     boost::condition mCondition;
+
+    /**
+     * Operations for our test format. Necessary for encoding/decoding frames
+     */
+    FormatOperationsServicePrx mFormatOperationsService;
 };
 static SharedTestData Testbed;
 
@@ -288,6 +293,40 @@ private:
     StreamSourcePrx mSource;
 };
 
+class TestFormatOperations : public FormatOperationsService
+{
+    bool checkCompatible(
+            const FormatPtr& format1,
+            const FormatPtr& format2,
+            const Ice::Current&)
+    {
+        return format1 == format2;
+    }
+
+    FramePayloadPtr decodePayload(
+            const Ice::ByteSeq& toDecode,
+            const Ice::Current&)
+    {
+        Ice::ByteSeq bytePayload;
+        std::copy(toDecode.begin(), toDecode.end(), std::back_inserter(bytePayload));
+        return new ByteSeqPayload(bytePayload);
+    }
+
+    Ice::ByteSeq encodePayload(
+            const FramePayloadPtr& toEncode,
+            const Ice::Current&)
+    {
+        ByteSeqPayloadPtr bytePayload = ByteSeqPayloadPtr::dynamicCast(toEncode);
+    
+        if (!bytePayload)
+        {
+            return Ice::ByteSeq();
+        }
+    
+        return bytePayload->payload;
+    }
+};
+
 /**
  * A global fixture for Ice initialization.
  * Provides setup/teardown for the entire set of tests.
@@ -321,6 +360,8 @@ struct GlobalIceFixture
             Testbed.mInformationListenerProxy = RTCP::V1::InformationListenerPrx::uncheckedCast(Testbed.adapter->addWithUUID(
                                                                                                     Testbed.mInformationListener));
 
+            Testbed.mFormatOperationsService = FormatOperationsServicePrx::uncheckedCast(Testbed.adapter->addWithUUID(new TestFormatOperations));
+
             Testbed.adapter->activate();
 
             Testbed.locator = ServiceLocatorPrx::checkedCast(Testbed.communicator->stringToProxy("LocatorService:tcp -p 4411"));
@@ -477,6 +518,7 @@ BOOST_AUTO_TEST_CASE(AllocateRTPSession)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
+        format->operations = Testbed.mFormatOperationsService;
 
         FormatSeq formats;
         formats.push_back(format);
@@ -749,6 +791,7 @@ BOOST_AUTO_TEST_CASE(TransmitFrametoEmptySink)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
+        format->operations = Testbed.mFormatOperationsService;
 
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
@@ -879,6 +922,7 @@ BOOST_AUTO_TEST_CASE(PushPayloadMappings)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
+        format->operations = Testbed.mFormatOperationsService;
 
         /* I'm just going to go ahead and use payload 98 for it since
          * that is dynamic.
@@ -1069,6 +1113,7 @@ BOOST_AUTO_TEST_CASE(TransmitandReceiveFrame)
         AudioFormatPtr format = new AudioFormat();
         format->name = "test_format";
         format->frameSize = 20;
+        format->operations = Testbed.mFormatOperationsService;
 
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
@@ -1109,9 +1154,13 @@ BOOST_AUTO_TEST_CASE(TransmitandReceiveFrame)
             (received_frame->mediaFormat->name == format->name))
         {
             AudioFormatPtr received_format;
+            ByteSeqPayloadPtr originalPayload;
+            ByteSeqPayloadPtr receivedPayload;
             if ((received_format = AudioFormatPtr::dynamicCast(received_frame->mediaFormat)) &&
                 (received_format->frameSize == format->frameSize) &&
-                (received_frame->payload == frame->payload))
+                (originalPayload = ByteSeqPayloadPtr::dynamicCast(frame->payload)) &&
+                (receivedPayload = ByteSeqPayloadPtr::dynamicCast(received_frame->payload)) &&
+                (receivedPayload->payload == originalPayload->payload))
             {
                 received = true;
             }
@@ -1141,6 +1190,7 @@ BOOST_AUTO_TEST_CASE(TransmitFrameWithUnsupportedMediaFormat)
         AudioFormatPtr format = new AudioFormat();
         format->name = "tacos";
         format->frameSize = 20;
+        format->operations = Testbed.mFormatOperationsService;
 
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
@@ -1203,6 +1253,7 @@ BOOST_AUTO_TEST_CASE(ReceiveUnknownRTPPacket)
         AudioFormatPtr format = new AudioFormat();
         format->name = "zombies";
         format->frameSize = 20;
+        format->operations = Testbed.mFormatOperationsService;
 
         FormatSeq formats;
         formats.push_back(format);

commit a543a39849ddd8588c4e5d42e53e6607ba802f24
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 22 15:24:43 2011 -0500

    Use format operation services to encode and decode frame payloads.

diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index 687ded0..48d2bc6 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -125,10 +125,12 @@ void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, co
             throw UnsupportedMediaFormatException();
         }
 
+        Ice::ByteSeq framePayload = (*frame)->mediaFormat->operations->encodePayload((*frame)->payload);
+
         /* 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,
-                                                    payload, 0, (int) (*frame)->payload.size(),
-                                                    (int) (*frame)->payload.size(), &header, &header_len);
+                                                    payload, 0, (int) framePayload.size(),
+                                                    (int) framePayload.size(), &header, &header_len);
 
         if (status != PJ_SUCCESS)
         {
@@ -143,11 +145,11 @@ void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, co
         pj_memcpy(packet, (const pjmedia_rtp_hdr*)header, header_len);
 
         /* Now the actual payload */
-        pj_memcpy(packet + header_len, &(*frame)->payload[0], (*frame)->payload.size());
+        pj_memcpy(packet + header_len, &framePayload[0], framePayload.size());
 
         /* All done, transmission can now occur */
         status = pjmedia_transport_send_rtp(mImpl->mTransport->getTransport(), packet,
-                (*frame)->payload.size() + header_len);
+                framePayload.size() + header_len);
 
         if (status != PJ_SUCCESS)
         {
@@ -156,7 +158,7 @@ void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, co
         }
 
 	// Update RTCP information
-	pjmedia_rtcp_tx_rtp(mImpl->mSessionAdapter->getRtcpSession(), static_cast<unsigned int>((*frame)->payload.size()));
+	pjmedia_rtcp_tx_rtp(mImpl->mSessionAdapter->getRtcpSession(), static_cast<unsigned int>(framePayload.size()));
     }
 }
 
diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index 23dae4f..969ce7b 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -416,25 +416,29 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
     if ((audioformat = AudioFormatPtr::dynamicCast(mediaformat)))
     {
         AudioFramePtr frame = new AudioFrame();
-        frame->mediaFormat = mediaformat;
+
+        Ice::ByteSeq bytePayload(payload, payload + payload_size);
+        frame->payload = mediaformat->operations->decodePayload(bytePayload);
 
         // Populate the common data
+        frame->mediaFormat = mediaformat;
         frame->timestamp = header->ts;
         frame->seqno = header->seq;
 
-        // Copy the payload from the RTP packet into the frame
-        copy(payload, payload + payload_size, std::back_inserter(frame->payload));
-
         // Into the frames sequence it goes
         frames.push_back(frame);
     }
     else if ((videoformat = VideoFormatPtr::dynamicCast(mediaformat)))
     {
         VideoFramePtr frame = new VideoFrame();
+
+        Ice::ByteSeq bytePayload(payload, payload + payload_size);
+        frame->payload = mediaformat->operations->decodePayload(bytePayload);
+
         frame->mediaFormat = mediaformat;
         frame->timestamp = header->ts;
         frame->seqno = header->seq;
-        copy(payload, payload + payload_size, std::back_inserter(frame->payload));
+
         frames.push_back(frame);
     }
 
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 3c4e6d8..24a6500 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -753,17 +753,20 @@ BOOST_AUTO_TEST_CASE(TransmitFrametoEmptySink)
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
 
+        Ice::ByteSeq payload;
         /* 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');
+        payload.push_back('a');
+        payload.push_back('b');
+        payload.push_back('c');
+        payload.push_back('d');
+        payload.push_back('e');
+        payload.push_back('f');
+        payload.push_back('g');
+        payload.push_back('h');
+        payload.push_back('i');
+        payload.push_back('j');
+
+        frame->payload = new ByteSeqPayload(payload);
 
         FrameSeq frames;
         frames.push_back(frame);
@@ -1070,17 +1073,20 @@ BOOST_AUTO_TEST_CASE(TransmitandReceiveFrame)
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
 
+        Ice::ByteSeq payload;
         /* 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');
+        payload.push_back('a');
+        payload.push_back('b');
+        payload.push_back('c');
+        payload.push_back('d');
+        payload.push_back('e');
+        payload.push_back('f');
+        payload.push_back('g');
+        payload.push_back('h');
+        payload.push_back('i');
+        payload.push_back('j');
+
+        frame->payload = new ByteSeqPayload(payload);
 
         FrameSeq frames;
         frames.push_back(frame);
@@ -1139,16 +1145,19 @@ BOOST_AUTO_TEST_CASE(TransmitFrameWithUnsupportedMediaFormat)
         AudioFramePtr frame = new AudioFrame();
         frame->mediaFormat = format;
 
-        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');
+        Ice::ByteSeq payload;
+        payload.push_back('a');
+        payload.push_back('b');
+        payload.push_back('c');
+        payload.push_back('d');
+        payload.push_back('e');
+        payload.push_back('f');
+        payload.push_back('g');
+        payload.push_back('h');
+        payload.push_back('i');
+        payload.push_back('j');
+
+        frame->payload = new ByteSeqPayload(payload);
 
         FrameSeq frames;
         frames.push_back(frame);
@@ -1218,16 +1227,20 @@ BOOST_AUTO_TEST_CASE(ReceiveUnknownRTPPacket)
         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');
+        Ice::ByteSeq payload;
+
+        payload.push_back('a');
+        payload.push_back('b');
+        payload.push_back('c');
+        payload.push_back('d');
+        payload.push_back('e');
+        payload.push_back('f');
+        payload.push_back('g');
+        payload.push_back('h');
+        payload.push_back('i');
+        payload.push_back('j');
+
+        frame->payload = new ByteSeqPayload(payload);
 
         FrameSeq frames;
         frames.push_back(frame);

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


-- 
asterisk-scf/release/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list