Replace scoped_ptr with unique_ptr in webrtc/modules/video_coding/
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1721353002
Cr-Commit-Position: refs/heads/master@{#11814}
diff --git a/webrtc/modules/video_coding/codec_database.h b/webrtc/modules/video_coding/codec_database.h
index 62ec30a..4ba72f7 100644
--- a/webrtc/modules/video_coding/codec_database.h
+++ b/webrtc/modules/video_coding/codec_database.h
@@ -12,8 +12,8 @@
#define WEBRTC_MODULES_VIDEO_CODING_CODEC_DATABASE_H_
#include <map>
+#include <memory>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/modules/video_coding/include/video_coding.h"
#include "webrtc/modules/video_coding/generic_decoder.h"
@@ -28,7 +28,7 @@
int number_of_cores,
bool require_key_frame);
- rtc::scoped_ptr<VideoCodec> settings;
+ std::unique_ptr<VideoCodec> settings;
int number_of_cores;
bool require_key_frame;
};
@@ -156,7 +156,7 @@
bool internal_source_;
VideoEncoderRateObserver* const encoder_rate_observer_;
VCMEncodedFrameCallback* const encoded_frame_callback_;
- rtc::scoped_ptr<VCMGenericEncoder> ptr_encoder_;
+ std::unique_ptr<VCMGenericEncoder> ptr_encoder_;
VCMGenericDecoder* ptr_decoder_;
DecoderMap dec_map_;
ExternalDecoderMap dec_external_map_;
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
index c889554..e724c37 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
+++ b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
@@ -12,13 +12,14 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_
+#include <memory>
+
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
extern "C" {
#include "third_party/ffmpeg/libavcodec/avcodec.h"
} // extern "C"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_video/include/i420_buffer_pool.h"
namespace webrtc {
@@ -67,8 +68,8 @@
void ReportError();
I420BufferPool pool_;
- rtc::scoped_ptr<AVCodecContext, AVCodecContextDeleter> av_context_;
- rtc::scoped_ptr<AVFrame, AVFrameDeleter> av_frame_;
+ std::unique_ptr<AVCodecContext, AVCodecContextDeleter> av_context_;
+ std::unique_ptr<AVFrame, AVFrameDeleter> av_frame_;
DecodedImageCallback* decoded_image_callback_;
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 03c1c8e..0e065c5 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -81,7 +81,7 @@
// is updated to point to each fragment, with offsets and lengths set as to
// exclude the start codes.
static void RtpFragmentize(EncodedImage* encoded_image,
- rtc::scoped_ptr<uint8_t[]>* encoded_image_buffer,
+ std::unique_ptr<uint8_t[]>* encoded_image_buffer,
const VideoFrame& frame,
SFrameBSInfo* info,
RTPFragmentationHeader* frag_header) {
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h
index 0ac3b4e..d7493e0 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h
@@ -14,9 +14,9 @@
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
+#include <memory>
#include <vector>
-#include "webrtc/base/scoped_ptr.h"
class ISVCEncoder;
@@ -65,7 +65,7 @@
VideoCodec codec_settings_;
EncodedImage encoded_image_;
- rtc::scoped_ptr<uint8_t[]> encoded_image_buffer_;
+ std::unique_ptr<uint8_t[]> encoded_image_buffer_;
EncodedImageCallback* encoded_image_callback_;
bool has_reported_init_;
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc
index 20d8aef..eb11c59 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc
@@ -13,6 +13,8 @@
#if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
+#include <memory>
+
#include "libyuv/convert.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
@@ -85,7 +87,7 @@
CVImageBufferRef image_buffer,
CMTime timestamp,
CMTime duration) {
- rtc::scoped_ptr<FrameDecodeParams> decode_params(
+ std::unique_ptr<FrameDecodeParams> decode_params(
reinterpret_cast<FrameDecodeParams*>(params));
if (status != noErr) {
LOG(LS_ERROR) << "Failed to decode frame. Status: " << status;
@@ -142,7 +144,7 @@
}
VTDecodeFrameFlags decode_flags =
kVTDecodeFrame_EnableAsynchronousDecompression;
- rtc::scoped_ptr<internal::FrameDecodeParams> frame_decode_params;
+ std::unique_ptr<internal::FrameDecodeParams> frame_decode_params;
frame_decode_params.reset(
new internal::FrameDecodeParams(callback_, input_image._timeStamp));
OSStatus status = VTDecompressionSessionDecodeFrame(
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
index c7f82c1..407bb67 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
@@ -13,13 +13,13 @@
#if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
+#include <memory>
#include <string>
#include <vector>
#include "libyuv/convert_from.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.h"
#include "webrtc/system_wrappers/include/clock.h"
@@ -43,7 +43,7 @@
CFStringGetMaximumSizeForEncoding(CFStringGetLength(cf_string),
kCFStringEncodingUTF8) +
1;
- rtc::scoped_ptr<char[]> buffer(new char[buffer_size]);
+ std::unique_ptr<char[]> buffer(new char[buffer_size]);
if (CFStringGetCString(cf_string, buffer.get(), buffer_size,
kCFStringEncodingUTF8)) {
// Copy over the characters.
@@ -177,7 +177,7 @@
OSStatus status,
VTEncodeInfoFlags info_flags,
CMSampleBufferRef sample_buffer) {
- rtc::scoped_ptr<FrameEncodeParams> encode_params(
+ std::unique_ptr<FrameEncodeParams> encode_params(
reinterpret_cast<FrameEncodeParams*>(params));
encode_params->encoder->OnEncodedFrame(
status, info_flags, sample_buffer, encode_params->codec_specific_info,
@@ -277,7 +277,7 @@
CFTypeRef values[] = {kCFBooleanTrue};
frame_properties = internal::CreateCFDictionary(keys, values, 1);
}
- rtc::scoped_ptr<internal::FrameEncodeParams> encode_params;
+ std::unique_ptr<internal::FrameEncodeParams> encode_params;
encode_params.reset(new internal::FrameEncodeParams(
this, codec_specific_info, width_, height_, input_image.render_time_ms(),
input_image.timestamp()));
@@ -462,11 +462,16 @@
// Convert the sample buffer into a buffer suitable for RTP packetization.
// TODO(tkchin): Allocate buffers through a pool.
- rtc::scoped_ptr<rtc::Buffer> buffer(new rtc::Buffer());
- rtc::scoped_ptr<webrtc::RTPFragmentationHeader> header;
- if (!H264CMSampleBufferToAnnexBBuffer(sample_buffer, is_keyframe,
- buffer.get(), header.accept())) {
- return;
+ std::unique_ptr<rtc::Buffer> buffer(new rtc::Buffer());
+ std::unique_ptr<webrtc::RTPFragmentationHeader> header;
+ {
+ webrtc::RTPFragmentationHeader* header_raw;
+ bool result = H264CMSampleBufferToAnnexBBuffer(sample_buffer, is_keyframe,
+ buffer.get(), &header_raw);
+ header.reset(header_raw);
+ if (!result) {
+ return;
+ }
}
webrtc::EncodedImage frame(buffer->data(), buffer->size(), buffer->size());
frame._encodedWidth = width;
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
index 322c213..8328a56 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
@@ -14,6 +14,7 @@
#if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
#include <CoreFoundation/CoreFoundation.h>
+#include <memory>
#include <vector>
#include "webrtc/base/checks.h"
@@ -139,7 +140,7 @@
}
RTC_DCHECK_EQ(bytes_remaining, (size_t)0);
- rtc::scoped_ptr<webrtc::RTPFragmentationHeader> header;
+ std::unique_ptr<webrtc::RTPFragmentationHeader> header;
header.reset(new webrtc::RTPFragmentationHeader());
header->VerifyAndAllocateFragmentationHeader(frag_offsets.size());
RTC_DCHECK_EQ(frag_lengths.size(), frag_offsets.size());
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu_unittest.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu_unittest.cc
index 36946f1..4087dbc 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu_unittest.cc
@@ -9,6 +9,8 @@
*
*/
+#include <memory>
+
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/arraysize.h"
@@ -90,7 +92,7 @@
TEST(AvccBufferWriterTest, TestEmptyOutputBuffer) {
const uint8_t expected_buffer[] = {0x00};
const size_t buffer_size = 1;
- rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
memset(buffer.get(), 0, buffer_size);
AvccBufferWriter writer(buffer.get(), 0);
EXPECT_EQ(0u, writer.BytesRemaining());
@@ -104,7 +106,7 @@
0x00, 0x00, 0x00, 0x03, 0xAA, 0xBB, 0xCC,
};
const size_t buffer_size = arraysize(NALU_TEST_DATA_0) + 4;
- rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
AvccBufferWriter writer(buffer.get(), buffer_size);
EXPECT_EQ(buffer_size, writer.BytesRemaining());
EXPECT_TRUE(writer.WriteNalu(NALU_TEST_DATA_0, arraysize(NALU_TEST_DATA_0)));
@@ -123,7 +125,7 @@
// clang-format on
const size_t buffer_size =
arraysize(NALU_TEST_DATA_0) + arraysize(NALU_TEST_DATA_1) + 8;
- rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
AvccBufferWriter writer(buffer.get(), buffer_size);
EXPECT_EQ(buffer_size, writer.BytesRemaining());
EXPECT_TRUE(writer.WriteNalu(NALU_TEST_DATA_0, arraysize(NALU_TEST_DATA_0)));
@@ -138,7 +140,7 @@
TEST(AvccBufferWriterTest, TestOverflow) {
const uint8_t expected_buffer[] = {0x00, 0x00, 0x00};
const size_t buffer_size = arraysize(NALU_TEST_DATA_0);
- rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
memset(buffer.get(), 0, buffer_size);
AvccBufferWriter writer(buffer.get(), buffer_size);
EXPECT_EQ(buffer_size, writer.BytesRemaining());
diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
index 5b33e82..e64babd 100644
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
@@ -14,6 +14,7 @@
#include <string.h>
#include <limits>
+#include <memory>
#include <vector>
#include "webrtc/system_wrappers/include/cpu_info.h"
@@ -283,7 +284,7 @@
// Make a raw copy of the |encoded_image| buffer.
size_t copied_buffer_size = encoded_image._length +
EncodedImage::GetBufferPaddingBytes(codec);
- rtc::scoped_ptr<uint8_t[]> copied_buffer(new uint8_t[copied_buffer_size]);
+ std::unique_ptr<uint8_t[]> copied_buffer(new uint8_t[copied_buffer_size]);
memcpy(copied_buffer.get(), encoded_image._buffer, encoded_image._length);
// The image to feed to the decoder.
EncodedImage copied_image;
@@ -350,7 +351,7 @@
}
// TODO(mikhal): Extracting the buffer for now - need to update test.
size_t length = CalcBufferSize(kI420, up_image.width(), up_image.height());
- rtc::scoped_ptr<uint8_t[]> image_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> image_buffer(new uint8_t[length]);
int extracted_length = ExtractBuffer(up_image, length, image_buffer.get());
assert(extracted_length > 0);
// Update our copy of the last successful frame:
@@ -364,7 +365,7 @@
// Update our copy of the last successful frame:
// TODO(mikhal): Add as a member function, so won't be allocated per frame.
size_t length = CalcBufferSize(kI420, image.width(), image.height());
- rtc::scoped_ptr<uint8_t[]> image_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> image_buffer(new uint8_t[length]);
int extracted_length = ExtractBuffer(image, length, image_buffer.get());
assert(extracted_length > 0);
memcpy(last_successful_frame_buffer_, image_buffer.get(), extracted_length);
diff --git a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
index e5e8894..2733d7d 100644
--- a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
@@ -8,12 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <vector>
#include "gtest/gtest.h"
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h"
#include "webrtc/modules/video_coding/utility/mock/mock_frame_dropper.h"
@@ -105,7 +105,7 @@
int min_qp_;
int max_qp_;
int frame_size_;
- rtc::scoped_ptr<ScreenshareLayers> layers_;
+ std::unique_ptr<ScreenshareLayers> layers_;
};
TEST_F(ScreenshareLayerTest, 1Layer) {
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
index f75a158..777ac1b 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
@@ -12,10 +12,10 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SIMULCAST_ENCODER_ADAPTER_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SIMULCAST_ENCODER_ADAPTER_H_
+#include <memory>
#include <string>
#include <vector>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
namespace webrtc {
@@ -110,8 +110,8 @@
bool Initialized() const;
- rtc::scoped_ptr<VideoEncoderFactory> factory_;
- rtc::scoped_ptr<TemporalLayersFactory> screensharing_tl_factory_;
+ std::unique_ptr<VideoEncoderFactory> factory_;
+ std::unique_ptr<TemporalLayersFactory> screensharing_tl_factory_;
VideoCodec codec_;
std::vector<StreamInfo> streaminfos_;
EncodedImageCallback* encoded_complete_callback_;
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
index 6e449f2..589edb6 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <vector>
#include "testing/gmock/include/gmock/gmock.h"
@@ -340,8 +341,8 @@
}
protected:
- rtc::scoped_ptr<TestSimulcastEncoderAdapterFakeHelper> helper_;
- rtc::scoped_ptr<VP8Encoder> adapter_;
+ std::unique_ptr<TestSimulcastEncoderAdapterFakeHelper> helper_;
+ std::unique_ptr<VP8Encoder> adapter_;
VideoCodec codec_;
int last_encoded_image_width_;
int last_encoded_image_height_;
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h b/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
index 4e1e686..9f0dc5c 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
@@ -12,10 +12,10 @@
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SIMULCAST_UNITTEST_H_
#include <algorithm>
+#include <memory>
#include <vector>
#include "webrtc/base/checks.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
@@ -944,9 +944,9 @@
}
}
- rtc::scoped_ptr<VP8Encoder> encoder_;
+ std::unique_ptr<VP8Encoder> encoder_;
MockEncodedImageCallback encoder_callback_;
- rtc::scoped_ptr<VP8Decoder> decoder_;
+ std::unique_ptr<VP8Decoder> decoder_;
MockDecodedImageCallback decoder_callback_;
VideoCodec settings_;
VideoFrame input_frame_;
diff --git a/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
index 0dd3d7c..f3ebfa1 100644
--- a/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
@@ -10,9 +10,10 @@
#include <stdio.h>
+#include <memory>
+
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/checks.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/system_wrappers/include/tick_util.h"
@@ -41,7 +42,7 @@
private:
EncodedImage* const encoded_frame_;
- rtc::scoped_ptr<uint8_t[]> frame_buffer_;
+ std::unique_ptr<uint8_t[]> frame_buffer_;
bool encode_complete_;
};
@@ -181,13 +182,13 @@
const int kWidth = 172;
const int kHeight = 144;
- rtc::scoped_ptr<Vp8UnitTestEncodeCompleteCallback> encode_complete_callback_;
- rtc::scoped_ptr<Vp8UnitTestDecodeCompleteCallback> decode_complete_callback_;
- rtc::scoped_ptr<uint8_t[]> source_buffer_;
+ std::unique_ptr<Vp8UnitTestEncodeCompleteCallback> encode_complete_callback_;
+ std::unique_ptr<Vp8UnitTestDecodeCompleteCallback> decode_complete_callback_;
+ std::unique_ptr<uint8_t[]> source_buffer_;
FILE* source_file_;
VideoFrame input_frame_;
- rtc::scoped_ptr<VideoEncoder> encoder_;
- rtc::scoped_ptr<VideoDecoder> decoder_;
+ std::unique_ptr<VideoEncoder> encoder_;
+ std::unique_ptr<VideoDecoder> decoder_;
EncodedImage encoded_frame_;
VideoFrame decoded_frame_;
size_t length_source_frame_;
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_sequence_coder.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_sequence_coder.cc
index 9e54665..33dae8d 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_sequence_coder.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_sequence_coder.cc
@@ -8,9 +8,10 @@
* 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/checks.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_video/include/video_image.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
@@ -147,7 +148,7 @@
EXPECT_EQ(0, decoder->InitDecode(&inst, 1));
webrtc::VideoFrame input_frame;
size_t length = webrtc::CalcBufferSize(webrtc::kI420, width, height);
- rtc::scoped_ptr<uint8_t[]> frame_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> frame_buffer(new uint8_t[length]);
int half_width = (width + 1) / 2;
// Set and register callbacks.
diff --git a/webrtc/modules/video_coding/codecs/vp9/screenshare_layers_unittest.cc b/webrtc/modules/video_coding/codecs/vp9/screenshare_layers_unittest.cc
index 5eb7b23..4708172 100644
--- a/webrtc/modules/video_coding/codecs/vp9/screenshare_layers_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp9/screenshare_layers_unittest.cc
@@ -9,6 +9,7 @@
*/
#include <limits>
+#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
#include "vpx/vp8cx.h"
@@ -81,7 +82,7 @@
Settings expected_;
SimulatedClock clock_;
- rtc::scoped_ptr<ScreenshareLayersVP9> layers_;
+ std::unique_ptr<ScreenshareLayersVP9> layers_;
};
TEST_F(ScreenshareLayerTestVP9, NoRefsOnKeyFrame) {
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h
index f861fef..3ff2d1f 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h
@@ -12,6 +12,7 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_IMPL_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_IMPL_H_
+#include <memory>
#include <vector>
#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
@@ -128,7 +129,7 @@
int64_t frames_encoded_;
uint8_t num_ref_pics_[kMaxVp9NumberOfSpatialLayers];
uint8_t p_diff_[kMaxVp9NumberOfSpatialLayers][kMaxVp9RefPics];
- rtc::scoped_ptr<ScreenshareLayersVP9> spatial_layer_;
+ std::unique_ptr<ScreenshareLayersVP9> spatial_layer_;
};
class VP9DecoderImpl : public VP9Decoder {
diff --git a/webrtc/modules/video_coding/generic_encoder.h b/webrtc/modules/video_coding/generic_encoder.h
index da7297f..e96d995 100644
--- a/webrtc/modules/video_coding/generic_encoder.h
+++ b/webrtc/modules/video_coding/generic_encoder.h
@@ -18,7 +18,6 @@
#include "webrtc/modules/video_coding/include/video_coding_defines.h"
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/scoped_ptr.h"
namespace webrtc {
class CriticalSectionWrapper;
diff --git a/webrtc/modules/video_coding/jitter_buffer.cc b/webrtc/modules/video_coding/jitter_buffer.cc
index 663bf03..ca8c0d9 100644
--- a/webrtc/modules/video_coding/jitter_buffer.cc
+++ b/webrtc/modules/video_coding/jitter_buffer.cc
@@ -215,7 +215,7 @@
}
VCMJitterBuffer::VCMJitterBuffer(Clock* clock,
- rtc::scoped_ptr<EventWrapper> event)
+ std::unique_ptr<EventWrapper> event)
: clock_(clock),
running_(false),
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
diff --git a/webrtc/modules/video_coding/jitter_buffer.h b/webrtc/modules/video_coding/jitter_buffer.h
index 01e2775..8ba338f 100644
--- a/webrtc/modules/video_coding/jitter_buffer.h
+++ b/webrtc/modules/video_coding/jitter_buffer.h
@@ -13,6 +13,7 @@
#include <list>
#include <map>
+#include <memory>
#include <set>
#include <vector>
@@ -103,7 +104,7 @@
class VCMJitterBuffer {
public:
- VCMJitterBuffer(Clock* clock, rtc::scoped_ptr<EventWrapper> event);
+ VCMJitterBuffer(Clock* clock, std::unique_ptr<EventWrapper> event);
~VCMJitterBuffer();
@@ -325,7 +326,7 @@
bool running_;
CriticalSectionWrapper* crit_sect_;
// Event to signal when we have a frame ready for decoder.
- rtc::scoped_ptr<EventWrapper> frame_event_;
+ std::unique_ptr<EventWrapper> frame_event_;
// Number of allocated frames.
int max_number_of_frames_;
UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_);
diff --git a/webrtc/modules/video_coding/jitter_buffer_unittest.cc b/webrtc/modules/video_coding/jitter_buffer_unittest.cc
index 8abc1b5..c538468 100644
--- a/webrtc/modules/video_coding/jitter_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/jitter_buffer_unittest.cc
@@ -11,6 +11,7 @@
#include <string.h>
#include <list>
+#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/video_coding/frame_buffer.h"
@@ -190,7 +191,7 @@
clock_.reset(new SimulatedClock(0));
jitter_buffer_.reset(new VCMJitterBuffer(
clock_.get(),
- rtc::scoped_ptr<EventWrapper>(event_factory_.CreateEvent())));
+ std::unique_ptr<EventWrapper>(event_factory_.CreateEvent())));
jitter_buffer_->Start();
seq_num_ = 1234;
timestamp_ = 0;
@@ -273,10 +274,10 @@
uint32_t timestamp_;
int size_;
uint8_t data_[1500];
- rtc::scoped_ptr<VCMPacket> packet_;
- rtc::scoped_ptr<SimulatedClock> clock_;
+ std::unique_ptr<VCMPacket> packet_;
+ std::unique_ptr<SimulatedClock> clock_;
NullEventFactory event_factory_;
- rtc::scoped_ptr<VCMJitterBuffer> jitter_buffer_;
+ std::unique_ptr<VCMJitterBuffer> jitter_buffer_;
};
class TestRunningJitterBuffer : public ::testing::Test {
@@ -289,7 +290,7 @@
oldest_packet_to_nack_ = 250;
jitter_buffer_ = new VCMJitterBuffer(
clock_.get(),
- rtc::scoped_ptr<EventWrapper>(event_factory_.CreateEvent()));
+ std::unique_ptr<EventWrapper>(event_factory_.CreateEvent()));
stream_generator_ = new StreamGenerator(0, clock_->TimeInMilliseconds());
jitter_buffer_->Start();
jitter_buffer_->SetNackSettings(max_nack_list_size_, oldest_packet_to_nack_,
@@ -380,7 +381,7 @@
VCMJitterBuffer* jitter_buffer_;
StreamGenerator* stream_generator_;
- rtc::scoped_ptr<SimulatedClock> clock_;
+ std::unique_ptr<SimulatedClock> clock_;
NullEventFactory event_factory_;
size_t max_nack_list_size_;
int oldest_packet_to_nack_;
diff --git a/webrtc/modules/video_coding/media_opt_util.h b/webrtc/modules/video_coding/media_opt_util.h
index a016a03..6b47e3b 100644
--- a/webrtc/modules/video_coding/media_opt_util.h
+++ b/webrtc/modules/video_coding/media_opt_util.h
@@ -14,8 +14,9 @@
#include <math.h>
#include <stdlib.h>
+#include <memory>
+
#include "webrtc/base/exp_filter.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/internal_defines.h"
#include "webrtc/modules/video_coding/qm_select.h"
#include "webrtc/system_wrappers/include/trace.h"
@@ -333,7 +334,7 @@
// Sets the available loss protection methods.
void UpdateMaxLossHistory(uint8_t lossPr255, int64_t now);
uint8_t MaxFilteredLossPr(int64_t nowMs) const;
- rtc::scoped_ptr<VCMProtectionMethod> _selectedMethod;
+ std::unique_ptr<VCMProtectionMethod> _selectedMethod;
VCMProtectionParameters _currentParameters;
int64_t _rtt;
float _lossPr;
diff --git a/webrtc/modules/video_coding/media_optimization.h b/webrtc/modules/video_coding/media_optimization.h
index 54389bf..060cd89 100644
--- a/webrtc/modules/video_coding/media_optimization.h
+++ b/webrtc/modules/video_coding/media_optimization.h
@@ -12,8 +12,8 @@
#define WEBRTC_MODULES_VIDEO_CODING_MEDIA_OPTIMIZATION_H_
#include <list>
+#include <memory>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/video_coding/include/video_coding.h"
#include "webrtc/modules/video_coding/media_opt_util.h"
@@ -134,7 +134,7 @@
uint32_t SentFrameRateInternal() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Protect all members.
- rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
+ std::unique_ptr<CriticalSectionWrapper> crit_sect_;
Clock* clock_ GUARDED_BY(crit_sect_);
int32_t max_bit_rate_ GUARDED_BY(crit_sect_);
@@ -142,8 +142,8 @@
uint16_t codec_width_ GUARDED_BY(crit_sect_);
uint16_t codec_height_ GUARDED_BY(crit_sect_);
float user_frame_rate_ GUARDED_BY(crit_sect_);
- rtc::scoped_ptr<FrameDropper> frame_dropper_ GUARDED_BY(crit_sect_);
- rtc::scoped_ptr<VCMLossProtectionLogic> loss_prot_logic_
+ std::unique_ptr<FrameDropper> frame_dropper_ GUARDED_BY(crit_sect_);
+ std::unique_ptr<VCMLossProtectionLogic> loss_prot_logic_
GUARDED_BY(crit_sect_);
uint8_t fraction_lost_ GUARDED_BY(crit_sect_);
uint32_t send_statistics_[4] GUARDED_BY(crit_sect_);
@@ -158,8 +158,8 @@
uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_);
uint32_t key_frame_cnt_ GUARDED_BY(crit_sect_);
uint32_t delta_frame_cnt_ GUARDED_BY(crit_sect_);
- rtc::scoped_ptr<VCMContentMetricsProcessing> content_ GUARDED_BY(crit_sect_);
- rtc::scoped_ptr<VCMQmResolution> qm_resolution_ GUARDED_BY(crit_sect_);
+ std::unique_ptr<VCMContentMetricsProcessing> content_ GUARDED_BY(crit_sect_);
+ std::unique_ptr<VCMQmResolution> qm_resolution_ GUARDED_BY(crit_sect_);
int64_t last_qm_update_time_ GUARDED_BY(crit_sect_);
int64_t last_change_time_ GUARDED_BY(crit_sect_); // Content/user triggered.
int num_layers_ GUARDED_BY(crit_sect_);
diff --git a/webrtc/modules/video_coding/receiver.cc b/webrtc/modules/video_coding/receiver.cc
index fa2a2dc..988f1ef 100644
--- a/webrtc/modules/video_coding/receiver.cc
+++ b/webrtc/modules/video_coding/receiver.cc
@@ -32,14 +32,14 @@
EventFactory* event_factory)
: VCMReceiver(timing,
clock,
- rtc::scoped_ptr<EventWrapper>(event_factory->CreateEvent()),
- rtc::scoped_ptr<EventWrapper>(event_factory->CreateEvent())) {
+ std::unique_ptr<EventWrapper>(event_factory->CreateEvent()),
+ std::unique_ptr<EventWrapper>(event_factory->CreateEvent())) {
}
VCMReceiver::VCMReceiver(VCMTiming* timing,
Clock* clock,
- rtc::scoped_ptr<EventWrapper> receiver_event,
- rtc::scoped_ptr<EventWrapper> jitter_buffer_event)
+ std::unique_ptr<EventWrapper> receiver_event,
+ std::unique_ptr<EventWrapper> jitter_buffer_event)
: crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
clock_(clock),
jitter_buffer_(clock_, std::move(jitter_buffer_event)),
diff --git a/webrtc/modules/video_coding/receiver.h b/webrtc/modules/video_coding/receiver.h
index ff0eef8..7b2149d 100644
--- a/webrtc/modules/video_coding/receiver.h
+++ b/webrtc/modules/video_coding/receiver.h
@@ -11,6 +11,7 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_
#define WEBRTC_MODULES_VIDEO_CODING_RECEIVER_H_
+#include <memory>
#include <vector>
#include "webrtc/modules/video_coding/jitter_buffer.h"
@@ -35,8 +36,8 @@
// that of VCMReceiver itself.
VCMReceiver(VCMTiming* timing,
Clock* clock,
- rtc::scoped_ptr<EventWrapper> receiver_event,
- rtc::scoped_ptr<EventWrapper> jitter_buffer_event);
+ std::unique_ptr<EventWrapper> receiver_event,
+ std::unique_ptr<EventWrapper> jitter_buffer_event);
~VCMReceiver();
@@ -83,7 +84,7 @@
Clock* const clock_;
VCMJitterBuffer jitter_buffer_;
VCMTiming* timing_;
- rtc::scoped_ptr<EventWrapper> render_wait_event_;
+ std::unique_ptr<EventWrapper> render_wait_event_;
int max_video_delay_ms_;
};
diff --git a/webrtc/modules/video_coding/receiver_unittest.cc b/webrtc/modules/video_coding/receiver_unittest.cc
index 1f3a144..42cc9ac 100644
--- a/webrtc/modules/video_coding/receiver_unittest.cc
+++ b/webrtc/modules/video_coding/receiver_unittest.cc
@@ -10,6 +10,7 @@
#include <string.h>
#include <list>
+#include <memory>
#include <queue>
#include <vector>
@@ -84,11 +85,11 @@
return true;
}
- rtc::scoped_ptr<SimulatedClock> clock_;
+ std::unique_ptr<SimulatedClock> clock_;
VCMTiming timing_;
NullEventFactory event_factory_;
VCMReceiver receiver_;
- rtc::scoped_ptr<StreamGenerator> stream_generator_;
+ std::unique_ptr<StreamGenerator> stream_generator_;
};
TEST_F(TestVCMReceiver, RenderBufferSize_AllComplete) {
@@ -449,8 +450,8 @@
receiver_(
&timing_,
&clock_,
- rtc::scoped_ptr<EventWrapper>(new FrameInjectEvent(&clock_, false)),
- rtc::scoped_ptr<EventWrapper>(
+ std::unique_ptr<EventWrapper>(new FrameInjectEvent(&clock_, false)),
+ std::unique_ptr<EventWrapper>(
new FrameInjectEvent(&clock_, true))) {}
virtual void SetUp() { receiver_.Reset(); }
diff --git a/webrtc/modules/video_coding/test/rtp_player.cc b/webrtc/modules/video_coding/test/rtp_player.cc
index 9b64906..97d63e0 100644
--- a/webrtc/modules/video_coding/test/rtp_player.cc
+++ b/webrtc/modules/video_coding/test/rtp_player.cc
@@ -13,8 +13,8 @@
#include <stdio.h>
#include <map>
+#include <memory>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
@@ -62,7 +62,7 @@
uint16_t seq_num() const { return seq_num_; }
private:
- rtc::scoped_ptr<uint8_t[]> data_;
+ std::unique_ptr<uint8_t[]> data_;
size_t length_;
int64_t resend_time_ms_;
uint32_t ssrc_;
@@ -177,7 +177,7 @@
typedef RtpPacketList::iterator RtpPacketIterator;
typedef RtpPacketList::const_iterator ConstRtpPacketIterator;
- rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
+ std::unique_ptr<CriticalSectionWrapper> crit_sect_;
FILE* debug_file_;
int loss_count_;
RtpPacketList packets_;
@@ -210,7 +210,7 @@
}
DEBUG_LOG1("Registering handler for ssrc=%08x", ssrc);
- rtc::scoped_ptr<Handler> handler(
+ std::unique_ptr<Handler> handler(
new Handler(ssrc, payload_types_, lost_packets));
handler->payload_sink_.reset(payload_sink_factory_->Create(handler.get()));
if (handler->payload_sink_.get() == NULL) {
@@ -292,10 +292,10 @@
virtual uint32_t ssrc() const { return ssrc_; }
virtual const PayloadTypes& payload_types() const { return payload_types_; }
- rtc::scoped_ptr<RtpHeaderParser> rtp_header_parser_;
- rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
- rtc::scoped_ptr<RtpReceiver> rtp_module_;
- rtc::scoped_ptr<PayloadSinkInterface> payload_sink_;
+ std::unique_ptr<RtpHeaderParser> rtp_header_parser_;
+ std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
+ std::unique_ptr<RtpReceiver> rtp_module_;
+ std::unique_ptr<PayloadSinkInterface> payload_sink_;
private:
uint32_t ssrc_;
@@ -320,7 +320,7 @@
RtpPlayerImpl(PayloadSinkFactoryInterface* payload_sink_factory,
const PayloadTypes& payload_types,
Clock* clock,
- rtc::scoped_ptr<test::RtpFileReader>* packet_source,
+ std::unique_ptr<test::RtpFileReader>* packet_source,
float loss_rate,
int64_t rtt_ms,
bool reordering)
@@ -419,7 +419,7 @@
assert(data);
assert(length > 0);
- rtc::scoped_ptr<RtpHeaderParser> rtp_header_parser(
+ std::unique_ptr<RtpHeaderParser> rtp_header_parser(
RtpHeaderParser::Create());
if (!rtp_header_parser->IsRtcp(data, length)) {
RTPHeader header;
@@ -448,7 +448,7 @@
SsrcHandlers ssrc_handlers_;
Clock* clock_;
- rtc::scoped_ptr<test::RtpFileReader> packet_source_;
+ std::unique_ptr<test::RtpFileReader> packet_source_;
test::RtpPacket next_packet_;
uint32_t next_rtp_time_;
bool first_packet_;
@@ -460,7 +460,7 @@
uint32_t no_loss_startup_;
bool end_of_file_;
bool reordering_;
- rtc::scoped_ptr<RawRtpPacket> reorder_buffer_;
+ std::unique_ptr<RawRtpPacket> reorder_buffer_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpPlayerImpl);
};
@@ -472,7 +472,7 @@
float loss_rate,
int64_t rtt_ms,
bool reordering) {
- rtc::scoped_ptr<test::RtpFileReader> packet_source(
+ std::unique_ptr<test::RtpFileReader> packet_source(
test::RtpFileReader::Create(test::RtpFileReader::kRtpDump,
input_filename));
if (packet_source.get() == NULL) {
@@ -483,7 +483,7 @@
}
}
- rtc::scoped_ptr<RtpPlayerImpl> impl(
+ std::unique_ptr<RtpPlayerImpl> impl(
new RtpPlayerImpl(payload_sink_factory, payload_types, clock,
&packet_source, loss_rate, rtt_ms, reordering));
return impl.release();
diff --git a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc
index 88242fd..e774db1 100644
--- a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc
+++ b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc
@@ -27,8 +27,8 @@
public:
VcmPayloadSink(VcmPayloadSinkFactory* factory,
RtpStreamInterface* stream,
- rtc::scoped_ptr<VideoCodingModule>* vcm,
- rtc::scoped_ptr<FileOutputFrameReceiver>* frame_receiver)
+ std::unique_ptr<VideoCodingModule>* vcm,
+ std::unique_ptr<FileOutputFrameReceiver>* frame_receiver)
: factory_(factory), stream_(stream), vcm_(), frame_receiver_() {
assert(factory);
assert(stream);
@@ -87,8 +87,8 @@
private:
VcmPayloadSinkFactory* factory_;
RtpStreamInterface* stream_;
- rtc::scoped_ptr<VideoCodingModule> vcm_;
- rtc::scoped_ptr<FileOutputFrameReceiver> frame_receiver_;
+ std::unique_ptr<VideoCodingModule> vcm_;
+ std::unique_ptr<FileOutputFrameReceiver> frame_receiver_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VcmPayloadSink);
};
@@ -124,7 +124,7 @@
assert(stream);
CriticalSectionScoped cs(crit_sect_.get());
- rtc::scoped_ptr<VideoCodingModule> vcm(
+ std::unique_ptr<VideoCodingModule> vcm(
VideoCodingModule::Create(clock_, null_event_factory_.get()));
if (vcm.get() == NULL) {
return NULL;
@@ -149,9 +149,9 @@
vcm->SetMinimumPlayoutDelay(min_playout_delay_ms_);
vcm->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0);
- rtc::scoped_ptr<FileOutputFrameReceiver> frame_receiver(
+ std::unique_ptr<FileOutputFrameReceiver> frame_receiver(
new FileOutputFrameReceiver(base_out_filename_, stream->ssrc()));
- rtc::scoped_ptr<VcmPayloadSink> sink(
+ std::unique_ptr<VcmPayloadSink> sink(
new VcmPayloadSink(this, stream, &vcm, &frame_receiver));
sinks_.push_back(sink.get());
diff --git a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h
index dae53b0..8d6eb6e 100644
--- a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h
+++ b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h
@@ -11,11 +11,11 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_VCM_PAYLOAD_SINK_FACTORY_H_
#define WEBRTC_MODULES_VIDEO_CODING_TEST_VCM_PAYLOAD_SINK_FACTORY_H_
+#include <memory>
#include <string>
#include <vector>
#include "webrtc/base/constructormagic.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/include/video_coding_defines.h"
#include "webrtc/modules/video_coding/test/rtp_player.h"
@@ -58,8 +58,8 @@
int64_t rtt_ms_;
uint32_t render_delay_ms_;
uint32_t min_playout_delay_ms_;
- rtc::scoped_ptr<NullEventFactory> null_event_factory_;
- rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
+ std::unique_ptr<NullEventFactory> null_event_factory_;
+ std::unique_ptr<CriticalSectionWrapper> crit_sect_;
Sinks sinks_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VcmPayloadSinkFactory);
diff --git a/webrtc/modules/video_coding/test/video_rtp_play.cc b/webrtc/modules/video_coding/test/video_rtp_play.cc
index cb092e3..0b8df36 100644
--- a/webrtc/modules/video_coding/test/video_rtp_play.cc
+++ b/webrtc/modules/video_coding/test/video_rtp_play.cc
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "webrtc/modules/video_coding/test/receiver_tests.h"
#include "webrtc/modules/video_coding/test/vcm_payload_sink_factory.h"
#include "webrtc/system_wrappers/include/trace.h"
@@ -51,7 +53,7 @@
webrtc::rtpplayer::VcmPayloadSinkFactory factory(
output_file, &clock, kConfigProtectionEnabled, kConfigProtectionMethod,
kConfigRttMs, kConfigRenderDelayMs, kConfigMinPlayoutDelayMs);
- rtc::scoped_ptr<webrtc::rtpplayer::RtpPlayerInterface> rtp_player(
+ std::unique_ptr<webrtc::rtpplayer::RtpPlayerInterface> rtp_player(
webrtc::rtpplayer::Create(args.inputFile, &factory, &clock, payload_types,
kConfigLossRate, kConfigRttMs,
kConfigReordering));
diff --git a/webrtc/modules/video_coding/timestamp_map.h b/webrtc/modules/video_coding/timestamp_map.h
index 435d058..8ec9029 100644
--- a/webrtc/modules/video_coding/timestamp_map.h
+++ b/webrtc/modules/video_coding/timestamp_map.h
@@ -11,7 +11,8 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_
#define WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_
-#include "webrtc/base/scoped_ptr.h"
+#include <memory>
+
#include "webrtc/typedefs.h"
namespace webrtc {
@@ -36,7 +37,7 @@
};
bool IsEmpty() const;
- rtc::scoped_ptr<TimestampDataTuple[]> ring_buffer_;
+ std::unique_ptr<TimestampDataTuple[]> ring_buffer_;
const size_t capacity_;
size_t next_add_idx_;
size_t next_pop_idx_;
diff --git a/webrtc/modules/video_coding/video_coding_impl.cc b/webrtc/modules/video_coding/video_coding_impl.cc
index 7d6d177..01a7a42 100644
--- a/webrtc/modules/video_coding/video_coding_impl.cc
+++ b/webrtc/modules/video_coding/video_coding_impl.cc
@@ -65,7 +65,7 @@
}
private:
- rtc::scoped_ptr<CriticalSectionWrapper> cs_;
+ std::unique_ptr<CriticalSectionWrapper> cs_;
EncodedImageCallback* callback_ GUARDED_BY(cs_);
};
@@ -283,7 +283,7 @@
EncodedImageCallbackWrapper post_encode_callback_;
vcm::VideoSender sender_;
vcm::VideoReceiver receiver_;
- rtc::scoped_ptr<EventFactory> own_event_factory_;
+ std::unique_ptr<EventFactory> own_event_factory_;
};
} // namespace
diff --git a/webrtc/modules/video_coding/video_coding_impl.h b/webrtc/modules/video_coding/video_coding_impl.h
index dc766b1..c01d517 100644
--- a/webrtc/modules/video_coding/video_coding_impl.h
+++ b/webrtc/modules/video_coding/video_coding_impl.h
@@ -13,6 +13,7 @@
#include "webrtc/modules/video_coding/include/video_coding.h"
+#include <memory>
#include <vector>
#include "webrtc/base/thread_annotations.h"
@@ -101,7 +102,7 @@
Clock* const clock_;
- rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_;
+ std::unique_ptr<CriticalSectionWrapper> process_crit_sect_;
rtc::CriticalSection encoder_crit_;
VCMGenericEncoder* _encoder;
VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_);
@@ -185,7 +186,7 @@
private:
Clock* const clock_;
- rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_;
+ std::unique_ptr<CriticalSectionWrapper> process_crit_sect_;
CriticalSectionWrapper* _receiveCritSect;
VCMTiming _timing;
VCMReceiver _receiver;
diff --git a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc
index eb5d485..b8e0f5d 100644
--- a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc
+++ b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
@@ -69,13 +71,13 @@
ASSERT_EQ(VCM_OK, vcm_->IncomingPacket(payload, kPayloadLen, rtp_info));
}
- rtc::scoped_ptr<VideoCodingModule> vcm_;
+ std::unique_ptr<VideoCodingModule> vcm_;
VideoCodec video_codec_;
MockVCMFrameTypeCallback frame_type_callback_;
MockPacketRequestCallback request_callback_;
NiceMock<MockVideoDecoder> decoder_;
NiceMock<MockVideoDecoder> decoderCopy_;
- rtc::scoped_ptr<SimulatedClock> clock_;
+ std::unique_ptr<SimulatedClock> clock_;
NullEventFactory event_factory_;
};
diff --git a/webrtc/modules/video_coding/video_receiver_unittest.cc b/webrtc/modules/video_coding/video_receiver_unittest.cc
index 693fdc6..05656a5 100644
--- a/webrtc/modules/video_coding/video_receiver_unittest.cc
+++ b/webrtc/modules/video_coding/video_receiver_unittest.cc
@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
#include "webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h"
#include "webrtc/modules/video_coding/include/video_coding.h"
@@ -75,7 +75,7 @@
NiceMock<MockVideoDecoder> decoder_;
NiceMock<MockPacketRequestCallback> packet_request_callback_;
- rtc::scoped_ptr<VideoReceiver> receiver_;
+ std::unique_ptr<VideoReceiver> receiver_;
};
TEST_F(TestVideoReceiver, PaddingOnlyFrames) {
diff --git a/webrtc/modules/video_coding/video_sender_unittest.cc b/webrtc/modules/video_coding/video_sender_unittest.cc
index 7249797..3f9ba4e 100644
--- a/webrtc/modules/video_coding/video_sender_unittest.cc
+++ b/webrtc/modules/video_coding/video_sender_unittest.cc
@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h"
@@ -83,7 +83,7 @@
private:
const int width_;
const int height_;
- rtc::scoped_ptr<VideoFrame> frame_;
+ std::unique_ptr<VideoFrame> frame_;
};
class PacketizationCallback : public VCMPacketizationCallback {
@@ -193,9 +193,9 @@
PacketizationCallback packetization_callback_;
MockEncodedImageCallback post_encode_callback_;
// Used by subclassing tests, need to outlive sender_.
- rtc::scoped_ptr<VideoEncoder> encoder_;
- rtc::scoped_ptr<VideoSender> sender_;
- rtc::scoped_ptr<FrameGenerator> generator_;
+ std::unique_ptr<VideoEncoder> encoder_;
+ std::unique_ptr<VideoSender> sender_;
+ std::unique_ptr<FrameGenerator> generator_;
};
class TestVideoSenderWithMockEncoder : public TestVideoSender {