Bug 1376636 - Exempt AV1 decoding from the vp9 benchmark. r=gerald draft
authorRalph Giles <giles@mozilla.com>
Tue, 27 Jun 2017 17:20:00 -0700
changeset 601767 08ae650424c7d84d0acada5b20051256940a6ae3
parent 601524 217b7fcf58944f927118b465769faeb1e613130a
child 635390 744f9cf93265d2c805f8cf47f6918cf1c121ee40
push id66203
push userbmo:giles@thaumas.net
push dateThu, 29 Jun 2017 05:03:42 +0000
reviewersgerald
bugs1376636
milestone56.0a1
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
dom/media/mediasource/MediaSource.cpp
--- 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))) {