mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1149343 - Part2: Add HW decode blacklisting support on mac. r=mattwoodrow
This commit is contained in:
parent
0427f54e6b
commit
b10106d3f9
@ -21,6 +21,7 @@
|
||||
#include "prlog.h"
|
||||
#include "VideoUtils.h"
|
||||
#include <algorithm>
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PRLogModuleInfo* GetAppleMediaLog();
|
||||
@ -79,6 +80,11 @@ AppleVDADecoder::~AppleVDADecoder()
|
||||
nsresult
|
||||
AppleVDADecoder::Init()
|
||||
{
|
||||
if (!gfxPlatform::CanUseHardwareVideoDecoding()) {
|
||||
// This GPU is blacklisted for hardware decoding.
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (mDecoder) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsThreadUtils.h"
|
||||
#include "prlog.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PRLogModuleInfo* GetAppleMediaLog();
|
||||
@ -381,7 +382,13 @@ AppleVTDecoder::CreateDecoderSpecification()
|
||||
}
|
||||
|
||||
const void* specKeys[] = { AppleVTLinker::skPropEnableHWAccel };
|
||||
const void* specValues[] = { kCFBooleanTrue };
|
||||
const void* specValues[1];
|
||||
if (gfxPlatform::CanUseHardwareVideoDecoding()) {
|
||||
specValues[0] = kCFBooleanTrue;
|
||||
} else {
|
||||
// This GPU is blacklisted for hardware decoding.
|
||||
specValues[0] = kCFBooleanFalse;
|
||||
}
|
||||
static_assert(ArrayLength(specKeys) == ArrayLength(specValues),
|
||||
"Non matching keys/values array size");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user