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 MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 5 #ifndef MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
6 #define MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 6 #define MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 private: | 58 private: |
59 DISALLOW_COPY_AND_ASSIGN(ScopedGLContextLock); | 59 DISALLOW_COPY_AND_ASSIGN(ScopedGLContextLock); |
60 }; | 60 }; |
61 | 61 |
62 enum class OutputFormat { | 62 enum class OutputFormat { |
63 UNDEFINED = 0, // Unset state | 63 UNDEFINED = 0, // Unset state |
64 I420, // 3 x R8 GMBs | 64 I420, // 3 x R8 GMBs |
65 UYVY, // One 422 GMB | 65 UYVY, // One 422 GMB |
66 NV12_SINGLE_GMB, // One NV12 GMB | 66 NV12_SINGLE_GMB, // One NV12 GMB |
67 NV12_DUAL_GMB, // One R8, one RG88 GMB | 67 NV12_DUAL_GMB, // One R8, one RG88 GMB |
| 68 Y16, // One RG88 GMB |
68 }; | 69 }; |
69 | 70 |
70 // Return whether GPU encoding/decoding is enabled. | 71 // Return whether GPU encoding/decoding is enabled. |
71 virtual bool IsGpuVideoAcceleratorEnabled() = 0; | 72 virtual bool IsGpuVideoAcceleratorEnabled() = 0; |
72 // Caller owns returned pointer, but should call Destroy() on it (instead of | 73 // Caller owns returned pointer, but should call Destroy() on it (instead of |
73 // directly deleting) for proper destruction, as per the | 74 // directly deleting) for proper destruction, as per the |
74 // VideoDecodeAccelerator interface. | 75 // VideoDecodeAccelerator interface. |
75 virtual std::unique_ptr<VideoDecodeAccelerator> | 76 virtual std::unique_ptr<VideoDecodeAccelerator> |
76 CreateVideoDecodeAccelerator() = 0; | 77 CreateVideoDecodeAccelerator() = 0; |
77 | 78 |
(...skipping 14 matching lines...) Expand all Loading... |
92 | 93 |
93 virtual void WaitSyncToken(const gpu::SyncToken& sync_token) = 0; | 94 virtual void WaitSyncToken(const gpu::SyncToken& sync_token) = 0; |
94 | 95 |
95 virtual std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 96 virtual std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
96 const gfx::Size& size, | 97 const gfx::Size& size, |
97 gfx::BufferFormat format, | 98 gfx::BufferFormat format, |
98 gfx::BufferUsage usage) = 0; | 99 gfx::BufferUsage usage) = 0; |
99 | 100 |
100 virtual bool ShouldUseGpuMemoryBuffersForVideoFrames() const = 0; | 101 virtual bool ShouldUseGpuMemoryBuffersForVideoFrames() const = 0; |
101 virtual unsigned ImageTextureTarget(gfx::BufferFormat format) = 0; | 102 virtual unsigned ImageTextureTarget(gfx::BufferFormat format) = 0; |
102 // Pixel format of the hardware video frames created when GpuMemoryBuffers | 103 // Pixel format of the hardware video frames of provided video type, |
103 // video frames are enabled. | 104 // created when GpuMemoryBuffers video frames are enabled. |
104 virtual OutputFormat VideoFrameOutputFormat() = 0; | 105 virtual OutputFormat VideoFrameOutputFormat(media::VideoPixelFormat) = 0; |
105 | 106 |
106 virtual std::unique_ptr<ScopedGLContextLock> GetGLContextLock() = 0; | 107 virtual std::unique_ptr<ScopedGLContextLock> GetGLContextLock() = 0; |
107 | 108 |
108 // Allocate & return a shared memory segment. | 109 // Allocate & return a shared memory segment. |
109 virtual std::unique_ptr<base::SharedMemory> CreateSharedMemory( | 110 virtual std::unique_ptr<base::SharedMemory> CreateSharedMemory( |
110 size_t size) = 0; | 111 size_t size) = 0; |
111 | 112 |
112 // Returns the task runner the video accelerator runs on. | 113 // Returns the task runner the video accelerator runs on. |
113 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; | 114 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; |
114 | 115 |
115 // Return the capabilities of video decode accelerator, which includes the | 116 // Return the capabilities of video decode accelerator, which includes the |
116 // supported codec profiles. | 117 // supported codec profiles. |
117 virtual VideoDecodeAccelerator::Capabilities | 118 virtual VideoDecodeAccelerator::Capabilities |
118 GetVideoDecodeAcceleratorCapabilities() = 0; | 119 GetVideoDecodeAcceleratorCapabilities() = 0; |
119 | 120 |
120 // Returns the supported codec profiles of video encode accelerator. | 121 // Returns the supported codec profiles of video encode accelerator. |
121 virtual VideoEncodeAccelerator::SupportedProfiles | 122 virtual VideoEncodeAccelerator::SupportedProfiles |
122 GetVideoEncodeAcceleratorSupportedProfiles() = 0; | 123 GetVideoEncodeAcceleratorSupportedProfiles() = 0; |
123 | 124 |
124 protected: | 125 protected: |
125 friend class base::RefCounted<GpuVideoAcceleratorFactories>; | 126 friend class base::RefCounted<GpuVideoAcceleratorFactories>; |
126 virtual ~GpuVideoAcceleratorFactories() {} | 127 virtual ~GpuVideoAcceleratorFactories() {} |
127 }; | 128 }; |
128 | 129 |
129 } // namespace media | 130 } // namespace media |
130 | 131 |
131 #endif // MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 132 #endif // MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
OLD | NEW |