diff --git a/webrtc/audio/audio_receive_stream.cc b/webrtc/audio/audio_receive_stream.cc index 7ff5ff35b9..2c58def560 100644 --- a/webrtc/audio/audio_receive_stream.cc +++ b/webrtc/audio/audio_receive_stream.cc @@ -93,8 +93,7 @@ AudioReceiveStream::AudioReceiveStream( RTC_DCHECK(rtp_header_parser_); VoiceEngineImpl* voe_impl = static_cast(voice_engine()); - channel_proxy_ = - rtc::UniqueToScoped(voe_impl->GetChannelProxy(config_.voe_channel_id)); + channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); for (const auto& extension : config.rtp.extensions) { if (extension.name == RtpExtension::kAudioLevel) { @@ -229,9 +228,9 @@ webrtc::AudioReceiveStream::Stats AudioReceiveStream::GetStats() const { return stats; } -void AudioReceiveStream::SetSink(rtc::scoped_ptr sink) { +void AudioReceiveStream::SetSink(std::unique_ptr sink) { RTC_DCHECK(thread_checker_.CalledOnValidThread()); - channel_proxy_->SetSink(rtc::ScopedToUnique(std::move(sink))); + channel_proxy_->SetSink(std::move(sink)); } const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const { diff --git a/webrtc/audio/audio_receive_stream.h b/webrtc/audio/audio_receive_stream.h index 4940c6a64c..c9754afbf5 100644 --- a/webrtc/audio/audio_receive_stream.h +++ b/webrtc/audio/audio_receive_stream.h @@ -11,6 +11,8 @@ #ifndef WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ #define WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ +#include + #include "webrtc/audio_receive_stream.h" #include "webrtc/audio_state.h" #include "webrtc/base/thread_checker.h" @@ -45,7 +47,7 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream { // webrtc::AudioReceiveStream implementation. webrtc::AudioReceiveStream::Stats GetStats() const override; - void SetSink(rtc::scoped_ptr sink) override; + void SetSink(std::unique_ptr sink) override; const webrtc::AudioReceiveStream::Config& config() const; @@ -56,8 +58,8 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream { RemoteBitrateEstimator* remote_bitrate_estimator_ = nullptr; const webrtc::AudioReceiveStream::Config config_; rtc::scoped_refptr audio_state_; - rtc::scoped_ptr rtp_header_parser_; - rtc::scoped_ptr channel_proxy_; + std::unique_ptr rtp_header_parser_; + std::unique_ptr channel_proxy_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); }; diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc index 49d867bac5..c18331cea6 100644 --- a/webrtc/audio/audio_send_stream.cc +++ b/webrtc/audio/audio_send_stream.cc @@ -67,8 +67,7 @@ AudioSendStream::AudioSendStream( RTC_DCHECK(congestion_controller); VoiceEngineImpl* voe_impl = static_cast(voice_engine()); - channel_proxy_ = - rtc::UniqueToScoped(voe_impl->GetChannelProxy(config_.voe_channel_id)); + channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); channel_proxy_->RegisterSenderCongestionControlObjects( congestion_controller->pacer(), congestion_controller->GetTransportFeedbackObserver(), diff --git a/webrtc/audio/audio_send_stream.h b/webrtc/audio/audio_send_stream.h index 8b96350590..cf0a19ca4b 100644 --- a/webrtc/audio/audio_send_stream.h +++ b/webrtc/audio/audio_send_stream.h @@ -11,10 +11,11 @@ #ifndef WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ #define WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ +#include + #include "webrtc/audio_send_stream.h" #include "webrtc/audio_state.h" #include "webrtc/base/thread_checker.h" -#include "webrtc/base/scoped_ptr.h" namespace webrtc { class CongestionController; @@ -51,7 +52,7 @@ class AudioSendStream final : public webrtc::AudioSendStream { rtc::ThreadChecker thread_checker_; const webrtc::AudioSendStream::Config config_; rtc::scoped_refptr audio_state_; - rtc::scoped_ptr channel_proxy_; + std::unique_ptr channel_proxy_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); }; diff --git a/webrtc/audio/audio_state_unittest.cc b/webrtc/audio/audio_state_unittest.cc index 11fbdb4a86..b0e2bc4c03 100644 --- a/webrtc/audio/audio_state_unittest.cc +++ b/webrtc/audio/audio_state_unittest.cc @@ -8,10 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include + #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/audio/audio_state.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/test/mock_voice_engine.h" namespace webrtc { @@ -44,20 +45,20 @@ TEST(AudioStateTest, Create) { TEST(AudioStateTest, ConstructDestruct) { ConfigHelper helper; - rtc::scoped_ptr audio_state( + std::unique_ptr audio_state( new internal::AudioState(helper.config())); } TEST(AudioStateTest, GetVoiceEngine) { ConfigHelper helper; - rtc::scoped_ptr audio_state( + std::unique_ptr audio_state( new internal::AudioState(helper.config())); EXPECT_EQ(audio_state->voice_engine(), &helper.voice_engine()); } TEST(AudioStateTest, TypingNoiseDetected) { ConfigHelper helper; - rtc::scoped_ptr audio_state( + std::unique_ptr audio_state( new internal::AudioState(helper.config())); VoiceEngineObserver* voe_observer = static_cast(audio_state.get()); diff --git a/webrtc/audio_receive_stream.h b/webrtc/audio_receive_stream.h index 6c8a028286..5254c41780 100644 --- a/webrtc/audio_receive_stream.h +++ b/webrtc/audio_receive_stream.h @@ -12,10 +12,10 @@ #define WEBRTC_AUDIO_RECEIVE_STREAM_H_ #include +#include #include #include -#include "webrtc/base/scoped_ptr.h" #include "webrtc/config.h" #include "webrtc/stream.h" #include "webrtc/transport.h" @@ -114,7 +114,7 @@ class AudioReceiveStream : public ReceiveStream { // to stream through this sink. In practice, this happens if mixed audio // is being pulled+rendered and/or if audio is being pulled for the purposes // of feeding to the AEC. - virtual void SetSink(rtc::scoped_ptr sink) = 0; + virtual void SetSink(std::unique_ptr sink) = 0; }; } // namespace webrtc diff --git a/webrtc/media/engine/fakewebrtccall.cc b/webrtc/media/engine/fakewebrtccall.cc index 59eb230aa0..af098af822 100644 --- a/webrtc/media/engine/fakewebrtccall.cc +++ b/webrtc/media/engine/fakewebrtccall.cc @@ -76,8 +76,8 @@ webrtc::AudioReceiveStream::Stats FakeAudioReceiveStream::GetStats() const { } void FakeAudioReceiveStream::SetSink( - rtc::scoped_ptr sink) { - sink_ = std::move(sink); + std::unique_ptr sink) { + sink_ = rtc::UniqueToScoped(std::move(sink)); } FakeVideoSendStream::FakeVideoSendStream( diff --git a/webrtc/media/engine/fakewebrtccall.h b/webrtc/media/engine/fakewebrtccall.h index 8966987032..fa58ebbe58 100644 --- a/webrtc/media/engine/fakewebrtccall.h +++ b/webrtc/media/engine/fakewebrtccall.h @@ -20,6 +20,7 @@ #ifndef WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ #define WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ +#include #include #include "webrtc/audio_receive_stream.h" @@ -90,7 +91,7 @@ class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { // webrtc::AudioReceiveStream implementation. webrtc::AudioReceiveStream::Stats GetStats() const override; - void SetSink(rtc::scoped_ptr sink) override; + void SetSink(std::unique_ptr sink) override; webrtc::AudioReceiveStream::Config config_; webrtc::AudioReceiveStream::Stats stats_; diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc index b6c2deaf53..70f7f3a4b4 100644 --- a/webrtc/media/engine/webrtcvoiceengine.cc +++ b/webrtc/media/engine/webrtcvoiceengine.cc @@ -1338,7 +1338,7 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream { void SetRawAudioSink(rtc::scoped_ptr sink) { RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); - stream_->SetSink(std::move(sink)); + stream_->SetSink(rtc::ScopedToUnique(std::move(sink))); } private: