summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorsandersd <sandersd@chromium.org>2014-12-03 14:33:15 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-03 22:33:37 +0000
commit3125ca55d73650bd37ce9d9daa3dfe5182a7cf3a (patch)
treefcc97440953b49d520a90f60418de59c172d5957 /content
parentd00cdf71c4e5ab4aa73cfa5f251a526e60cc2aba (diff)
downloadchromium_src-3125ca55d73650bd37ce9d9daa3dfe5182a7cf3a.zip
chromium_src-3125ca55d73650bd37ce9d9daa3dfe5182a7cf3a.tar.gz
chromium_src-3125ca55d73650bd37ce9d9daa3dfe5182a7cf3a.tar.bz2
Add UMA to track software fallback in VTVideoDecodeAccelerator.
VideoToolbox can fall back to software internally for two reasons: 1) The resolution is below the minimum (or other format incompatibility). Eventually we want Chromium to handle fallback in this case. 2) The sandbox was not initialized properly. This we want to know about and fix. This CL does not distinguish the two cases. BUG=133828 Review URL: https://codereview.chromium.org/773673002 Cr-Commit-Position: refs/heads/master@{#306692}
Diffstat (limited to 'content')
-rw-r--r--content/common/gpu/media/vt.sig1
-rw-r--r--content/common/gpu/media/vt_stubs_header.fragment1
-rw-r--r--content/common/gpu/media/vt_video_decode_accelerator.cc13
3 files changed, 15 insertions, 0 deletions
diff --git a/content/common/gpu/media/vt.sig b/content/common/gpu/media/vt.sig
index a9639a3..39c408e 100644
--- a/content/common/gpu/media/vt.sig
+++ b/content/common/gpu/media/vt.sig
@@ -14,3 +14,4 @@ Boolean VTDecompressionSessionCanAcceptFormatDescription(VTDecompressionSessionR
OSStatus VTDecompressionSessionCreate(CFAllocatorRef allocator, CMVideoFormatDescriptionRef videoFormatDescription, CFDictionaryRef videoDecoderSpecification, CFDictionaryRef destinationImageBufferAttributes, const VTDecompressionOutputCallbackRecord *outputCallback, VTDecompressionSessionRef *decompressionSessionOut);
OSStatus VTDecompressionSessionDecodeFrame(VTDecompressionSessionRef session, CMSampleBufferRef sampleBuffer, VTDecodeFrameFlags decodeFlags, void *sourceFrameRefCon, VTDecodeInfoFlags *infoFlagsOut);
OSStatus VTDecompressionSessionWaitForAsynchronousFrames(VTDecompressionSessionRef session);
+OSStatus VTSessionCopyProperty(VTSessionRef session, CFStringRef propertyKey, CFAllocatorRef allocator, void *propertyValueOut);
diff --git a/content/common/gpu/media/vt_stubs_header.fragment b/content/common/gpu/media/vt_stubs_header.fragment
index f8f7ded..eabcd26 100644
--- a/content/common/gpu/media/vt_stubs_header.fragment
+++ b/content/common/gpu/media/vt_stubs_header.fragment
@@ -66,6 +66,7 @@ enum {
};
typedef UInt32 VTDecodeInfoFlags;
typedef struct OpaqueVTDecompressionSession* VTDecompressionSessionRef;
+typedef CFTypeRef VTSessionRef;
typedef void (*VTDecompressionOutputCallback)(
void *decompressionOutputRefCon,
diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc
index d4ad116..b0a9d7e 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/mac/mac_logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/sys_byteorder.h"
#include "base/thread_task_runner_handle.h"
#include "content/common/gpu/media/vt_video_decode_accelerator.h"
@@ -334,6 +335,18 @@ bool VTVideoDecodeAccelerator::ConfigureDecoder() {
return false;
}
+ // Report whether hardware decode is being used.
+ base::ScopedCFTypeRef<CFBooleanRef> using_hardware;
+ if (VTSessionCopyProperty(
+ session_,
+ // kVTDecompressionPropertyKey_UsingHardwareAcceleratedVideoDecoder
+ CFSTR("UsingHardwareAcceleratedVideoDecoder"),
+ kCFAllocatorDefault,
+ using_hardware.InitializeInto()) == 0) {
+ UMA_HISTOGRAM_BOOLEAN("Media.VTVDA.HardwareAccelerated",
+ CFBooleanGetValue(using_hardware));
+ }
+
return true;
}