Bug 1376636 - Exempt AV1 decoding from the vp9 benchmark. r=gerald
Accept av1 video in the webm decoder even when we've determined
the machine is too slow for software vp9 decoding. While we're
at an experimental stage with this codec, poor performance is
preferable to not being able to see a demo at all.
MozReview-Commit-ID: 6DJHCPfXHlA
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -1,16 +1,19 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "MediaSource.h"
+#if MOZ_AV1
+#include "AOMDecoder.h"
+#endif
#include "AsyncEventRunner.h"
#include "DecoderTraits.h"
#include "Benchmark.h"
#include "DecoderDoctorDiagnostics.h"
#include "MediaContainerType.h"
#include "MediaResult.h"
#include "MediaSourceDemuxer.h"
#include "MediaSourceUtils.h"
@@ -113,16 +116,21 @@ MediaSource::IsTypeSupported(const nsASt
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
}
if (mimeType == MEDIAMIMETYPE("video/webm")) {
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
containerType->ExtendedType().Codecs().Contains(
NS_LITERAL_STRING("vp8")) ||
+#ifdef MOZ_AV1
+ // FIXME: Temporary comparison with the full codecs attribute.
+ // See bug 1377015.
+ AOMDecoder::IsSupportedCodec(containerType->ExtendedType().Codecs().AsString()) ||
+#endif
IsWebMForced(aDiagnostics))) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
}
if (mimeType == MEDIAMIMETYPE("audio/webm")) {
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
Preferences::GetBool("media.mediasource.webm.audio.enabled", true))) {