Replace scoped_ptr with unique_ptr in webrtc/video/
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1751903002
Cr-Commit-Position: refs/heads/master@{#11833}
diff --git a/webrtc/video/call_stats.h b/webrtc/video/call_stats.h
index bb3670c..9a5967e 100644
--- a/webrtc/video/call_stats.h
+++ b/webrtc/video/call_stats.h
@@ -12,10 +12,10 @@
#define WEBRTC_VIDEO_CALL_STATS_H_
#include <list>
+#include <memory>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/include/module.h"
#include "webrtc/system_wrappers/include/clock.h"
@@ -64,7 +64,7 @@
// Protecting all members.
rtc::CriticalSection crit_;
// Observer receiving statistics updates.
- rtc::scoped_ptr<RtcpRttStats> rtcp_rtt_stats_;
+ std::unique_ptr<RtcpRttStats> rtcp_rtt_stats_;
// The last time 'Process' resulted in statistic update.
int64_t last_process_time_;
// The last RTT in the statistics update (zero if there is no valid estimate).
diff --git a/webrtc/video/call_stats_unittest.cc b/webrtc/video/call_stats_unittest.cc
index 2421cc7..6e2e1bc 100644
--- a/webrtc/video/call_stats_unittest.cc
+++ b/webrtc/video/call_stats_unittest.cc
@@ -8,10 +8,11 @@
* 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/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/system_wrappers/include/metrics.h"
#include "webrtc/system_wrappers/include/tick_util.h"
@@ -39,7 +40,7 @@
protected:
virtual void SetUp() { call_stats_.reset(new CallStats(&fake_clock_)); }
SimulatedClock fake_clock_;
- rtc::scoped_ptr<CallStats> call_stats_;
+ std::unique_ptr<CallStats> call_stats_;
};
TEST_F(CallStatsTest, AddAndTriggerCallback) {
diff --git a/webrtc/video/end_to_end_tests.cc b/webrtc/video/end_to_end_tests.cc
index 2a88e28..9e8ead9 100644
--- a/webrtc/video/end_to_end_tests.cc
+++ b/webrtc/video/end_to_end_tests.cc
@@ -10,6 +10,7 @@
#include <algorithm>
#include <list>
#include <map>
+#include <memory>
#include <sstream>
#include <string>
@@ -17,7 +18,6 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/event.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/call.h"
#include "webrtc/call/transport_adapter.h"
@@ -173,7 +173,7 @@
// Create frames that are smaller than the send width/height, this is done to
// check that the callbacks are done after processing video.
- rtc::scoped_ptr<test::FrameGenerator> frame_generator(
+ std::unique_ptr<test::FrameGenerator> frame_generator(
test::FrameGenerator::CreateChromaGenerator(kWidth, kHeight));
video_send_stream_->Input()->IncomingCapturedFrame(
*frame_generator->NextFrame());
@@ -220,7 +220,7 @@
CreateVideoStreams();
Start();
- rtc::scoped_ptr<test::FrameGenerator> frame_generator(
+ std::unique_ptr<test::FrameGenerator> frame_generator(
test::FrameGenerator::CreateChromaGenerator(
video_encoder_config_.streams[0].width,
video_encoder_config_.streams[0].height));
@@ -282,8 +282,8 @@
bool IsTextureSupported() const override { return false; }
private:
- rtc::scoped_ptr<webrtc::VideoEncoder> encoder_;
- rtc::scoped_ptr<webrtc::VideoDecoder> decoder_;
+ std::unique_ptr<webrtc::VideoEncoder> encoder_;
+ std::unique_ptr<webrtc::VideoDecoder> decoder_;
int frame_counter_;
} test;
@@ -338,8 +338,8 @@
bool IsTextureSupported() const override { return false; }
private:
- rtc::scoped_ptr<webrtc::VideoEncoder> encoder_;
- rtc::scoped_ptr<webrtc::VideoDecoder> decoder_;
+ std::unique_ptr<webrtc::VideoEncoder> encoder_;
+ std::unique_ptr<webrtc::VideoDecoder> decoder_;
int frame_counter_;
} test;
@@ -816,7 +816,7 @@
const int payload_type_;
const uint32_t retransmission_ssrc_;
const int retransmission_payload_type_;
- rtc::scoped_ptr<VideoEncoder> encoder_;
+ std::unique_ptr<VideoEncoder> encoder_;
const std::string payload_name_;
int marker_bits_observed_;
uint32_t retransmitted_timestamp_ GUARDED_BY(&crit_);
@@ -908,7 +908,7 @@
receiver_transport.SetReceiver(sender_call_->Receiver());
CreateSendConfig(1, 0, &sender_transport);
- rtc::scoped_ptr<VideoEncoder> encoder(
+ std::unique_ptr<VideoEncoder> encoder(
VideoEncoder::Create(VideoEncoder::kVp8));
video_send_config_.encoder_settings.encoder = encoder.get();
video_send_config_.encoder_settings.payload_name = "VP8";
@@ -926,7 +926,7 @@
// Create frames that are smaller than the send width/height, this is done to
// check that the callbacks are done after processing video.
- rtc::scoped_ptr<test::FrameGenerator> frame_generator(
+ std::unique_ptr<test::FrameGenerator> frame_generator(
test::FrameGenerator::CreateChromaGenerator(kWidth / 2, kHeight / 2));
video_send_stream_->Input()->IncomingCapturedFrame(
*frame_generator->NextFrame());
@@ -1213,16 +1213,16 @@
virtual ~MultiStreamTest() {}
void RunTest() {
- rtc::scoped_ptr<Call> sender_call(Call::Create(Call::Config()));
- rtc::scoped_ptr<Call> receiver_call(Call::Create(Call::Config()));
- rtc::scoped_ptr<test::DirectTransport> sender_transport(
+ std::unique_ptr<Call> sender_call(Call::Create(Call::Config()));
+ std::unique_ptr<Call> receiver_call(Call::Create(Call::Config()));
+ std::unique_ptr<test::DirectTransport> sender_transport(
CreateSendTransport(sender_call.get()));
- rtc::scoped_ptr<test::DirectTransport> receiver_transport(
+ std::unique_ptr<test::DirectTransport> receiver_transport(
CreateReceiveTransport(receiver_call.get()));
sender_transport->SetReceiver(receiver_call->Receiver());
receiver_transport->SetReceiver(sender_call->Receiver());
- rtc::scoped_ptr<VideoEncoder> encoders[kNumStreams];
+ std::unique_ptr<VideoEncoder> encoders[kNumStreams];
for (size_t i = 0; i < kNumStreams; ++i)
encoders[i].reset(VideoEncoder::Create(VideoEncoder::kVp8));
@@ -1374,7 +1374,7 @@
}
private:
- rtc::scoped_ptr<VideoOutputObserver> observers_[kNumStreams];
+ std::unique_ptr<VideoOutputObserver> observers_[kNumStreams];
} tester;
tester.RunTest();
@@ -1492,7 +1492,7 @@
rtc::CriticalSection lock_;
rtc::Event done_;
- rtc::scoped_ptr<RtpHeaderParser> parser_;
+ std::unique_ptr<RtpHeaderParser> parser_;
SequenceNumberUnwrapper unwrapper_;
std::set<int64_t> received_packed_ids_;
std::set<uint32_t> streams_observed_;
@@ -1706,7 +1706,7 @@
}
private:
- rtc::scoped_ptr<uint8_t[]> buffer_;
+ std::unique_ptr<uint8_t[]> buffer_;
size_t length_;
FrameType frame_type_;
rtc::Event called_;
@@ -1730,7 +1730,7 @@
CreateVideoStreams();
Start();
- rtc::scoped_ptr<test::FrameGenerator> frame_generator(
+ std::unique_ptr<test::FrameGenerator> frame_generator(
test::FrameGenerator::CreateChromaGenerator(
video_encoder_config_.streams[0].width,
video_encoder_config_.streams[0].height));
@@ -1960,7 +1960,7 @@
Clock* const clock_;
uint32_t sender_ssrc_;
int remb_bitrate_bps_;
- rtc::scoped_ptr<RtpRtcp> rtp_rtcp_;
+ std::unique_ptr<RtpRtcp> rtp_rtcp_;
test::PacketTransport* receive_transport_;
rtc::Event event_;
rtc::PlatformThread poller_thread_;
@@ -1986,7 +1986,7 @@
Action OnSendRtp(const uint8_t* packet, size_t length) override {
rtc::CritScope lock(&crit_);
if (++sent_rtp_packets_ == kPacketNumberToDrop) {
- rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
+ std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
RTPHeader header;
EXPECT_TRUE(parser->Parse(packet, length, &header));
dropped_rtp_packet_ = header.sequenceNumber;
@@ -2162,7 +2162,7 @@
const bool use_rtx_;
const bool use_red_;
const bool screenshare_;
- const rtc::scoped_ptr<VideoEncoder> vp8_encoder_;
+ const std::unique_ptr<VideoEncoder> vp8_encoder_;
Call* sender_call_;
Call* receiver_call_;
int64_t start_runtime_ms_;
diff --git a/webrtc/video/overuse_frame_detector.cc b/webrtc/video/overuse_frame_detector.cc
index 18c6b9e..522a505 100644
--- a/webrtc/video/overuse_frame_detector.cc
+++ b/webrtc/video/overuse_frame_detector.cc
@@ -166,8 +166,8 @@
const float kMaxSampleDiffMs;
uint64_t count_;
const CpuOveruseOptions options_;
- rtc::scoped_ptr<rtc::ExpFilter> filtered_processing_ms_;
- rtc::scoped_ptr<rtc::ExpFilter> filtered_frame_diff_ms_;
+ std::unique_ptr<rtc::ExpFilter> filtered_processing_ms_;
+ std::unique_ptr<rtc::ExpFilter> filtered_frame_diff_ms_;
};
OveruseFrameDetector::OveruseFrameDetector(
diff --git a/webrtc/video/overuse_frame_detector.h b/webrtc/video/overuse_frame_detector.h
index 43c9e28..9f78c6c 100644
--- a/webrtc/video/overuse_frame_detector.h
+++ b/webrtc/video/overuse_frame_detector.h
@@ -12,11 +12,11 @@
#define WEBRTC_VIDEO_OVERUSE_FRAME_DETECTOR_H_
#include <list>
+#include <memory>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/optional.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/exp_filter.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/base/thread_checker.h"
@@ -154,7 +154,7 @@
// TODO(asapersson): Can these be regular members (avoid separate heap
// allocs)?
- const rtc::scoped_ptr<SendProcessingUsage> usage_ GUARDED_BY(crit_);
+ const std::unique_ptr<SendProcessingUsage> usage_ GUARDED_BY(crit_);
std::list<FrameTiming> frame_timing_ GUARDED_BY(crit_);
rtc::ThreadChecker processing_thread_;
diff --git a/webrtc/video/overuse_frame_detector_unittest.cc b/webrtc/video/overuse_frame_detector_unittest.cc
index 1a6384c..06cff38 100644
--- a/webrtc/video/overuse_frame_detector_unittest.cc
+++ b/webrtc/video/overuse_frame_detector_unittest.cc
@@ -8,12 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "webrtc/video/overuse_frame_detector.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/video_frame.h"
@@ -121,9 +122,9 @@
int UsagePercent() { return metrics_.encode_usage_percent; }
CpuOveruseOptions options_;
- rtc::scoped_ptr<SimulatedClock> clock_;
- rtc::scoped_ptr<MockCpuOveruseObserver> observer_;
- rtc::scoped_ptr<OveruseFrameDetector> overuse_detector_;
+ std::unique_ptr<SimulatedClock> clock_;
+ std::unique_ptr<MockCpuOveruseObserver> observer_;
+ std::unique_ptr<OveruseFrameDetector> overuse_detector_;
CpuOveruseMetrics metrics_;
};
diff --git a/webrtc/video/payload_router.h b/webrtc/video/payload_router.h
index 661856d..9eaf716 100644
--- a/webrtc/video/payload_router.h
+++ b/webrtc/video/payload_router.h
@@ -15,7 +15,6 @@
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/common_types.h"
#include "webrtc/system_wrappers/include/atomic32.h"
diff --git a/webrtc/video/payload_router_unittest.cc b/webrtc/video/payload_router_unittest.cc
index 9b831a3..5fe478f 100644
--- a/webrtc/video/payload_router_unittest.cc
+++ b/webrtc/video/payload_router_unittest.cc
@@ -8,9 +8,10 @@
* 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/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
#include "webrtc/video/payload_router.h"
@@ -27,7 +28,7 @@
virtual void SetUp() {
payload_router_.reset(new PayloadRouter());
}
- rtc::scoped_ptr<PayloadRouter> payload_router_;
+ std::unique_ptr<PayloadRouter> payload_router_;
};
TEST_F(PayloadRouterTest, SendOnOneModule) {
diff --git a/webrtc/video/replay.cc b/webrtc/video/replay.cc
index 4849248..52b6ff6 100644
--- a/webrtc/video/replay.cc
+++ b/webrtc/video/replay.cc
@@ -11,13 +11,13 @@
#include <stdio.h>
#include <map>
+#include <memory>
#include <sstream>
#include "gflags/gflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/checks.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/call.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
@@ -209,12 +209,12 @@
};
void RtpReplay() {
- rtc::scoped_ptr<test::VideoRenderer> playback_video(
+ std::unique_ptr<test::VideoRenderer> playback_video(
test::VideoRenderer::Create("Playback Video", 640, 480));
FileRenderPassthrough file_passthrough(flags::OutBase(),
playback_video.get());
- rtc::scoped_ptr<Call> call(Call::Create(Call::Config()));
+ std::unique_ptr<Call> call(Call::Create(Call::Config()));
test::NullTransport transport;
VideoReceiveStream::Config receive_config(&transport);
@@ -237,7 +237,7 @@
encoder_settings.payload_name = flags::Codec();
encoder_settings.payload_type = flags::PayloadType();
VideoReceiveStream::Decoder decoder;
- rtc::scoped_ptr<DecoderBitstreamFileWriter> bitstream_writer;
+ std::unique_ptr<DecoderBitstreamFileWriter> bitstream_writer;
if (!flags::DecoderBitstreamFilename().empty()) {
bitstream_writer.reset(new DecoderBitstreamFileWriter(
flags::DecoderBitstreamFilename().c_str()));
@@ -255,7 +255,7 @@
VideoReceiveStream* receive_stream =
call->CreateVideoReceiveStream(receive_config);
- rtc::scoped_ptr<test::RtpFileReader> rtp_reader(test::RtpFileReader::Create(
+ std::unique_ptr<test::RtpFileReader> rtp_reader(test::RtpFileReader::Create(
test::RtpFileReader::kRtpDump, flags::InputFile()));
if (rtp_reader.get() == nullptr) {
rtp_reader.reset(test::RtpFileReader::Create(test::RtpFileReader::kPcap,
@@ -290,7 +290,7 @@
break;
case PacketReceiver::DELIVERY_UNKNOWN_SSRC: {
RTPHeader header;
- rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
+ std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
parser->Parse(packet.data, packet.length, &header);
if (unknown_packets[header.ssrc] == 0)
fprintf(stderr, "Unknown SSRC: %u!\n", header.ssrc);
diff --git a/webrtc/video/send_statistics_proxy.h b/webrtc/video/send_statistics_proxy.h
index 24a09b0..66f0336 100644
--- a/webrtc/video/send_statistics_proxy.h
+++ b/webrtc/video/send_statistics_proxy.h
@@ -12,12 +12,12 @@
#define WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_
#include <map>
+#include <memory>
#include <string>
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/exp_filter.h"
#include "webrtc/base/ratetracker.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
@@ -174,7 +174,7 @@
const VideoSendStream::Stats start_stats_;
};
- rtc::scoped_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_);
+ std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_);
};
} // namespace webrtc
diff --git a/webrtc/video/send_statistics_proxy_unittest.cc b/webrtc/video/send_statistics_proxy_unittest.cc
index b3da5e9..a98505f 100644
--- a/webrtc/video/send_statistics_proxy_unittest.cc
+++ b/webrtc/video/send_statistics_proxy_unittest.cc
@@ -12,6 +12,7 @@
#include "webrtc/video/send_statistics_proxy.h"
#include <map>
+#include <memory>
#include <string>
#include <vector>
@@ -94,7 +95,7 @@
}
SimulatedClock fake_clock_;
- rtc::scoped_ptr<SendStatisticsProxy> statistics_proxy_;
+ std::unique_ptr<SendStatisticsProxy> statistics_proxy_;
VideoSendStream::Config config_;
int avg_delay_ms_;
int max_delay_ms_;
diff --git a/webrtc/video/video_capture_input_unittest.cc b/webrtc/video/video_capture_input_unittest.cc
index d20b999..357914d 100644
--- a/webrtc/video/video_capture_input_unittest.cc
+++ b/webrtc/video/video_capture_input_unittest.cc
@@ -9,12 +9,12 @@
*/
#include "webrtc/video/video_capture_input.h"
+#include <memory>
#include <vector>
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/event.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/ref_count.h"
#include "webrtc/system_wrappers/include/scoped_vector.h"
#include "webrtc/test/fake_texture_frame.h"
@@ -82,12 +82,12 @@
SendStatisticsProxy stats_proxy_;
- rtc::scoped_ptr<MockVideoCaptureCallback> mock_frame_callback_;
+ std::unique_ptr<MockVideoCaptureCallback> mock_frame_callback_;
- rtc::scoped_ptr<OveruseFrameDetector> overuse_detector_;
+ std::unique_ptr<OveruseFrameDetector> overuse_detector_;
// Used to send input capture frames to VideoCaptureInput.
- rtc::scoped_ptr<internal::VideoCaptureInput> input_;
+ std::unique_ptr<internal::VideoCaptureInput> input_;
// Input capture frames of VideoCaptureInput.
ScopedVector<VideoFrame> input_frames_;
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index 0fc125c..84dbb51 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -21,7 +21,6 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/event.h"
#include "webrtc/base/format_macros.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/call.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
@@ -1039,7 +1038,7 @@
params_ = params;
CheckParams();
- rtc::scoped_ptr<test::VideoRenderer> local_preview(
+ std::unique_ptr<test::VideoRenderer> local_preview(
test::VideoRenderer::Create("Local Preview", params_.common.width,
params_.common.height));
size_t stream_id = params_.ss.selected_stream;
@@ -1050,7 +1049,7 @@
title += " - Stream #" + s.str();
}
- rtc::scoped_ptr<test::VideoRenderer> loopback_video(
+ std::unique_ptr<test::VideoRenderer> loopback_video(
test::VideoRenderer::Create(title.c_str(),
params_.ss.streams[stream_id].width,
params_.ss.streams[stream_id].height));
@@ -1059,7 +1058,7 @@
// match the full stack tests.
Call::Config call_config;
call_config.bitrate_config = params_.common.call_bitrate_config;
- rtc::scoped_ptr<Call> call(Call::Create(call_config));
+ std::unique_ptr<Call> call(Call::Create(call_config));
test::LayerFilteringTransport transport(
params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9,
diff --git a/webrtc/video/video_quality_test.h b/webrtc/video/video_quality_test.h
index dd2b011..b476004 100644
--- a/webrtc/video/video_quality_test.h
+++ b/webrtc/video/video_quality_test.h
@@ -10,6 +10,7 @@
#ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_
#define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_
+#include <memory>
#include <string>
#include <vector>
@@ -103,10 +104,10 @@
void SetupScreenshare();
// We need a more general capturer than the FrameGeneratorCapturer.
- rtc::scoped_ptr<test::VideoCapturer> capturer_;
- rtc::scoped_ptr<test::TraceToStderr> trace_to_stderr_;
- rtc::scoped_ptr<test::FrameGenerator> frame_generator_;
- rtc::scoped_ptr<VideoEncoder> encoder_;
+ std::unique_ptr<test::VideoCapturer> capturer_;
+ std::unique_ptr<test::TraceToStderr> trace_to_stderr_;
+ std::unique_ptr<test::FrameGenerator> frame_generator_;
+ std::unique_ptr<VideoEncoder> encoder_;
VideoCodecUnion codec_settings_;
Clock* const clock_;
diff --git a/webrtc/video/video_receive_stream.h b/webrtc/video/video_receive_stream.h
index 5510945..f1061dc 100644
--- a/webrtc/video/video_receive_stream.h
+++ b/webrtc/video/video_receive_stream.h
@@ -11,9 +11,9 @@
#ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_
#define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_
+#include <memory>
#include <vector>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/call.h"
#include "webrtc/call/transport_adapter.h"
#include "webrtc/common_video/include/incoming_video_stream.h"
@@ -95,7 +95,7 @@
CallStats* const call_stats_;
VieRemb* const remb_;
- rtc::scoped_ptr<VideoCodingModule> vcm_;
+ std::unique_ptr<VideoCodingModule> vcm_;
IncomingVideoStream incoming_video_stream_;
ReceiveStatisticsProxy stats_proxy_;
ViEChannel vie_channel_;
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index e8f1101..4243ee6 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <algorithm> // max
+#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
@@ -18,7 +19,6 @@
#include "webrtc/base/event.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/platform_thread.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/call.h"
#include "webrtc/call/transport_adapter.h"
#include "webrtc/frame_callback.h"
@@ -304,7 +304,7 @@
RtcpStatistics stats_;
};
- rtc::scoped_ptr<LossyStatistician> lossy_stats_;
+ std::unique_ptr<LossyStatistician> lossy_stats_;
StatisticianMap stats_map_;
};
@@ -442,8 +442,8 @@
EXPECT_TRUE(Wait()) << "Timed out waiting for FEC and media packets.";
}
- rtc::scoped_ptr<internal::TransportAdapter> transport_adapter_;
- rtc::scoped_ptr<VideoEncoder> encoder_;
+ std::unique_ptr<internal::TransportAdapter> transport_adapter_;
+ std::unique_ptr<VideoEncoder> encoder_;
const std::string payload_name_;
const bool use_nack_;
const bool expect_red_;
@@ -562,7 +562,7 @@
EXPECT_TRUE(Wait()) << "Timed out while waiting for NACK retransmission.";
}
- rtc::scoped_ptr<internal::TransportAdapter> transport_adapter_;
+ std::unique_ptr<internal::TransportAdapter> transport_adapter_;
int send_count_;
uint32_t retransmit_ssrc_;
uint8_t retransmit_payload_type_;
@@ -758,7 +758,7 @@
EXPECT_TRUE(Wait()) << "Timed out while observing incoming RTP packets.";
}
- rtc::scoped_ptr<internal::TransportAdapter> transport_adapter_;
+ std::unique_ptr<internal::TransportAdapter> transport_adapter_;
test::ConfigurableFrameSizeEncoder encoder_;
const size_t max_packet_size_;
@@ -937,7 +937,7 @@
EXPECT_EQ(0, rtcp_sender.SendRTCP(feedback_state, kRtcpRr));
}
- rtc::scoped_ptr<internal::TransportAdapter> transport_adapter_;
+ std::unique_ptr<internal::TransportAdapter> transport_adapter_;
Clock* const clock_;
VideoSendStream* stream_;
@@ -1015,7 +1015,7 @@
}
Clock* const clock_;
- rtc::scoped_ptr<internal::TransportAdapter> transport_adapter_;
+ std::unique_ptr<internal::TransportAdapter> transport_adapter_;
rtc::CriticalSection crit_;
int64_t last_packet_time_ms_ GUARDED_BY(crit_);
test::FrameGeneratorCapturer* capturer_ GUARDED_BY(crit_);
@@ -1103,8 +1103,8 @@
<< "Timeout while waiting for low bitrate stats after REMB.";
}
- rtc::scoped_ptr<RtpRtcp> rtp_rtcp_;
- rtc::scoped_ptr<internal::TransportAdapter> feedback_transport_;
+ std::unique_ptr<RtpRtcp> rtp_rtcp_;
+ std::unique_ptr<internal::TransportAdapter> feedback_transport_;
VideoSendStream* stream_;
bool bitrate_capped_;
} test;
@@ -1292,7 +1292,7 @@
VideoFrame CreateVideoFrame(int width, int height, uint8_t data) {
const int kSizeY = width * height * 2;
- rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[kSizeY]);
+ std::unique_ptr<uint8_t[]> buffer(new uint8_t[kSizeY]);
memset(buffer.get(), data, kSizeY);
VideoFrame frame;
frame.CreateFrame(buffer.get(), buffer.get(), buffer.get(), width, height,
@@ -2168,7 +2168,7 @@
VerifyTl0Idx(vp9);
}
- rtc::scoped_ptr<VP9Encoder> vp9_encoder_;
+ std::unique_ptr<VP9Encoder> vp9_encoder_;
VideoCodecVP9 vp9_settings_;
webrtc::VideoEncoderConfig encoder_config_;
RTPHeader last_header_;
diff --git a/webrtc/video/vie_channel.h b/webrtc/video/vie_channel.h
index afb8d89..b89b800 100644
--- a/webrtc/video/vie_channel.h
+++ b/webrtc/video/vie_channel.h
@@ -13,11 +13,11 @@
#include <list>
#include <map>
+#include <memory>
#include <vector>
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/platform_thread.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
@@ -284,13 +284,13 @@
rtc::CriticalSection crit_;
// Owned modules/classes.
- rtc::scoped_ptr<ViEChannelProtectionCallback> vcm_protection_callback_;
+ std::unique_ptr<ViEChannelProtectionCallback> vcm_protection_callback_;
VideoCodingModule* const vcm_;
ViEReceiver vie_receiver_;
// Helper to report call statistics.
- rtc::scoped_ptr<ChannelStatsObserver> stats_observer_;
+ std::unique_ptr<ChannelStatsObserver> stats_observer_;
// Not owned.
ReceiveStatisticsProxy* receive_stats_callback_ GUARDED_BY(crit_);
@@ -301,7 +301,7 @@
PacedSender* const paced_sender_;
PacketRouter* const packet_router_;
- const rtc::scoped_ptr<RtcpBandwidthObserver> bandwidth_observer_;
+ const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
TransportFeedbackObserver* const transport_feedback_observer_;
int max_nack_reordering_threshold_;
diff --git a/webrtc/video/vie_encoder.h b/webrtc/video/vie_encoder.h
index 3bb6d3f..77046cb 100644
--- a/webrtc/video/vie_encoder.h
+++ b/webrtc/video/vie_encoder.h
@@ -11,10 +11,10 @@
#ifndef WEBRTC_VIDEO_VIE_ENCODER_H_
#define WEBRTC_VIDEO_VIE_ENCODER_H_
+#include <memory>
#include <vector>
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/call/bitrate_allocator.h"
@@ -139,12 +139,12 @@
const uint32_t number_of_cores_;
const std::vector<uint32_t> ssrcs_;
- const rtc::scoped_ptr<VideoProcessing> vp_;
- const rtc::scoped_ptr<QMVideoSettingsCallback> qm_callback_;
- const rtc::scoped_ptr<VideoCodingModule> vcm_;
+ const std::unique_ptr<VideoProcessing> vp_;
+ const std::unique_ptr<QMVideoSettingsCallback> qm_callback_;
+ const std::unique_ptr<VideoCodingModule> vcm_;
rtc::CriticalSection data_cs_;
- rtc::scoped_ptr<BitrateObserver> bitrate_observer_;
+ std::unique_ptr<BitrateObserver> bitrate_observer_;
SendStatisticsProxy* const stats_proxy_;
I420FrameCallback* const pre_encode_callback_;
diff --git a/webrtc/video/vie_receiver.h b/webrtc/video/vie_receiver.h
index ccfbd45..b6e19cb 100644
--- a/webrtc/video/vie_receiver.h
+++ b/webrtc/video/vie_receiver.h
@@ -12,10 +12,10 @@
#define WEBRTC_VIDEO_VIE_RECEIVER_H_
#include <list>
+#include <memory>
#include <string>
#include <vector>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/engine_configurations.h"
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
@@ -100,17 +100,17 @@
rtc::CriticalSection receive_cs_;
Clock* clock_;
- rtc::scoped_ptr<RtpHeaderParser> rtp_header_parser_;
- rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
- rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
- const rtc::scoped_ptr<ReceiveStatistics> rtp_receive_statistics_;
- rtc::scoped_ptr<FecReceiver> fec_receiver_;
+ std::unique_ptr<RtpHeaderParser> rtp_header_parser_;
+ std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
+ std::unique_ptr<RtpReceiver> rtp_receiver_;
+ const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
+ std::unique_ptr<FecReceiver> fec_receiver_;
RtpRtcp* rtp_rtcp_;
std::vector<RtpRtcp*> rtp_rtcp_simulcast_;
VideoCodingModule* vcm_;
RemoteBitrateEstimator* remote_bitrate_estimator_;
- rtc::scoped_ptr<RemoteNtpTimeEstimator> ntp_estimator_;
+ std::unique_ptr<RemoteNtpTimeEstimator> ntp_estimator_;
bool receiving_;
uint8_t restored_packet_[IP_PACKET_SIZE];
diff --git a/webrtc/video/vie_remb.h b/webrtc/video/vie_remb.h
index 39dbc85..d2c60db 100644
--- a/webrtc/video/vie_remb.h
+++ b/webrtc/video/vie_remb.h
@@ -16,7 +16,6 @@
#include <vector>
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/include/module.h"
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
diff --git a/webrtc/video/vie_remb_unittest.cc b/webrtc/video/vie_remb_unittest.cc
index 3a69cdb..5f72b96 100644
--- a/webrtc/video/vie_remb_unittest.cc
+++ b/webrtc/video/vie_remb_unittest.cc
@@ -11,11 +11,11 @@
// This file includes unit tests for ViERemb.
+#include <memory>
#include <vector>
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
#include "webrtc/modules/utility/include/mock/mock_process_thread.h"
@@ -39,8 +39,8 @@
vie_remb_.reset(new VieRemb(&fake_clock_));
}
SimulatedClock fake_clock_;
- rtc::scoped_ptr<MockProcessThread> process_thread_;
- rtc::scoped_ptr<VieRemb> vie_remb_;
+ std::unique_ptr<MockProcessThread> process_thread_;
+ std::unique_ptr<VieRemb> vie_remb_;
};
TEST_F(ViERembTest, OneModuleTestForSendingRemb) {
diff --git a/webrtc/video/vie_sync_module.h b/webrtc/video/vie_sync_module.h
index 5724ce7..a5dff43 100644
--- a/webrtc/video/vie_sync_module.h
+++ b/webrtc/video/vie_sync_module.h
@@ -14,8 +14,9 @@
#ifndef WEBRTC_VIDEO_VIE_SYNC_MODULE_H_
#define WEBRTC_VIDEO_VIE_SYNC_MODULE_H_
+#include <memory>
+
#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/include/module.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/video/stream_synchronization.h"
@@ -50,7 +51,7 @@
int voe_channel_id_;
VoEVideoSync* voe_sync_interface_;
TickTime last_sync_time_;
- rtc::scoped_ptr<StreamSynchronization> sync_;
+ std::unique_ptr<StreamSynchronization> sync_;
StreamSynchronization::Measurements audio_measurement_;
StreamSynchronization::Measurements video_measurement_;
};