Bug 1213177: Enable WebM on machines where H264 HW decoding is disabled. r=kentuckyfriedtakahe

This commit is contained in:
Jean-Yves Avenard 2015-10-28 14:14:11 +11:00
Родитель fd8146966c
Коммит 3c3b1f1353
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "gfxPlatform.h"
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h" #include "AndroidBridge.h"
@ -75,13 +76,14 @@ static const char* const gMediaSourceTypes[6] = {
// * Windows Vista and Server 2008 without the optional "Platform Update Supplement" // * Windows Vista and Server 2008 without the optional "Platform Update Supplement"
// * N/KN editions (Europe and Korea) of Windows 7/8/8.1/10 without the // * N/KN editions (Europe and Korea) of Windows 7/8/8.1/10 without the
// optional "Windows Media Feature Pack" // optional "Windows Media Feature Pack"
// 2. If H264 hardware acceleration is not available.
static bool static bool
IsWebMForced() IsWebMForced()
{ {
bool mp4supported = bool mp4supported =
DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4")); DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"));
return !mp4supported; bool hwsupported = gfxPlatform::GetPlatform()->CanUseHardwareVideoDecoding();
return !mp4supported || !hwsupported;
} }
static nsresult static nsresult