Use base/scoped_ptr.h; system_wrappers/interface/scoped_ptr.h is going away

BUG=
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36229004

Cr-Commit-Position: refs/heads/master@{#8517}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8517 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kwiberg@webrtc.org
2015-02-26 14:34:55 +00:00
parent ac2d27d9ae
commit 00b8f6b364
391 changed files with 1427 additions and 1402 deletions

View File

@ -14,7 +14,7 @@
#include <string>
#include "webrtc/base/constructormagic.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@ -49,7 +49,7 @@ class AudioLoop {
size_t next_index_;
size_t loop_length_samples_;
size_t block_length_samples_;
scoped_ptr<int16_t[]> audio_array_;
rtc::scoped_ptr<int16_t[]> audio_array_;
DISALLOW_COPY_AND_ASSIGN(AudioLoop);
};

View File

@ -11,10 +11,10 @@
#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_EXTERNAL_DECODER_TEST_H_
#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_EXTERNAL_DECODER_TEST_H_
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
namespace webrtc {
namespace test {
@ -52,7 +52,7 @@ class NetEqExternalDecoderTest {
AudioDecoder* decoder_;
int sample_rate_hz_;
int channels_;
scoped_ptr<NetEq> neteq_;
rtc::scoped_ptr<NetEq> neteq_;
};
} // namespace test

View File

@ -14,10 +14,10 @@
#include <gflags/gflags.h>
#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
#include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/typedefs.h"
using google::RegisterFlagValidator;
@ -57,7 +57,7 @@ class GilbertElliotLoss : public LossModel {
// Prob. of losing current packet, when previous packet is not lost.
double prob_trans_01_;
bool lost_last_;
scoped_ptr<UniformLoss> uniform_loss_model_;
rtc::scoped_ptr<UniformLoss> uniform_loss_model_;
};
class NetEqQualityTest : public ::testing::Test {
@ -121,17 +121,17 @@ class NetEqQualityTest : public ::testing::Test {
size_t payload_size_bytes_;
int max_payload_bytes_;
scoped_ptr<InputAudioFile> in_file_;
rtc::scoped_ptr<InputAudioFile> in_file_;
FILE* out_file_;
FILE* log_file_;
scoped_ptr<RtpGenerator> rtp_generator_;
scoped_ptr<NetEq> neteq_;
scoped_ptr<LossModel> loss_model_;
rtc::scoped_ptr<RtpGenerator> rtp_generator_;
rtc::scoped_ptr<NetEq> neteq_;
rtc::scoped_ptr<LossModel> loss_model_;
scoped_ptr<int16_t[]> in_data_;
scoped_ptr<uint8_t[]> payload_;
scoped_ptr<int16_t[]> out_data_;
rtc::scoped_ptr<int16_t[]> in_data_;
rtc::scoped_ptr<uint8_t[]> payload_;
rtc::scoped_ptr<int16_t[]> out_data_;
WebRtcRTPHeader rtp_header_;
size_t total_payload_size_bytes_;

View File

@ -23,6 +23,7 @@
#include "google/gflags.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h"
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
@ -31,7 +32,6 @@
#include "webrtc/modules/audio_coding/neteq/tools/packet.h"
#include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/trace.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/typedefs.h"
@ -270,8 +270,8 @@ int CodecTimestampRate(uint8_t payload_type) {
}
size_t ReplacePayload(webrtc::test::InputAudioFile* replacement_audio_file,
webrtc::scoped_ptr<int16_t[]>* replacement_audio,
webrtc::scoped_ptr<uint8_t[]>* payload,
rtc::scoped_ptr<int16_t[]>* replacement_audio,
rtc::scoped_ptr<uint8_t[]>* payload,
size_t* payload_mem_size_bytes,
size_t* frame_size_samples,
WebRtcRTPHeader* rtp_header,
@ -384,7 +384,7 @@ int main(int argc, char* argv[]) {
}
printf("Input file: %s\n", argv[1]);
webrtc::scoped_ptr<webrtc::test::RtpFileSource> file_source(
rtc::scoped_ptr<webrtc::test::RtpFileSource> file_source(
webrtc::test::RtpFileSource::Create(argv[1]));
assert(file_source.get());
@ -397,7 +397,7 @@ int main(int argc, char* argv[]) {
// Check if a replacement audio file was provided, and if so, open it.
bool replace_payload = false;
webrtc::scoped_ptr<webrtc::test::InputAudioFile> replacement_audio_file;
rtc::scoped_ptr<webrtc::test::InputAudioFile> replacement_audio_file;
if (!FLAGS_replacement_audio_file.empty()) {
replacement_audio_file.reset(
new webrtc::test::InputAudioFile(FLAGS_replacement_audio_file));
@ -405,7 +405,7 @@ int main(int argc, char* argv[]) {
}
// Read first packet.
webrtc::scoped_ptr<webrtc::test::Packet> packet(file_source->NextPacket());
rtc::scoped_ptr<webrtc::test::Packet> packet(file_source->NextPacket());
if (!packet) {
printf(
"Warning: input file is empty, or the filters did not match any "
@ -427,7 +427,7 @@ int main(int argc, char* argv[]) {
// for wav files.)
// Check output file type.
std::string output_file_name = argv[2];
webrtc::scoped_ptr<webrtc::test::AudioSink> output;
rtc::scoped_ptr<webrtc::test::AudioSink> output;
if (output_file_name.size() >= 4 &&
output_file_name.substr(output_file_name.size() - 4) == ".wav") {
// Open a wav file.
@ -454,11 +454,11 @@ int main(int argc, char* argv[]) {
// Set up variables for audio replacement if needed.
webrtc::scoped_ptr<webrtc::test::Packet> next_packet;
rtc::scoped_ptr<webrtc::test::Packet> next_packet;
bool next_packet_available = false;
size_t input_frame_size_timestamps = 0;
webrtc::scoped_ptr<int16_t[]> replacement_audio;
webrtc::scoped_ptr<uint8_t[]> payload;
rtc::scoped_ptr<int16_t[]> replacement_audio;
rtc::scoped_ptr<uint8_t[]> payload;
size_t payload_mem_size_bytes = 0;
if (replace_payload) {
// Initially assume that the frame size is 30 ms at the initial sample rate.

View File

@ -55,7 +55,7 @@ Packet::Packet(uint8_t* packet_memory, size_t allocated_bytes, double time_ms)
virtual_packet_length_bytes_(allocated_bytes),
virtual_payload_length_bytes_(0),
time_ms_(time_ms) {
scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
valid_header_ = ParseHeader(*parser);
}
@ -70,7 +70,7 @@ Packet::Packet(uint8_t* packet_memory,
virtual_packet_length_bytes_(virtual_packet_length_bytes),
virtual_payload_length_bytes_(0),
time_ms_(time_ms) {
scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
valid_header_ = ParseHeader(*parser);
}

View File

@ -14,8 +14,8 @@
#include <list>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@ -103,7 +103,7 @@ class Packet {
void CopyToHeader(RTPHeader* destination) const;
RTPHeader header_;
scoped_ptr<uint8_t[]> payload_memory_;
rtc::scoped_ptr<uint8_t[]> payload_memory_;
const uint8_t* payload_; // First byte after header.
const size_t packet_length_bytes_; // Total length of packet.
size_t payload_length_bytes_; // Length of the payload, after RTP header.

View File

@ -11,7 +11,7 @@
#include "webrtc/modules/audio_coding/neteq/tools/resample_input_audio_file.h"
#include "webrtc/base/checks.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc {
namespace test {
@ -22,7 +22,7 @@ bool ResampleInputAudioFile::Read(size_t samples,
const size_t samples_to_read = samples * file_rate_hz_ / output_rate_hz;
CHECK_EQ(samples_to_read * output_rate_hz, samples * file_rate_hz_)
<< "Frame size and sample rates don't add up to an integer.";
scoped_ptr<int16_t[]> temp_destination(new int16_t[samples_to_read]);
rtc::scoped_ptr<int16_t[]> temp_destination(new int16_t[samples_to_read]);
if (!InputAudioFile::Read(samples_to_read, temp_destination.get()))
return false;
resampler_.ResetIfNeeded(

View File

@ -13,9 +13,9 @@
#include <vector>
#include "google/gflags.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_coding/neteq/tools/packet.h"
#include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
// Flag validator.
static bool ValidatePayloadType(const char* flagname, int32_t value) {
@ -60,7 +60,7 @@ int main(int argc, char* argv[]) {
}
printf("Input file: %s\n", argv[1]);
webrtc::scoped_ptr<webrtc::test::RtpFileSource> file_source(
rtc::scoped_ptr<webrtc::test::RtpFileSource> file_source(
webrtc::test::RtpFileSource::Create(argv[1]));
assert(file_source.get());
// Set RTP extension ID.
@ -90,7 +90,7 @@ int main(int argc, char* argv[]) {
}
fprintf(out_file, "\n");
webrtc::scoped_ptr<webrtc::test::Packet> packet;
rtc::scoped_ptr<webrtc::test::Packet> packet;
while (true) {
packet.reset(file_source->NextPacket());
if (!packet.get()) {

View File

@ -52,13 +52,11 @@ Packet* RtpFileSource::NextPacket() {
// Read the next one.
continue;
}
scoped_ptr<uint8_t[]> packet_memory(new uint8_t[temp_packet.length]);
rtc::scoped_ptr<uint8_t[]> packet_memory(new uint8_t[temp_packet.length]);
memcpy(packet_memory.get(), temp_packet.data, temp_packet.length);
scoped_ptr<Packet> packet(new Packet(packet_memory.release(),
temp_packet.length,
temp_packet.original_length,
temp_packet.time_ms,
*parser_.get()));
rtc::scoped_ptr<Packet> packet(new Packet(
packet_memory.release(), temp_packet.length,
temp_packet.original_length, temp_packet.time_ms, *parser_.get()));
if (!packet->valid_header()) {
assert(false);
return NULL;

View File

@ -15,10 +15,10 @@
#include <string>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_coding/neteq/tools/packet_source.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
namespace webrtc {
@ -52,8 +52,8 @@ class RtpFileSource : public PacketSource {
bool OpenFile(const std::string& file_name);
scoped_ptr<RtpFileReader> rtp_reader_;
scoped_ptr<RtpHeaderParser> parser_;
rtc::scoped_ptr<RtpFileReader> rtp_reader_;
rtc::scoped_ptr<RtpHeaderParser> parser_;
DISALLOW_COPY_AND_ASSIGN(RtpFileSource);
};

View File

@ -11,11 +11,11 @@
#include <stdio.h>
#include "webrtc/base/checks.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/test/rtp_file_reader.h"
#include "webrtc/test/rtp_file_writer.h"
using webrtc::scoped_ptr;
using rtc::scoped_ptr;
using webrtc::test::RtpFileReader;
using webrtc::test::RtpFileWriter;