Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; | 52 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; |
| 53 void NotifyFlushDone() override; | 53 void NotifyFlushDone() override; |
| 54 void NotifyResetDone() override; | 54 void NotifyResetDone() override; |
| 55 | 55 |
| 56 // GpuCommandBufferStub::DestructionObserver implementation. | 56 // GpuCommandBufferStub::DestructionObserver implementation. |
| 57 void OnWillDestroyStub() override; | 57 void OnWillDestroyStub() override; |
| 58 | 58 |
| 59 // Function to delegate sending to actual sender. | 59 // Function to delegate sending to actual sender. |
| 60 bool Send(IPC::Message* message) override; | 60 bool Send(IPC::Message* message) override; |
| 61 | 61 |
| 62 // Initialize the accelerator with the given profile and send the | 62 // Prepare all appropriate platform-specific VDAs and send the |
| 63 // |init_done_msg| when done. | 63 // |init_done_msg| when initialize one of accelerators with |profile| |
|
Pawel Osciak
2014/12/30 06:14:38
We send the message always, just with a different
henryhsu
2014/12/30 14:40:51
Done.
| |
| 64 // successfully. | |
| 64 void Initialize(const media::VideoCodecProfile profile, | 65 void Initialize(const media::VideoCodecProfile profile, |
| 65 IPC::Message* init_done_msg); | 66 IPC::Message* init_done_msg); |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 class MessageFilter; | 69 class MessageFilter; |
| 69 | 70 |
| 70 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 71 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
| 71 ~GpuVideoDecodeAccelerator() override; | 72 ~GpuVideoDecodeAccelerator() override; |
| 72 | 73 |
| 74 // Initialize VDA for |profile|. Return true when initialization succeeded | |
| 75 // and filter_ is passed to GpuCommandBufferStube channel only if we can | |
| 76 // decode on IO thread. | |
| 77 bool InitializeDecoder(media::VideoCodecProfile profile); | |
| 78 | |
| 73 // Handlers for IPC messages. | 79 // Handlers for IPC messages. |
| 74 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); | 80 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); |
| 75 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, | 81 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, |
| 76 const std::vector<uint32>& texture_ids); | 82 const std::vector<uint32>& texture_ids); |
| 77 void OnReusePictureBuffer(int32 picture_buffer_id); | 83 void OnReusePictureBuffer(int32 picture_buffer_id); |
| 78 void OnFlush(); | 84 void OnFlush(); |
| 79 void OnReset(); | 85 void OnReset(); |
| 80 void OnDestroy(); | 86 void OnDestroy(); |
| 81 | 87 |
| 82 // Called on IO thread when |filter_| has been removed. | 88 // Called on IO thread when |filter_| has been removed. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 | 138 |
| 133 // A map from picture buffer ID to TextureRef that have not been cleared. | 139 // A map from picture buffer ID to TextureRef that have not been cleared. |
| 134 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 140 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
| 135 | 141 |
| 136 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 142 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 137 }; | 143 }; |
| 138 | 144 |
| 139 } // namespace content | 145 } // namespace content |
| 140 | 146 |
| 141 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 147 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |