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

Unified Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 30983002: Switch from using internal constraints to use explicit PeerConnectionFactoryInterface::SetOptions t… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track_stop
Patch Set: Addressed fishmans comment. Created 7 years, 2 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: content/renderer/media/media_stream_dependency_factory.cc
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index 20269e4aad0363c31fb43d1e01f239b8d0aa1a30..b5be48a72471e3898f4c93c1c4121a33e8102814 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -302,11 +302,6 @@ void MediaStreamDependencyFactory::CreateNativeMediaSources(
ApplyFixedAudioConstraints(&native_audio_constraints);
WebKit::WebVector<WebKit::WebMediaStreamTrack> audio_tracks;
web_stream->audioTracks(audio_tracks);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kEnableWebRtcAecRecordings)) {
- native_audio_constraints.AddOptional(
- RTCMediaConstraints::kInternalAecDump, "true");
- }
for (size_t i = 0; i < audio_tracks.size(); ++i) {
const WebKit::WebMediaStreamSource& source = audio_tracks[i].source();
MediaStreamSourceExtraData* source_data =
@@ -511,45 +506,55 @@ bool MediaStreamDependencyFactory::RemoveNativeMediaStreamTrack(
}
bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() {
+ DCHECK(!pc_factory_.get());
+ DCHECK(!audio_device_.get());
DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()";
- if (!pc_factory_.get()) {
- DCHECK(!audio_device_.get());
- audio_device_ = new WebRtcAudioDeviceImpl();
- scoped_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory;
- scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory;
+ audio_device_ = new WebRtcAudioDeviceImpl();
Ami GONE FROM CHROMIUM 2013/10/23 21:33:11 nit: it would be clearer in my opinion to make thi
perkj_chrome 2013/11/01 09:12:54 good points. Done.
- const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
- scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories =
- RenderThreadImpl::current()->GetGpuFactories();
+ scoped_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory;
+ scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory;
+
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ scoped_refptr<RendererGpuVideoAcceleratorFactories> gpu_factories =
+ RenderThreadImpl::current()->GetGpuFactories();
#if !defined(GOOGLE_TV)
- if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) {
- if (gpu_factories)
- decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
- }
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) {
+ if (gpu_factories)
+ decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
+ }
#else
- // PeerConnectionFactory will hold the ownership of this
- // VideoDecoderFactory.
- decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv());
+ // PeerConnectionFactory will hold the ownership of this
+ // VideoDecoderFactory.
+ decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv());
#endif
- if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
- if (gpu_factories)
- encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
- }
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
+ if (gpu_factories)
+ encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
+ }
- scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory(
- webrtc::CreatePeerConnectionFactory(worker_thread_,
- signaling_thread_,
- audio_device_.get(),
- encoder_factory.release(),
- decoder_factory.release()));
- if (factory.get())
- pc_factory_ = factory;
- else
- audio_device_ = NULL;
+
Ami GONE FROM CHROMIUM 2013/10/23 21:33:11 delete extra \n ?
perkj_chrome 2013/11/01 09:12:54 Done.
+ scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory(
+ webrtc::CreatePeerConnectionFactory(worker_thread_,
+ signaling_thread_,
+ audio_device_.get(),
+ encoder_factory.release(),
+ decoder_factory.release()));
+ if (!factory.get()) {
+ audio_device_ = NULL;
+ return false;
}
- return pc_factory_.get() != NULL;
+
+ pc_factory_ = factory;
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ PeerConnectionFactoryInterface::Options factory_options;
Ami GONE FROM CHROMIUM 2013/10/23 21:33:11 Probably obvious but this can't land until 5526392
perkj_chrome 2013/11/01 09:12:54 Done.
+ factory_options.enable_aec_dump =
+ cmd_line->HasSwitch(switches::kEnableWebRtcAecRecordings);
+ factory_options.disable_sctp_data_channels=
Ami GONE FROM CHROMIUM 2013/10/23 21:33:11 s/=/ =/
perkj_chrome 2013/11/01 09:12:54 Done.
+ cmd_line->HasSwitch(switches::kDisableSCTPDataChannels);
+ pc_factory_->SetOptions(factory_options);
+ return true;
}
bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() {
« no previous file with comments | « no previous file | content/renderer/media/rtc_media_constraints.cc » ('j') | content/renderer/media/rtc_media_constraints.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698