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_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <d3d11.h> | 8 #include <d3d11.h> |
9 #include <d3d9.h> | 9 #include <d3d9.h> |
10 // Work around bug in this header by disabling the relevant warning for it. | 10 // Work around bug in this header by disabling the relevant warning for it. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 }; | 57 }; |
58 | 58 |
59 // Does not take ownership of |client| which must outlive |*this|. | 59 // Does not take ownership of |client| which must outlive |*this|. |
60 explicit DXVAVideoDecodeAccelerator( | 60 explicit DXVAVideoDecodeAccelerator( |
61 const base::Callback<bool(void)>& make_context_current, | 61 const base::Callback<bool(void)>& make_context_current, |
62 gfx::GLContext* gl_context); | 62 gfx::GLContext* gl_context); |
63 ~DXVAVideoDecodeAccelerator() override; | 63 ~DXVAVideoDecodeAccelerator() override; |
64 | 64 |
65 // media::VideoDecodeAccelerator implementation. | 65 // media::VideoDecodeAccelerator implementation. |
66 bool Initialize(media::VideoCodecProfile profile, | 66 bool Initialize(media::VideoCodecProfile profile, |
| 67 uint32 min_picture_count, |
67 Client* client) override; | 68 Client* client) override; |
68 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; | 69 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
69 void AssignPictureBuffers( | 70 void AssignPictureBuffers( |
70 const std::vector<media::PictureBuffer>& buffers) override; | 71 const std::vector<media::PictureBuffer>& buffers) override; |
71 void ReusePictureBuffer(int32 picture_buffer_id) override; | 72 void ReusePictureBuffer(int32 picture_buffer_id) override; |
72 void Flush() override; | 73 void Flush() override; |
73 void Reset() override; | 74 void Reset() override; |
74 void Destroy() override; | 75 void Destroy() override; |
75 bool CanDecodeOnIOThread() override; | 76 bool CanDecodeOnIOThread() override; |
76 GLenum GetSurfaceInternalFormat() const override; | 77 GLenum GetSurfaceInternalFormat() const override; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // This map maintains the picture buffers passed the client for decoding. | 302 // This map maintains the picture buffers passed the client for decoding. |
302 // The key is the picture buffer id. | 303 // The key is the picture buffer id. |
303 OutputBuffers output_picture_buffers_; | 304 OutputBuffers output_picture_buffers_; |
304 | 305 |
305 // After a resolution change there may be a few output buffers which have yet | 306 // After a resolution change there may be a few output buffers which have yet |
306 // to be displayed so they cannot be dismissed immediately. We move them from | 307 // to be displayed so they cannot be dismissed immediately. We move them from |
307 // |output_picture_buffers_| to this map so they may be dismissed once they | 308 // |output_picture_buffers_| to this map so they may be dismissed once they |
308 // become available. | 309 // become available. |
309 OutputBuffers stale_output_picture_buffers_; | 310 OutputBuffers stale_output_picture_buffers_; |
310 | 311 |
| 312 // The number of picture buffers to allocate |
| 313 uint32 num_picture_buffers_; |
| 314 |
311 // Set to true if we requested picture slots from the client. | 315 // Set to true if we requested picture slots from the client. |
312 bool pictures_requested_; | 316 bool pictures_requested_; |
313 | 317 |
314 // Counter which holds the number of input packets before a successful | 318 // Counter which holds the number of input packets before a successful |
315 // decode. | 319 // decode. |
316 int inputs_before_decode_; | 320 int inputs_before_decode_; |
317 | 321 |
318 // Set to true when the drain message is sent to the decoder during a flush | 322 // Set to true when the drain message is sent to the decoder during a flush |
319 // operation. Used to ensure the message is only sent once after | 323 // operation. Used to ensure the message is only sent once after |
320 // |pending_input_buffers_| is drained. Protected by |decoder_lock_|. | 324 // |pending_input_buffers_| is drained. Protected by |decoder_lock_|. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // WeakPtrFactory for posting tasks back to |this|. | 371 // WeakPtrFactory for posting tasks back to |this|. |
368 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; | 372 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; |
369 | 373 |
370 // Function pointer for the MFCreateDXGIDeviceManager API. | 374 // Function pointer for the MFCreateDXGIDeviceManager API. |
371 static CreateDXGIDeviceManager create_dxgi_device_manager_; | 375 static CreateDXGIDeviceManager create_dxgi_device_manager_; |
372 }; | 376 }; |
373 | 377 |
374 } // namespace content | 378 } // namespace content |
375 | 379 |
376 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 380 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |