| 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 #include "media/gpu/dxva_video_decode_accelerator_win.h" | 5 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #if !defined(OS_WIN) | 9 #if !defined(OS_WIN) |
| 10 #error This file should only be built on Windows. | 10 #error This file should only be built on Windows. |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 RETURN_ON_HR_FAILURE(hr, "Failed to enable DXVA H/W decoding", false); | 1430 RETURN_ON_HR_FAILURE(hr, "Failed to enable DXVA H/W decoding", false); |
| 1431 } | 1431 } |
| 1432 | 1432 |
| 1433 hr = attributes->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE); | 1433 hr = attributes->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE); |
| 1434 if (SUCCEEDED(hr)) { | 1434 if (SUCCEEDED(hr)) { |
| 1435 DVLOG(1) << "Successfully set Low latency mode on decoder."; | 1435 DVLOG(1) << "Successfully set Low latency mode on decoder."; |
| 1436 } else { | 1436 } else { |
| 1437 DVLOG(1) << "Failed to set Low latency mode on decoder. Error: " << hr; | 1437 DVLOG(1) << "Failed to set Low latency mode on decoder. Error: " << hr; |
| 1438 } | 1438 } |
| 1439 | 1439 |
| 1440 auto gl_context = get_gl_context_cb_.Run(); | 1440 auto* gl_context = get_gl_context_cb_.Run(); |
| 1441 RETURN_ON_FAILURE(gl_context, "Couldn't get GL context", false); | 1441 RETURN_ON_FAILURE(gl_context, "Couldn't get GL context", false); |
| 1442 | 1442 |
| 1443 // The decoder should use DX11 iff | 1443 // The decoder should use DX11 iff |
| 1444 // 1. The underlying H/W decoder supports it. | 1444 // 1. The underlying H/W decoder supports it. |
| 1445 // 2. We have a pointer to the MFCreateDXGIDeviceManager function needed for | 1445 // 2. We have a pointer to the MFCreateDXGIDeviceManager function needed for |
| 1446 // this. This should always be true for Windows 8+. | 1446 // this. This should always be true for Windows 8+. |
| 1447 // 3. ANGLE is using DX11. | 1447 // 3. ANGLE is using DX11. |
| 1448 if (create_dxgi_device_manager_ && | 1448 if (create_dxgi_device_manager_ && |
| 1449 (gl_context->GetGLRenderer().find("Direct3D11") != std::string::npos)) { | 1449 (gl_context->GetGLRenderer().find("Direct3D11") != std::string::npos)) { |
| 1450 UINT32 dx11_aware = 0; | 1450 UINT32 dx11_aware = 0; |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2670 SetState(kConfigChange); | 2670 SetState(kConfigChange); |
| 2671 Invalidate(); | 2671 Invalidate(); |
| 2672 Initialize(config_, client_); | 2672 Initialize(config_, client_); |
| 2673 decoder_thread_task_runner_->PostTask( | 2673 decoder_thread_task_runner_->PostTask( |
| 2674 FROM_HERE, | 2674 FROM_HERE, |
| 2675 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2675 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2676 base::Unretained(this))); | 2676 base::Unretained(this))); |
| 2677 } | 2677 } |
| 2678 | 2678 |
| 2679 } // namespace media | 2679 } // namespace media |
| OLD | NEW |