diff options
Diffstat (limited to 'test/test_opus.cc')
-rw-r--r-- | test/test_opus.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/test/test_opus.cc b/test/test_opus.cc index ea6a5b4..380e7b9 100644 --- a/test/test_opus.cc +++ b/test/test_opus.cc @@ -81,20 +81,19 @@ public: int32_t lookahead; - size_t ts = 0; + //size_t ts = 0; int sent = 0; { // Encode struct lrtp_t *lrtp = lrtp_init(KEY, SSRC); - struct lrtp_profile_t *profile = - lrtp_create_profile(lrtp, PROFILE_OPUS, csrc, - //OPTION_RAW_PKG_SIZE, pkg_size, - OPTION_END); + int x = lrtp_create_profile(lrtp, PROFILE_OPUS, csrc, + OPTION_END); + CPPUNIT_ASSERT_EQUAL(0, x); char packet[16*1024]; - size_t packetsize = sizeof(packet); + //size_t packetsize = sizeof(packet); int err; OpusEncoder *opus = opus_encoder_create(FS, channels, @@ -108,14 +107,14 @@ public: long long int sin_x = 0; - int cnt = 0; + //int cnt = 0; size_t timestamp = 0; size_t idx = 0; for(unsigned int ts = 0; ts < FS / 10; ts++) { size_t pcmsize = ms[idx] / (48000.0 / FS); // Number of samples pr channel sent += pcmsize; short *pcm = new short[100000/*pcmsize * channels*/]; - for(int i = 0 ; i < pcmsize; i++) { + for(size_t i = 0 ; i < pcmsize; i++) { sin_x++; if((int)sin_x % FS == 0) { @@ -138,7 +137,7 @@ public: printf("Opus error: %s\n", opus_strerror(framesize)); } - int ret = lrtp_enqueue_frame(profile, frame, framesize); + int ret = lrtp_enqueue_frame(lrtp, csrc, frame, framesize, timestamp); while( (ret = lrtp_pack(lrtp, packet, sizeof(packet))) != 0) { std::string p; p.append(packet, ret); @@ -156,15 +155,15 @@ public: { // Decode struct lrtp_t *lrtp = lrtp_init(KEY, SSRC); - struct lrtp_profile_t *profile = - lrtp_create_profile(lrtp, PROFILE_OPUS, csrc, - OPTION_END); + int x = lrtp_create_profile(lrtp, PROFILE_OPUS, csrc, + OPTION_END); + CPPUNIT_ASSERT_EQUAL(0, x); int err; OpusDecoder *opus = opus_decoder_create(FS, channels, &err); CPPUNIT_ASSERT_EQUAL(0, err); - int idx = (sizeof(ms)/sizeof(size_t)) - 1; + //int idx = (sizeof(ms)/sizeof(size_t)) - 1; char frame[16*1024]; @@ -173,7 +172,7 @@ public: long long int errl = 0; long long int errr = 0; - int cnt = 0; + //int cnt = 0; std::vector<std::string>::iterator i = packets.begin(); while(i != packets.end()) { size_t packetsize = i->size(); |