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

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

Issue 16320005: Define EncodedVideoSource and RtcCapturedEncodingVideoCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased at 209707. Fix compile warnings. Created 7 years, 6 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
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/renderer/media/rtc_encoding_video_capturer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e334a0494de87dc10f0adf5b9c6baadcd476cacc..8a6558e08ef737e26179660f1be42a45e5aeac4e 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"
@@ -487,17 +488,32 @@ 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
+#if defined(OS_CHROMEOS)
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kEnableEncodedScreenCapture)) {
+ // 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 =
+ new RtcEncodingVideoCapturerFactory();
+ encoder_factory = rtc_encoding_capturer_factory;
+ vc_manager_->set_encoding_capturer_factory(
+ rtc_encoding_capturer_factory->AsWeakPtr());
+ }
+#endif
+
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;
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/renderer/media/rtc_encoding_video_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698