Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/renderers/gpu_video_accelerator_factories.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index d059c0be894fc9594c161bc94d5f3ff1cf8531e7..64668fa398f76ef6c38c7e6aab94d16141bfe84c 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -98,35 +98,12 @@ void GpuVideoDecoder::Reset(const base::Closure& closure) {
}
static bool IsCodedSizeSupported(const gfx::Size& coded_size,
- VideoCodecProfile profile) {
-#if defined(OS_WIN)
- // Windows Media Foundation H.264 decoding does not support decoding videos
- // with any dimension smaller than 48 pixels:
- // http://msdn.microsoft.com/en-us/library/windows/desktop/dd797815
- if (coded_size.width() < 48 || coded_size.height() < 48)
- return false;
-#endif
-
- // Only non-Windows, Ivy Bridge+ platforms can support more than 1920x1080.
- // We test against 1088 to account for 16x16 macroblocks.
- if (coded_size.width() <= 1920 && coded_size.height() <= 1088)
- return true;
-
- // NOTE: additional autodetection logic may require updating input buffer size
- // selection in platform-specific implementations, such as
- // V4L2VideoDecodeAccelerator.
- base::CPU cpu;
- bool hw_large_video_support =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode) ||
- ((cpu.vendor_name() == "GenuineIntel") && cpu.model() >= 55 &&
- // TODO(posciak, henryhsu): Remove this once we can query in runtime.
- profile >= H264PROFILE_MIN && profile <= H264PROFILE_MAX);
- bool os_large_video_support = true;
-#if defined(OS_WIN)
- os_large_video_support = false;
-#endif
- return os_large_video_support && hw_large_video_support;
+ const gfx::Size& min_resolution,
+ const gfx::Size& max_resolution) {
+ return (coded_size.width() <= max_resolution.width() &&
+ coded_size.height() <= max_resolution.height() &&
+ coded_size.width() >= min_resolution.width() &&
+ coded_size.height() >= min_resolution.height());
}
// Report |status| to UMA and run |cb| with it. This is super-specific to the
@@ -169,7 +146,7 @@ void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
return;
}
- if (!IsCodedSizeSupported(config.coded_size(), config.profile())) {
+ if (!IsProfileSupported(config.profile(), config.coded_size())) {
status_cb.Run(DECODER_ERROR_NOT_SUPPORTED);
return;
}
@@ -593,6 +570,21 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
DestroyVDA();
}
+bool GpuVideoDecoder::IsProfileSupported(VideoCodecProfile profile,
+ const gfx::Size& coded_size) {
+ DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
+ VideoDecodeAccelerator::SupportedProfiles supported_profiles =
+ factories_->GetVideoDecodeAcceleratorSupportedProfiles();
+ for (const auto& supported_profile : supported_profiles) {
+ if (profile == supported_profile.profile) {
+ return IsCodedSizeSupported(coded_size,
+ supported_profile.min_resolution,
+ supported_profile.max_resolution);
+ }
+ }
+ return false;
+}
+
void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
const {
DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/renderers/gpu_video_accelerator_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698