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/platforms/agnostic/AOMDecoder.cpp | 13 +++++++++++++ dom/media/platforms/agnostic/AOMDecoder.h | 3 +++ 2 files changed, 16 insertions(+) (limited to 'dom/media/platforms/agnostic') diff --git a/dom/media/platforms/agnostic/AOMDecoder.cpp b/dom/media/platforms/agnostic/AOMDecoder.cpp index 3ab5004e3..d1b45cf7f 100644 --- a/dom/media/platforms/agnostic/AOMDecoder.cpp +++ b/dom/media/platforms/agnostic/AOMDecoder.cpp @@ -210,6 +210,19 @@ AOMDecoder::IsAV1(const nsACString& aMimeType) || aMimeType.EqualsLiteral("video/av1"); } +/* static */ +bool +AOMDecoder::IsSupportedCodec(const nsAString& aCodecType) +{ + // While AV1 is under development, we describe support + // for a specific aom commit hash so sites can check + // compatibility. + auto version = NS_ConvertASCIItoUTF16("av1.experimental."); + version.AppendLiteral("4d668d7feb1f8abd809d1bca0418570a7f142a36"); + return aCodecType.EqualsLiteral("av1") || + aCodecType.Equals(version); +} + /* static */ bool AOMDecoder::IsKeyframe(Span aBuffer) { diff --git a/dom/media/platforms/agnostic/AOMDecoder.h b/dom/media/platforms/agnostic/AOMDecoder.h index ec6b1f95a..1e2b76c2c 100644 --- a/dom/media/platforms/agnostic/AOMDecoder.h +++ b/dom/media/platforms/agnostic/AOMDecoder.h @@ -34,6 +34,9 @@ public: // by our demuxers to identify AV1 streams. static bool IsAV1(const nsACString& aMimeType); + // Return true if aCodecType is a supported codec description. + static bool IsSupportedCodec(const nsAString& aCodecType); + // Return true if a sample is a keyframe. static bool IsKeyframe(Span aBuffer); -- cgit v1.2.3