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 436428acd4076cee6a11cfa776bb687f4e970263..e12bb2eb8704f5f0aa57f5e68497554f5101200a 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" |
@@ -249,7 +250,8 @@ void GpuVideoDecodeAccelerator::Initialize( |
#endif |
// Array of Create..VDA() function pointers, maybe applicable to the current |
- // platform. This list is ordered by priority of use. |
+ // platform. This list is ordered by priority of use and it should be the |
+ // same as the order of querying supported profiles of VDAs. |
const GpuVideoDecodeAccelerator::CreateVDAFp create_vda_fps[] = { |
&GpuVideoDecodeAccelerator::CreateDXVAVDA, |
&GpuVideoDecodeAccelerator::CreateV4L2VDA, |
@@ -383,6 +385,38 @@ GpuVideoDecodeAccelerator::CreateAndroidVDA() { |
return decoder.Pass(); |
} |
+// static |
+std::vector<gpu::VideoDecodeAcceleratorSupportedProfile> |
+GpuVideoDecodeAccelerator::GetSupportedProfiles() { |
+ std::vector<media::VideoDecodeAccelerator::SupportedProfile> profiles; |
+ std::vector<media::VideoDecodeAccelerator::SupportedProfile> vda_profiles; |
+ // 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(OS_WIN) |
+ vda_profiles = DXVAVideoDecodeAccelerator::GetSupportedProfiles(); |
+ profiles.insert(profiles.end(), vda_profiles.begin(), vda_profiles.end()); |
piman
2015/03/23 20:29:30
nit: you can do profiles = DXVAVideoDecodeAccelera
henryhsu
2015/03/24 10:02:44
Done.
|
+#elif defined(OS_CHROMEOS) |
+#if defined(USE_V4L2_CODEC) |
+ vda_profiles = V4L2VideoDecodeAccelerator::GetSupportedProfiles(); |
+ GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles(vda_profiles, &profiles); |
+ vda_profiles = V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles(); |
+ GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles(vda_profiles, &profiles); |
+#endif |
+#if defined(ARCH_CPU_X86_FAMILY) |
+ vda_profiles = VaapiVideoDecodeAccelerator::GetSupportedProfiles(); |
+ GpuVideoAcceleratorUtil::InsertUniqueDecodeProfiles(vda_profiles, &profiles); |
+#endif |
+#elif defined(OS_MACOSX) |
+ vda_profiles = VTVideoDecodeAccelerator::GetSupportedProfiles(); |
+ profiles.insert(profiles.end(), vda_profiles.begin(), vda_profiles.end()); |
+#elif defined(OS_ANDROID) |
+ vda_profiles = AndroidVideoDecodeAccelerator::GetSupportedProfiles(); |
+ profiles.insert(profiles.end(), vda_profiles.begin(), vda_profiles.end()); |
+#endif // defined(OS_CHROMEOS) |
wuchengli
2015/03/23 14:42:06
Remove "// defined(OS_CHROMEOS)" comment
henryhsu
2015/03/24 10:02:44
Done.
|
+ return GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(profiles); |
+} |
+ |
// Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is |
// true, otherwise on the main thread. |
void GpuVideoDecodeAccelerator::OnDecode( |