| Index: content/renderer/media/webrtc/peer_connection_dependency_factory.cc
|
| diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
|
| index f5c98179338e2ac6b0cf05f9880916e03c964428..dc072860d128ec361375b812db72fea2cde23532 100644
|
| --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
|
| +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
|
| @@ -180,7 +180,7 @@ PeerConnectionDependencyFactory::PeerConnectionDependencyFactory(
|
|
|
| PeerConnectionDependencyFactory::~PeerConnectionDependencyFactory() {
|
| CleanupPeerConnectionFactory();
|
| - if (aec_dump_message_filter_)
|
| + if (aec_dump_message_filter_.get())
|
| aec_dump_message_filter_->RemoveDelegate(this);
|
| }
|
|
|
| @@ -224,7 +224,7 @@ bool PeerConnectionDependencyFactory::InitializeMediaStreamAudioSource(
|
| // be called multiple times which is likely also a bug.
|
| return false;
|
| }
|
| - source_data->SetAudioCapturer(capturer);
|
| + source_data->SetAudioCapturer(capturer.get());
|
|
|
| // Creates a LocalAudioSource object which holds audio options.
|
| // TODO(xians): The option should apply to the track instead of the source.
|
| @@ -237,7 +237,7 @@ bool PeerConnectionDependencyFactory::InitializeMediaStreamAudioSource(
|
| DLOG(WARNING) << "Failed to create rtc LocalAudioSource.";
|
| return false;
|
| }
|
| - source_data->SetLocalAudioSource(rtc_source);
|
| + source_data->SetLocalAudioSource(rtc_source.get());
|
| return true;
|
| }
|
|
|
| @@ -248,7 +248,7 @@ PeerConnectionDependencyFactory::CreateVideoCapturer(
|
| // before we can use an instance of a WebRtcVideoCapturerAdapter. This is
|
| // since the base class of WebRtcVideoCapturerAdapter is a
|
| // cricket::VideoCapturer and it uses the libjingle thread wrappers.
|
| - if (!GetPcFactory())
|
| + if (!GetPcFactory().get())
|
| return NULL;
|
| return new WebRtcVideoCapturerAdapter(is_screeencast);
|
| }
|
| @@ -265,9 +265,9 @@ PeerConnectionDependencyFactory::CreateVideoSource(
|
|
|
| const scoped_refptr<webrtc::PeerConnectionFactoryInterface>&
|
| PeerConnectionDependencyFactory::GetPcFactory() {
|
| - if (!pc_factory_)
|
| + if (!pc_factory_.get())
|
| CreatePeerConnectionFactory();
|
| - CHECK(pc_factory_);
|
| + CHECK(pc_factory_.get());
|
| return pc_factory_;
|
| }
|
|
|
| @@ -326,12 +326,12 @@ void PeerConnectionDependencyFactory::CreatePeerConnectionFactory() {
|
| scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories =
|
| RenderThreadImpl::current()->GetGpuFactories();
|
| if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) {
|
| - if (gpu_factories)
|
| + if (gpu_factories.get())
|
| decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
|
| }
|
|
|
| if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
|
| - if (gpu_factories)
|
| + if (gpu_factories.get())
|
| encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
|
| }
|
|
|
| @@ -348,7 +348,7 @@ void PeerConnectionDependencyFactory::CreatePeerConnectionFactory() {
|
| audio_device_.get(),
|
| encoder_factory.release(),
|
| decoder_factory.release()));
|
| - CHECK(factory);
|
| + CHECK(factory.get());
|
|
|
| pc_factory_ = factory;
|
| webrtc::PeerConnectionFactoryInterface::Options factory_options;
|
| @@ -364,7 +364,7 @@ void PeerConnectionDependencyFactory::CreatePeerConnectionFactory() {
|
| // In unit tests not creating a message filter, |aec_dump_message_filter_|
|
| // will be NULL. We can just ignore that. Other unit tests and browser tests
|
| // ensure that we do get the filter when we should.
|
| - if (aec_dump_message_filter_)
|
| + if (aec_dump_message_filter_.get())
|
| aec_dump_message_filter_->AddDelegate(this);
|
| }
|
| }
|
| @@ -381,7 +381,7 @@ PeerConnectionDependencyFactory::CreatePeerConnection(
|
| webrtc::PeerConnectionObserver* observer) {
|
| CHECK(web_frame);
|
| CHECK(observer);
|
| - if (!GetPcFactory())
|
| + if (!GetPcFactory().get())
|
| return NULL;
|
|
|
| scoped_refptr<P2PPortAllocatorFactory> pa_factory =
|
| @@ -449,10 +449,8 @@ void PeerConnectionDependencyFactory::CreateLocalAudioTrack(
|
| // TODO(xians): Merge |source| to the capturer(). We can't do this today
|
| // because only one capturer() is supported while one |source| is created
|
| // for each audio track.
|
| - scoped_ptr<WebRtcLocalAudioTrack> audio_track(
|
| - new WebRtcLocalAudioTrack(adapter,
|
| - source_data->GetAudioCapturer(),
|
| - webaudio_source));
|
| + scoped_ptr<WebRtcLocalAudioTrack> audio_track(new WebRtcLocalAudioTrack(
|
| + adapter.get(), source_data->GetAudioCapturer(), webaudio_source.get()));
|
|
|
| StartLocalAudioTrack(audio_track.get());
|
|
|
| @@ -656,7 +654,7 @@ void PeerConnectionDependencyFactory::OnIpcClosing() {
|
| }
|
|
|
| void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() {
|
| - if (audio_device_)
|
| + if (audio_device_.get())
|
| return;
|
|
|
| audio_device_ = new WebRtcAudioDeviceImpl();
|
|
|