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.<git-commit-id> so test sites can verify playback support of particular encodings while the av1 bitstream is under development.
This commit is contained in:
trav90 2018-10-17 05:54:22 -05:00 committed by Roy Tam
commit 1c8af26369
3 changed files with 24 additions and 0 deletions

View file

@ -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<const uint8_t> aBuffer) {