Index: content/common/gpu/media/vt_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc |
index 75844ee0536f5f1417820a9ea36f562b0262a526..a46d611b380fc80a703678e7f613e7499d00161d 100644 |
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc |
@@ -33,6 +33,18 @@ using content_common_gpu_media::StubPathMap; |
namespace content { |
+const media::VideoCodecProfile kSupportedProfiles[] = { |
wuchengli
2015/03/23 14:42:06
static
henryhsu
2015/03/24 10:02:44
Done.
|
+ H264PROFILE_BASELINE, |
+ H264PROFILE_MAIN, |
+ H264PROFILE_EXTENDED, |
+ H264PROFILE_HIGH, |
+ H264PROFILE_HIGH10PROFILE, |
+ H264PROFILE_SCALABLEBASELINE, |
+ H264PROFILE_SCALABLEHIGH, |
+ H264PROFILE_STEREOHIGH, |
+ H264PROFILE_MULTIVIEWHIGH, |
+}; |
+ |
// Size to use for NALU length headers in AVC format (can be 1, 2, or 4). |
static const int kNALUHeaderLength = 4; |
@@ -312,12 +324,15 @@ bool VTVideoDecodeAccelerator::Initialize( |
return false; |
// Only H.264 with 4:2:0 chroma sampling is supported. |
wuchengli
2015/03/23 14:42:06
Move the comment to where kSupportedProfiles is de
henryhsu
2015/03/24 10:02:44
Done.
|
- if (profile < media::H264PROFILE_MIN || |
- profile > media::H264PROFILE_MAX || |
- profile == media::H264PROFILE_HIGH422PROFILE || |
- profile == media::H264PROFILE_HIGH444PREDICTIVEPROFILE) { |
- return false; |
+ bool profile_supported = false; |
+ for (size_t i = 0; i < arraysize(kSupportedProfiles); ++i) { |
piman
2015/03/23 20:29:30
nit: same as other file, you can use range for loo
henryhsu
2015/03/24 10:02:44
Done.
|
+ if (profile == kSupportedProfiles[i]) { |
+ profile_supported = true; |
+ break; |
+ } |
} |
+ if (!profile_supported) |
+ return false; |
// Spawn a thread to handle parsing and calling VideoToolbox. |
if (!decoder_thread_.Start()) |
@@ -1054,4 +1069,18 @@ bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { |
return false; |
} |
+// static |
+std::vector<media::VideoDecodeAccelerator::SupportedProfile> |
+VTVideoDecodeAccelerator::GetSupportedProfiles() { |
+ std::vector<media::VideoDecodeAccelerator::SupportedProfile> profiles; |
+ for (size_t i = 0; i < arraysize(kSupportedProfiles); ++i) { |
+ media::VideoDecodeAccelerator::SupportedProfile profile; |
+ profile.profile = kSupportedProfiles[i]; |
+ profile.min_resolution.SetSize(480, 360); |
+ profile.max_resolution.SetSize(4096, 2160); |
+ profiles.push_back(profile); |
+ } |
+ return profiles; |
+} |
+ |
} // namespace content |