OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ | 5 #ifndef MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ |
6 #define MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ | 6 #define MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/containers/scoped_ptr_hash_map.h" | 12 #include "base/containers/scoped_ptr_hash_map.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "ipc/ipc_listener.h" | 14 #include "ipc/ipc_listener.h" |
15 #include "ipc/ipc_sender.h" | 15 #include "ipc/ipc_sender.h" |
16 #include "media/video/video_decode_accelerator.h" | 16 #include "media/video/video_decode_accelerator.h" |
17 | 17 |
18 namespace gpu { | 18 namespace gpu { |
19 class GpuChannel; | |
20 class GpuChannelManager; | 19 class GpuChannelManager; |
21 } | 20 } |
22 | 21 |
23 namespace media { | 22 namespace media { |
24 | 23 |
25 class MediaGpuChannel; | 24 class MediaGpuChannel; |
26 | 25 |
27 class MediaGpuChannelManager { | 26 class MediaGpuChannelManager { |
28 public: | 27 public: |
29 explicit MediaGpuChannelManager(gpu::GpuChannelManager* channel_manager); | 28 explicit MediaGpuChannelManager(gpu::GpuChannelManager* channel_manager); |
30 ~MediaGpuChannelManager(); | 29 ~MediaGpuChannelManager(); |
31 | 30 |
32 void AddChannel(int32_t client_id); | 31 void AddChannel(int32_t client_id); |
33 void RemoveChannel(int32_t client_id); | 32 void RemoveChannel(int32_t client_id); |
34 void DestroyAllChannels(); | 33 void DestroyAllChannels(); |
35 | 34 |
36 private: | 35 private: |
37 gpu::GpuChannelManager* const channel_manager_; | 36 gpu::GpuChannelManager* const channel_manager_; |
38 base::ScopedPtrHashMap<int32_t, std::unique_ptr<MediaGpuChannel>> | 37 base::ScopedPtrHashMap<int32_t, std::unique_ptr<MediaGpuChannel>> |
39 media_gpu_channels_; | 38 media_gpu_channels_; |
40 DISALLOW_COPY_AND_ASSIGN(MediaGpuChannelManager); | 39 DISALLOW_COPY_AND_ASSIGN(MediaGpuChannelManager); |
41 }; | 40 }; |
42 | 41 |
43 } // namespace media | 42 } // namespace media |
44 | 43 |
45 #endif // MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ | 44 #endif // MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ |
OLD | NEW |