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..d63f1a08124a201a54c232d0c2b9e1ce8d206955 100644 |
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
@@ -454,18 +454,18 @@ V4L2VideoDecodeAccelerator::GetSupportedProfiles() { |
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) { |
+ // Get maximum resolution for each format |
+ profile.max_resolution = V4L2Device::GetSupportedMaxResolution( |
+ device, fmtdesc.pixelformat); |
+ if (profile.max_resolution.IsEmpty()) { |
+ LOG(ERROR) << "GetSupportedMaxResolution failed for format " |
+ << std::hex << fmtdesc.pixelformat; |
+ profile.max_resolution.SetSize(1920, 1088); |
wuchengli
2015/04/20 14:05:16
This should be handled in V4L2Device::GetSupported
henryhsu
2015/04/21 05:56:27
Done.
|
+ } |
switch (fmtdesc.pixelformat) { |
case V4L2_PIX_FMT_H264: |
for (uint32 media_profile = media::H264PROFILE_MIN; |
@@ -1799,8 +1799,9 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() { |
} |
size_t input_size; |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode)) |
+ gfx::Size max_resolution = V4L2Device::GetSupportedMaxResolution( |
+ device_, input_format_fourcc); |
+ if (max_resolution.width() >= 4096 && max_resolution.height() >= 2160) |
input_size = kInputBufferMaxSizeFor4k; |
else |
input_size = kInputBufferMaxSizeFor1080p; |