| 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 "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
| 18 #include "ipc/ipc_sender.h" | 19 #include "ipc/ipc_sender.h" |
| 19 #include "media/video/video_decode_accelerator.h" | 20 #include "media/video/video_decode_accelerator.h" |
| 20 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class MessageLoopProxy; | 24 class MessageLoopProxy; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Function to delegate sending to actual sender. | 60 // Function to delegate sending to actual sender. |
| 60 bool Send(IPC::Message* message) override; | 61 bool Send(IPC::Message* message) override; |
| 61 | 62 |
| 62 // Initialize VDAs from the set of VDAs supported for current platform until | 63 // Initialize VDAs from the set of VDAs supported for current platform until |
| 63 // one of them succeeds for given |profile|. Send the |init_done_msg| when | 64 // one of them succeeds for given |profile|. Send the |init_done_msg| when |
| 64 // done. filter_ is passed to GpuCommandBufferStub channel only if the chosen | 65 // done. filter_ is passed to GpuCommandBufferStub channel only if the chosen |
| 65 // VDA can decode on IO thread. | 66 // VDA can decode on IO thread. |
| 66 void Initialize(const media::VideoCodecProfile profile, | 67 void Initialize(const media::VideoCodecProfile profile, |
| 67 IPC::Message* init_done_msg); | 68 IPC::Message* init_done_msg); |
| 68 | 69 |
| 70 // Static query for supported profiles. This query calls the appropriate |
| 71 // platform-specific version and stores supported decoder profiles in |
| 72 // |supported_profiles|. Return true if platform supports to query decoder |
| 73 // profiles. |supported_profiles| would not have duplicate codec profile. |
| 74 static bool GetSupportedProfiles( |
| 75 std::vector<gpu::VideoDecodeAcceleratorSupportedProfile>* |
| 76 supported_profiles); |
| 77 |
| 69 private: | 78 private: |
| 70 typedef scoped_ptr<media::VideoDecodeAccelerator>( | 79 typedef scoped_ptr<media::VideoDecodeAccelerator>( |
| 71 GpuVideoDecodeAccelerator::*CreateVDAFp)(); | 80 GpuVideoDecodeAccelerator::*CreateVDAFp)(); |
| 72 | 81 |
| 73 class MessageFilter; | 82 class MessageFilter; |
| 74 | 83 |
| 75 // Return a set of VDA Create function pointers applicable to the current | 84 // Return a set of VDA Create function pointers applicable to the current |
| 76 // platform. | 85 // platform. |
| 77 std::vector<CreateVDAFp> CreateVDAFps(); | 86 std::vector<CreateVDAFp> CreateVDAFps(); |
| 78 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); | 87 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 162 |
| 154 // A map from picture buffer ID to TextureRef that have not been cleared. | 163 // A map from picture buffer ID to TextureRef that have not been cleared. |
| 155 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 164 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
| 156 | 165 |
| 157 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 166 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 158 }; | 167 }; |
| 159 | 168 |
| 160 } // namespace content | 169 } // namespace content |
| 161 | 170 |
| 162 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 171 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |