From 0cc51bc106250988cc3b89cb5d743a5af52cd35a Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 17 Oct 2018 05:54:22 -0500 Subject: Add av1 to MediaSource.isTypeSupported When av1 video playback is enabled, declare it as supported in the webm container in MediaSource.IsTypeSupported. Also support special mime types of the form video/webm; codecs=vp9.experimental. so test sites can verify playback support of particular encodings while the av1 bitstream is under development. --- dom/media/webm/WebMDecoder.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index b41de6d40..d721a8ccc 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -5,6 +5,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/Preferences.h" +#ifdef MOZ_AV1 +#include "AOMDecoder.h" +#endif #include "MediaDecoderStateMachine.h" #include "WebMDemuxer.h" #include "WebMDecoder.h" @@ -65,6 +68,11 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, continue; } +#ifdef MOZ_AV1 + if (isVideo && AOMDecoder::IsSupportedCodec(codec)) { + continue; + } +#endif // Some unsupported codec. return false; } -- cgit v1.2.3 From 4b5e2295672e2858d0e09a458f049772930db825 Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 17 Oct 2018 22:40:32 -0500 Subject: Fix typo (build bustage) --- dom/media/webm/WebMDecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index d721a8ccc..32feda6c0 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -69,7 +69,7 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, continue; } #ifdef MOZ_AV1 - if (isVideo && AOMDecoder::IsSupportedCodec(codec)) { + if (isWebMVideo && AOMDecoder::IsSupportedCodec(codec)) { continue; } #endif -- 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/webm/WebMDecoder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index 32feda6c0..5a32793ac 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -8,6 +8,7 @@ #ifdef MOZ_AV1 #include "AOMDecoder.h" #endif +#include "MediaPrefs.h" #include "MediaDecoderStateMachine.h" #include "WebMDemuxer.h" #include "WebMDecoder.h" @@ -69,7 +70,8 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, continue; } #ifdef MOZ_AV1 - if (isWebMVideo && AOMDecoder::IsSupportedCodec(codec)) { + if (isWebMVideo && MediaPrefs::AV1Enabled() && + AOMDecoder::IsSupportedCodec(codec)) { continue; } #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/webm/WebMDecoder.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index 5a32793ac..9575d6e42 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -70,8 +70,7 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, continue; } #ifdef MOZ_AV1 - if (isWebMVideo && MediaPrefs::AV1Enabled() && - AOMDecoder::IsSupportedCodec(codec)) { + if (MediaPrefs::AV1Enabled() && IsAV1CodecString(codec)) { continue; } #endif -- cgit v1.2.3 From 18f9b185b67120ba88f5e643b7413ca06c497383 Mon Sep 17 00:00:00 2001 From: Jeroen Vreeken Date: Wed, 10 Jul 2019 11:05:38 +0200 Subject: Allow matroska mime types for video element and MSE Allow avc (h.264) content in matroska/webm containers --- dom/media/webm/WebMDecoder.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index 9575d6e42..37e1e4a33 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -41,7 +41,7 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, } const bool isWebMAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/webm"); - const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm"); + const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm") || aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ; if (!isWebMAudio && !isWebMVideo) { return false; } @@ -74,6 +74,11 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, continue; } #endif + + if (IsH264CodecString(codec)) { + continue; + } + // Some unsupported codec. return false; } -- cgit v1.2.3 From 31addeaac8841867008699478ef55e1c1b3d68a7 Mon Sep 17 00:00:00 2001 From: Jeroen Vreeken Date: Thu, 11 Jul 2019 16:36:22 +0200 Subject: Make matroska mime type checking more consistent. --- dom/media/webm/WebMDecoder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index 37e1e4a33..5cb943742 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -41,8 +41,11 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, } const bool isWebMAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/webm"); - const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm") || aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ; - if (!isWebMAudio && !isWebMVideo) { + const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm"); + const bool isMatroskaAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/x-matroska") ; + const bool isMatroskaVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ; + + if (!isWebMAudio && !isWebMVideo && !isMatroskaAudio && !isMatroskaVideo) { return false; } @@ -63,7 +66,7 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, } // Note: Only accept VP8/VP9 in a video content type, not in an audio // content type. - if (isWebMVideo && + if ((isWebMVideo || isMatroskaVideo) && (codec.EqualsLiteral("vp8") || codec.EqualsLiteral("vp8.0") || codec.EqualsLiteral("vp9") || codec.EqualsLiteral("vp9.0"))) { -- cgit v1.2.3 From 6b6aa59ffc97ac76b4429db38eedac8474f5fda7 Mon Sep 17 00:00:00 2001 From: Jeroen Vreeken Date: Thu, 18 Jul 2019 11:00:46 +0200 Subject: Alow AAC audio codec data in matroska/webm streams. Allow CRC32 elements in matroska cluster elements. --- dom/media/webm/WebMDecoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dom/media/webm/WebMDecoder.cpp') diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index 5cb943742..cbe9ffdb7 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -82,6 +82,10 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, continue; } + if (IsAACCodecString(codec)) { + continue; + } + // Some unsupported codec. return false; } -- cgit v1.2.3