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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "base/threading/non_thread_safe.h"
10 #include "media/video/jpeg_decode_accelerator.h"
11
12 namespace base {
13 class SingleThreadTaskRunner;
14 }
15
16 namespace IPC {
17 class Listener;
18 class Message;
19 }
20
21 namespace content {
22 class GpuChannelHost;
23
24 // This class is used to talk to JpegDecodeAccelerator in the GPU process
25 // through IPC messages.
26 class GpuJpegDecodeAcceleratorHost : public media::JpegDecodeAccelerator,
27 public base::NonThreadSafe {
28 public:
29 // GpuJpegDecoder owns |this| and |channel|. And GpuJpegDecoder delete |this|
30 // before |channel|. So |this| is guaranteed not to outlive |channel|.
31 GpuJpegDecodeAcceleratorHost(
32 GpuChannelHost* channel,
33 int32 route_id,
34 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
35 ~GpuJpegDecodeAcceleratorHost() override;
36
37 // media::JpegDecodeAccelerator implementation.
38 // |client| is called on the IO thread, but is never called into after the
39 // GpuJpegDecodeAcceleratorHost is destroyed.
40 bool Initialize(media::JpegDecodeAccelerator::Client* client) override;
41 void Decode(const media::BitstreamBuffer& bitstream_buffer,
42 const scoped_refptr<media::VideoFrame>& video_frame) override;
43
44 base::WeakPtr<IPC::Listener> GetReceiver();
45
46 private:
47 class Receiver;
48
49 void Send(IPC::Message* message);
50
51 // Unowned reference to the GpuChannelHost to send IPC messages to the GPU
52 // process.
53 GpuChannelHost* channel_;
54
55 // Route ID for the associated decoder in the GPU process.
56 int32 decoder_route_id_;
57
58 // GPU IO task runner.
59 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
60
61 scoped_ptr<Receiver> receiver_;
62
63 DISALLOW_COPY_AND_ASSIGN(GpuJpegDecodeAcceleratorHost);
64 };
65
66 } // namespace content
67
68 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
OLDNEW
« 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