Bug 1314147 - Add AOMDecoder to AgnosticDecoderModule. r=jya draft
authorRalph Giles <giles@mozilla.com>
Wed, 19 Apr 2017 13:30:32 -0700
changeset 573366 33128df83181a8d372731cf95f50171d1d1df05d
parent 573365 97cdc5ded26dee10a0d6ceb56aa4b8eda16f9632
child 573367 9b534330eff32fa49eda23dca2354a016211bfc3
push id57365
push userbmo:giles@thaumas.net
push dateFri, 05 May 2017 16:49:55 +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)