Chromium Code Reviews| Index: content/common/gpu/media/v4l2_video_decode_accelerator.cc |
| diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
| index 186d92086e776d78da2ace497b82718bb0206e29..9f3d20ca472edfdc51b2a4101bf1a93df777c6ae 100644 |
| --- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
| +++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
| @@ -452,41 +452,8 @@ V4L2VideoDecodeAccelerator::GetSupportedProfiles() { |
| if (!device) |
| return profiles; |
|
wuchengli
2015/04/23 07:11:44
return SupportedProfiles(). remove |profiles|
henryhsu
2015/04/23 08:21:54
Done.
|
| - SupportedProfile profile; |
| - profile.min_resolution.SetSize(16, 16); |
| - // NOTE: additional autodetection logic may require updating input buffer size |
| - // selection. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
| - profile.max_resolution.SetSize(4096, 2160); |
| - else |
| - profile.max_resolution.SetSize(1920, 1088); |
| - |
| - v4l2_fmtdesc fmtdesc; |
| - memset(&fmtdesc, 0, sizeof(fmtdesc)); |
| - fmtdesc.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; |
| - for (; device->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0; ++fmtdesc.index) { |
| - switch (fmtdesc.pixelformat) { |
| - case V4L2_PIX_FMT_H264: |
| - for (uint32 media_profile = media::H264PROFILE_MIN; |
| - media_profile <= media::H264PROFILE_MAX; ++media_profile) { |
| - profile.profile = |
| - static_cast<media::VideoCodecProfile>(media_profile); |
| - profiles.push_back(profile); |
| - } |
| - break; |
| - case V4L2_PIX_FMT_VP8: |
| - profile.profile = media::VP8PROFILE_ANY; |
| - profiles.push_back(profile); |
| - break; |
| - case V4L2_PIX_FMT_VP9: |
| - profile.profile = media::VP9PROFILE_ANY; |
| - profiles.push_back(profile); |
| - break; |
| - } |
| - } |
| - |
| - return profiles; |
| + return device->GetSupportedDecodeProfiles(std::vector<uint32_t>( |
| + {V4L2_PIX_FMT_H264, V4L2_PIX_FMT_VP8, V4L2_PIX_FMT_VP9})); |
| } |
| void V4L2VideoDecodeAccelerator::DecodeTask( |
| @@ -1799,8 +1766,9 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() { |
| } |
| size_t input_size; |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
| + gfx::Size max_resolution = |
| + device_->GetMaxSupportedResolution(input_format_fourcc); |
| + if (max_resolution.width() >= 1920 && max_resolution.height() >= 1080) |
|
wuchengli
2015/04/23 07:11:44
s/>=/>/
henryhsu
2015/04/23 08:21:54
Done.
|
| input_size = kInputBufferMaxSizeFor4k; |
| else |
| input_size = kInputBufferMaxSizeFor1080p; |