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.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
933 RETURN_ON_FAILURE(version_info, | 933 RETURN_ON_FAILURE(version_info, |
934 "unable to get version of msmpeg2vdec.dll", | 934 "unable to get version of msmpeg2vdec.dll", |
935 false); | 935 false); |
936 base::string16 file_version = version_info->file_version(); | 936 base::string16 file_version = version_info->file_version(); |
937 RETURN_ON_FAILURE(file_version.find(L"6.1.7140") == base::string16::npos, | 937 RETURN_ON_FAILURE(file_version.find(L"6.1.7140") == base::string16::npos, |
938 "blacklisted version of msmpeg2vdec.dll 6.7.7140", | 938 "blacklisted version of msmpeg2vdec.dll 6.7.7140", |
939 false); | 939 false); |
940 codec_ = media::kCodecH264; | 940 codec_ = media::kCodecH264; |
941 } else if (profile == media::VP8PROFILE_ANY || | 941 } else if (profile == media::VP8PROFILE_ANY || |
942 profile == media::VP9PROFILE_ANY) { | 942 profile == media::VP9PROFILE_ANY) { |
943 int program_files_key = base::DIR_PROGRAM_FILES; | |
944 if (base::win::OSInfo::GetInstance()->wow64_status() == | |
945 base::win::OSInfo::WOW64_ENABLED) { | |
DaleCurtis
2015/03/25 22:19:28
Indent seems wrong?
ananta
2015/03/25 22:54:55
Fixed. Thanks
| |
946 program_files_key = base::DIR_PROGRAM_FILES6432; | |
947 } | |
948 | |
943 base::FilePath dll_path; | 949 base::FilePath dll_path; |
944 RETURN_ON_FAILURE(PathService::Get(base::DIR_PROGRAM_FILES6432, &dll_path), | 950 RETURN_ON_FAILURE(PathService::Get(program_files_key, &dll_path), |
945 "failed to get path for DIR_PROGRAM_FILES6432", false); | 951 "failed to get path for Program Files", false); |
952 | |
946 dll_path = dll_path.Append(kVPXDecoderDLLPath); | 953 dll_path = dll_path.Append(kVPXDecoderDLLPath); |
947 if (profile == media::VP8PROFILE_ANY) { | 954 if (profile == media::VP8PROFILE_ANY) { |
948 codec_ = media::kCodecVP8; | 955 codec_ = media::kCodecVP8; |
949 dll_path = dll_path.Append(kVP8DecoderDLLName); | 956 dll_path = dll_path.Append(kVP8DecoderDLLName); |
950 } else { | 957 } else { |
951 codec_ = media::kCodecVP9; | 958 codec_ = media::kCodecVP9; |
952 dll_path = dll_path.Append(kVP9DecoderDLLName); | 959 dll_path = dll_path.Append(kVP9DecoderDLLName); |
953 } | 960 } |
954 decoder_dll = ::LoadLibraryEx(dll_path.value().data(), NULL, | 961 decoder_dll = ::LoadLibraryEx(dll_path.value().data(), NULL, |
955 LOAD_WITH_ALTERED_SEARCH_PATH); | 962 LOAD_WITH_ALTERED_SEARCH_PATH); |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2152 D3DSURFACE_DESC surface_desc; | 2159 D3DSURFACE_DESC surface_desc; |
2153 hr = surface->GetDesc(&surface_desc); | 2160 hr = surface->GetDesc(&surface_desc); |
2154 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); | 2161 RETURN_ON_HR_FAILURE(hr, "Failed to get surface description", false); |
2155 *width = surface_desc.Width; | 2162 *width = surface_desc.Width; |
2156 *height = surface_desc.Height; | 2163 *height = surface_desc.Height; |
2157 } | 2164 } |
2158 return true; | 2165 return true; |
2159 } | 2166 } |
2160 | 2167 |
2161 } // namespace content | 2168 } // namespace content |
OLD | NEW |