OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/shared_memory.h" | 16 #include "base/memory/shared_memory.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "content/common/gpu/gpu_command_buffer_stub.h" | 18 #include "content/common/gpu/gpu_command_buffer_stub.h" |
19 #include "gpu/command_buffer/service/texture_manager.h" | 19 #include "gpu/command_buffer/service/texture_manager.h" |
20 #include "gpu/config/gpu_info.h" | 20 #include "gpu/config/gpu_info.h" |
21 #include "ipc/ipc_listener.h" | 21 #include "ipc/ipc_listener.h" |
22 #include "ipc/ipc_sender.h" | 22 #include "ipc/ipc_sender.h" |
23 #include "media/video/video_decode_accelerator.h" | 23 #include "media/video/video_decode_accelerator.h" |
24 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
25 | 25 |
26 struct AcceleratedVideoDecoderMsg_Decode_Params; | 26 namespace content { |
27 | 27 |
28 namespace content { | 28 struct VideoDecodeParams; |
29 | 29 |
30 class GpuVideoDecodeAccelerator | 30 class GpuVideoDecodeAccelerator |
31 : public IPC::Listener, | 31 : public IPC::Listener, |
32 public IPC::Sender, | 32 public IPC::Sender, |
33 public media::VideoDecodeAccelerator::Client, | 33 public media::VideoDecodeAccelerator::Client, |
34 public GpuCommandBufferStub::DestructionObserver { | 34 public GpuCommandBufferStub::DestructionObserver { |
35 public: | 35 public: |
36 // Each of the arguments to the constructor must outlive this object. | 36 // Each of the arguments to the constructor must outlive this object. |
37 // |stub->decoder()| will be made current around any operation that touches | 37 // |stub->decoder()| will be made current around any operation that touches |
38 // the underlying VDA so that it can make GL calls safely. | 38 // the underlying VDA so that it can make GL calls safely. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); | 86 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); |
87 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); | 87 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); |
88 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); | 88 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); |
89 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); | 89 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); |
90 | 90 |
91 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 91 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
92 ~GpuVideoDecodeAccelerator() override; | 92 ~GpuVideoDecodeAccelerator() override; |
93 | 93 |
94 // Handlers for IPC messages. | 94 // Handlers for IPC messages. |
95 void OnSetCdm(int cdm_id); | 95 void OnSetCdm(int cdm_id); |
96 void OnDecode(const AcceleratedVideoDecoderMsg_Decode_Params& params); | 96 void OnDecode(const VideoDecodeParams& params); |
97 void OnAssignPictureBuffers(const std::vector<int32_t>& buffer_ids, | 97 void OnAssignPictureBuffers(const std::vector<int32_t>& buffer_ids, |
98 const std::vector<uint32_t>& texture_ids); | 98 const std::vector<uint32_t>& texture_ids); |
99 void OnReusePictureBuffer(int32_t picture_buffer_id); | 99 void OnReusePictureBuffer(int32_t picture_buffer_id); |
100 void OnFlush(); | 100 void OnFlush(); |
101 void OnReset(); | 101 void OnReset(); |
102 void OnDestroy(); | 102 void OnDestroy(); |
103 | 103 |
104 // Called on IO thread when |filter_| has been removed. | 104 // Called on IO thread when |filter_| has been removed. |
105 void OnFilterRemoved(); | 105 void OnFilterRemoved(); |
106 | 106 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 // A map from picture buffer ID to TextureRef that have not been cleared. | 160 // A map from picture buffer ID to TextureRef that have not been cleared. |
161 std::map<int32_t, scoped_refptr<gpu::gles2::TextureRef>> uncleared_textures_; | 161 std::map<int32_t, scoped_refptr<gpu::gles2::TextureRef>> uncleared_textures_; |
162 | 162 |
163 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 163 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
164 }; | 164 }; |
165 | 165 |
166 } // namespace content | 166 } // namespace content |
167 | 167 |
168 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 168 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |