diff --git a/webrtc/modules/video_coding/codec_database.h b/webrtc/modules/video_coding/codec_database.h index 62ec30a46e..4ba72f7b36 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 +#include -#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 @@ struct VCMDecoderMapItem { int number_of_cores, bool require_key_frame); - rtc::scoped_ptr settings; + std::unique_ptr settings; int number_of_cores; bool require_key_frame; }; @@ -156,7 +156,7 @@ class VCMCodecDataBase { bool internal_source_; VideoEncoderRateObserver* const encoder_rate_observer_; VCMEncodedFrameCallback* const encoded_frame_callback_; - rtc::scoped_ptr ptr_encoder_; + std::unique_ptr 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 c88955480e..e724c371c8 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 + #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 @@ class H264DecoderImpl : public H264Decoder { void ReportError(); I420BufferPool pool_; - rtc::scoped_ptr av_context_; - rtc::scoped_ptr av_frame_; + std::unique_ptr av_context_; + std::unique_ptr 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 03c1c8eeac..0e065c5e49 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 @@ static FrameType EVideoFrameType_to_FrameType(EVideoFrameType type) { // 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* encoded_image_buffer, + std::unique_ptr* 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 0ac3b4ea54..d7493e04b2 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 #include -#include "webrtc/base/scoped_ptr.h" class ISVCEncoder; @@ -65,7 +65,7 @@ class H264EncoderImpl : public H264Encoder { VideoCodec codec_settings_; EncodedImage encoded_image_; - rtc::scoped_ptr encoded_image_buffer_; + std::unique_ptr 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 20d8aef55e..eb11c59434 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 + #include "libyuv/convert.h" #include "webrtc/base/checks.h" #include "webrtc/base/logging.h" @@ -85,7 +87,7 @@ void VTDecompressionOutputCallback(void* decoder, CVImageBufferRef image_buffer, CMTime timestamp, CMTime duration) { - rtc::scoped_ptr decode_params( + std::unique_ptr decode_params( reinterpret_cast(params)); if (status != noErr) { LOG(LS_ERROR) << "Failed to decode frame. Status: " << status; @@ -142,7 +144,7 @@ int H264VideoToolboxDecoder::Decode( } VTDecodeFrameFlags decode_flags = kVTDecodeFrame_EnableAsynchronousDecompression; - rtc::scoped_ptr frame_decode_params; + std::unique_ptr 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 c7f82c1fd9..407bb67608 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 #include #include #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 @@ std::string CFStringToString(const CFStringRef cf_string) { CFStringGetMaximumSizeForEncoding(CFStringGetLength(cf_string), kCFStringEncodingUTF8) + 1; - rtc::scoped_ptr buffer(new char[buffer_size]); + std::unique_ptr buffer(new char[buffer_size]); if (CFStringGetCString(cf_string, buffer.get(), buffer_size, kCFStringEncodingUTF8)) { // Copy over the characters. @@ -177,7 +177,7 @@ void VTCompressionOutputCallback(void* encoder, OSStatus status, VTEncodeInfoFlags info_flags, CMSampleBufferRef sample_buffer) { - rtc::scoped_ptr encode_params( + std::unique_ptr encode_params( reinterpret_cast(params)); encode_params->encoder->OnEncodedFrame( status, info_flags, sample_buffer, encode_params->codec_specific_info, @@ -277,7 +277,7 @@ int H264VideoToolboxEncoder::Encode( CFTypeRef values[] = {kCFBooleanTrue}; frame_properties = internal::CreateCFDictionary(keys, values, 1); } - rtc::scoped_ptr encode_params; + std::unique_ptr 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 @@ void H264VideoToolboxEncoder::OnEncodedFrame( // Convert the sample buffer into a buffer suitable for RTP packetization. // TODO(tkchin): Allocate buffers through a pool. - rtc::scoped_ptr buffer(new rtc::Buffer()); - rtc::scoped_ptr header; - if (!H264CMSampleBufferToAnnexBBuffer(sample_buffer, is_keyframe, - buffer.get(), header.accept())) { - return; + std::unique_ptr buffer(new rtc::Buffer()); + std::unique_ptr 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 322c213f7b..8328a56cb7 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 +#include #include #include "webrtc/base/checks.h" @@ -139,7 +140,7 @@ bool H264CMSampleBufferToAnnexBBuffer( } RTC_DCHECK_EQ(bytes_remaining, (size_t)0); - rtc::scoped_ptr header; + std::unique_ptr 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 36946f1f8e..4087dbc79d 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 + #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/arraysize.h" @@ -90,7 +92,7 @@ TEST(AnnexBBufferReaderTest, TestReadMultipleNalus) { TEST(AvccBufferWriterTest, TestEmptyOutputBuffer) { const uint8_t expected_buffer[] = {0x00}; const size_t buffer_size = 1; - rtc::scoped_ptr buffer(new uint8_t[buffer_size]); + std::unique_ptr 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 @@ TEST(AvccBufferWriterTest, TestWriteSingleNalu) { 0x00, 0x00, 0x00, 0x03, 0xAA, 0xBB, 0xCC, }; const size_t buffer_size = arraysize(NALU_TEST_DATA_0) + 4; - rtc::scoped_ptr buffer(new uint8_t[buffer_size]); + std::unique_ptr 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 @@ TEST(AvccBufferWriterTest, TestWriteMultipleNalus) { // clang-format on const size_t buffer_size = arraysize(NALU_TEST_DATA_0) + arraysize(NALU_TEST_DATA_1) + 8; - rtc::scoped_ptr buffer(new uint8_t[buffer_size]); + std::unique_ptr 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, TestWriteMultipleNalus) { TEST(AvccBufferWriterTest, TestOverflow) { const uint8_t expected_buffer[] = {0x00, 0x00, 0x00}; const size_t buffer_size = arraysize(NALU_TEST_DATA_0); - rtc::scoped_ptr buffer(new uint8_t[buffer_size]); + std::unique_ptr 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 5b33e8265f..e64babd599 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc @@ -14,6 +14,7 @@ #include #include +#include #include #include "webrtc/system_wrappers/include/cpu_info.h" @@ -283,7 +284,7 @@ void VideoProcessorImpl::FrameEncoded( // Make a raw copy of the |encoded_image| buffer. size_t copied_buffer_size = encoded_image._length + EncodedImage::GetBufferPaddingBytes(codec); - rtc::scoped_ptr copied_buffer(new uint8_t[copied_buffer_size]); + std::unique_ptr 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 @@ void VideoProcessorImpl::FrameDecoded(const VideoFrame& image) { } // 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 image_buffer(new uint8_t[length]); + std::unique_ptr 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 @@ void VideoProcessorImpl::FrameDecoded(const VideoFrame& image) { // 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 image_buffer(new uint8_t[length]); + std::unique_ptr 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 e5e88942e4..2733d7d2be 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 #include #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 @@ class ScreenshareLayerTest : public ::testing::Test { int min_qp_; int max_qp_; int frame_size_; - rtc::scoped_ptr layers_; + std::unique_ptr 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 f75a158802..777ac1ba36 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 #include #include -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" namespace webrtc { @@ -110,8 +110,8 @@ class SimulcastEncoderAdapter : public VP8Encoder { bool Initialized() const; - rtc::scoped_ptr factory_; - rtc::scoped_ptr screensharing_tl_factory_; + std::unique_ptr factory_; + std::unique_ptr screensharing_tl_factory_; VideoCodec codec_; std::vector 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 6e449f21f3..589edb6d3e 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 #include #include "testing/gmock/include/gmock/gmock.h" @@ -340,8 +341,8 @@ class TestSimulcastEncoderAdapterFake : public ::testing::Test, } protected: - rtc::scoped_ptr helper_; - rtc::scoped_ptr adapter_; + std::unique_ptr helper_; + std::unique_ptr 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 4e1e686169..9f0dc5ce93 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 +#include #include #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 @@ class TestVp8Simulcast : public ::testing::Test { } } - rtc::scoped_ptr encoder_; + std::unique_ptr encoder_; MockEncodedImageCallback encoder_callback_; - rtc::scoped_ptr decoder_; + std::unique_ptr 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 0dd3d7cef8..f3ebfa1f76 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 +#include + #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 @@ class Vp8UnitTestEncodeCompleteCallback : public webrtc::EncodedImageCallback { private: EncodedImage* const encoded_frame_; - rtc::scoped_ptr frame_buffer_; + std::unique_ptr frame_buffer_; bool encode_complete_; }; @@ -181,13 +182,13 @@ class TestVp8Impl : public ::testing::Test { const int kWidth = 172; const int kHeight = 144; - rtc::scoped_ptr encode_complete_callback_; - rtc::scoped_ptr decode_complete_callback_; - rtc::scoped_ptr source_buffer_; + std::unique_ptr encode_complete_callback_; + std::unique_ptr decode_complete_callback_; + std::unique_ptr source_buffer_; FILE* source_file_; VideoFrame input_frame_; - rtc::scoped_ptr encoder_; - rtc::scoped_ptr decoder_; + std::unique_ptr encoder_; + std::unique_ptr 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 9e546653db..33dae8d8e4 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 + #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 @@ int SequenceCoder(webrtc::test::CommandLineParser* parser) { EXPECT_EQ(0, decoder->InitDecode(&inst, 1)); webrtc::VideoFrame input_frame; size_t length = webrtc::CalcBufferSize(webrtc::kI420, width, height); - rtc::scoped_ptr frame_buffer(new uint8_t[length]); + std::unique_ptr 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 5eb7b237ac..4708172962 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 +#include #include "testing/gtest/include/gtest/gtest.h" #include "vpx/vp8cx.h" @@ -81,7 +82,7 @@ class ScreenshareLayerTestVP9 : public ::testing::Test { Settings expected_; SimulatedClock clock_; - rtc::scoped_ptr layers_; + std::unique_ptr 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 f861fefb35..3ff2d1fa49 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 #include #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" @@ -128,7 +129,7 @@ class VP9EncoderImpl : public VP9Encoder { int64_t frames_encoded_; uint8_t num_ref_pics_[kMaxVp9NumberOfSpatialLayers]; uint8_t p_diff_[kMaxVp9NumberOfSpatialLayers][kMaxVp9RefPics]; - rtc::scoped_ptr spatial_layer_; + std::unique_ptr 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 da7297ffa2..e96d995781 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 663bf03a7f..ca8c0d9571 100644 --- a/webrtc/modules/video_coding/jitter_buffer.cc +++ b/webrtc/modules/video_coding/jitter_buffer.cc @@ -215,7 +215,7 @@ void Vp9SsMap::UpdateFrames(FrameList* frames) { } VCMJitterBuffer::VCMJitterBuffer(Clock* clock, - rtc::scoped_ptr event) + std::unique_ptr 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 01e27752d2..8ba338f0c7 100644 --- a/webrtc/modules/video_coding/jitter_buffer.h +++ b/webrtc/modules/video_coding/jitter_buffer.h @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -103,7 +104,7 @@ class Vp9SsMap { class VCMJitterBuffer { public: - VCMJitterBuffer(Clock* clock, rtc::scoped_ptr event); + VCMJitterBuffer(Clock* clock, std::unique_ptr event); ~VCMJitterBuffer(); @@ -325,7 +326,7 @@ class VCMJitterBuffer { bool running_; CriticalSectionWrapper* crit_sect_; // Event to signal when we have a frame ready for decoder. - rtc::scoped_ptr frame_event_; + std::unique_ptr 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 8abc1b5471..c5384681b3 100644 --- a/webrtc/modules/video_coding/jitter_buffer_unittest.cc +++ b/webrtc/modules/video_coding/jitter_buffer_unittest.cc @@ -11,6 +11,7 @@ #include #include +#include #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/modules/video_coding/frame_buffer.h" @@ -190,7 +191,7 @@ class TestBasicJitterBuffer : public ::testing::Test { clock_.reset(new SimulatedClock(0)); jitter_buffer_.reset(new VCMJitterBuffer( clock_.get(), - rtc::scoped_ptr(event_factory_.CreateEvent()))); + std::unique_ptr(event_factory_.CreateEvent()))); jitter_buffer_->Start(); seq_num_ = 1234; timestamp_ = 0; @@ -273,10 +274,10 @@ class TestBasicJitterBuffer : public ::testing::Test { uint32_t timestamp_; int size_; uint8_t data_[1500]; - rtc::scoped_ptr packet_; - rtc::scoped_ptr clock_; + std::unique_ptr packet_; + std::unique_ptr clock_; NullEventFactory event_factory_; - rtc::scoped_ptr jitter_buffer_; + std::unique_ptr jitter_buffer_; }; class TestRunningJitterBuffer : public ::testing::Test { @@ -289,7 +290,7 @@ class TestRunningJitterBuffer : public ::testing::Test { oldest_packet_to_nack_ = 250; jitter_buffer_ = new VCMJitterBuffer( clock_.get(), - rtc::scoped_ptr(event_factory_.CreateEvent())); + std::unique_ptr(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 @@ class TestRunningJitterBuffer : public ::testing::Test { VCMJitterBuffer* jitter_buffer_; StreamGenerator* stream_generator_; - rtc::scoped_ptr clock_; + std::unique_ptr 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 a016a03eab..6b47e3b2d9 100644 --- a/webrtc/modules/video_coding/media_opt_util.h +++ b/webrtc/modules/video_coding/media_opt_util.h @@ -14,8 +14,9 @@ #include #include +#include + #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 @@ class VCMLossProtectionLogic { // Sets the available loss protection methods. void UpdateMaxLossHistory(uint8_t lossPr255, int64_t now); uint8_t MaxFilteredLossPr(int64_t nowMs) const; - rtc::scoped_ptr _selectedMethod; + std::unique_ptr _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 54389bf5b5..060cd893ff 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 +#include -#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 @@ class MediaOptimization { uint32_t SentFrameRateInternal() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); // Protect all members. - rtc::scoped_ptr crit_sect_; + std::unique_ptr crit_sect_; Clock* clock_ GUARDED_BY(crit_sect_); int32_t max_bit_rate_ GUARDED_BY(crit_sect_); @@ -142,8 +142,8 @@ class MediaOptimization { 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 frame_dropper_ GUARDED_BY(crit_sect_); - rtc::scoped_ptr loss_prot_logic_ + std::unique_ptr frame_dropper_ GUARDED_BY(crit_sect_); + std::unique_ptr 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 @@ class MediaOptimization { 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 content_ GUARDED_BY(crit_sect_); - rtc::scoped_ptr qm_resolution_ GUARDED_BY(crit_sect_); + std::unique_ptr content_ GUARDED_BY(crit_sect_); + std::unique_ptr 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 fa2a2dca29..988f1ef5c7 100644 --- a/webrtc/modules/video_coding/receiver.cc +++ b/webrtc/modules/video_coding/receiver.cc @@ -32,14 +32,14 @@ VCMReceiver::VCMReceiver(VCMTiming* timing, EventFactory* event_factory) : VCMReceiver(timing, clock, - rtc::scoped_ptr(event_factory->CreateEvent()), - rtc::scoped_ptr(event_factory->CreateEvent())) { + std::unique_ptr(event_factory->CreateEvent()), + std::unique_ptr(event_factory->CreateEvent())) { } VCMReceiver::VCMReceiver(VCMTiming* timing, Clock* clock, - rtc::scoped_ptr receiver_event, - rtc::scoped_ptr jitter_buffer_event) + std::unique_ptr receiver_event, + std::unique_ptr 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 ff0eef8a6a..7b2149ddce 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 #include #include "webrtc/modules/video_coding/jitter_buffer.h" @@ -35,8 +36,8 @@ class VCMReceiver { // that of VCMReceiver itself. VCMReceiver(VCMTiming* timing, Clock* clock, - rtc::scoped_ptr receiver_event, - rtc::scoped_ptr jitter_buffer_event); + std::unique_ptr receiver_event, + std::unique_ptr jitter_buffer_event); ~VCMReceiver(); @@ -83,7 +84,7 @@ class VCMReceiver { Clock* const clock_; VCMJitterBuffer jitter_buffer_; VCMTiming* timing_; - rtc::scoped_ptr render_wait_event_; + std::unique_ptr 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 1f3a144bad..42cc9ac0a8 100644 --- a/webrtc/modules/video_coding/receiver_unittest.cc +++ b/webrtc/modules/video_coding/receiver_unittest.cc @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -84,11 +85,11 @@ class TestVCMReceiver : public ::testing::Test { return true; } - rtc::scoped_ptr clock_; + std::unique_ptr clock_; VCMTiming timing_; NullEventFactory event_factory_; VCMReceiver receiver_; - rtc::scoped_ptr stream_generator_; + std::unique_ptr stream_generator_; }; TEST_F(TestVCMReceiver, RenderBufferSize_AllComplete) { @@ -449,8 +450,8 @@ class VCMReceiverTimingTest : public ::testing::Test { receiver_( &timing_, &clock_, - rtc::scoped_ptr(new FrameInjectEvent(&clock_, false)), - rtc::scoped_ptr( + std::unique_ptr(new FrameInjectEvent(&clock_, false)), + std::unique_ptr( 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 9b6490618c..97d63e0fb5 100644 --- a/webrtc/modules/video_coding/test/rtp_player.cc +++ b/webrtc/modules/video_coding/test/rtp_player.cc @@ -13,8 +13,8 @@ #include #include +#include -#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 @@ class RawRtpPacket { uint16_t seq_num() const { return seq_num_; } private: - rtc::scoped_ptr data_; + std::unique_ptr data_; size_t length_; int64_t resend_time_ms_; uint32_t ssrc_; @@ -177,7 +177,7 @@ class LostPackets { typedef RtpPacketList::iterator RtpPacketIterator; typedef RtpPacketList::const_iterator ConstRtpPacketIterator; - rtc::scoped_ptr crit_sect_; + std::unique_ptr crit_sect_; FILE* debug_file_; int loss_count_; RtpPacketList packets_; @@ -210,7 +210,7 @@ class SsrcHandlers { } DEBUG_LOG1("Registering handler for ssrc=%08x", ssrc); - rtc::scoped_ptr handler( + std::unique_ptr 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 @@ class SsrcHandlers { virtual uint32_t ssrc() const { return ssrc_; } virtual const PayloadTypes& payload_types() const { return payload_types_; } - rtc::scoped_ptr rtp_header_parser_; - rtc::scoped_ptr rtp_payload_registry_; - rtc::scoped_ptr rtp_module_; - rtc::scoped_ptr payload_sink_; + std::unique_ptr rtp_header_parser_; + std::unique_ptr rtp_payload_registry_; + std::unique_ptr rtp_module_; + std::unique_ptr payload_sink_; private: uint32_t ssrc_; @@ -320,7 +320,7 @@ class RtpPlayerImpl : public RtpPlayerInterface { RtpPlayerImpl(PayloadSinkFactoryInterface* payload_sink_factory, const PayloadTypes& payload_types, Clock* clock, - rtc::scoped_ptr* packet_source, + std::unique_ptr* packet_source, float loss_rate, int64_t rtt_ms, bool reordering) @@ -419,7 +419,7 @@ class RtpPlayerImpl : public RtpPlayerInterface { assert(data); assert(length > 0); - rtc::scoped_ptr rtp_header_parser( + std::unique_ptr rtp_header_parser( RtpHeaderParser::Create()); if (!rtp_header_parser->IsRtcp(data, length)) { RTPHeader header; @@ -448,7 +448,7 @@ class RtpPlayerImpl : public RtpPlayerInterface { SsrcHandlers ssrc_handlers_; Clock* clock_; - rtc::scoped_ptr packet_source_; + std::unique_ptr packet_source_; test::RtpPacket next_packet_; uint32_t next_rtp_time_; bool first_packet_; @@ -460,7 +460,7 @@ class RtpPlayerImpl : public RtpPlayerInterface { uint32_t no_loss_startup_; bool end_of_file_; bool reordering_; - rtc::scoped_ptr reorder_buffer_; + std::unique_ptr reorder_buffer_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpPlayerImpl); }; @@ -472,7 +472,7 @@ RtpPlayerInterface* Create(const std::string& input_filename, float loss_rate, int64_t rtt_ms, bool reordering) { - rtc::scoped_ptr packet_source( + std::unique_ptr packet_source( test::RtpFileReader::Create(test::RtpFileReader::kRtpDump, input_filename)); if (packet_source.get() == NULL) { @@ -483,7 +483,7 @@ RtpPlayerInterface* Create(const std::string& input_filename, } } - rtc::scoped_ptr impl( + std::unique_ptr 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 88242fd0ab..e774db1652 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 @@ class VcmPayloadSinkFactory::VcmPayloadSink : public PayloadSinkInterface, public: VcmPayloadSink(VcmPayloadSinkFactory* factory, RtpStreamInterface* stream, - rtc::scoped_ptr* vcm, - rtc::scoped_ptr* frame_receiver) + std::unique_ptr* vcm, + std::unique_ptr* frame_receiver) : factory_(factory), stream_(stream), vcm_(), frame_receiver_() { assert(factory); assert(stream); @@ -87,8 +87,8 @@ class VcmPayloadSinkFactory::VcmPayloadSink : public PayloadSinkInterface, private: VcmPayloadSinkFactory* factory_; RtpStreamInterface* stream_; - rtc::scoped_ptr vcm_; - rtc::scoped_ptr frame_receiver_; + std::unique_ptr vcm_; + std::unique_ptr frame_receiver_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VcmPayloadSink); }; @@ -124,7 +124,7 @@ PayloadSinkInterface* VcmPayloadSinkFactory::Create( assert(stream); CriticalSectionScoped cs(crit_sect_.get()); - rtc::scoped_ptr vcm( + std::unique_ptr vcm( VideoCodingModule::Create(clock_, null_event_factory_.get())); if (vcm.get() == NULL) { return NULL; @@ -149,9 +149,9 @@ PayloadSinkInterface* VcmPayloadSinkFactory::Create( vcm->SetMinimumPlayoutDelay(min_playout_delay_ms_); vcm->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); - rtc::scoped_ptr frame_receiver( + std::unique_ptr frame_receiver( new FileOutputFrameReceiver(base_out_filename_, stream->ssrc())); - rtc::scoped_ptr sink( + std::unique_ptr 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 dae53b0c08..8d6eb6eadf 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 #include #include #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 @@ class VcmPayloadSinkFactory : public PayloadSinkFactoryInterface { int64_t rtt_ms_; uint32_t render_delay_ms_; uint32_t min_playout_delay_ms_; - rtc::scoped_ptr null_event_factory_; - rtc::scoped_ptr crit_sect_; + std::unique_ptr null_event_factory_; + std::unique_ptr 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 cb092e381e..0b8df36ef3 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 + #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 @@ int RtpPlay(const CmdArgs& args) { webrtc::rtpplayer::VcmPayloadSinkFactory factory( output_file, &clock, kConfigProtectionEnabled, kConfigProtectionMethod, kConfigRttMs, kConfigRenderDelayMs, kConfigMinPlayoutDelayMs); - rtc::scoped_ptr rtp_player( + std::unique_ptr 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 435d05895c..8ec902938d 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 + #include "webrtc/typedefs.h" namespace webrtc { @@ -36,7 +37,7 @@ class VCMTimestampMap { }; bool IsEmpty() const; - rtc::scoped_ptr ring_buffer_; + std::unique_ptr 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 7d6d17798d..01a7a42ccf 100644 --- a/webrtc/modules/video_coding/video_coding_impl.cc +++ b/webrtc/modules/video_coding/video_coding_impl.cc @@ -65,7 +65,7 @@ class EncodedImageCallbackWrapper : public EncodedImageCallback { } private: - rtc::scoped_ptr cs_; + std::unique_ptr cs_; EncodedImageCallback* callback_ GUARDED_BY(cs_); }; @@ -283,7 +283,7 @@ class VideoCodingModuleImpl : public VideoCodingModule { EncodedImageCallbackWrapper post_encode_callback_; vcm::VideoSender sender_; vcm::VideoReceiver receiver_; - rtc::scoped_ptr own_event_factory_; + std::unique_ptr 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 dc766b1ed2..c01d51716b 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 #include #include "webrtc/base/thread_annotations.h" @@ -101,7 +102,7 @@ class VideoSender { Clock* const clock_; - rtc::scoped_ptr process_crit_sect_; + std::unique_ptr process_crit_sect_; rtc::CriticalSection encoder_crit_; VCMGenericEncoder* _encoder; VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_); @@ -185,7 +186,7 @@ class VideoReceiver { private: Clock* const clock_; - rtc::scoped_ptr process_crit_sect_; + std::unique_ptr 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 eb5d485d59..b8e0f5d764 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 + #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 @@ class VCMRobustnessTest : public ::testing::Test { ASSERT_EQ(VCM_OK, vcm_->IncomingPacket(payload, kPayloadLen, rtp_info)); } - rtc::scoped_ptr vcm_; + std::unique_ptr vcm_; VideoCodec video_codec_; MockVCMFrameTypeCallback frame_type_callback_; MockPacketRequestCallback request_callback_; NiceMock decoder_; NiceMock decoderCopy_; - rtc::scoped_ptr clock_; + std::unique_ptr 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 693fdc60ee..05656a5c25 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 #include #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 @@ class TestVideoReceiver : public ::testing::Test { NiceMock decoder_; NiceMock packet_request_callback_; - rtc::scoped_ptr receiver_; + std::unique_ptr 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 7249797eff..3f9ba4eadd 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 #include #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 @@ class EmptyFrameGenerator : public FrameGenerator { private: const int width_; const int height_; - rtc::scoped_ptr frame_; + std::unique_ptr frame_; }; class PacketizationCallback : public VCMPacketizationCallback { @@ -193,9 +193,9 @@ class TestVideoSender : public ::testing::Test { PacketizationCallback packetization_callback_; MockEncodedImageCallback post_encode_callback_; // Used by subclassing tests, need to outlive sender_. - rtc::scoped_ptr encoder_; - rtc::scoped_ptr sender_; - rtc::scoped_ptr generator_; + std::unique_ptr encoder_; + std::unique_ptr sender_; + std::unique_ptr generator_; }; class TestVideoSenderWithMockEncoder : public TestVideoSender {