Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index aaf2b41f45f5b433484af6ed212f4425bf20b37d..1ed8daf8a98c325c5b5406bbf1e094b82b06ee7b 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -68,6 +68,7 @@ |
#include "content/renderer/media/media_stream_dependency_factory.h" |
#include "content/renderer/media/midi_message_filter.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" |
@@ -870,6 +871,27 @@ void RenderThreadImpl::PostponeIdleNotification() { |
idle_notifications_to_skip_ = 2; |
} |
+scoped_refptr<media::GpuVideoDecoder::Factories> |
+RenderThreadImpl::GetGpuFactories() { |
piman
2013/07/08 20:53:39
nit: can you add a DCHECK(IsMainThread());
wuchengli
2013/07/09 07:39:19
Done.
|
+ 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(); |
piman
2013/07/08 20:53:39
nit: RenderThreadImpl::current() == this.
wuchengli
2013/07/09 07:39:19
Done.
|
+ 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( |
piman
2013/07/08 20:53:39
nit: RenderThreadImpl::current() == this.
wuchengli
2013/07/09 07:39:19
Done.
|
+ CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
piman
2013/07/08 20:53:39
note: this can fail in theory (return NULL).
Actua
wuchengli
2013/07/09 07:39:19
I added NULL check. I don't see why gpu_channel_ c
piman
2013/07/09 19:35:22
It has to have been called it you have a non-NULL
wuchengli
2013/07/09 22:29:26
I see. EstablishGpuChannelSync recreates the chann
|
+ gpu_factories = new RendererGpuVideoDecoderFactories( |
+ gpu_channel_host, factories_loop, context3d); |
+ } |
+ return gpu_factories; |
+} |
+ |
/* static */ |
void RenderThreadImpl::OnGpuVDAContextLoss() { |
RenderThreadImpl* self = RenderThreadImpl::current(); |