Chromium Code Reviews| Index: content/common/gpu/media/dxva_video_decode_accelerator.cc |
| diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc |
| index be50634283fa0f00806b7c69f5951f6889453eba..959828bdf576ba77bf22e38847e1b908d1a1f9ea 100644 |
| --- a/content/common/gpu/media/dxva_video_decode_accelerator.cc |
| +++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc |
| @@ -911,6 +911,31 @@ GLenum DXVAVideoDecodeAccelerator::GetSurfaceInternalFormat() const { |
| return GL_BGRA_EXT; |
| } |
| +// static |
| +std::vector<media::VideoDecodeAccelerator::SupportedProfile> |
| +DXVAVideoDecodeAccelerator::GetSupportedProfiles() { |
|
wuchengli
2015/03/23 08:28:08
Add a TODO to say we need to make sure the profile
henryhsu
2015/03/23 10:06:35
Done.
|
| + // Supported media profiles should be synced with Initialize function. |
|
wuchengli
2015/03/23 08:28:08
line 537 should also use |media_profiles| array to
henryhsu
2015/03/23 10:06:35
Done.
|
| + std::vector<media::VideoCodecProfile> media_profiles({ |
|
wuchengli
2015/03/23 08:28:08
Just use an array.
henryhsu
2015/03/23 10:06:35
Done.
|
| + media::H264PROFILE_BASELINE, |
| + media::H264PROFILE_MAIN, |
| + media::H264PROFILE_HIGH, |
| + media::VP8PROFILE_ANY, |
| + media::VP9PROFILE_ANY}); |
| + std::vector<media::VideoDecodeAccelerator::SupportedProfile> profiles; |
| + for (const auto& media_profile : media_profiles) { |
| + media::VideoDecodeAccelerator::SupportedProfile profile; |
| + profile.profile = media_profile; |
| + // Windows Media Foundation H.264 decoding does not support decoding videos |
| + // with any dimension smaller than 48 pixels: |
| + // http://msdn.microsoft.com/en-us/library/windows/desktop/dd797815 |
| + profile.min_resolution.SetSize(48, 48); |
| + // Use 1088 to account for 16x16 macroblocks. |
| + profile.max_resolution.SetSize(1920, 1088); |
| + profiles.push_back(profile); |
| + } |
| + return profiles; |
| +} |
| + |
| bool DXVAVideoDecodeAccelerator::InitDecoder(media::VideoCodecProfile profile) { |
| HMODULE decoder_dll = NULL; |