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

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 to 207015; addressed Ami's most recent comments. 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
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 eeb813905705fdfc66a776f5140b175b2107cb92..9712d12c364b0be06e9acf1146926e603bf20992 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,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;

Powered by Google App Engine
This is Rietveld 408576698