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

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

Issue 1165943008: MJPEG acceleration for video capture using VAAPI, the GPU host part (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mjpeg-2-gpu
Patch Set: rebase and fix compile on mac Created 5 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/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 7bd55f9b7d8ab6f4337e672f3f50386bee8cf320..237a1d31f10bef6786926618715d536cdcf73b9f 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -14,6 +14,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"
@@ -258,6 +259,28 @@ scoped_ptr<media::VideoEncodeAccelerator> GpuChannelHost::CreateVideoEncoder(
return it->second->CreateVideoEncoder();
}
+scoped_ptr<media::JpegDecodeAccelerator> GpuChannelHost::CreateJpegDecoder(
+ media::JpegDecodeAccelerator::Client* client) {
+ TRACE_EVENT0("gpu", "GpuChannelHost::CreateJpegDecoder");
+
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner =
+ factory_->GetIOThreadTaskRunner();
+ int32 route_id = GenerateRouteID();
+ scoped_ptr<GpuJpegDecodeAcceleratorHost> decoder(
+ new GpuJpegDecodeAcceleratorHost(this, route_id, io_task_runner));
+ if (!decoder->Initialize(client)) {
+ return nullptr;
+ }
+
+ // The reply message of jpeg decoder should run on IO thread.
+ io_task_runner->PostTask(FROM_HERE,
+ base::Bind(&GpuChannelHost::MessageFilter::AddRoute,
+ channel_filter_.get(), route_id,
+ decoder->GetReceiver(), io_task_runner));
+
+ return decoder.Pass();
+}
+
void GpuChannelHost::DestroyCommandBuffer(
CommandBufferProxyImpl* command_buffer) {
TRACE_EVENT0("gpu", "GpuChannelHost::DestroyCommandBuffer");
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.h ('k') | content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698