Chromium Code Reviews| Index: content/common/gpu/media/gpu_video_decode_accelerator.cc |
| diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc |
| index fde81acaa4f86cdf09d080032316db55ac24bc46..90e54589b4d4b1f4daa0f13bb23518db8c83f576 100644 |
| --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc |
| +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc |
| @@ -15,6 +15,7 @@ |
| #include "content/common/gpu/gpu_channel.h" |
| #include "content/common/gpu/gpu_messages.h" |
| +#include "content/common/gpu/media/gpu_video_accelerator_util.h" |
| #include "content/public/common/content_switches.h" |
| #include "gpu/command_buffer/common/command_buffer.h" |
| #include "ipc/ipc_message_macros.h" |
| @@ -389,6 +390,31 @@ GpuVideoDecodeAccelerator::CreateAndroidVDA() { |
| return decoder.Pass(); |
| } |
| +// static |
| +bool GpuVideoDecodeAccelerator::GetSupportedProfiles( |
| + std::vector<gpu::VideoDecodeAcceleratorSupportedProfile>* |
| + supported_profiles) { |
| + std::vector<media::VideoDecodeAccelerator::SupportedProfile> profiles; |
| + bool support_query_profile = false; |
| +#if defined(OS_CHROMEOS) |
| + std::vector<media::VideoDecodeAccelerator::SupportedProfile> vda_profiles; |
| + support_query_profile = true; |
|
wuchengli
2015/03/19 06:19:25
Add comment to say the insert order here must be t
henryhsu
2015/03/19 10:00:32
Done.
|
| +#if defined(USE_V4L2_CODEC) |
| + vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles(); |
| + profiles.insert(profiles.end(), vda_profiles.begin(), vda_profiles.end()); |
| + vda_profiles = V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles(); |
| + profiles.insert(profiles.end(), vda_profiles.begin(), vda_profiles.end()); |
| +#endif |
| +#if defined(ARCH_CPU_X86_FAMILY) |
| + vda_profiles = VaapiVideoDecodeAccelerator::GetSupportedProfiles(); |
| + profiles.insert(profiles.end(), vda_profiles.begin(), vda_profiles.end()); |
| +#endif |
| +#endif // defined(OS_CHROMEOS) |
| + *supported_profiles = |
| + GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(profiles); |
|
wuchengli
2015/03/19 06:19:24
We shouldn't touch |supported_profiles| if this fu
henryhsu
2015/03/19 10:00:32
Done.
|
| + return support_query_profile; |
| +} |
| + |
| // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is |
| // true, otherwise on the main thread. |
| void GpuVideoDecodeAccelerator::OnDecode( |