Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Unified Diff: webrtc/pc/peerconnectionfactory.cc

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: Rebase onto master Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/pc/peerconnectionfactory.cc
diff --git a/webrtc/pc/peerconnectionfactory.cc b/webrtc/pc/peerconnectionfactory.cc
index 4adee157587868a9d67bae44874048ddbe6c1e6a..1de7284cfe315549f5fbf1b4710f86f887a9bdb3 100644
--- a/webrtc/pc/peerconnectionfactory.cc
+++ b/webrtc/pc/peerconnectionfactory.cc
@@ -211,13 +211,13 @@ bool PeerConnectionFactory::Initialize() {
// TODO: Need to make sure only one VoE is created inside
nisse-webrtc 2017/02/13 08:25:58 When? Do you intend to ensure that before landing?
the sun 2017/02/13 09:02:31 This is an old comment (mid 2013) and nothing I'd
Taylor Brandstetter 2017/02/13 17:47:45 Removing comment.
// WebRtcMediaEngine.
- cricket::MediaEngineInterface* media_engine =
- worker_thread_->Invoke<cricket::MediaEngineInterface*>(
+ std::unique_ptr<cricket::MediaEngineInterface> media_engine =
+ worker_thread_->Invoke<std::unique_ptr<cricket::MediaEngineInterface>>(
RTC_FROM_HERE,
rtc::Bind(&PeerConnectionFactory::CreateMediaEngine_w, this));
channel_manager_.reset(new cricket::ChannelManager(
- media_engine, worker_thread_, network_thread_));
+ std::move(media_engine), worker_thread_, network_thread_));
channel_manager_->SetVideoRtxEnabled(true);
channel_manager_->SetCryptoOptions(options_.crypto_options);
@@ -254,21 +254,23 @@ PeerConnectionFactory::CreateAudioSource(const cricket::AudioOptions& options) {
rtc::scoped_refptr<VideoTrackSourceInterface>
PeerConnectionFactory::CreateVideoSource(
- cricket::VideoCapturer* capturer,
+ std::unique_ptr<cricket::VideoCapturer> capturer,
const MediaConstraintsInterface* constraints) {
RTC_DCHECK(signaling_thread_->IsCurrent());
rtc::scoped_refptr<VideoTrackSourceInterface> source(
- VideoCapturerTrackSource::Create(worker_thread_, capturer, constraints,
- false));
+ VideoCapturerTrackSource::Create(worker_thread_, std::move(capturer),
+ constraints, false));
return VideoTrackSourceProxy::Create(signaling_thread_, worker_thread_,
source);
}
rtc::scoped_refptr<VideoTrackSourceInterface>
-PeerConnectionFactory::CreateVideoSource(cricket::VideoCapturer* capturer) {
+PeerConnectionFactory::CreateVideoSource(
+ std::unique_ptr<cricket::VideoCapturer> capturer) {
RTC_DCHECK(signaling_thread_->IsCurrent());
rtc::scoped_refptr<VideoTrackSourceInterface> source(
- VideoCapturerTrackSource::Create(worker_thread_, capturer, false));
+ VideoCapturerTrackSource::Create(worker_thread_, std::move(capturer),
+ false));
return VideoTrackSourceProxy::Create(signaling_thread_, worker_thread_,
source);
}
@@ -389,11 +391,14 @@ rtc::Thread* PeerConnectionFactory::network_thread() {
return network_thread_;
}
-cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() {
+std::unique_ptr<cricket::MediaEngineInterface>
+PeerConnectionFactory::CreateMediaEngine_w() {
RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
- return cricket::WebRtcMediaEngineFactory::Create(
- default_adm_.get(), audio_decoder_factory_, video_encoder_factory_.get(),
- video_decoder_factory_.get(), external_audio_mixer_);
+ return std::unique_ptr<cricket::MediaEngineInterface>(
+ cricket::WebRtcMediaEngineFactory::Create(
+ default_adm_.get(), audio_decoder_factory_,
+ video_encoder_factory_.get(), video_decoder_factory_.get(),
+ external_audio_mixer_));
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698