| 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..07b13361739fcc0f62d23961dd7de653433938a1 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"
|
| @@ -273,6 +274,8 @@ void GpuVideoDecodeAccelerator::Initialize(
|
| std::vector<GpuVideoDecodeAccelerator::CreateVDAFp>
|
| GpuVideoDecodeAccelerator::CreateVDAFps() {
|
| std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> create_vda_fps;
|
| + // The order of initializing VDAs should be the same as the order of querying
|
| + // supported profiles of VDAs.
|
| create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateDXVAVDA);
|
| create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2VDA);
|
| create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2SliceVDA);
|
| @@ -389,6 +392,34 @@ 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;
|
| + // Query supported profiles for each VDA. The order of querying VDAs should
|
| + // be the same as the order of initializing VDAs. Then the returned profile
|
| + // can be initialized by corresponding VDA successfully.
|
| +#if defined(USE_V4L2_CODEC)
|
| + vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles();
|
| + GpuVideoAcceleratorUtil::UniqueInsertDecodeProfiles(&profiles, vda_profiles);
|
| + vda_profiles = V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles();
|
| + GpuVideoAcceleratorUtil::UniqueInsertDecodeProfiles(&profiles, vda_profiles);
|
| +#endif
|
| +#if defined(ARCH_CPU_X86_FAMILY)
|
| + vda_profiles = VaapiVideoDecodeAccelerator::GetSupportedProfiles();
|
| + GpuVideoAcceleratorUtil::UniqueInsertDecodeProfiles(&profiles, vda_profiles);
|
| +#endif
|
| + *supported_profiles =
|
| + GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(profiles);
|
| +#endif // defined(OS_CHROMEOS)
|
| + return support_query_profile;
|
| +}
|
| +
|
| // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is
|
| // true, otherwise on the main thread.
|
| void GpuVideoDecodeAccelerator::OnDecode(
|
|
|