Chromium Code Reviews| 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 80cd8a40613fcce1f03b2b684aba21aebbfbb948..2c475dede117a182b2ce52219cfa873c143440dc 100644 |
| --- a/content/renderer/media/media_stream_dependency_factory.cc |
| +++ b/content/renderer/media/media_stream_dependency_factory.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/synchronization/waitable_event.h" |
| #include "content/public/common/content_switches.h" |
| #include "content/renderer/media/media_stream_source_extra_data.h" |
| +#include "content/renderer/media/rtc_encoding_video_capturer_factory.h" |
| #include "content/renderer/media/rtc_media_constraints.h" |
| #include "content/renderer/media/rtc_peer_connection_handler.h" |
| #include "content/renderer/media/rtc_video_capturer.h" |
| @@ -485,17 +486,29 @@ bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { |
| audio_device_ = new WebRtcAudioDeviceImpl(); |
| cricket::WebRtcVideoDecoderFactory* decoder_factory = NULL; |
| + cricket::WebRtcVideoEncoderFactory* encoder_factory = NULL; |
| + |
| #if defined(GOOGLE_TV) |
| // PeerConnectionFactory will hold the ownership of this |
| // VideoDecoderFactory. |
| decoder_factory = decoder_factory_tv_ = new RTCVideoDecoderFactoryTv; |
| #endif |
| + // PeerConnectionFactory owns the encoder factory. Pass a weak pointer of |
| + // encoder factory to |vc_manager_| because the manager outlives it. |
| + RtcEncodingVideoCapturerFactory* rtc_encoding_capturer_factory = |
|
Ami GONE FROM CHROMIUM
2013/06/13 22:56:58
Needs to be flag-protected.
hshi1
2013/06/13 23:33:40
Do you still think we need a runtime switch (is #i
|
| + new RtcEncodingVideoCapturerFactory(); |
| + if (rtc_encoding_capturer_factory) { |
|
Ami GONE FROM CHROMIUM
2013/06/13 22:56:58
this can never fail
hshi1
2013/06/13 23:33:40
Done.
|
| + encoder_factory = rtc_encoding_capturer_factory; |
| + vc_manager_->set_encoding_capturer_factory( |
| + rtc_encoding_capturer_factory->AsWeakPtr()); |
| + } |
| + |
| scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
| webrtc::CreatePeerConnectionFactory(worker_thread_, |
| signaling_thread_, |
| audio_device_.get(), |
| - NULL, |
| + encoder_factory, |
| decoder_factory)); |
| if (factory.get()) |
| pc_factory_ = factory; |