Index: content/common/gpu/client/gpu_channel_host.cc |
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc |
index aa47e2fd677bad9d115abb27209433292689fe57..e8808fe8a91fe9ae3457a8ae8eb5a331755d6689 100644 |
--- a/content/common/gpu/client/gpu_channel_host.cc |
+++ b/content/common/gpu/client/gpu_channel_host.cc |
@@ -13,6 +13,7 @@ |
#include "base/threading/thread_restrictions.h" |
#include "base/trace_event/trace_event.h" |
#include "content/common/gpu/client/command_buffer_proxy_impl.h" |
+#include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" |
#include "content/common/gpu/gpu_messages.h" |
#include "ipc/ipc_sync_message_filter.h" |
#include "url/gurl.h" |
@@ -256,6 +257,28 @@ scoped_ptr<media::VideoEncodeAccelerator> GpuChannelHost::CreateVideoEncoder( |
return it->second->CreateVideoEncoder(); |
} |
+scoped_ptr<media::JpegDecodeAccelerator> GpuChannelHost::CreateJpegDecoder( |
+ scoped_refptr<base::MessageLoopProxy> reply_loop) { |
+ TRACE_EVENT0("gpu", "GpuChannelHost::CreateJpegDecoder"); |
+ // This function is called from GpuJpegDecoder's main task thread, which is |
wuchengli
2015/04/24 05:54:23
Just call it task thread. main task thread sounds
kcwu
2015/04/30 19:25:40
Done.
|
+ // not main thread. |
+ |
+ int32 route_id = GenerateRouteID(); |
+ GpuJpegDecodeAcceleratorHost* decoder( |
+ new GpuJpegDecodeAcceleratorHost(this, route_id, |
+ factory_->GetIOLoopProxy())); |
+ |
+ // GpuJpegDecoder's main task thread (i.e., device thread on Linux) is |
+ // usually blocking wait for next frame, so it expects decoder responses are |
wuchengli
2015/04/24 05:54:23
s/blocking wait/waiting/.
Here it refers to the m
kcwu
2015/04/30 19:25:40
Done.
|
+ // send to |reply_loop| directly. |
+ scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); |
+ io_loop->PostTask(FROM_HERE, |
+ base::Bind(&GpuChannelHost::MessageFilter::AddRoute, |
+ channel_filter_.get(), route_id, |
+ decoder->AsWeakPtr(), reply_loop)); |
wuchengli
2015/04/24 05:54:23
Why not just use |io_loop|? reply_loop is always I
kcwu
2015/04/30 19:25:40
I want to make these thread logic stay in GpuJpegD
|
+ return scoped_ptr<media::JpegDecodeAccelerator>(decoder); |
+} |
+ |
void GpuChannelHost::DestroyCommandBuffer( |
CommandBufferProxyImpl* command_buffer) { |
TRACE_EVENT0("gpu", "GpuChannelHost::DestroyCommandBuffer"); |