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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 1016773002: MJPEG acceleration for video capture using VAAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address most comments Created 5 years, 8 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/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..2d96c7d7957db175f962309fe96608fd37dac3a0 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,21 @@ scoped_ptr<media::VideoEncodeAccelerator> GpuChannelHost::CreateVideoEncoder(
return it->second->CreateVideoEncoder();
}
+scoped_ptr<media::JpegDecodeAccelerator> GpuChannelHost::CreateJpegDecoder() {
wuchengli 2015/04/15 07:11:57 It looks OK to run CreateJpegDecoder on non-main t
kcwu 2015/04/16 14:38:27 Acknowledged.
+ TRACE_EVENT0("gpu", "GpuChannelHost::CreateJpegDecoder");
+
+ int32 route_id = GenerateRouteID();
+ GpuJpegDecodeAcceleratorHost* decoder(
+ new GpuJpegDecodeAcceleratorHost(this, route_id));
+
+ scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy();
wuchengli 2015/04/15 07:11:57 Add a comment to explain we want to run VideoFrame
kcwu 2015/04/16 14:38:27 Done.
+ io_loop->PostTask(FROM_HERE,
+ base::Bind(&GpuChannelHost::MessageFilter::AddRoute,
+ channel_filter_.get(), route_id,
+ decoder->AsWeakPtr(), io_loop));
+ return scoped_ptr<media::JpegDecodeAccelerator>(decoder);
+}
+
void GpuChannelHost::DestroyCommandBuffer(
CommandBufferProxyImpl* command_buffer) {
TRACE_EVENT0("gpu", "GpuChannelHost::DestroyCommandBuffer");

Powered by Google App Engine
This is Rietveld 408576698