| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // supported by the VDA (see Capabilities), and it is supported by the | 160 // supported by the VDA (see Capabilities), and it is supported by the |
| 161 // client (see Config::is_deferred_initialization_allowed), and the initial | 161 // client (see Config::is_deferred_initialization_allowed), and the initial |
| 162 // call to VDA::Initialize returns true. | 162 // call to VDA::Initialize returns true. |
| 163 // The default implementation is a NOTREACHED, since deferred initialization | 163 // The default implementation is a NOTREACHED, since deferred initialization |
| 164 // is not supported by default. | 164 // is not supported by default. |
| 165 virtual void NotifyInitializationComplete(bool success); | 165 virtual void NotifyInitializationComplete(bool success); |
| 166 | 166 |
| 167 // Callback to tell client how many and what size of buffers to provide. | 167 // Callback to tell client how many and what size of buffers to provide. |
| 168 // Note that the actual count provided through AssignPictureBuffers() can be | 168 // Note that the actual count provided through AssignPictureBuffers() can be |
| 169 // larger than the value requested. | 169 // larger than the value requested. |
| 170 // |format| indicates what format the decoded frames will be produced in | |
| 171 // by the VDA, or PIXEL_FORMAT_UNKNOWN if the underlying platform handles | |
| 172 // this transparently. | |
| 173 virtual void ProvidePictureBuffers(uint32_t requested_num_of_buffers, | 170 virtual void ProvidePictureBuffers(uint32_t requested_num_of_buffers, |
| 174 VideoPixelFormat format, | |
| 175 uint32_t textures_per_buffer, | 171 uint32_t textures_per_buffer, |
| 176 const gfx::Size& dimensions, | 172 const gfx::Size& dimensions, |
| 177 uint32_t texture_target) = 0; | 173 uint32_t texture_target) = 0; |
| 178 | 174 |
| 179 // Callback to dismiss picture buffer that was assigned earlier. | 175 // Callback to dismiss picture buffer that was assigned earlier. |
| 180 virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0; | 176 virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0; |
| 181 | 177 |
| 182 // Callback to deliver decoded pictures ready to be displayed. | 178 // Callback to deliver decoded pictures ready to be displayed. |
| 183 virtual void PictureReady(const Picture& picture) = 0; | 179 virtual void PictureReady(const Picture& picture) = 0; |
| 184 | 180 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // to run decode operations without GL context, which helps reduce latency and | 310 // to run decode operations without GL context, which helps reduce latency and |
| 315 // offloads the GPU Child thread. | 311 // offloads the GPU Child thread. |
| 316 virtual bool TryToSetupDecodeOnSeparateThread( | 312 virtual bool TryToSetupDecodeOnSeparateThread( |
| 317 const base::WeakPtr<Client>& decode_client, | 313 const base::WeakPtr<Client>& decode_client, |
| 318 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner); | 314 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner); |
| 319 | 315 |
| 320 // Windows creates a BGRA texture. | 316 // Windows creates a BGRA texture. |
| 321 // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691 | 317 // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691 |
| 322 virtual GLenum GetSurfaceInternalFormat() const; | 318 virtual GLenum GetSurfaceInternalFormat() const; |
| 323 | 319 |
| 320 // In IMPORT OutputMode, if supported by the VDA, return the format that it |
| 321 // requires for imported picture buffers. |
| 322 virtual VideoPixelFormat GetOutputFormat() const; |
| 323 |
| 324 protected: | 324 protected: |
| 325 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which | 325 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
| 326 // will Destroy() it properly by default. | 326 // will Destroy() it properly by default. |
| 327 virtual ~VideoDecodeAccelerator(); | 327 virtual ~VideoDecodeAccelerator(); |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 } // namespace media | 330 } // namespace media |
| 331 | 331 |
| 332 namespace std { | 332 namespace std { |
| 333 | 333 |
| 334 // Specialize std::default_delete so that | 334 // Specialize std::default_delete so that |
| 335 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to | 335 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to |
| 336 // use the destructor. | 336 // use the destructor. |
| 337 template <> | 337 template <> |
| 338 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { | 338 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { |
| 339 void operator()(media::VideoDecodeAccelerator* vda) const; | 339 void operator()(media::VideoDecodeAccelerator* vda) const; |
| 340 }; | 340 }; |
| 341 | 341 |
| 342 } // namespace std | 342 } // namespace std |
| 343 | 343 |
| 344 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 344 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |