Replace scoped_ptr with unique_ptr in webrtc/modules/audio_coding/
BUG=webrtc:5520 Review URL: https://codereview.webrtc.org/1694073002 Cr-Commit-Position: refs/heads/master@{#11622}
This commit is contained in:
parent
395939781b
commit
16c5a96630
@ -13,6 +13,8 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h"
|
||||
@ -151,7 +153,7 @@ int AcmReceiveTestOldApi::RegisterExternalReceiveCodec(
|
||||
}
|
||||
|
||||
void AcmReceiveTestOldApi::Run() {
|
||||
for (rtc::scoped_ptr<Packet> packet(packet_source_->NextPacket()); packet;
|
||||
for (std::unique_ptr<Packet> packet(packet_source_->NextPacket()); packet;
|
||||
packet.reset(packet_source_->NextPacket())) {
|
||||
// Pull audio until time to insert packet.
|
||||
while (clock_.TimeInMilliseconds() < packet->time_ms()) {
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVE_TEST_OLDAPI_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVE_TEST_OLDAPI_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -61,7 +61,7 @@ class AcmReceiveTestOldApi {
|
||||
virtual void AfterGetAudio() {}
|
||||
|
||||
SimulatedClock clock_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_;
|
||||
std::unique_ptr<AudioCodingModule> acm_;
|
||||
PacketSource* packet_source_;
|
||||
AudioSink* audio_sink_;
|
||||
int output_freq_hz_;
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_RECEIVER_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/array_view.h"
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
#include "webrtc/common_audio/vad/include/webrtc_vad.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
@ -288,8 +288,8 @@ class AcmReceiver {
|
||||
ACMResampler resampler_ GUARDED_BY(crit_sect_);
|
||||
// Used in GetAudio, declared as member to avoid allocating every 10ms.
|
||||
// TODO(henrik.lundin) Stack-allocate in GetAudio instead?
|
||||
rtc::scoped_ptr<int16_t[]> audio_buffer_ GUARDED_BY(crit_sect_);
|
||||
rtc::scoped_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_);
|
||||
std::unique_ptr<int16_t[]> audio_buffer_ GUARDED_BY(crit_sect_);
|
||||
std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_);
|
||||
CallStatistics call_stats_ GUARDED_BY(crit_sect_);
|
||||
NetEq* neteq_;
|
||||
// Decoders map is keyed by payload type
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
#include "webrtc/modules/audio_coding/acm2/acm_receiver.h"
|
||||
|
||||
#include <algorithm> // std::min
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h"
|
||||
@ -153,9 +153,9 @@ class AcmReceiverTestOldApi : public AudioPacketizationCallback,
|
||||
return 0;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<AcmReceiver> receiver_;
|
||||
std::unique_ptr<AcmReceiver> receiver_;
|
||||
rtc::ArrayView<const CodecInst> codecs_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_;
|
||||
std::unique_ptr<AudioCodingModule> acm_;
|
||||
WebRtcRTPHeader rtp_header_;
|
||||
uint32_t timestamp_;
|
||||
bool packet_sent_; // Set when SendData is called reset when inserting audio.
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_SEND_TEST_OLDAPI_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_SEND_TEST_OLDAPI_H_
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/packet_source.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
@ -68,7 +68,7 @@ class AcmSendTestOldApi : public AudioPacketizationCallback,
|
||||
Packet* CreatePacket();
|
||||
|
||||
SimulatedClock clock_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_;
|
||||
std::unique_ptr<AudioCodingModule> acm_;
|
||||
InputAudioFile* audio_source_;
|
||||
int source_rate_hz_;
|
||||
const size_t input_block_size_samples_;
|
||||
|
||||
@ -11,12 +11,12 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/buffer.h"
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/engine_configurations.h"
|
||||
@ -253,7 +253,7 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
|
||||
CodecManager codec_manager;
|
||||
RentACodec rent_a_codec;
|
||||
};
|
||||
rtc::scoped_ptr<EncoderFactory> encoder_factory_ GUARDED_BY(acm_crit_sect_);
|
||||
std::unique_ptr<EncoderFactory> encoder_factory_ GUARDED_BY(acm_crit_sect_);
|
||||
|
||||
// Current encoder stack, either obtained from
|
||||
// encoder_factory_->rent_a_codec.RentEncoderStack or provided by a call to
|
||||
@ -269,7 +269,7 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
|
||||
// IMPORTANT: this variable is only used in IncomingPayload(), therefore,
|
||||
// no lock acquired when interacting with this variable. If it is going to
|
||||
// be used in other methods, locks need to be taken.
|
||||
rtc::scoped_ptr<WebRtcRTPHeader> aux_rtp_header_;
|
||||
std::unique_ptr<WebRtcRTPHeader> aux_rtp_header_;
|
||||
|
||||
bool receiver_initialized_ GUARDED_BY(acm_crit_sect_);
|
||||
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/md5digest.h"
|
||||
#include "webrtc/base/platform_thread.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/acm_receive_test_oldapi.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.h"
|
||||
@ -225,8 +225,8 @@ class AudioCodingModuleTestOldApi : public ::testing::Test {
|
||||
}
|
||||
|
||||
const int id_;
|
||||
rtc::scoped_ptr<RtpUtility> rtp_utility_;
|
||||
rtc::scoped_ptr<AudioCodingModule> acm_;
|
||||
std::unique_ptr<RtpUtility> rtp_utility_;
|
||||
std::unique_ptr<AudioCodingModule> acm_;
|
||||
PacketizationCallbackStubOldApi packet_cb_;
|
||||
WebRtcRTPHeader rtp_header_;
|
||||
AudioFrame input_frame_;
|
||||
@ -575,13 +575,13 @@ class AudioCodingModuleMtTestOldApi : public AudioCodingModuleTestOldApi {
|
||||
rtc::PlatformThread send_thread_;
|
||||
rtc::PlatformThread insert_packet_thread_;
|
||||
rtc::PlatformThread pull_audio_thread_;
|
||||
const rtc::scoped_ptr<EventWrapper> test_complete_;
|
||||
const std::unique_ptr<EventWrapper> test_complete_;
|
||||
int send_count_;
|
||||
int insert_packet_count_;
|
||||
int pull_audio_count_ GUARDED_BY(crit_sect_);
|
||||
rtc::CriticalSection crit_sect_;
|
||||
int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
|
||||
rtc::scoped_ptr<SimulatedClock> fake_clock_;
|
||||
std::unique_ptr<SimulatedClock> fake_clock_;
|
||||
};
|
||||
|
||||
#if defined(WEBRTC_IOS)
|
||||
@ -775,7 +775,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
||||
bool CbReceiveImpl() {
|
||||
SleepMs(1);
|
||||
const size_t max_encoded_bytes = isac_encoder_->MaxEncodedBytes();
|
||||
rtc::scoped_ptr<uint8_t[]> encoded(new uint8_t[max_encoded_bytes]);
|
||||
std::unique_ptr<uint8_t[]> encoded(new uint8_t[max_encoded_bytes]);
|
||||
AudioEncoder::EncodedInfo info;
|
||||
{
|
||||
rtc::CritScope lock(&crit_sect_);
|
||||
@ -841,13 +841,13 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
||||
|
||||
rtc::PlatformThread receive_thread_;
|
||||
rtc::PlatformThread codec_registration_thread_;
|
||||
const rtc::scoped_ptr<EventWrapper> test_complete_;
|
||||
const std::unique_ptr<EventWrapper> test_complete_;
|
||||
rtc::CriticalSection crit_sect_;
|
||||
bool codec_registered_ GUARDED_BY(crit_sect_);
|
||||
int receive_packet_count_ GUARDED_BY(crit_sect_);
|
||||
int64_t next_insert_packet_time_ms_ GUARDED_BY(crit_sect_);
|
||||
rtc::scoped_ptr<AudioEncoderIsac> isac_encoder_;
|
||||
rtc::scoped_ptr<SimulatedClock> fake_clock_;
|
||||
std::unique_ptr<AudioEncoderIsac> isac_encoder_;
|
||||
std::unique_ptr<SimulatedClock> fake_clock_;
|
||||
test::AudioLoop audio_loop_;
|
||||
};
|
||||
|
||||
@ -897,7 +897,7 @@ class AcmReceiverBitExactnessOldApi : public ::testing::Test {
|
||||
const std::vector<ExternalDecoder>& external_decoders) {
|
||||
const std::string input_file_name =
|
||||
webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp");
|
||||
rtc::scoped_ptr<test::RtpFileSource> packet_source(
|
||||
std::unique_ptr<test::RtpFileSource> packet_source(
|
||||
test::RtpFileSource::Create(input_file_name));
|
||||
#ifdef WEBRTC_ANDROID
|
||||
// Filter out iLBC and iSAC-swb since they are not supported on Android.
|
||||
@ -1199,8 +1199,8 @@ class AcmSenderBitExactnessOldApi : public ::testing::Test,
|
||||
RegisterExternalSendCodec(external_speech_encoder, payload_type));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<test::AcmSendTestOldApi> send_test_;
|
||||
rtc::scoped_ptr<test::InputAudioFile> audio_source_;
|
||||
std::unique_ptr<test::AcmSendTestOldApi> send_test_;
|
||||
std::unique_ptr<test::InputAudioFile> audio_source_;
|
||||
uint32_t frame_size_rtp_timestamps_;
|
||||
int packet_count_;
|
||||
uint8_t payload_type_;
|
||||
@ -1490,8 +1490,8 @@ class AcmSetBitRateOldApi : public ::testing::Test {
|
||||
codec_frame_size_rtp_timestamps));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<test::AcmSendTestOldApi> send_test_;
|
||||
rtc::scoped_ptr<test::InputAudioFile> audio_source_;
|
||||
std::unique_ptr<test::AcmSendTestOldApi> send_test_;
|
||||
std::unique_ptr<test::InputAudioFile> audio_source_;
|
||||
};
|
||||
|
||||
TEST_F(AcmSetBitRateOldApi, Opus_48khz_20ms_10kbps) {
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/thread_checker.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/codec_manager.h"
|
||||
@ -21,8 +23,8 @@ using ::testing::Return;
|
||||
namespace {
|
||||
|
||||
// Create a MockAudioEncoder with some reasonable default behavior.
|
||||
rtc::scoped_ptr<MockAudioEncoder> CreateMockEncoder() {
|
||||
auto enc = rtc_make_scoped_ptr(new MockAudioEncoder);
|
||||
std::unique_ptr<MockAudioEncoder> CreateMockEncoder() {
|
||||
auto enc = std::unique_ptr<MockAudioEncoder>(new MockAudioEncoder);
|
||||
EXPECT_CALL(*enc, SampleRateHz()).WillRepeatedly(Return(8000));
|
||||
EXPECT_CALL(*enc, NumChannels()).WillRepeatedly(Return(1));
|
||||
EXPECT_CALL(*enc, Max10MsFramesInAPacket()).WillRepeatedly(Return(1));
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_INITIAL_DELAY_MANAGER_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_ACM2_INITIAL_DELAY_MANAGER_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/include/module_common_types.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/audio_coding/acm2/initial_delay_manager.h"
|
||||
|
||||
@ -78,7 +80,7 @@ class InitialDelayManagerTest : public ::testing::Test {
|
||||
NextRtpHeader(rtp_info, rtp_receive_timestamp);
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<InitialDelayManager> manager_;
|
||||
std::unique_ptr<InitialDelayManager> manager_;
|
||||
WebRtcRTPHeader rtp_info_;
|
||||
uint32_t rtp_receive_timestamp_;
|
||||
};
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "webrtc/base/logging.h"
|
||||
@ -144,52 +145,53 @@ namespace {
|
||||
|
||||
// Returns a new speech encoder, or null on error.
|
||||
// TODO(kwiberg): Don't handle errors here (bug 5033)
|
||||
rtc::scoped_ptr<AudioEncoder> CreateEncoder(
|
||||
const CodecInst& speech_inst,
|
||||
LockedIsacBandwidthInfo* bwinfo) {
|
||||
std::unique_ptr<AudioEncoder> CreateEncoder(const CodecInst& speech_inst,
|
||||
LockedIsacBandwidthInfo* bwinfo) {
|
||||
#if defined(WEBRTC_CODEC_ISACFX)
|
||||
if (STR_CASE_CMP(speech_inst.plname, "isac") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderIsacFix(speech_inst, bwinfo));
|
||||
return std::unique_ptr<AudioEncoder>(
|
||||
new AudioEncoderIsacFix(speech_inst, bwinfo));
|
||||
#endif
|
||||
#if defined(WEBRTC_CODEC_ISAC)
|
||||
if (STR_CASE_CMP(speech_inst.plname, "isac") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderIsac(speech_inst, bwinfo));
|
||||
return std::unique_ptr<AudioEncoder>(
|
||||
new AudioEncoderIsac(speech_inst, bwinfo));
|
||||
#endif
|
||||
#ifdef WEBRTC_CODEC_OPUS
|
||||
if (STR_CASE_CMP(speech_inst.plname, "opus") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderOpus(speech_inst));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderOpus(speech_inst));
|
||||
#endif
|
||||
if (STR_CASE_CMP(speech_inst.plname, "pcmu") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderPcmU(speech_inst));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderPcmU(speech_inst));
|
||||
if (STR_CASE_CMP(speech_inst.plname, "pcma") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderPcmA(speech_inst));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderPcmA(speech_inst));
|
||||
if (STR_CASE_CMP(speech_inst.plname, "l16") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderPcm16B(speech_inst));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderPcm16B(speech_inst));
|
||||
#ifdef WEBRTC_CODEC_ILBC
|
||||
if (STR_CASE_CMP(speech_inst.plname, "ilbc") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderIlbc(speech_inst));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderIlbc(speech_inst));
|
||||
#endif
|
||||
#ifdef WEBRTC_CODEC_G722
|
||||
if (STR_CASE_CMP(speech_inst.plname, "g722") == 0)
|
||||
return rtc_make_scoped_ptr(new AudioEncoderG722(speech_inst));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderG722(speech_inst));
|
||||
#endif
|
||||
LOG_F(LS_ERROR) << "Could not create encoder of type " << speech_inst.plname;
|
||||
return rtc::scoped_ptr<AudioEncoder>();
|
||||
return std::unique_ptr<AudioEncoder>();
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<AudioEncoder> CreateRedEncoder(AudioEncoder* encoder,
|
||||
std::unique_ptr<AudioEncoder> CreateRedEncoder(AudioEncoder* encoder,
|
||||
int red_payload_type) {
|
||||
#ifdef WEBRTC_CODEC_RED
|
||||
AudioEncoderCopyRed::Config config;
|
||||
config.payload_type = red_payload_type;
|
||||
config.speech_encoder = encoder;
|
||||
return rtc::scoped_ptr<AudioEncoder>(new AudioEncoderCopyRed(config));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderCopyRed(config));
|
||||
#else
|
||||
return rtc::scoped_ptr<AudioEncoder>();
|
||||
return std::unique_ptr<AudioEncoder>();
|
||||
#endif
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<AudioEncoder> CreateCngEncoder(AudioEncoder* encoder,
|
||||
std::unique_ptr<AudioEncoder> CreateCngEncoder(AudioEncoder* encoder,
|
||||
int payload_type,
|
||||
ACMVADMode vad_mode) {
|
||||
AudioEncoderCng::Config config;
|
||||
@ -212,18 +214,18 @@ rtc::scoped_ptr<AudioEncoder> CreateCngEncoder(AudioEncoder* encoder,
|
||||
default:
|
||||
FATAL();
|
||||
}
|
||||
return rtc::scoped_ptr<AudioEncoder>(new AudioEncoderCng(config));
|
||||
return std::unique_ptr<AudioEncoder>(new AudioEncoderCng(config));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<AudioDecoder> CreateIsacDecoder(
|
||||
std::unique_ptr<AudioDecoder> CreateIsacDecoder(
|
||||
LockedIsacBandwidthInfo* bwinfo) {
|
||||
#if defined(WEBRTC_CODEC_ISACFX)
|
||||
return rtc_make_scoped_ptr(new AudioDecoderIsacFix(bwinfo));
|
||||
return std::unique_ptr<AudioDecoder>(new AudioDecoderIsacFix(bwinfo));
|
||||
#elif defined(WEBRTC_CODEC_ISAC)
|
||||
return rtc_make_scoped_ptr(new AudioDecoderIsac(bwinfo));
|
||||
return std::unique_ptr<AudioDecoder>(new AudioDecoderIsac(bwinfo));
|
||||
#else
|
||||
FATAL() << "iSAC is not supported.";
|
||||
return rtc::scoped_ptr<AudioDecoder>();
|
||||
return std::unique_ptr<AudioDecoder>();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -233,7 +235,7 @@ RentACodec::RentACodec() = default;
|
||||
RentACodec::~RentACodec() = default;
|
||||
|
||||
AudioEncoder* RentACodec::RentEncoder(const CodecInst& codec_inst) {
|
||||
rtc::scoped_ptr<AudioEncoder> enc =
|
||||
std::unique_ptr<AudioEncoder> enc =
|
||||
CreateEncoder(codec_inst, &isac_bandwidth_info_);
|
||||
if (!enc)
|
||||
return nullptr;
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/array_view.h"
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
|
||||
#include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||
@ -229,10 +229,10 @@ class RentACodec {
|
||||
AudioDecoder* RentIsacDecoder();
|
||||
|
||||
private:
|
||||
rtc::scoped_ptr<AudioEncoder> speech_encoder_;
|
||||
rtc::scoped_ptr<AudioEncoder> cng_encoder_;
|
||||
rtc::scoped_ptr<AudioEncoder> red_encoder_;
|
||||
rtc::scoped_ptr<AudioDecoder> isac_decoder_;
|
||||
std::unique_ptr<AudioEncoder> speech_encoder_;
|
||||
std::unique_ptr<AudioEncoder> cng_encoder_;
|
||||
std::unique_ptr<AudioEncoder> red_encoder_;
|
||||
std::unique_ptr<AudioDecoder> isac_decoder_;
|
||||
LockedIsacBandwidthInfo isac_bandwidth_info_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RentACodec);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user