OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ENCODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "content/common/gpu/gpu_command_buffer_stub.h" | 12 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 13 #include "gpu/config/gpu_info.h" |
13 #include "ipc/ipc_listener.h" | 14 #include "ipc/ipc_listener.h" |
14 #include "media/video/video_encode_accelerator.h" | 15 #include "media/video/video_encode_accelerator.h" |
15 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 | 19 |
19 class SharedMemory; | 20 class SharedMemory; |
20 | 21 |
21 } // namespace base | 22 } // namespace base |
22 | 23 |
(...skipping 28 matching lines...) Expand all Loading... |
51 void BitstreamBufferReady(int32 bitstream_buffer_id, | 52 void BitstreamBufferReady(int32 bitstream_buffer_id, |
52 size_t payload_size, | 53 size_t payload_size, |
53 bool key_frame) override; | 54 bool key_frame) override; |
54 void NotifyError(media::VideoEncodeAccelerator::Error error) override; | 55 void NotifyError(media::VideoEncodeAccelerator::Error error) override; |
55 | 56 |
56 // GpuCommandBufferStub::DestructionObserver implementation. | 57 // GpuCommandBufferStub::DestructionObserver implementation. |
57 void OnWillDestroyStub() override; | 58 void OnWillDestroyStub() override; |
58 | 59 |
59 // Static query for supported profiles. This query calls the appropriate | 60 // Static query for supported profiles. This query calls the appropriate |
60 // platform-specific version. | 61 // platform-specific version. |
61 static std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 62 static std::vector<gpu::VideoEncodeAcceleratorSupportedProfile> |
62 GetSupportedProfiles(); | 63 GetSupportedProfiles(); |
| 64 static std::vector<gpu::VideoEncodeAcceleratorSupportedProfile> |
| 65 ConvertMediaToGpuProfiles(const std::vector< |
| 66 media::VideoEncodeAccelerator::SupportedProfile>& media_profiles); |
63 | 67 |
64 private: | 68 private: |
65 // Create the appropriate platform-specific VEA. | 69 // Create the appropriate platform-specific VEA. |
66 static scoped_ptr<media::VideoEncodeAccelerator> CreateEncoder(); | 70 static scoped_ptr<media::VideoEncodeAccelerator> CreateEncoder(); |
67 | 71 |
68 // IPC handlers, proxying media::VideoEncodeAccelerator for the renderer | 72 // IPC handlers, proxying media::VideoEncodeAccelerator for the renderer |
69 // process. | 73 // process. |
70 void OnEncode(int32 frame_id, | 74 void OnEncode(int32 frame_id, |
71 base::SharedMemoryHandle buffer_handle, | 75 base::SharedMemoryHandle buffer_handle, |
72 uint32 buffer_size, | 76 uint32 buffer_size, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 108 |
105 // Weak pointer for media::VideoFrames that refer back to |this|. | 109 // Weak pointer for media::VideoFrames that refer back to |this|. |
106 base::WeakPtrFactory<GpuVideoEncodeAccelerator> weak_this_factory_; | 110 base::WeakPtrFactory<GpuVideoEncodeAccelerator> weak_this_factory_; |
107 | 111 |
108 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAccelerator); | 112 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAccelerator); |
109 }; | 113 }; |
110 | 114 |
111 } // namespace content | 115 } // namespace content |
112 | 116 |
113 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ | 117 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ |
OLD | NEW |