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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 13890012: Integrate VDA with WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments and update tests 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/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 63610a93924606c3395dc4b346810d3f61a2b6c8..d20b6ba0ce0868e64a03c1927bee44da2aa30624 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -65,6 +65,7 @@
#include "content/renderer/media/media_stream_center.h"
#include "content/renderer/media/media_stream_dependency_factory.h"
#include "content/renderer/media/peer_connection_tracker.h"
+#include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
#include "content/renderer/media/video_capture_impl_manager.h"
#include "content/renderer/media/video_capture_message_filter.h"
#include "content/renderer/memory_benchmarking_extension.h"
@@ -874,6 +875,27 @@ void RenderThreadImpl::PostponeIdleNotification() {
idle_notifications_to_skip_ = 2;
}
+scoped_refptr<media::GpuVideoDecoder::Factories>
+RenderThreadImpl::GetGpuFactories() {
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories;
+ WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
+ if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
+ context3d = RenderThreadImpl::current()->GetGpuVDAContext3D();
+ if (context3d) {
+ scoped_refptr<base::MessageLoopProxy> factories_loop =
+ RenderThreadImpl::current()->compositor_message_loop_proxy();
+ if (!factories_loop.get())
+ factories_loop = base::MessageLoopProxy::current();
+ GpuChannelHost* gpu_channel_host =
+ RenderThreadImpl::current()->EstablishGpuChannelSync(
+ CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
+ gpu_factories = new RendererGpuVideoDecoderFactories(
+ gpu_channel_host, factories_loop, context3d);
+ }
+ return gpu_factories;
+}
+
/* static */
void RenderThreadImpl::OnGpuVDAContextLoss() {
RenderThreadImpl* self = RenderThreadImpl::current();

Powered by Google App Engine
This is Rietveld 408576698