diff --git a/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc b/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc index 11fd64f84e..4967913558 100644 --- a/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc +++ b/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc @@ -8,8 +8,9 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include + #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test.h" #include "webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h" @@ -244,8 +245,8 @@ TEST_P(BweSimulation, SelfFairnessTest) { Random prng(Clock::GetRealTimeClock()->TimeInMicroseconds()); const int kAllFlowIds[] = {0, 1, 2, 3}; const size_t kNumFlows = sizeof(kAllFlowIds) / sizeof(kAllFlowIds[0]); - rtc::scoped_ptr sources[kNumFlows]; - rtc::scoped_ptr senders[kNumFlows]; + std::unique_ptr sources[kNumFlows]; + std::unique_ptr senders[kNumFlows]; for (size_t i = 0; i < kNumFlows; ++i) { // Streams started 20 seconds apart to give them different advantage when // competing for the bandwidth. @@ -257,7 +258,7 @@ TEST_P(BweSimulation, SelfFairnessTest) { ChokeFilter choke(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); choke.set_capacity_kbps(1000); - rtc::scoped_ptr rate_counters[kNumFlows]; + std::unique_ptr rate_counters[kNumFlows]; for (size_t i = 0; i < kNumFlows; ++i) { rate_counters[i].reset( new RateCounterFilter(&uplink_, CreateFlowIds(&kAllFlowIds[i], 1), @@ -268,7 +269,7 @@ TEST_P(BweSimulation, SelfFairnessTest) { &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "total_utilization", "Total_link_utilization"); - rtc::scoped_ptr receivers[kNumFlows]; + std::unique_ptr receivers[kNumFlows]; for (size_t i = 0; i < kNumFlows; ++i) { receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], GetParam(), i == 0, false)); diff --git a/webrtc/modules/remote_bitrate_estimator/inter_arrival_unittest.cc b/webrtc/modules/remote_bitrate_estimator/inter_arrival_unittest.cc index 64f7ccae6b..3b4151b3b7 100644 --- a/webrtc/modules/remote_bitrate_estimator/inter_arrival_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/inter_arrival_unittest.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/scoped_ptr.h" #include "webrtc/common_types.h" #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" @@ -199,8 +200,8 @@ class InterArrivalTest : public ::testing::Test { EXPECT_EQ(expected_packet_size_delta, delta_packet_size); } - rtc::scoped_ptr inter_arrival_rtp_; - rtc::scoped_ptr inter_arrival_ast_; + std::unique_ptr inter_arrival_rtp_; + std::unique_ptr inter_arrival_ast_; }; TEST_F(InterArrivalTest, FirstPacket) { diff --git a/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc b/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc index 957d69837a..dabc6551a0 100644 --- a/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc @@ -13,12 +13,12 @@ #include #include #include +#include #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/random.h" #include "webrtc/base/rate_statistics.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/common_types.h" #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" @@ -114,9 +114,9 @@ class OveruseDetectorTest : public ::testing::Test { int64_t receive_time_ms_; uint32_t rtp_timestamp_; OverUseDetectorOptions options_; - rtc::scoped_ptr overuse_detector_; - rtc::scoped_ptr overuse_estimator_; - rtc::scoped_ptr inter_arrival_; + std::unique_ptr overuse_detector_; + std::unique_ptr overuse_estimator_; + std::unique_ptr inter_arrival_; Random random_; }; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc index bf3fdc23df..7c2abb2f08 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc @@ -16,7 +16,6 @@ #include "webrtc/base/constructormagic.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/modules/pacing/paced_sender.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h index 39d3e032a7..1f47dc3b24 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h @@ -13,12 +13,12 @@ #include #include +#include #include #include "webrtc/base/checks.h" #include "webrtc/base/criticalsection.h" #include "webrtc/base/rate_statistics.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_checker.h" #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" @@ -120,7 +120,7 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator { rtc::ThreadChecker network_thread_; RemoteBitrateObserver* const observer_; - rtc::scoped_ptr inter_arrival_; + std::unique_ptr inter_arrival_; OveruseEstimator estimator_; OveruseDetector detector_; RateStatistics incoming_bitrate_; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc index 9a1bbc16b5..f38ef78306 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc @@ -14,7 +14,6 @@ #include "webrtc/base/constructormagic.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" #include "webrtc/modules/remote_bitrate_estimator/inter_arrival.h" diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h index f3a208a0b7..5516ea781d 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h @@ -12,6 +12,7 @@ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_BITRATE_ESTIMATOR_SINGLE_STREAM_H_ #include +#include #include #include "webrtc/base/rate_statistics.h" @@ -54,9 +55,9 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator { Clock* clock_; SsrcOveruseEstimatorMap overuse_detectors_ GUARDED_BY(crit_sect_.get()); RateStatistics incoming_bitrate_ GUARDED_BY(crit_sect_.get()); - rtc::scoped_ptr remote_rate_ GUARDED_BY(crit_sect_.get()); + std::unique_ptr remote_rate_ GUARDED_BY(crit_sect_.get()); RemoteBitrateObserver* observer_ GUARDED_BY(crit_sect_.get()); - rtc::scoped_ptr crit_sect_; + std::unique_ptr crit_sect_; int64_t last_process_time_; int64_t process_interval_ms_ GUARDED_BY(crit_sect_.get()); diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h index 69f1763952..12ac9e8502 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.h @@ -13,12 +13,12 @@ #include #include +#include #include #include #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/constructormagic.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "webrtc/system_wrappers/include/clock.h" @@ -210,9 +210,9 @@ class RemoteBitrateEstimatorTest : public ::testing::Test { static const int kArrivalTimeClockOffsetMs = 60000; SimulatedClock clock_; // Time at the receiver. - rtc::scoped_ptr bitrate_observer_; - rtc::scoped_ptr bitrate_estimator_; - rtc::scoped_ptr stream_generator_; + std::unique_ptr bitrate_observer_; + std::unique_ptr bitrate_estimator_; + std::unique_ptr stream_generator_; RTC_DISALLOW_COPY_AND_ASSIGN(RemoteBitrateEstimatorTest); }; diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc index 9da21c1aaa..e32cc94a26 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc @@ -10,11 +10,11 @@ #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test.h" +#include #include #include "webrtc/base/arraysize.h" #include "webrtc/base/common.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" #include "webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h" @@ -555,10 +555,10 @@ void BweTest::RunVariableCapacity2MultipleFlows(BandwidthEstimatorType bwe_type, void BweTest::RunBidirectionalFlow(BandwidthEstimatorType bwe_type) { enum direction { kForward = 0, kBackward }; const size_t kNumFlows = 2; - rtc::scoped_ptr sources[kNumFlows]; - rtc::scoped_ptr senders[kNumFlows]; - rtc::scoped_ptr metric_recorders[kNumFlows]; - rtc::scoped_ptr receivers[kNumFlows]; + std::unique_ptr sources[kNumFlows]; + std::unique_ptr senders[kNumFlows]; + std::unique_ptr metric_recorders[kNumFlows]; + std::unique_ptr receivers[kNumFlows]; sources[kForward].reset(new AdaptiveVideoSource(kForward, 30, 300, 0, 0)); senders[kForward].reset( @@ -664,9 +664,9 @@ void BweTest::RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type) { const int kAllFlowIds[] = {0, 1, 2, 3, 4}; // Five RMCAT flows. const int64_t kAllOneWayDelayMs[] = {10, 25, 50, 100, 150}; const size_t kNumFlows = arraysize(kAllFlowIds); - rtc::scoped_ptr sources[kNumFlows]; - rtc::scoped_ptr senders[kNumFlows]; - rtc::scoped_ptr metric_recorders[kNumFlows]; + std::unique_ptr sources[kNumFlows]; + std::unique_ptr senders[kNumFlows]; + std::unique_ptr metric_recorders[kNumFlows]; // Flows initialized 10 seconds apart. const int64_t kStartingApartMs = 10 * 1000; @@ -682,7 +682,7 @@ void BweTest::RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type) { JitterFilter jitter_filter(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); - rtc::scoped_ptr up_delay_filters[kNumFlows]; + std::unique_ptr up_delay_filters[kNumFlows]; for (size_t i = 0; i < kNumFlows; ++i) { up_delay_filters[i].reset(new DelayFilter(&uplink_, kAllFlowIds[i])); } @@ -693,7 +693,7 @@ void BweTest::RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type) { // Delays is being plotted only for the first flow. // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). - rtc::scoped_ptr receivers[kNumFlows]; + std::unique_ptr receivers[kNumFlows]; for (size_t i = 0; i < kNumFlows; ++i) { metric_recorders[i].reset( new MetricRecorder(bwe_names[bwe_type], static_cast(i), @@ -708,7 +708,7 @@ void BweTest::RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type) { i == 0 && plot_total_available_capacity_); } - rtc::scoped_ptr down_delay_filters[kNumFlows]; + std::unique_ptr down_delay_filters[kNumFlows]; for (size_t i = 0; i < kNumFlows; ++i) { down_delay_filters[i].reset(new DelayFilter(&downlink_, kAllFlowIds[i])); } @@ -780,10 +780,10 @@ void BweTest::RunMultipleShortTcpFairness( const size_t kNumRmcatFlows = arraysize(kAllRmcatFlowIds); const size_t kNumTotalFlows = kNumRmcatFlows + arraysize(kAllTcpFlowIds); - rtc::scoped_ptr sources[kNumRmcatFlows]; - rtc::scoped_ptr senders[kNumTotalFlows]; - rtc::scoped_ptr metric_recorders[kNumTotalFlows]; - rtc::scoped_ptr receivers[kNumTotalFlows]; + std::unique_ptr sources[kNumRmcatFlows]; + std::unique_ptr senders[kNumTotalFlows]; + std::unique_ptr metric_recorders[kNumTotalFlows]; + std::unique_ptr receivers[kNumTotalFlows]; // RMCAT Flows are initialized simultaneosly at t=5 seconds. const int64_t kRmcatStartingTimeMs = 5 * 1000; @@ -872,10 +872,10 @@ void BweTest::RunPauseResumeFlows(BandwidthEstimatorType bwe_type) { const int kAllFlowIds[] = {0, 1, 2}; // Three RMCAT flows. const size_t kNumFlows = arraysize(kAllFlowIds); - rtc::scoped_ptr sources[kNumFlows]; - rtc::scoped_ptr senders[kNumFlows]; - rtc::scoped_ptr metric_recorders[kNumFlows]; - rtc::scoped_ptr receivers[kNumFlows]; + std::unique_ptr sources[kNumFlows]; + std::unique_ptr senders[kNumFlows]; + std::unique_ptr metric_recorders[kNumFlows]; + std::unique_ptr receivers[kNumFlows]; // Flows initialized simultaneously. const int64_t kStartingApartMs = 0; diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc index d7abede707..7ba95f0b76 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc @@ -13,10 +13,10 @@ #include #include +#include #include #include "webrtc/base/constructormagic.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" #include "webrtc/test/testsupport/fileutils.h" @@ -44,7 +44,7 @@ class BaseLineFileVerify : public BaseLineFileInterface { BaseLineFileVerify(const std::string& filepath, bool allow_missing_file) : reader_(), fail_to_read_response_(false) { - rtc::scoped_ptr reader; + std::unique_ptr reader; reader.reset(ResourceFileReader::Create(filepath, "bin")); if (!reader.get()) { printf("WARNING: Missing baseline file for BWE test: %s.bin\n", @@ -91,7 +91,7 @@ class BaseLineFileVerify : public BaseLineFileInterface { } private: - rtc::scoped_ptr reader_; + std::unique_ptr reader_; bool fail_to_read_response_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BaseLineFileVerify); @@ -122,7 +122,7 @@ class BaseLineFileUpdate : public BaseLineFileInterface { printf("WARNING: Cannot create output dir: %s\n", dir_path.c_str()); return false; } - rtc::scoped_ptr writer; + std::unique_ptr writer; writer.reset(OutputFileWriter::Create(filepath_, "bin")); if (!writer.get()) { printf("WARNING: Cannot create output file: %s.bin\n", @@ -142,7 +142,7 @@ class BaseLineFileUpdate : public BaseLineFileInterface { } private: - rtc::scoped_ptr verifier_; + std::unique_ptr verifier_; std::vector output_content_; std::string filepath_; @@ -155,7 +155,7 @@ BaseLineFileInterface* BaseLineFileInterface::Create( std::replace(filepath.begin(), filepath.end(), '/', '_'); filepath = std::string(kResourceSubDir) + "/" + filepath; - rtc::scoped_ptr result; + std::unique_ptr result; result.reset(new BaseLineFileVerify(filepath, !write_output_file)); if (write_output_file) { // Takes ownership of the |verifier| instance. diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc index 5744c9c320..5fe78a7758 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc @@ -17,7 +17,6 @@ #endif #include -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" #include "webrtc/test/testsupport/fileutils.h" diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h index 3bb9b95f4b..223b20f21c 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include "webrtc/base/common.h" #include "webrtc/base/random.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/pacing/paced_sender.h" @@ -345,7 +345,7 @@ class ChokeFilter : public PacketProcessor { private: uint32_t capacity_kbps_; int64_t last_send_time_us_; - rtc::scoped_ptr delay_cap_helper_; + std::unique_ptr delay_cap_helper_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ChokeFilter); }; @@ -379,9 +379,9 @@ class TraceBasedDeliveryFilter : public PacketProcessor { TimeList delivery_times_us_; TimeList::const_iterator next_delivery_it_; int64_t local_time_us_; - rtc::scoped_ptr rate_counter_; + std::unique_ptr rate_counter_; std::string name_; - rtc::scoped_ptr delay_cap_helper_; + std::unique_ptr delay_cap_helper_; Stats packets_per_second_stats_; Stats kbps_stats_; diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h index cc7807ba8a..53550fb854 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h @@ -120,11 +120,11 @@ #else // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE #include +#include #include #include #include "webrtc/base/constructormagic.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/common_types.h" #define BWE_TEST_LOGGING_GLOBAL_CONTEXT(name) \ @@ -310,7 +310,7 @@ class Logging { void PopState(); static Logging g_Logging; - rtc::scoped_ptr crit_sect_; + std::unique_ptr crit_sect_; ThreadMap thread_map_; RTC_DISALLOW_COPY_AND_ASSIGN(Logging); diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h index ab4541672d..37009c7701 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h @@ -19,6 +19,7 @@ #include #include +#include #include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" @@ -50,7 +51,7 @@ class NadaBweReceiver : public BweReceiver { private: SimulatedClock clock_; int64_t last_feedback_ms_; - rtc::scoped_ptr recv_stats_; + std::unique_ptr recv_stats_; int64_t baseline_delay_ms_; // Referred as d_f. int64_t delay_signal_ms_; // Referred as d_n. int64_t last_congestion_signal_ms_; diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada_unittest.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada_unittest.cc index 51afae1df4..ec008ffb7f 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada_unittest.cc @@ -11,11 +11,11 @@ #include "webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h" #include +#include #include #include "webrtc/base/arraysize.h" #include "webrtc/base/common.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" #include "webrtc/modules/remote_bitrate_estimator/test/packet.h" #include "testing/gtest/include/gtest/gtest.h" @@ -314,7 +314,7 @@ TEST_F(NadaSenderSideTest, VeryHighBandwith) { } TEST_F(NadaReceiverSideTest, FeedbackInitialCases) { - rtc::scoped_ptr nada_feedback( + std::unique_ptr nada_feedback( static_cast(nada_receiver_.GetFeedback(0))); EXPECT_EQ(nada_feedback, nullptr); @@ -342,7 +342,7 @@ TEST_F(NadaReceiverSideTest, FeedbackEmptyQueues) { } // Baseline delay will be equal kOneWayDelayMs. - rtc::scoped_ptr nada_feedback( + std::unique_ptr nada_feedback( static_cast(nada_receiver_.GetFeedback(500))); EXPECT_EQ(nada_feedback->exp_smoothed_delay_ms(), 0L); EXPECT_EQ(nada_feedback->est_queuing_delay_signal_ms(), 0L); @@ -378,7 +378,7 @@ TEST_F(NadaReceiverSideTest, FeedbackIncreasingDelay) { const MediaPacket media_packet(kFlowId, send_time_us, 0, sequence_number); nada_receiver_.ReceivePacket(arrival_time_ms, media_packet); - rtc::scoped_ptr nada_feedback(static_cast( + std::unique_ptr nada_feedback(static_cast( nada_receiver_.GetFeedback(arrival_time_ms))); EXPECT_EQ(nada_feedback->exp_smoothed_delay_ms(), exp_smoothed_delays_ms[i]); @@ -447,7 +447,7 @@ TEST_F(NadaReceiverSideTest, FeedbackWarpedDelay) { const MediaPacket media_packet(kFlowId, send_time_us, 0, sequence_number); nada_receiver_.ReceivePacket(arrival_time_ms, media_packet); - rtc::scoped_ptr nada_feedback(static_cast( + std::unique_ptr nada_feedback(static_cast( nada_receiver_.GetFeedback(arrival_time_ms))); EXPECT_EQ(nada_feedback->exp_smoothed_delay_ms(), exp_smoothed_delays_ms[i]); diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h index 058873eeda..5e6b6edb25 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_REMB_H_ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_REMB_H_ +#include #include #include @@ -38,8 +39,8 @@ class RembBweSender : public BweSender { void Process() override; protected: - rtc::scoped_ptr bitrate_controller_; - rtc::scoped_ptr feedback_observer_; + std::unique_ptr bitrate_controller_; + std::unique_ptr feedback_observer_; private: Clock* clock_; @@ -68,10 +69,10 @@ class RembReceiver : public BweReceiver, public RemoteBitrateObserver { std::string estimate_log_prefix_; bool plot_estimate_; SimulatedClock clock_; - rtc::scoped_ptr recv_stats_; + std::unique_ptr recv_stats_; int64_t latest_estimate_bps_; int64_t last_feedback_ms_; - rtc::scoped_ptr estimator_; + std::unique_ptr estimator_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RembReceiver); }; diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h index 9832eb2d28..51e29e34c2 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_SEND_SIDE_H_ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_SEND_SIDE_H_ +#include #include #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" @@ -34,9 +35,9 @@ class FullBweSender : public BweSender, public RemoteBitrateObserver { void Process() override; protected: - rtc::scoped_ptr bitrate_controller_; - rtc::scoped_ptr rbe_; - rtc::scoped_ptr feedback_observer_; + std::unique_ptr bitrate_controller_; + std::unique_ptr rbe_; + std::unique_ptr feedback_observer_; private: Clock* const clock_; diff --git a/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h b/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h index fb9e9fd7ab..7214460ae3 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h +++ b/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h @@ -11,10 +11,10 @@ #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_RECEIVER_H_ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_RECEIVER_H_ +#include #include #include "webrtc/base/constructormagic.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" #include "webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h" @@ -53,7 +53,7 @@ class PacketReceiver : public PacketProcessor { size_t payload_size); Stats delay_stats_; - rtc::scoped_ptr bwe_receiver_; + std::unique_ptr bwe_receiver_; private: void PlotDelay(int64_t arrival_time_ms, int64_t send_time_ms); diff --git a/webrtc/modules/remote_bitrate_estimator/test/packet_sender.h b/webrtc/modules/remote_bitrate_estimator/test/packet_sender.h index f48ed62f57..5ed4a3bc38 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/packet_sender.h +++ b/webrtc/modules/remote_bitrate_estimator/test/packet_sender.h @@ -13,11 +13,11 @@ #include #include +#include #include #include #include "webrtc/base/constructormagic.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/include/module.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" @@ -91,7 +91,7 @@ class VideoSender : public PacketSender, public BitrateObserver { Packets* generated); VideoSource* source_; - rtc::scoped_ptr bwe_; + std::unique_ptr bwe_; int64_t start_of_run_ms_; std::list modules_; diff --git a/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc b/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc index 2d89e191c3..08dc0e63a0 100644 --- a/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc +++ b/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc @@ -10,8 +10,9 @@ #include +#include + #include "webrtc/base/format_macros.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" @@ -48,9 +49,9 @@ int main(int argc, char** argv) { &parser, &estimator, &estimator_used)) { return -1; } - rtc::scoped_ptr rtp_reader(reader); - rtc::scoped_ptr rtp_parser(parser); - rtc::scoped_ptr rbe(estimator); + std::unique_ptr rtp_reader(reader); + std::unique_ptr rtp_parser(parser); + std::unique_ptr rbe(estimator); // Process the file. int packet_counter = 0; diff --git a/webrtc/modules/remote_bitrate_estimator/tools/rtp_to_text.cc b/webrtc/modules/remote_bitrate_estimator/tools/rtp_to_text.cc index bf698728e8..2b8c5b056c 100644 --- a/webrtc/modules/remote_bitrate_estimator/tools/rtp_to_text.cc +++ b/webrtc/modules/remote_bitrate_estimator/tools/rtp_to_text.cc @@ -9,10 +9,11 @@ */ #include + +#include #include #include "webrtc/base/format_macros.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" @@ -26,8 +27,8 @@ int main(int argc, char** argv) { return -1; } bool arrival_time_only = (argc >= 5 && strncmp(argv[4], "-t", 2) == 0); - rtc::scoped_ptr rtp_reader(reader); - rtc::scoped_ptr rtp_parser(parser); + std::unique_ptr rtp_reader(reader); + std::unique_ptr rtp_parser(parser); fprintf(stdout, "seqnum timestamp ts_offset abs_sendtime recvtime " "markerbit ssrc size original_size\n"); int packet_counter = 0; diff --git a/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h b/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h index 073dfd0d48..c97ef57cf0 100644 --- a/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h +++ b/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h @@ -11,6 +11,7 @@ #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ +#include #include #include "webrtc/base/criticalsection.h" @@ -54,7 +55,7 @@ class TransportFeedbackAdapter : public TransportFeedbackObserver, rtc::CriticalSection lock_; SendTimeHistory send_time_history_ GUARDED_BY(&lock_); BitrateController* bitrate_controller_; - rtc::scoped_ptr bitrate_estimator_; + std::unique_ptr bitrate_estimator_; Clock* const clock_; int64_t current_offset_ms_; int64_t last_timestamp_us_; diff --git a/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter_unittest.cc b/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter_unittest.cc index 03407c0e8e..f3be09206e 100644 --- a/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter_unittest.cc @@ -9,13 +9,13 @@ */ #include +#include #include #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/checks.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h" #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h" #include "webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h" @@ -107,7 +107,7 @@ class TransportFeedbackAdapterTest : public ::testing::Test { SimulatedClock clock_; MockRemoteBitrateEstimator* bitrate_estimator_; MockBitrateControllerAdapter bitrate_controller_; - rtc::scoped_ptr adapter_; + std::unique_ptr adapter_; uint32_t receiver_estimated_bitrate_; }; @@ -198,7 +198,7 @@ TEST_F(TransportFeedbackAdapterTest, SendTimeWrapsBothWays) { OnSentPacket(packet); for (size_t i = 0; i < packets.size(); ++i) { - rtc::scoped_ptr feedback( + std::unique_ptr feedback( new rtcp::TransportFeedback()); feedback->WithBase(packets[i].sequence_number, packets[i].arrival_time_ms * 1000); @@ -207,8 +207,8 @@ TEST_F(TransportFeedbackAdapterTest, SendTimeWrapsBothWays) { packets[i].sequence_number, packets[i].arrival_time_ms * 1000)); rtc::Buffer raw_packet = feedback->Build(); - feedback = rtcp::TransportFeedback::ParseFrom(raw_packet.data(), - raw_packet.size()); + feedback = rtc::ScopedToUnique(rtcp::TransportFeedback::ParseFrom( + raw_packet.data(), raw_packet.size())); std::vector expected_packets; expected_packets.push_back(packets[i]); @@ -263,7 +263,7 @@ TEST_F(TransportFeedbackAdapterTest, TimestampDeltas) { OnSentPacket(info); // Create expected feedback and send into adapter. - rtc::scoped_ptr feedback( + std::unique_ptr feedback( new rtcp::TransportFeedback()); feedback->WithBase(sent_packets[0].sequence_number, sent_packets[0].arrival_time_ms * 1000); @@ -276,8 +276,8 @@ TEST_F(TransportFeedbackAdapterTest, TimestampDeltas) { info.arrival_time_ms * 1000)); rtc::Buffer raw_packet = feedback->Build(); - feedback = rtcp::TransportFeedback::ParseFrom(raw_packet.data(), - raw_packet.size()); + feedback = rtc::ScopedToUnique( + rtcp::TransportFeedback::ParseFrom(raw_packet.data(), raw_packet.size())); std::vector received_feedback; @@ -297,8 +297,8 @@ TEST_F(TransportFeedbackAdapterTest, TimestampDeltas) { EXPECT_TRUE(feedback->WithReceivedPacket(info.sequence_number, info.arrival_time_ms * 1000)); raw_packet = feedback->Build(); - feedback = rtcp::TransportFeedback::ParseFrom(raw_packet.data(), - raw_packet.size()); + feedback = rtc::ScopedToUnique( + rtcp::TransportFeedback::ParseFrom(raw_packet.data(), raw_packet.size())); EXPECT_TRUE(feedback.get() != nullptr); EXPECT_CALL(*bitrate_estimator_, IncomingPacketFeedbackVector(_))