OLD | NEW |
| (Empty) |
1 // Copyright 2016 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_MEDIA_MEDIA_CHANNEL_H_ | |
6 #define CONTENT_COMMON_GPU_MEDIA_MEDIA_CHANNEL_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" | |
11 #include "ipc/ipc_listener.h" | |
12 #include "ipc/ipc_sender.h" | |
13 #include "media/video/video_decode_accelerator.h" | |
14 | |
15 namespace media { | |
16 struct CreateVideoEncoderParams; | |
17 } | |
18 | |
19 namespace gpu { | |
20 class GpuChannel; | |
21 class GpuCommandBufferStub; | |
22 } | |
23 | |
24 namespace content { | |
25 | |
26 class MediaChannelDispatchHelper; | |
27 | |
28 class MediaChannel : public IPC::Listener, public IPC::Sender { | |
29 public: | |
30 explicit MediaChannel(gpu::GpuChannel* channel); | |
31 ~MediaChannel() override; | |
32 | |
33 // IPC::Sender implementation: | |
34 bool Send(IPC::Message* msg) override; | |
35 | |
36 private: | |
37 friend class MediaChannelDispatchHelper; | |
38 | |
39 // IPC::Listener implementation: | |
40 bool OnMessageReceived(const IPC::Message& message) override; | |
41 | |
42 // Message handlers. | |
43 void OnCreateJpegDecoder(int32_t route_id, IPC::Message* reply_msg); | |
44 void OnCreateVideoDecoder(int32_t command_buffer_route_id, | |
45 const media::VideoDecodeAccelerator::Config& config, | |
46 int32_t route_id, | |
47 IPC::Message* reply_message); | |
48 void OnCreateVideoEncoder(int32_t command_buffer_route_id, | |
49 const media::CreateVideoEncoderParams& params, | |
50 IPC::Message* reply_message); | |
51 | |
52 gpu::GpuChannel* const channel_; | |
53 std::unique_ptr<GpuJpegDecodeAccelerator> jpeg_decoder_; | |
54 DISALLOW_COPY_AND_ASSIGN(MediaChannel); | |
55 }; | |
56 | |
57 } // namespace content | |
58 | |
59 #endif // CONTENT_COMMON_GPU_MEDIA_MEDIA_CHANNEL_H_ | |
OLD | NEW |