| 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 "content/common/gpu/media/dxva_video_decode_accelerator_win.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h" |
| 6 | 6 |
| 7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
| 8 #error This file should only be built on Windows. | 8 #error This file should only be built on Windows. |
| 9 #endif // !defined(OS_WIN) | 9 #endif // !defined(OS_WIN) |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 } // namespace | 150 } // namespace |
| 151 | 151 |
| 152 namespace content { | 152 namespace content { |
| 153 | 153 |
| 154 static const media::VideoCodecProfile kSupportedProfiles[] = { | 154 static const media::VideoCodecProfile kSupportedProfiles[] = { |
| 155 media::H264PROFILE_BASELINE, | 155 media::H264PROFILE_BASELINE, |
| 156 media::H264PROFILE_MAIN, | 156 media::H264PROFILE_MAIN, |
| 157 media::H264PROFILE_HIGH, | 157 media::H264PROFILE_HIGH, |
| 158 media::VP8PROFILE_ANY, | 158 media::VP8PROFILE_ANY, |
| 159 media::VP9PROFILE_ANY | 159 media::VP9PROFILE_PROFILE0, |
| 160 media::VP9PROFILE_PROFILE1, |
| 161 media::VP9PROFILE_PROFILE2, |
| 162 media::VP9PROFILE_PROFILE3 |
| 160 }; | 163 }; |
| 161 | 164 |
| 162 CreateDXGIDeviceManager DXVAVideoDecodeAccelerator::create_dxgi_device_manager_ | 165 CreateDXGIDeviceManager DXVAVideoDecodeAccelerator::create_dxgi_device_manager_ |
| 163 = NULL; | 166 = NULL; |
| 164 | 167 |
| 165 #define RETURN_ON_FAILURE(result, log, ret) \ | 168 #define RETURN_ON_FAILURE(result, log, ret) \ |
| 166 do { \ | 169 do { \ |
| 167 if (!(result)) { \ | 170 if (!(result)) { \ |
| 168 DLOG(ERROR) << log; \ | 171 DLOG(ERROR) << log; \ |
| 169 return ret; \ | 172 return ret; \ |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 "unable to get version of msmpeg2vdec.dll", | 1398 "unable to get version of msmpeg2vdec.dll", |
| 1396 false); | 1399 false); |
| 1397 base::string16 file_version = version_info->file_version(); | 1400 base::string16 file_version = version_info->file_version(); |
| 1398 RETURN_ON_FAILURE(file_version.find(L"6.1.7140") == base::string16::npos, | 1401 RETURN_ON_FAILURE(file_version.find(L"6.1.7140") == base::string16::npos, |
| 1399 "blacklisted version of msmpeg2vdec.dll 6.1.7140", | 1402 "blacklisted version of msmpeg2vdec.dll 6.1.7140", |
| 1400 false); | 1403 false); |
| 1401 codec_ = media::kCodecH264; | 1404 codec_ = media::kCodecH264; |
| 1402 clsid = __uuidof(CMSH264DecoderMFT); | 1405 clsid = __uuidof(CMSH264DecoderMFT); |
| 1403 } else if (enable_accelerated_vpx_decode_ && | 1406 } else if (enable_accelerated_vpx_decode_ && |
| 1404 (profile == media::VP8PROFILE_ANY || | 1407 (profile == media::VP8PROFILE_ANY || |
| 1405 profile == media::VP9PROFILE_ANY)) { | 1408 profile == media::VP9PROFILE_PROFILE0 || |
| 1409 profile == media::VP9PROFILE_PROFILE1 || |
| 1410 profile == media::VP9PROFILE_PROFILE2 || |
| 1411 profile == media::VP9PROFILE_PROFILE3)) { |
| 1406 int program_files_key = base::DIR_PROGRAM_FILES; | 1412 int program_files_key = base::DIR_PROGRAM_FILES; |
| 1407 if (base::win::OSInfo::GetInstance()->wow64_status() == | 1413 if (base::win::OSInfo::GetInstance()->wow64_status() == |
| 1408 base::win::OSInfo::WOW64_ENABLED) { | 1414 base::win::OSInfo::WOW64_ENABLED) { |
| 1409 program_files_key = base::DIR_PROGRAM_FILES6432; | 1415 program_files_key = base::DIR_PROGRAM_FILES6432; |
| 1410 } | 1416 } |
| 1411 | 1417 |
| 1412 base::FilePath dll_path; | 1418 base::FilePath dll_path; |
| 1413 RETURN_ON_FAILURE(PathService::Get(program_files_key, &dll_path), | 1419 RETURN_ON_FAILURE(PathService::Get(program_files_key, &dll_path), |
| 1414 "failed to get path for Program Files", false); | 1420 "failed to get path for Program Files", false); |
| 1415 | 1421 |
| (...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2651 DismissStaleBuffers(true); | 2657 DismissStaleBuffers(true); |
| 2652 Invalidate(); | 2658 Invalidate(); |
| 2653 Initialize(config_, client_); | 2659 Initialize(config_, client_); |
| 2654 decoder_thread_task_runner_->PostTask( | 2660 decoder_thread_task_runner_->PostTask( |
| 2655 FROM_HERE, | 2661 FROM_HERE, |
| 2656 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2662 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2657 base::Unretained(this))); | 2663 base::Unretained(this))); |
| 2658 } | 2664 } |
| 2659 | 2665 |
| 2660 } // namespace content | 2666 } // namespace content |
| OLD | NEW |