| 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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) { | 1058 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) { |
| 1059 return false; | 1059 return false; |
| 1060 } | 1060 } |
| 1061 | 1061 |
| 1062 GLenum DXVAVideoDecodeAccelerator::GetSurfaceInternalFormat() const { | 1062 GLenum DXVAVideoDecodeAccelerator::GetSurfaceInternalFormat() const { |
| 1063 return GL_BGRA_EXT; | 1063 return GL_BGRA_EXT; |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 // static | 1066 // static |
| 1067 VideoDecodeAccelerator::SupportedProfiles | 1067 VideoDecodeAccelerator::SupportedProfiles |
| 1068 DXVAVideoDecodeAccelerator::GetSupportedProfiles() { | 1068 DXVAVideoDecodeAccelerator::GetSupportedProfiles( |
| 1069 const gpu::GpuPreferences& preferences) { |
| 1069 TRACE_EVENT0("gpu,startup", | 1070 TRACE_EVENT0("gpu,startup", |
| 1070 "DXVAVideoDecodeAccelerator::GetSupportedProfiles"); | 1071 "DXVAVideoDecodeAccelerator::GetSupportedProfiles"); |
| 1071 | 1072 |
| 1072 // TODO(henryhsu): Need to ensure the profiles are actually supported. | 1073 // TODO(henryhsu): Need to ensure the profiles are actually supported. |
| 1073 SupportedProfiles profiles; | 1074 SupportedProfiles profiles; |
| 1074 for (const auto& supported_profile : kSupportedProfiles) { | 1075 for (const auto& supported_profile : kSupportedProfiles) { |
| 1076 if (!preferences.enable_accelerated_vpx_decode && |
| 1077 (supported_profile >= VP8PROFILE_MIN) && |
| 1078 (supported_profile <= VP9PROFILE_MAX)) { |
| 1079 continue; |
| 1080 } |
| 1075 std::pair<int, int> min_resolution = GetMinResolution(supported_profile); | 1081 std::pair<int, int> min_resolution = GetMinResolution(supported_profile); |
| 1076 std::pair<int, int> max_resolution = GetMaxResolution(supported_profile); | 1082 std::pair<int, int> max_resolution = GetMaxResolution(supported_profile); |
| 1077 | 1083 |
| 1078 SupportedProfile profile; | 1084 SupportedProfile profile; |
| 1079 profile.profile = supported_profile; | 1085 profile.profile = supported_profile; |
| 1080 profile.min_resolution.SetSize(min_resolution.first, min_resolution.second); | 1086 profile.min_resolution.SetSize(min_resolution.first, min_resolution.second); |
| 1081 profile.max_resolution.SetSize(max_resolution.first, max_resolution.second); | 1087 profile.max_resolution.SetSize(max_resolution.first, max_resolution.second); |
| 1082 profiles.push_back(profile); | 1088 profiles.push_back(profile); |
| 1083 } | 1089 } |
| 1084 return profiles; | 1090 return profiles; |
| (...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2670 SetState(kConfigChange); | 2676 SetState(kConfigChange); |
| 2671 Invalidate(); | 2677 Invalidate(); |
| 2672 Initialize(config_, client_); | 2678 Initialize(config_, client_); |
| 2673 decoder_thread_task_runner_->PostTask( | 2679 decoder_thread_task_runner_->PostTask( |
| 2674 FROM_HERE, | 2680 FROM_HERE, |
| 2675 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2681 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2676 base::Unretained(this))); | 2682 base::Unretained(this))); |
| 2677 } | 2683 } |
| 2678 | 2684 |
| 2679 } // namespace media | 2685 } // namespace media |
| OLD | NEW |