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 MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 // supported by the VDA (see Capabilities), and it is supported by the | 154 // supported by the VDA (see Capabilities), and it is supported by the |
155 // client (see Config::is_deferred_initialization_allowed), and the initial | 155 // client (see Config::is_deferred_initialization_allowed), and the initial |
156 // call to VDA::Initialize returns true. | 156 // call to VDA::Initialize returns true. |
157 // The default implementation is a NOTREACHED, since deferred initialization | 157 // The default implementation is a NOTREACHED, since deferred initialization |
158 // is not supported by default. | 158 // is not supported by default. |
159 virtual void NotifyInitializationComplete(bool success); | 159 virtual void NotifyInitializationComplete(bool success); |
160 | 160 |
161 // Callback to tell client how many and what size of buffers to provide. | 161 // Callback to tell client how many and what size of buffers to provide. |
162 // Note that the actual count provided through AssignPictureBuffers() can be | 162 // Note that the actual count provided through AssignPictureBuffers() can be |
163 // larger than the value requested. | 163 // larger than the value requested. |
164 // If format is PIXEL_FORMAT_UNKNOWN, picture buffers can be treated as | |
Pawel Osciak
2016/05/18 07:32:32
I'm wondering if perhaps this would reflect the cu
| |
165 // either XRGB or ARGB. | |
164 virtual void ProvidePictureBuffers(uint32_t requested_num_of_buffers, | 166 virtual void ProvidePictureBuffers(uint32_t requested_num_of_buffers, |
167 VideoPixelFormat format, | |
165 uint32_t textures_per_buffer, | 168 uint32_t textures_per_buffer, |
166 const gfx::Size& dimensions, | 169 const gfx::Size& dimensions, |
167 uint32_t texture_target) = 0; | 170 uint32_t texture_target) = 0; |
168 | 171 |
169 // Callback to dismiss picture buffer that was assigned earlier. | 172 // Callback to dismiss picture buffer that was assigned earlier. |
170 virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0; | 173 virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0; |
171 | 174 |
172 // Callback to deliver decoded pictures ready to be displayed. | 175 // Callback to deliver decoded pictures ready to be displayed. |
173 virtual void PictureReady(const Picture& picture) = 0; | 176 virtual void PictureReady(const Picture& picture) = 0; |
174 | 177 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 // to run decode operations without GL context, which helps reduce latency and | 317 // to run decode operations without GL context, which helps reduce latency and |
315 // offloads the GPU Child thread. | 318 // offloads the GPU Child thread. |
316 virtual bool TryToSetupDecodeOnSeparateThread( | 319 virtual bool TryToSetupDecodeOnSeparateThread( |
317 const base::WeakPtr<Client>& decode_client, | 320 const base::WeakPtr<Client>& decode_client, |
318 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner); | 321 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner); |
319 | 322 |
320 // Windows creates a BGRA texture. | 323 // Windows creates a BGRA texture. |
321 // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691 | 324 // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691 |
322 virtual GLenum GetSurfaceInternalFormat() const; | 325 virtual GLenum GetSurfaceInternalFormat() const; |
323 | 326 |
324 // In IMPORT OutputMode, if supported by the VDA, return the format that it | |
325 // requires for imported picture buffers. | |
326 virtual VideoPixelFormat GetOutputFormat() const; | |
327 | |
328 protected: | 327 protected: |
329 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which | 328 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
330 // will Destroy() it properly by default. | 329 // will Destroy() it properly by default. |
331 virtual ~VideoDecodeAccelerator(); | 330 virtual ~VideoDecodeAccelerator(); |
332 }; | 331 }; |
333 | 332 |
334 } // namespace media | 333 } // namespace media |
335 | 334 |
336 namespace std { | 335 namespace std { |
337 | 336 |
338 // Specialize std::default_delete so that | 337 // Specialize std::default_delete so that |
339 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to | 338 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to |
340 // use the destructor. | 339 // use the destructor. |
341 template <> | 340 template <> |
342 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { | 341 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { |
343 void operator()(media::VideoDecodeAccelerator* vda) const; | 342 void operator()(media::VideoDecodeAccelerator* vda) const; |
344 }; | 343 }; |
345 | 344 |
346 } // namespace std | 345 } // namespace std |
347 | 346 |
348 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 347 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |