Replace scoped_ptr with unique_ptr in webrtc/modules/audio_coding/test/
BUG=webrtc:5520 Review URL: https://codereview.webrtc.org/1695763004 Cr-Commit-Position: refs/heads/master@{#11618}
This commit is contained in:
@ -11,7 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_APITEST_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_APITEST_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
@ -82,8 +83,8 @@ class APITest : public ACMTest {
|
||||
bool APIRunB();
|
||||
|
||||
//--- ACMs
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmA;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmB;
|
||||
std::unique_ptr<AudioCodingModule> _acmA;
|
||||
std::unique_ptr<AudioCodingModule> _acmB;
|
||||
|
||||
//--- Channels
|
||||
Channel* _channel_A2B;
|
||||
|
||||
@ -10,12 +10,12 @@
|
||||
|
||||
#include "webrtc/modules/audio_coding/test/EncodeDecodeTest.h"
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/acm_common_defs.h"
|
||||
@ -275,7 +275,7 @@ void EncodeDecodeTest::Perform() {
|
||||
codePars[1] = 0;
|
||||
codePars[2] = 0;
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
|
||||
std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
|
||||
struct CodecInst sendCodecTmp;
|
||||
numCodecs = acm->NumberOfCodecs();
|
||||
|
||||
@ -331,7 +331,7 @@ std::string EncodeDecodeTest::EncodeToFile(int fileType,
|
||||
int codeId,
|
||||
int* codePars,
|
||||
int testMode) {
|
||||
rtc::scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(1));
|
||||
std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(1));
|
||||
RTPFile rtpFile;
|
||||
std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(),
|
||||
"encode_decode_rtp");
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include "webrtc/modules/audio_coding/test/PacketLossTest.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
@ -126,7 +128,7 @@ void PacketLossTest::Perform() {
|
||||
#ifndef WEBRTC_CODEC_OPUS
|
||||
return;
|
||||
#else
|
||||
rtc::scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
|
||||
std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
|
||||
|
||||
int codec_id = acm->Codec("opus", 48000, channels_);
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_PACKETLOSSTEST_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_PACKETLOSSTEST_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/audio_coding/test/EncodeDecodeTest.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -55,8 +55,8 @@ class PacketLossTest : public ACMTest {
|
||||
int channels_;
|
||||
std::string in_file_name_;
|
||||
int sample_rate_hz_;
|
||||
rtc::scoped_ptr<SenderWithFEC> sender_;
|
||||
rtc::scoped_ptr<ReceiverWithPacketLoss> receiver_;
|
||||
std::unique_ptr<SenderWithFEC> sender_;
|
||||
std::unique_ptr<ReceiverWithPacketLoss> receiver_;
|
||||
int expected_loss_rate_;
|
||||
int actual_loss_rate_;
|
||||
int burst_length_;
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_SPATIALAUDIO_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_SPATIALAUDIO_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
@ -33,9 +34,9 @@ class SpatialAudio : public ACMTest {
|
||||
void EncodeDecode(double leftPanning, double rightPanning);
|
||||
void EncodeDecode();
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmLeft;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmRight;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmReceiver;
|
||||
std::unique_ptr<AudioCodingModule> _acmLeft;
|
||||
std::unique_ptr<AudioCodingModule> _acmRight;
|
||||
std::unique_ptr<AudioCodingModule> _acmReceiver;
|
||||
Channel* _channel;
|
||||
PCMFile _inFile;
|
||||
PCMFile _outFile;
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_TESTALLCODECS_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_TESTALLCODECS_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
#include "webrtc/modules/audio_coding/test/PCMFile.h"
|
||||
@ -69,8 +70,8 @@ class TestAllCodecs : public ACMTest {
|
||||
void DisplaySendReceiveCodec();
|
||||
|
||||
int test_mode_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_a_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_b_;
|
||||
std::unique_ptr<AudioCodingModule> acm_a_;
|
||||
std::unique_ptr<AudioCodingModule> acm_b_;
|
||||
TestPack* channel_a_to_b_;
|
||||
PCMFile infile_a_;
|
||||
PCMFile outfile_b_;
|
||||
|
||||
@ -11,8 +11,9 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
#include "webrtc/modules/audio_coding/test/PCMFile.h"
|
||||
@ -36,8 +37,8 @@ class TestRedFec : public ACMTest {
|
||||
void Run();
|
||||
void OpenOutFile(int16_t testNumber);
|
||||
int32_t SetVAD(bool enableDTX, bool enableVAD, ACMVADMode vadMode);
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmA;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmB;
|
||||
std::unique_ptr<AudioCodingModule> _acmA;
|
||||
std::unique_ptr<AudioCodingModule> _acmB;
|
||||
|
||||
Channel* _channelA2B;
|
||||
|
||||
|
||||
@ -13,7 +13,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
#include "webrtc/modules/audio_coding/test/PCMFile.h"
|
||||
@ -82,8 +83,8 @@ class TestStereo : public ACMTest {
|
||||
|
||||
int test_mode_;
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_a_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_b_;
|
||||
std::unique_ptr<AudioCodingModule> acm_a_;
|
||||
std::unique_ptr<AudioCodingModule> acm_b_;
|
||||
|
||||
TestPackStereo* channel_a2b_;
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_TESTVADDTX_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_TESTVADDTX_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||
@ -68,10 +68,10 @@ class TestVadDtx : public ACMTest {
|
||||
void Run(std::string in_filename, int frequency, int channels,
|
||||
std::string out_filename, bool append, const int* expects);
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_send_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_receive_;
|
||||
rtc::scoped_ptr<Channel> channel_;
|
||||
rtc::scoped_ptr<ActivityMonitor> monitor_;
|
||||
std::unique_ptr<AudioCodingModule> acm_send_;
|
||||
std::unique_ptr<AudioCodingModule> acm_receive_;
|
||||
std::unique_ptr<Channel> channel_;
|
||||
std::unique_ptr<ActivityMonitor> monitor_;
|
||||
};
|
||||
|
||||
// TestWebRtcVadDtx is to verify that the WebRTC VAD/DTX perform as they should.
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
@ -66,7 +68,7 @@ TwoWayCommunication::~TwoWayCommunication() {
|
||||
|
||||
void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A,
|
||||
uint8_t* codecID_B) {
|
||||
rtc::scoped_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0));
|
||||
std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0));
|
||||
uint8_t noCodec = tmpACM->NumberOfCodecs();
|
||||
CodecInst codecInst;
|
||||
printf("List of Supported Codecs\n");
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_TWOWAYCOMMUNICATION_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_TEST_TWOWAYCOMMUNICATION_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
@ -31,11 +32,11 @@ class TwoWayCommunication : public ACMTest {
|
||||
void SetUp();
|
||||
void SetUpAutotest();
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmA;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmB;
|
||||
std::unique_ptr<AudioCodingModule> _acmA;
|
||||
std::unique_ptr<AudioCodingModule> _acmB;
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmRefA;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmRefB;
|
||||
std::unique_ptr<AudioCodingModule> _acmRefA;
|
||||
std::unique_ptr<AudioCodingModule> _acmRefB;
|
||||
|
||||
Channel* _channel_A2B;
|
||||
Channel* _channel_B2A;
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
#include <math.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "gflags/gflags.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
@ -223,8 +223,8 @@ class DelayTest {
|
||||
out_file_b_.Close();
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_a_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_b_;
|
||||
std::unique_ptr<AudioCodingModule> acm_a_;
|
||||
std::unique_ptr<AudioCodingModule> acm_b_;
|
||||
|
||||
Channel* channel_a2b_;
|
||||
|
||||
|
||||
@ -13,7 +13,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
@ -51,11 +52,11 @@ class ISACTest : public ACMTest {
|
||||
|
||||
void SwitchingSamplingRate(int testNr, int maxSampRateChange);
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmA;
|
||||
rtc::scoped_ptr<AudioCodingModule> _acmB;
|
||||
std::unique_ptr<AudioCodingModule> _acmA;
|
||||
std::unique_ptr<AudioCodingModule> _acmB;
|
||||
|
||||
rtc::scoped_ptr<Channel> _channel_A2B;
|
||||
rtc::scoped_ptr<Channel> _channel_B2A;
|
||||
std::unique_ptr<Channel> _channel_A2B;
|
||||
std::unique_ptr<Channel> _channel_B2A;
|
||||
|
||||
PCMFile _inFileA;
|
||||
PCMFile _inFileB;
|
||||
|
||||
@ -10,9 +10,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "gflags/gflags.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/test/Channel.h"
|
||||
@ -241,8 +242,8 @@ class InsertPacketWithTiming {
|
||||
SimulatedClock* sender_clock_;
|
||||
SimulatedClock* receiver_clock_;
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> send_acm_;
|
||||
rtc::scoped_ptr<AudioCodingModule> receive_acm_;
|
||||
std::unique_ptr<AudioCodingModule> send_acm_;
|
||||
std::unique_ptr<AudioCodingModule> receive_acm_;
|
||||
Channel* channel_;
|
||||
|
||||
FILE* seq_num_fid_; // Input (text), one sequence number per line.
|
||||
|
||||
@ -13,7 +13,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/acm_resampler.h"
|
||||
#include "webrtc/modules/audio_coding/test/ACMTest.h"
|
||||
@ -39,7 +40,7 @@ class OpusTest : public ACMTest {
|
||||
|
||||
void OpenOutFile(int test_number);
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_receiver_;
|
||||
std::unique_ptr<AudioCodingModule> acm_receiver_;
|
||||
TestPackStereo* channel_a2b_;
|
||||
PCMFile in_file_stereo_;
|
||||
PCMFile in_file_mono_;
|
||||
|
||||
@ -8,8 +8,9 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
@ -193,7 +194,7 @@ class TargetDelayTest : public ::testing::Test {
|
||||
return acm_->LeastRequiredDelayMs();
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_;
|
||||
std::unique_ptr<AudioCodingModule> acm_;
|
||||
WebRtcRTPHeader rtp_info_;
|
||||
uint8_t payload_[kPayloadLenBytes];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user