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 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 void CopySurfaceComplete(IDirect3DSurface9* src_surface, | 215 void CopySurfaceComplete(IDirect3DSurface9* src_surface, |
216 IDirect3DSurface9* dest_surface, | 216 IDirect3DSurface9* dest_surface, |
217 int picture_buffer_id, | 217 int picture_buffer_id, |
218 int input_buffer_id); | 218 int input_buffer_id); |
219 | 219 |
220 // Copies the source texture |src_texture| to the destination |dest_texture|. | 220 // Copies the source texture |src_texture| to the destination |dest_texture|. |
221 // The copying is done on the decoder thread. The |video_frame| parameter | 221 // The copying is done on the decoder thread. The |video_frame| parameter |
222 // is the sample containing the frame to be copied. | 222 // is the sample containing the frame to be copied. |
223 void CopyTexture(ID3D11Texture2D* src_texture, | 223 void CopyTexture(ID3D11Texture2D* src_texture, |
224 ID3D11Texture2D* dest_texture, | 224 ID3D11Texture2D* dest_texture, |
| 225 base::win::ScopedComPtr<IDXGIKeyedMutex> dest_keyed_mutex, |
| 226 uint64_t keyed_mutex_value, |
225 IMFSample* video_frame, | 227 IMFSample* video_frame, |
226 int picture_buffer_id, | 228 int picture_buffer_id, |
227 int input_buffer_id); | 229 int input_buffer_id); |
228 | 230 |
229 // Flushes the decoder device to ensure that the decoded surface is copied | 231 // Flushes the decoder device to ensure that the decoded surface is copied |
230 // to the target surface. |iterations| helps to maintain an upper limit on | 232 // to the target surface. |iterations| helps to maintain an upper limit on |
231 // the number of times we try to complete the flush operation. | 233 // the number of times we try to complete the flush operation. |
232 void FlushDecoder(int iterations, | 234 void FlushDecoder(int iterations, |
233 IDirect3DSurface9* src_surface, | 235 IDirect3DSurface9* src_surface, |
234 IDirect3DSurface9* dest_surface, | 236 IDirect3DSurface9* dest_surface, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_; | 368 base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_; |
367 | 369 |
368 // Set to true if we are in the context of a Flush operation. Used to prevent | 370 // Set to true if we are in the context of a Flush operation. Used to prevent |
369 // multiple flush done notifications being sent out. | 371 // multiple flush done notifications being sent out. |
370 bool pending_flush_; | 372 bool pending_flush_; |
371 | 373 |
372 // Defaults to false. Indicates if we should use D3D or DX11 interfaces for | 374 // Defaults to false. Indicates if we should use D3D or DX11 interfaces for |
373 // H/W decoding. | 375 // H/W decoding. |
374 bool use_dx11_; | 376 bool use_dx11_; |
375 | 377 |
| 378 // True if we should use DXGI keyed mutexes to synchronize between the two |
| 379 // contexts. |
| 380 bool use_keyed_mutex_; |
| 381 |
376 // Set to true if the DX11 video format converter input media types need to | 382 // Set to true if the DX11 video format converter input media types need to |
377 // be initialized. Defaults to true. | 383 // be initialized. Defaults to true. |
378 bool dx11_video_format_converter_media_type_needs_init_; | 384 bool dx11_video_format_converter_media_type_needs_init_; |
379 | 385 |
380 // The GLContext to be used by the decoder. | 386 // The GLContext to be used by the decoder. |
381 scoped_refptr<gfx::GLContext> gl_context_; | 387 scoped_refptr<gfx::GLContext> gl_context_; |
382 | 388 |
383 // Set to true if we are sharing ANGLE's device. | 389 // Set to true if we are sharing ANGLE's device. |
384 bool using_angle_device_; | 390 bool using_angle_device_; |
385 | 391 |
386 // WeakPtrFactory for posting tasks back to |this|. | 392 // WeakPtrFactory for posting tasks back to |this|. |
387 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; | 393 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; |
388 | 394 |
389 // Function pointer for the MFCreateDXGIDeviceManager API. | 395 // Function pointer for the MFCreateDXGIDeviceManager API. |
390 static CreateDXGIDeviceManager create_dxgi_device_manager_; | 396 static CreateDXGIDeviceManager create_dxgi_device_manager_; |
391 | 397 |
392 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); | 398 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); |
393 }; | 399 }; |
394 | 400 |
395 } // namespace content | 401 } // namespace content |
396 | 402 |
397 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 403 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |