Bug 1314147 - Add AOMDecoder to AgnosticDecoderModule. r=jya draft
authorRalph Giles <giles@mozilla.com>
Wed, 19 Apr 2017 13:30:32 -0700
changeset 572911 b548312a910a541a37e44117462492865fa04f82
parent 572910 0c3b03d33f9a56ec089c484dd3f44c9f897eb81a
child 572912 c4b771cc81952c13160b17a34cf667caf9bbe6ba
push id57221
push userbmo:giles@thaumas.net
push dateThu, 04 May 2017 22:41:26 +0000
reviewersjya
bugs1314147
milestone55.0a1
Bug 1314147 - Add AOMDecoder to AgnosticDecoderModule. r=jya Conditionally enable the AV1 decoder as part of the agnostic PlatformDecoderModule factory. MozReview-Commit-ID: ApZ1CMvdLE
dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
--- a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
@@ -7,42 +7,55 @@
 #include "AgnosticDecoderModule.h"
 #include "OpusDecoder.h"
 #include "TheoraDecoder.h"
 #include "VPXDecoder.h"
 #include "VorbisDecoder.h"
 #include "WAVDecoder.h"
 #include "mozilla/Logging.h"
 
+#ifdef MOZ_AV1
+#include "AOMDecoder.h"
+#endif
+
 namespace mozilla {
 
 bool
 AgnosticDecoderModule::SupportsMimeType(
   const nsACString& aMimeType,
   DecoderDoctorDiagnostics* aDiagnostics) const
 {
   bool supports =
     VPXDecoder::IsVPX(aMimeType)
+#ifdef MOZ_AV1
+    || AOMDecoder::IsAV1(aMimeType)
+#endif
     || OpusDataDecoder::IsOpus(aMimeType)
     || VorbisDataDecoder::IsVorbis(aMimeType)
     || WaveDataDecoder::IsWave(aMimeType)
     || TheoraDecoder::IsTheora(aMimeType);
   MOZ_LOG(sPDMLog, LogLevel::Debug, ("Agnostic decoder %s requested type",
         supports ? "supports" : "rejects"));
   return supports;
 }
 
 already_AddRefed<MediaDataDecoder>
 AgnosticDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
   RefPtr<MediaDataDecoder> m;
 
   if (VPXDecoder::IsVPX(aParams.mConfig.mMimeType)) {
     m = new VPXDecoder(aParams);
-  } else if (TheoraDecoder::IsTheora(aParams.mConfig.mMimeType)) {
+  }
+#ifdef MOZ_AV1
+  else if (AOMDecoder::IsAV1(aParams.mConfig.mMimeType)) {
+    m = new AOMDecoder(aParams);
+  }
+#endif
+  else if (TheoraDecoder::IsTheora(aParams.mConfig.mMimeType)) {
     m = new TheoraDecoder(aParams);
   }
 
   return m.forget();
 }
 
 already_AddRefed<MediaDataDecoder>
 AgnosticDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)