2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-03-12 08:41:30 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/test/EncodeDecodeTest.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
#include <stdio.h>
|
2011-07-07 08:21:25 +00:00
|
|
|
#include <stdlib.h>
|
2018-06-19 15:03:05 +02:00
|
|
|
#include <memory>
|
2011-11-23 12:20:35 +00:00
|
|
|
|
2018-04-06 10:06:42 +02:00
|
|
|
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
2018-08-15 15:20:49 +02:00
|
|
|
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "common_types.h" // NOLINT(build/include)
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
|
|
|
|
#include "modules/audio_coding/include/audio_coding_module.h"
|
|
|
|
|
#include "modules/audio_coding/test/utility.h"
|
2018-09-06 13:41:30 +02:00
|
|
|
#include "rtc_base/strings/string_builder.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/gtest.h"
|
|
|
|
|
#include "test/testsupport/fileutils.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2013-05-03 07:34:12 +00:00
|
|
|
TestPacketization::TestPacketization(RTPStream *rtpStream, uint16_t frequency)
|
2011-12-16 10:09:04 +00:00
|
|
|
: _rtpStream(rtpStream),
|
|
|
|
|
_frequency(frequency),
|
|
|
|
|
_seqNo(0) {
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2013-05-03 07:34:12 +00:00
|
|
|
TestPacketization::~TestPacketization() {
|
|
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int32_t TestPacketization::SendData(
|
2013-05-03 07:34:12 +00:00
|
|
|
const FrameType /* frameType */, const uint8_t payloadType,
|
|
|
|
|
const uint32_t timeStamp, const uint8_t* payloadData,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
const size_t payloadSize,
|
2011-12-16 10:09:04 +00:00
|
|
|
const RTPFragmentationHeader* /* fragmentation */) {
|
|
|
|
|
_rtpStream->Write(payloadType, timeStamp, _seqNo++, payloadData, payloadSize,
|
|
|
|
|
_frequency);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Sender::Sender()
|
|
|
|
|
: _acm(NULL),
|
|
|
|
|
_pcmFile(),
|
|
|
|
|
_audioFrame(),
|
|
|
|
|
_packetization(NULL) {
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 15:16:51 +00:00
|
|
|
void Sender::Setup(AudioCodingModule *acm, RTPStream *rtpStream,
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
std::string in_file_name, int sample_rate, size_t channels) {
|
2011-12-16 10:09:04 +00:00
|
|
|
struct CodecInst sendCodec;
|
|
|
|
|
int codecNo;
|
|
|
|
|
|
2012-08-17 10:38:28 +00:00
|
|
|
// Open input file
|
2014-05-23 15:16:51 +00:00
|
|
|
const std::string file_name = webrtc::test::ResourcePath(in_file_name, "pcm");
|
|
|
|
|
_pcmFile.Open(file_name, sample_rate, "rb");
|
|
|
|
|
if (channels == 2) {
|
|
|
|
|
_pcmFile.ReadStereo(true);
|
|
|
|
|
}
|
2015-12-10 16:24:39 +01:00
|
|
|
// Set test length to 500 ms (50 blocks of 10 ms each).
|
|
|
|
|
_pcmFile.SetNum10MsBlocksToRead(50);
|
|
|
|
|
// Fast-forward 1 second (100 blocks) since the file starts with silence.
|
|
|
|
|
_pcmFile.FastForward(100);
|
2012-08-17 10:38:28 +00:00
|
|
|
|
|
|
|
|
// Set the codec for the current test.
|
2018-06-14 13:12:05 +02:00
|
|
|
codecNo = codeId;
|
2011-12-16 10:09:04 +00:00
|
|
|
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_EQ(0, acm->Codec(codecNo, &sendCodec));
|
2014-05-23 15:16:51 +00:00
|
|
|
|
|
|
|
|
sendCodec.channels = channels;
|
2013-08-27 07:33:51 +00:00
|
|
|
|
2018-08-15 15:20:49 +02:00
|
|
|
acm->SetEncoder(CreateBuiltinAudioEncoderFactory()->MakeAudioEncoder(
|
|
|
|
|
sendCodec.pltype, CodecInstToSdp(sendCodec), absl::nullopt));
|
2011-12-16 10:09:04 +00:00
|
|
|
_packetization = new TestPacketization(rtpStream, sendCodec.plfreq);
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_EQ(0, acm->RegisterTransportCallback(_packetization));
|
2011-12-16 10:09:04 +00:00
|
|
|
|
2012-08-17 10:38:28 +00:00
|
|
|
_acm = acm;
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
void Sender::Teardown() {
|
|
|
|
|
_pcmFile.Close();
|
|
|
|
|
delete _packetization;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
bool Sender::Add10MsData() {
|
|
|
|
|
if (!_pcmFile.EndOfFile()) {
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_GT(_pcmFile.Read10MsData(_audioFrame), 0);
|
2013-04-09 00:28:06 +00:00
|
|
|
int32_t ok = _acm->Add10MsData(_audioFrame);
|
2015-03-02 12:29:30 +00:00
|
|
|
EXPECT_GE(ok, 0);
|
|
|
|
|
return ok >= 0 ? true : false;
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
|
|
|
|
return false;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
void Sender::Run() {
|
|
|
|
|
while (true) {
|
|
|
|
|
if (!Add10MsData()) {
|
|
|
|
|
break;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
Receiver::Receiver()
|
|
|
|
|
: _playoutLengthSmpls(WEBRTC_10MS_PCM_AUDIO),
|
|
|
|
|
_payloadSizeBytes(MAX_INCOMING_PAYLOAD) {
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 15:16:51 +00:00
|
|
|
void Receiver::Setup(AudioCodingModule *acm, RTPStream *rtpStream,
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
std::string out_file_name, size_t channels) {
|
2014-08-11 21:06:30 +00:00
|
|
|
struct CodecInst recvCodec = CodecInst();
|
2011-12-16 10:09:04 +00:00
|
|
|
int noOfCodecs;
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_EQ(0, acm->InitializeReceiver());
|
2011-12-16 10:09:04 +00:00
|
|
|
|
|
|
|
|
noOfCodecs = acm->NumberOfCodecs();
|
|
|
|
|
for (int i = 0; i < noOfCodecs; i++) {
|
2014-05-23 15:16:51 +00:00
|
|
|
EXPECT_EQ(0, acm->Codec(i, &recvCodec));
|
|
|
|
|
if (recvCodec.channels == channels)
|
2016-10-24 13:47:09 -07:00
|
|
|
EXPECT_EQ(true, acm->RegisterReceiveCodec(recvCodec.pltype,
|
|
|
|
|
CodecInstToSdp(recvCodec)));
|
2014-05-23 15:16:51 +00:00
|
|
|
// Forces mono/stereo for Opus.
|
|
|
|
|
if (!strcmp(recvCodec.plname, "opus")) {
|
|
|
|
|
recvCodec.channels = channels;
|
2016-10-24 13:47:09 -07:00
|
|
|
EXPECT_EQ(true, acm->RegisterReceiveCodec(recvCodec.pltype,
|
|
|
|
|
CodecInstToSdp(recvCodec)));
|
2014-05-23 15:16:51 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
2012-01-26 14:49:28 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
int playSampFreq;
|
2012-08-17 10:38:28 +00:00
|
|
|
std::string file_name;
|
2018-09-06 13:41:30 +02:00
|
|
|
rtc::StringBuilder file_stream;
|
2014-05-23 15:16:51 +00:00
|
|
|
file_stream << webrtc::test::OutputPath() << out_file_name
|
2013-05-03 07:34:12 +00:00
|
|
|
<< static_cast<int>(codeId) << ".pcm";
|
2012-08-17 10:38:28 +00:00
|
|
|
file_name = file_stream.str();
|
|
|
|
|
_rtpStream = rtpStream;
|
2011-12-16 10:09:04 +00:00
|
|
|
|
2018-06-14 13:12:05 +02:00
|
|
|
playSampFreq = 32000;
|
|
|
|
|
_pcmFile.Open(file_name, 32000, "wb+");
|
2012-01-26 14:49:28 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
_realPayloadSizeBytes = 0;
|
2013-04-09 00:28:06 +00:00
|
|
|
_playoutBuffer = new int16_t[WEBRTC_10MS_PCM_AUDIO];
|
2011-12-16 10:09:04 +00:00
|
|
|
_frequency = playSampFreq;
|
|
|
|
|
_acm = acm;
|
|
|
|
|
_firstTime = true;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
void Receiver::Teardown() {
|
2013-05-03 07:34:12 +00:00
|
|
|
delete[] _playoutBuffer;
|
2011-12-16 10:09:04 +00:00
|
|
|
_pcmFile.Close();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
bool Receiver::IncomingPacket() {
|
|
|
|
|
if (!_rtpStream->EndOfFile()) {
|
|
|
|
|
if (_firstTime) {
|
|
|
|
|
_firstTime = false;
|
|
|
|
|
_realPayloadSizeBytes = _rtpStream->Read(&_rtpInfo, _incomingPayload,
|
|
|
|
|
_payloadSizeBytes, &_nextTime);
|
2012-01-17 19:27:33 +00:00
|
|
|
if (_realPayloadSizeBytes == 0) {
|
|
|
|
|
if (_rtpStream->EndOfFile()) {
|
|
|
|
|
_firstTime = true;
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
2013-05-03 07:34:12 +00:00
|
|
|
}
|
|
|
|
|
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_EQ(0, _acm->IncomingPacket(_incomingPayload, _realPayloadSizeBytes,
|
|
|
|
|
_rtpInfo));
|
2013-05-03 07:34:12 +00:00
|
|
|
_realPayloadSizeBytes = _rtpStream->Read(&_rtpInfo, _incomingPayload,
|
|
|
|
|
_payloadSizeBytes, &_nextTime);
|
2011-12-16 10:09:04 +00:00
|
|
|
if (_realPayloadSizeBytes == 0 && _rtpStream->EndOfFile()) {
|
|
|
|
|
_firstTime = true;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
bool Receiver::PlayoutData() {
|
|
|
|
|
AudioFrame audioFrame;
|
2016-05-17 12:21:55 -07:00
|
|
|
bool muted;
|
|
|
|
|
int32_t ok = _acm->PlayoutData10Ms(_frequency, &audioFrame, &muted);
|
|
|
|
|
if (muted) {
|
|
|
|
|
ADD_FAILURE();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_EQ(0, ok);
|
|
|
|
|
if (ok < 0){
|
|
|
|
|
return false;
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
|
|
|
|
if (_playoutLengthSmpls == 0) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2017-06-12 12:45:32 -07:00
|
|
|
_pcmFile.Write10MsData(audioFrame.data(),
|
2014-05-23 15:16:51 +00:00
|
|
|
audioFrame.samples_per_channel_ * audioFrame.num_channels_);
|
2011-12-16 10:09:04 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Receiver::Run() {
|
2013-04-09 00:28:06 +00:00
|
|
|
uint8_t counter500Ms = 50;
|
|
|
|
|
uint32_t clock = 0;
|
2011-12-16 10:09:04 +00:00
|
|
|
|
|
|
|
|
while (counter500Ms > 0) {
|
|
|
|
|
if (clock == 0 || clock >= _nextTime) {
|
2013-08-27 07:33:51 +00:00
|
|
|
EXPECT_TRUE(IncomingPacket());
|
2011-12-16 10:09:04 +00:00
|
|
|
if (clock == 0) {
|
|
|
|
|
clock = _nextTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ((clock % 10) == 0) {
|
|
|
|
|
if (!PlayoutData()) {
|
|
|
|
|
clock++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
if (_rtpStream->EndOfFile()) {
|
|
|
|
|
counter500Ms--;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
clock++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-14 13:12:05 +02:00
|
|
|
EncodeDecodeTest::EncodeDecodeTest(int test_mode) {
|
|
|
|
|
// There used to be different test modes. The only one still supported is the
|
|
|
|
|
// "autotest" mode.
|
|
|
|
|
RTC_CHECK_EQ(0, test_mode);
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EncodeDecodeTest::Perform() {
|
|
|
|
|
int numCodecs = 1;
|
2013-05-03 07:34:12 +00:00
|
|
|
int codePars[3]; // Frequency, packet size, rate.
|
|
|
|
|
int numPars[52]; // Number of codec parameters sets (freq, pacsize, rate)
|
|
|
|
|
// to test, for a given codec.
|
2011-12-16 10:09:04 +00:00
|
|
|
|
|
|
|
|
codePars[0] = 0;
|
|
|
|
|
codePars[1] = 0;
|
|
|
|
|
codePars[2] = 0;
|
|
|
|
|
|
2018-04-06 10:06:42 +02:00
|
|
|
std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(
|
|
|
|
|
AudioCodingModule::Config(CreateBuiltinAudioDecoderFactory())));
|
2012-06-01 09:27:35 +00:00
|
|
|
struct CodecInst sendCodecTmp;
|
2012-06-01 14:51:28 +00:00
|
|
|
numCodecs = acm->NumberOfCodecs();
|
2012-06-01 09:27:35 +00:00
|
|
|
|
2018-06-14 13:12:05 +02:00
|
|
|
for (int n = 0; n < numCodecs; n++) {
|
|
|
|
|
EXPECT_EQ(0, acm->Codec(n, &sendCodecTmp));
|
|
|
|
|
if (STR_CASE_CMP(sendCodecTmp.plname, "telephone-event") == 0) {
|
|
|
|
|
numPars[n] = 0;
|
|
|
|
|
} else if (STR_CASE_CMP(sendCodecTmp.plname, "cn") == 0) {
|
|
|
|
|
numPars[n] = 0;
|
|
|
|
|
} else if (STR_CASE_CMP(sendCodecTmp.plname, "red") == 0) {
|
|
|
|
|
numPars[n] = 0;
|
|
|
|
|
} else if (sendCodecTmp.channels == 2) {
|
|
|
|
|
numPars[n] = 0;
|
|
|
|
|
} else {
|
|
|
|
|
numPars[n] = 1;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
|
|
|
|
|
2012-06-01 09:27:35 +00:00
|
|
|
// Loop over all mono codecs:
|
2011-12-16 10:09:04 +00:00
|
|
|
for (int codeId = 0; codeId < numCodecs; codeId++) {
|
2012-06-01 09:27:35 +00:00
|
|
|
// Only encode using real mono encoders, not telephone-event and cng.
|
2011-12-16 10:09:04 +00:00
|
|
|
for (int loopPars = 1; loopPars <= numPars[codeId]; loopPars++) {
|
2013-08-27 07:33:51 +00:00
|
|
|
// Encode all data to file.
|
2018-06-14 13:12:05 +02:00
|
|
|
std::string fileName = EncodeToFile(1, codeId, codePars);
|
2011-12-16 10:09:04 +00:00
|
|
|
|
|
|
|
|
RTPFile rtpFile;
|
2011-12-21 13:34:18 +00:00
|
|
|
rtpFile.Open(fileName.c_str(), "rb");
|
2011-12-16 10:09:04 +00:00
|
|
|
|
|
|
|
|
_receiver.codeId = codeId;
|
|
|
|
|
|
|
|
|
|
rtpFile.ReadHeader();
|
2014-05-23 15:16:51 +00:00
|
|
|
_receiver.Setup(acm.get(), &rtpFile, "encodeDecode_out", 1);
|
2011-12-16 10:09:04 +00:00
|
|
|
_receiver.Run();
|
|
|
|
|
_receiver.Teardown();
|
|
|
|
|
rtpFile.Close();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2011-12-16 10:09:04 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-01 10:05:40 +00:00
|
|
|
std::string EncodeDecodeTest::EncodeToFile(int fileType,
|
|
|
|
|
int codeId,
|
2018-06-14 13:12:05 +02:00
|
|
|
int* codePars) {
|
2018-04-06 10:06:42 +02:00
|
|
|
std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(
|
|
|
|
|
AudioCodingModule::Config(CreateBuiltinAudioDecoderFactory())));
|
2011-12-16 10:09:04 +00:00
|
|
|
RTPFile rtpFile;
|
2014-10-01 10:05:40 +00:00
|
|
|
std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(),
|
|
|
|
|
"encode_decode_rtp");
|
2011-12-21 13:34:18 +00:00
|
|
|
rtpFile.Open(fileName.c_str(), "wb+");
|
2011-12-16 10:09:04 +00:00
|
|
|
rtpFile.WriteHeader();
|
|
|
|
|
|
2013-08-27 07:33:51 +00:00
|
|
|
// Store for auto_test and logging.
|
2011-12-16 10:09:04 +00:00
|
|
|
_sender.codeId = codeId;
|
|
|
|
|
|
2014-05-23 15:16:51 +00:00
|
|
|
_sender.Setup(acm.get(), &rtpFile, "audio_coding/testfile32kHz", 32000, 1);
|
2015-11-03 11:20:50 -08:00
|
|
|
if (acm->SendCodec()) {
|
2011-12-16 10:09:04 +00:00
|
|
|
_sender.Run();
|
|
|
|
|
}
|
|
|
|
|
_sender.Teardown();
|
|
|
|
|
rtpFile.Close();
|
2014-10-01 10:05:40 +00:00
|
|
|
|
|
|
|
|
return fileName;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2013-05-03 07:34:12 +00:00
|
|
|
} // namespace webrtc
|