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

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: address patch set 6 review comments Created 6 years 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
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 150dd05a26dccfa2801728f786369cf8a73baaeb..00774d4ea35e9e64d15da68181ad4ea127b0aace 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/command_line.h"
-#include "base/cpu.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/stl_util.h"
@@ -18,7 +17,6 @@
#include "gpu/command_buffer/common/mailbox_holder.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/decoder_buffer.h"
-#include "media/base/media_switches.h"
#include "media/base/pipeline.h"
#include "media/base/pipeline_status.h"
#include "media/base/video_decoder_config.h"
@@ -98,35 +96,6 @@ void GpuVideoDecoder::Reset(const base::Closure& closure) {
vda_->Reset();
}
-static bool IsCodedSizeSupported(const gfx::Size& coded_size) {
-#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 =
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode) ||
- ((cpu.vendor_name() == "GenuineIntel") && cpu.model() >= 55);
- 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;
-}
-
// Report |status| to UMA and run |cb| with it. This is super-specific to the
// UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a
// callsite to always be called with the same stat name (can't parameterize it).
@@ -623,6 +592,19 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
DestroyVDA();
}
+bool GpuVideoDecoder::IsCodedSizeSupported(const gfx::Size& coded_size) {
+ DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
+ media::VideoDecodeAccelerator::SupportedResolution supported_resolution =
+ factories_->GetVideoDecodeAcceleratorSupportedResolution();
+ if (coded_size.width() <= supported_resolution.max.width() &&
+ coded_size.height() <= supported_resolution.max.height() &&
+ coded_size.width() >= supported_resolution.min.width() &&
+ coded_size.height() >= supported_resolution.min.height()) {
+ return true;
+ }
+ return false;
+}
+
void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
const {
DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698