| 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> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // capabilities will not contain duplicate supported profile entries. | 48 // capabilities will not contain duplicate supported profile entries. |
| 49 static gpu::VideoDecodeAcceleratorCapabilities GetCapabilities( | 49 static gpu::VideoDecodeAcceleratorCapabilities GetCapabilities( |
| 50 const gpu::GpuPreferences& gpu_preferences); | 50 const gpu::GpuPreferences& gpu_preferences); |
| 51 | 51 |
| 52 // IPC::Listener implementation. | 52 // IPC::Listener implementation. |
| 53 bool OnMessageReceived(const IPC::Message& message) override; | 53 bool OnMessageReceived(const IPC::Message& message) override; |
| 54 | 54 |
| 55 // media::VideoDecodeAccelerator::Client implementation. | 55 // media::VideoDecodeAccelerator::Client implementation. |
| 56 void NotifyCdmAttached(bool success) override; | 56 void NotifyCdmAttached(bool success) override; |
| 57 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, | 57 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, |
| 58 uint32_t textures_per_buffer, |
| 58 const gfx::Size& dimensions, | 59 const gfx::Size& dimensions, |
| 59 uint32_t texture_target) override; | 60 uint32_t texture_target) override; |
| 60 void DismissPictureBuffer(int32_t picture_buffer_id) override; | 61 void DismissPictureBuffer(int32_t picture_buffer_id) override; |
| 61 void PictureReady(const media::Picture& picture) override; | 62 void PictureReady(const media::Picture& picture) override; |
| 62 void NotifyEndOfBitstreamBuffer(int32_t bitstream_buffer_id) override; | 63 void NotifyEndOfBitstreamBuffer(int32_t bitstream_buffer_id) override; |
| 63 void NotifyFlushDone() override; | 64 void NotifyFlushDone() override; |
| 64 void NotifyResetDone() override; | 65 void NotifyResetDone() override; |
| 65 void NotifyError(media::VideoDecodeAccelerator::Error error) override; | 66 void NotifyError(media::VideoDecodeAccelerator::Error error) override; |
| 66 | 67 |
| 67 // GpuCommandBufferStub::DestructionObserver implementation. | 68 // GpuCommandBufferStub::DestructionObserver implementation. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 #if defined(OS_ANDROID) | 102 #if defined(OS_ANDROID) |
| 102 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); | 103 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); |
| 103 #endif | 104 #endif |
| 104 | 105 |
| 105 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 106 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
| 106 ~GpuVideoDecodeAccelerator() override; | 107 ~GpuVideoDecodeAccelerator() override; |
| 107 | 108 |
| 108 // Handlers for IPC messages. | 109 // Handlers for IPC messages. |
| 109 void OnSetCdm(int cdm_id); | 110 void OnSetCdm(int cdm_id); |
| 110 void OnDecode(const media::BitstreamBuffer& bitstream_buffer); | 111 void OnDecode(const media::BitstreamBuffer& bitstream_buffer); |
| 111 void OnAssignPictureBuffers(const std::vector<int32_t>& buffer_ids, | 112 void OnAssignPictureBuffers( |
| 112 const std::vector<uint32_t>& texture_ids); | 113 const std::vector<int32_t>& buffer_ids, |
| 114 const std::vector<media::PictureBuffer::TextureIds>& texture_ids); |
| 113 void OnReusePictureBuffer(int32_t picture_buffer_id); | 115 void OnReusePictureBuffer(int32_t picture_buffer_id); |
| 114 void OnFlush(); | 116 void OnFlush(); |
| 115 void OnReset(); | 117 void OnReset(); |
| 116 void OnDestroy(); | 118 void OnDestroy(); |
| 117 | 119 |
| 118 // Called on IO thread when |filter_| has been removed. | 120 // Called on IO thread when |filter_| has been removed. |
| 119 void OnFilterRemoved(); | 121 void OnFilterRemoved(); |
| 120 | 122 |
| 121 // Sets the texture to cleared. | 123 // Sets the texture to cleared. |
| 122 void SetTextureCleared(const media::Picture& picture); | 124 void SetTextureCleared(const media::Picture& picture); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 142 // Callback for making the relevant context current for GL calls. | 144 // Callback for making the relevant context current for GL calls. |
| 143 // Returns false if failed. | 145 // Returns false if failed. |
| 144 base::Callback<bool(void)> make_context_current_; | 146 base::Callback<bool(void)> make_context_current_; |
| 145 | 147 |
| 146 // The texture dimensions as requested by ProvidePictureBuffers(). | 148 // The texture dimensions as requested by ProvidePictureBuffers(). |
| 147 gfx::Size texture_dimensions_; | 149 gfx::Size texture_dimensions_; |
| 148 | 150 |
| 149 // The texture target as requested by ProvidePictureBuffers(). | 151 // The texture target as requested by ProvidePictureBuffers(). |
| 150 uint32_t texture_target_; | 152 uint32_t texture_target_; |
| 151 | 153 |
| 154 // The number of textures per picture buffer as requests by |
| 155 // ProvidePictureBuffers() |
| 156 uint32_t textures_per_buffer_; |
| 157 |
| 152 // The message filter to run VDA::Decode on IO thread if VDA supports it. | 158 // The message filter to run VDA::Decode on IO thread if VDA supports it. |
| 153 scoped_refptr<MessageFilter> filter_; | 159 scoped_refptr<MessageFilter> filter_; |
| 154 | 160 |
| 155 // Used to wait on for |filter_| to be removed, before we can safely | 161 // Used to wait on for |filter_| to be removed, before we can safely |
| 156 // destroy the VDA. | 162 // destroy the VDA. |
| 157 base::WaitableEvent filter_removed_; | 163 base::WaitableEvent filter_removed_; |
| 158 | 164 |
| 159 // GPU child thread task runner. | 165 // GPU child thread task runner. |
| 160 const scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_; | 166 const scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_; |
| 161 | 167 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 172 | 178 |
| 173 // A map from picture buffer ID to TextureRef that have not been cleared. | 179 // A map from picture buffer ID to TextureRef that have not been cleared. |
| 174 std::map<int32_t, scoped_refptr<gpu::gles2::TextureRef>> uncleared_textures_; | 180 std::map<int32_t, scoped_refptr<gpu::gles2::TextureRef>> uncleared_textures_; |
| 175 | 181 |
| 176 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 182 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 177 }; | 183 }; |
| 178 | 184 |
| 179 } // namespace content | 185 } // namespace content |
| 180 | 186 |
| 181 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 187 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |