| 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 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
| 15 #include "content/common/gpu/gpu_command_buffer_stub.h" | 15 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 16 #include "gpu/command_buffer/service/texture_manager.h" | 16 #include "gpu/command_buffer/service/texture_manager.h" |
| 17 #include "gpu/config/gpu_info.h" | 17 #include "gpu/config/gpu_info.h" |
| 18 #include "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
| 19 #include "ipc/ipc_sender.h" | 19 #include "ipc/ipc_sender.h" |
| 20 #include "media/video/video_decode_accelerator.h" | 20 #include "media/video/video_decode_accelerator.h" |
| 21 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
| 22 | 22 |
| 23 struct AcceleratedVideoDecoderMsg_Decode_Params; |
| 24 |
| 23 namespace content { | 25 namespace content { |
| 24 | 26 |
| 25 class GpuVideoDecodeAccelerator | 27 class GpuVideoDecodeAccelerator |
| 26 : public IPC::Listener, | 28 : public IPC::Listener, |
| 27 public IPC::Sender, | 29 public IPC::Sender, |
| 28 public media::VideoDecodeAccelerator::Client, | 30 public media::VideoDecodeAccelerator::Client, |
| 29 public GpuCommandBufferStub::DestructionObserver { | 31 public GpuCommandBufferStub::DestructionObserver { |
| 30 public: | 32 public: |
| 31 // Each of the arguments to the constructor must outlive this object. | 33 // Each of the arguments to the constructor must outlive this object. |
| 32 // |stub->decoder()| will be made current around any operation that touches | 34 // |stub->decoder()| will be made current around any operation that touches |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA(); | 81 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA(); |
| 80 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); | 82 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); |
| 81 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); | 83 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); |
| 82 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); | 84 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); |
| 83 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); | 85 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); |
| 84 | 86 |
| 85 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 87 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
| 86 ~GpuVideoDecodeAccelerator() override; | 88 ~GpuVideoDecodeAccelerator() override; |
| 87 | 89 |
| 88 // Handlers for IPC messages. | 90 // Handlers for IPC messages. |
| 89 void OnDecode(base::SharedMemoryHandle handle, | 91 void OnDecode(const AcceleratedVideoDecoderMsg_Decode_Params& params); |
| 90 int32 id, | |
| 91 uint32 size, | |
| 92 base::TimeDelta presentation_timestamp); | |
| 93 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, | 92 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, |
| 94 const std::vector<uint32>& texture_ids); | 93 const std::vector<uint32>& texture_ids); |
| 95 void OnReusePictureBuffer(int32 picture_buffer_id); | 94 void OnReusePictureBuffer(int32 picture_buffer_id); |
| 96 void OnFlush(); | 95 void OnFlush(); |
| 97 void OnReset(); | 96 void OnReset(); |
| 98 void OnDestroy(); | 97 void OnDestroy(); |
| 99 | 98 |
| 100 // Called on IO thread when |filter_| has been removed. | 99 // Called on IO thread when |filter_| has been removed. |
| 101 void OnFilterRemoved(); | 100 void OnFilterRemoved(); |
| 102 | 101 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 154 |
| 156 // A map from picture buffer ID to TextureRef that have not been cleared. | 155 // A map from picture buffer ID to TextureRef that have not been cleared. |
| 157 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 156 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
| 158 | 157 |
| 159 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 158 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 160 }; | 159 }; |
| 161 | 160 |
| 162 } // namespace content | 161 } // namespace content |
| 163 | 162 |
| 164 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 163 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |