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

Unified Diff: content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h

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: 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_jpeg_decode_accelerator_host.h
diff --git a/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h b/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..86051240bd70d4d2159e7c5276392d511c34a669
--- /dev/null
+++ b/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h
@@ -0,0 +1,66 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
+#define CONTENT_COMMON_GPU_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
+
+#include "base/memory/weak_ptr.h"
+#include "base/threading/non_thread_safe.h"
+#include "media/video/jpeg_decode_accelerator.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace IPC {
+class Listener;
+class Message;
+}
+
+namespace content {
+class GpuChannelHost;
+
+// This class is used to talk to JpegDecodeAccelerator in the GPU process
+// through IPC messages.
+class GpuJpegDecodeAcceleratorHost : public media::JpegDecodeAccelerator,
+ public base::NonThreadSafe {
+ public:
+ // GpuJpegDecoder owns |this| and |channel|. And GpuJpegDecoder delete |this|
+ // before |channel|. So |this| is guaranteed not to outlive |channel|.
+ GpuJpegDecodeAcceleratorHost(
+ GpuChannelHost* channel,
+ int32 route_id,
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
+ ~GpuJpegDecodeAcceleratorHost() override;
+
+ // media::JpegDecodeAccelerator implementation.
+ bool Initialize(media::JpegDecodeAccelerator::Client* client) override;
piman 2015/06/08 21:22:17 nit: can you add a comment that the Client is call
kcwu 2015/06/09 08:34:42 Done.
+ void Decode(const media::BitstreamBuffer& bitstream_buffer,
+ const scoped_refptr<media::VideoFrame>& video_frame) override;
+
+ base::WeakPtr<IPC::Listener> GetReceiver();
+
+ private:
+ class Receiver;
+
+ void Send(IPC::Message* message);
+
+ // Unowned reference to the GpuChannelHost to send IPC messages to the GPU
+ // process.
+ GpuChannelHost* channel_;
+
+ // Route ID for the associated decoder in the GPU process.
+ int32 decoder_route_id_;
+
+ // GPU IO task runner.
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+
+ scoped_ptr<Receiver> receiver_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuJpegDecodeAcceleratorHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698