Index: content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc |
index 342be1a76bce961b37323e5c2b0ecc0fb4e6b283..4a7d8ecde92b26c355eef83dc3cbb6101c384c30 100644 |
--- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc |
@@ -576,8 +576,10 @@ bool V4L2SliceVideoDecodeAccelerator::SetupFormats() { |
} |
size_t input_size; |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
+ gfx::Size max_resolution, min_resolution; |
+ device_->GetSupportedResolution(input_format_fourcc, &min_resolution, |
+ &max_resolution); |
+ if (max_resolution.width() > 1920 && max_resolution.height() > 1088) |
input_size = kInputBufferMaxSizeFor4k; |
else |
input_size = kInputBufferMaxSizeFor1080p; |
@@ -2501,42 +2503,14 @@ bool V4L2SliceVideoDecodeAccelerator::CanDecodeOnIOThread() { |
// static |
media::VideoDecodeAccelerator::SupportedProfiles |
V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() { |
- SupportedProfiles profiles; |
scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
if (!device) |
- return profiles; |
- |
- 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_SLICE: |
- 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_FRAME: |
- profile.profile = media::VP8PROFILE_ANY; |
- profiles.push_back(profile); |
- break; |
- } |
- } |
+ return SupportedProfiles(); |
- return profiles; |
+ const uint32_t supported_formats[] = { |
+ V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; |
+ return device->GetSupportedDecodeProfiles(arraysize(supported_formats), |
+ supported_formats); |
} |
} // namespace content |