| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 // Task runner to be used for posting tasks to the decoder thread. | 337 // Task runner to be used for posting tasks to the decoder thread. |
| 338 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; | 338 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; |
| 339 | 339 |
| 340 // Task runner to be used for posting tasks to the main thread. | 340 // Task runner to be used for posting tasks to the main thread. |
| 341 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 341 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 342 | 342 |
| 343 // Used to synchronize access between the decoder thread and the main thread. | 343 // Used to synchronize access between the decoder thread and the main thread. |
| 344 base::Lock decoder_lock_; | 344 base::Lock decoder_lock_; |
| 345 | 345 |
| 346 // WeakPtrFactory for posting tasks back to |this|. | |
| 347 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; | |
| 348 | |
| 349 // Disallow rebinding WeakReference ownership to a different thread by | 346 // Disallow rebinding WeakReference ownership to a different thread by |
| 350 // keeping a persistent reference. This avoids problems with the | 347 // keeping a persistent reference. This avoids problems with the |
| 351 // thread safety of reaching into this class from multiple threads to | 348 // thread safety of reaching into this class from multiple threads to |
| 352 // attain a WeakPtr. | 349 // attain a WeakPtr. |
| 353 const base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_; | 350 base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_; |
| 354 | 351 |
| 355 // Set to true if we are in the context of a Flush operation. Used to prevent | 352 // Set to true if we are in the context of a Flush operation. Used to prevent |
| 356 // multiple flush done notifications being sent out. | 353 // multiple flush done notifications being sent out. |
| 357 bool pending_flush_; | 354 bool pending_flush_; |
| 358 | 355 |
| 359 // Defaults to false. Indicates if we should use D3D or DX11 interfaces for | 356 // Defaults to false. Indicates if we should use D3D or DX11 interfaces for |
| 360 // H/W decoding. | 357 // H/W decoding. |
| 361 bool use_dx11_; | 358 bool use_dx11_; |
| 362 | 359 |
| 363 // Set to true if the DX11 video format converter input media types need to | 360 // Set to true if the DX11 video format converter input media types need to |
| 364 // be initialized. Defaults to true. | 361 // be initialized. Defaults to true. |
| 365 bool dx11_video_format_converter_media_type_needs_init_; | 362 bool dx11_video_format_converter_media_type_needs_init_; |
| 366 | 363 |
| 367 // The GLContext to be used by the decoder. | 364 // The GLContext to be used by the decoder. |
| 368 scoped_refptr<gfx::GLContext> gl_context_; | 365 scoped_refptr<gfx::GLContext> gl_context_; |
| 369 | 366 |
| 367 // WeakPtrFactory for posting tasks back to |this|. |
| 368 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; |
| 369 |
| 370 // Function pointer for the MFCreateDXGIDeviceManager API. | 370 // Function pointer for the MFCreateDXGIDeviceManager API. |
| 371 static CreateDXGIDeviceManager create_dxgi_device_manager_; | 371 static CreateDXGIDeviceManager create_dxgi_device_manager_; |
| 372 }; | 372 }; |
| 373 | 373 |
| 374 } // namespace content | 374 } // namespace content |
| 375 | 375 |
| 376 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 376 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |