From 3e0443e4c1ea6612d722c3a5b38843e0da451e81 Mon Sep 17 00:00:00 2001 From: trav90 Date: Mon, 15 Oct 2018 22:10:46 -0500 Subject: Add AOMDecoder to AgnosticDecoderModule --- dom/media/platforms/agnostic/AgnosticDecoderModule.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'dom/media/platforms/agnostic/AgnosticDecoderModule.cpp') diff --git a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp index 7bd75b7fe..4d4a90bd4 100644 --- a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp +++ b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp @@ -12,6 +12,10 @@ #include "WAVDecoder.h" #include "TheoraDecoder.h" +#ifdef MOZ_AV1 +#include "AOMDecoder.h" +#endif + namespace mozilla { bool @@ -20,6 +24,9 @@ AgnosticDecoderModule::SupportsMimeType(const nsACString& aMimeType, { bool supports = VPXDecoder::IsVPX(aMimeType) || +#ifdef MOZ_AV1 + AOMDecoder::IsAV1(aMimeType) || +#endif OpusDataDecoder::IsOpus(aMimeType) || VorbisDataDecoder::IsVorbis(aMimeType) || WaveDataDecoder::IsWave(aMimeType) || @@ -36,7 +43,13 @@ AgnosticDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams) 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); } -- cgit v1.2.3 From 6ddf66542bfbc90056ca86023da7bdefcec31aa8 Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 20 Oct 2018 08:24:28 -0500 Subject: Put AV1 codec behind a pref Disabled by default. --- dom/media/platforms/agnostic/AgnosticDecoderModule.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dom/media/platforms/agnostic/AgnosticDecoderModule.cpp') diff --git a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp index 4d4a90bd4..51ca4e9de 100644 --- a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp +++ b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AgnosticDecoderModule.h" +#include "MediaPrefs.h" #include "mozilla/Logging.h" #include "OpusDecoder.h" #include "VorbisDecoder.h" @@ -25,7 +26,9 @@ AgnosticDecoderModule::SupportsMimeType(const nsACString& aMimeType, bool supports = VPXDecoder::IsVPX(aMimeType) || #ifdef MOZ_AV1 - AOMDecoder::IsAV1(aMimeType) || + if (MediaPrefs::AV1Enabled()) { + supports |= AOMDecoder::IsAV1(aMimeType); + } #endif OpusDataDecoder::IsOpus(aMimeType) || VorbisDataDecoder::IsVorbis(aMimeType) || @@ -45,7 +48,8 @@ AgnosticDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams) m = new VPXDecoder(aParams); } #ifdef MOZ_AV1 - else if (AOMDecoder::IsAV1(aParams.mConfig.mMimeType)) { + else if (AOMDecoder::IsAV1(aParams.mConfig.mMimeType) && + MediaPrefs::AV1Enabled()) { m = new AOMDecoder(aParams); } #endif -- cgit v1.2.3 From e5b30fc95e191a50da4b8735aaf52baa8d384a0e Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 20 Oct 2018 14:49:17 -0500 Subject: Fix canPlayType/isTypeSupported for AV1 content --- dom/media/platforms/agnostic/AgnosticDecoderModule.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dom/media/platforms/agnostic/AgnosticDecoderModule.cpp') diff --git a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp index 51ca4e9de..cf5ed3d22 100644 --- a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp +++ b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp @@ -25,15 +25,15 @@ AgnosticDecoderModule::SupportsMimeType(const nsACString& aMimeType, { bool supports = VPXDecoder::IsVPX(aMimeType) || + OpusDataDecoder::IsOpus(aMimeType) || + VorbisDataDecoder::IsVorbis(aMimeType) || + WaveDataDecoder::IsWave(aMimeType) || + TheoraDecoder::IsTheora(aMimeType); #ifdef MOZ_AV1 if (MediaPrefs::AV1Enabled()) { supports |= 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; -- cgit v1.2.3