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

Side by Side Diff: media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.h

Issue 2924573002: [NotForReview] Convert accelerated JPEG Decoder IPC to Mojo
Patch Set: . Created 3 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
« no previous file with comments | « media/gpu/ipc/DEPS ('k') | media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_ 5 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
6 #define MEDIA_GPU_IPC_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_ 6 #define MEDIA_GPU_IPC_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/sequence_checker.h" 14 #include "base/sequence_checker.h"
15 #include "media/gpu/mojo/jpeg_decoder.mojom.h"
15 #include "media/video/jpeg_decode_accelerator.h" 16 #include "media/video/jpeg_decode_accelerator.h"
16 17
17 namespace base { 18 namespace base {
18 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
19 } 20 }
20 21
21 namespace gpu {
22 class GpuChannelHost;
23 }
24
25 namespace IPC {
26 class Listener;
27 class Message;
28 }
29
30 namespace media { 22 namespace media {
31 23
32 // TODO(c.padhi): Move GpuJpegDecodeAcceleratorHost to media/gpu/mojo, see 24 // TODO(c.padhi): Move GpuJpegDecodeAcceleratorHost to media/gpu/mojo, see
33 // http://crbug.com/699255. 25 // http://crbug.com/699255.
34 // This class is used to talk to JpegDecodeAccelerator in the GPU process 26 // This class is used to talk to JpegDecodeAccelerator in the GPU process
35 // through IPC messages. 27 // through Mojo messages.
36 class GpuJpegDecodeAcceleratorHost : public JpegDecodeAccelerator { 28 class GpuJpegDecodeAcceleratorHost : public JpegDecodeAccelerator {
37 public: 29 public:
38 GpuJpegDecodeAcceleratorHost( 30 GpuJpegDecodeAcceleratorHost(
39 scoped_refptr<gpu::GpuChannelHost> channel, 31 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
40 int32_t route_id, 32 mojom::GpuJpegDecodeAcceleratorPtrInfo jpeg_decoder_info);
41 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
42 ~GpuJpegDecodeAcceleratorHost() override; 33 ~GpuJpegDecodeAcceleratorHost() override;
43 34
44 // JpegDecodeAccelerator implementation. 35 // JpegDecodeAccelerator implementation.
45 // |client| is called on the IO thread, but is never called into after the 36 // |client| is called on the IO thread, but is never called into after the
46 // GpuJpegDecodeAcceleratorHost is destroyed. 37 // GpuJpegDecodeAcceleratorHost is destroyed.
47 bool Initialize(JpegDecodeAccelerator::Client* client) override; 38 bool Initialize(JpegDecodeAccelerator::Client* client) override;
48 void Decode(const BitstreamBuffer& bitstream_buffer, 39 void Decode(const BitstreamBuffer& bitstream_buffer,
49 const scoped_refptr<VideoFrame>& video_frame) override; 40 const scoped_refptr<VideoFrame>& video_frame) override;
50 bool IsSupported() override; 41 bool IsSupported() override;
51 42
52 base::WeakPtr<IPC::Listener> GetReceiver();
53
54 private: 43 private:
55 class Receiver; 44 void OnDecodeAck(int32_t bitstream_buffer_id, mojom::Error error);
56 45 void OnDecodeAckOnIOThread(int32_t bitstream_buffer_id, mojom::Error error);
57 void Send(IPC::Message* message);
58
59 scoped_refptr<gpu::GpuChannelHost> channel_;
60
61 // Route ID for the associated decoder in the GPU process.
62 int32_t decoder_route_id_;
63 46
64 // GPU IO task runner. 47 // GPU IO task runner.
65 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 48 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
66 49
67 std::unique_ptr<Receiver> receiver_; 50 Client* client_;
51
52 mojom::GpuJpegDecodeAcceleratorPtr jpeg_decoder_;
68 53
69 SEQUENCE_CHECKER(sequence_checker_); 54 SEQUENCE_CHECKER(sequence_checker_);
70 55
71 DISALLOW_COPY_AND_ASSIGN(GpuJpegDecodeAcceleratorHost); 56 DISALLOW_COPY_AND_ASSIGN(GpuJpegDecodeAcceleratorHost);
72 }; 57 };
73 58
74 } // namespace media 59 } // namespace media
75 60
76 #endif // MEDIA_GPU_IPC_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_ 61 #endif // MEDIA_GPU_IPC_CLIENT_GPU_JPEG_DECODE_ACCELERATOR_HOST_H_
OLDNEW
« no previous file with comments | « media/gpu/ipc/DEPS ('k') | media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698