From ee1300453eb6e6d32962476351cf4e0391e8b4c4 Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 22:11:39 -0500 Subject: Updates to AOMDecoder for aom v1.0.0 This reflects the API changes to the aom_codec_decode function and the removal of I440. It also sets allow_lowbitdepth to give proper support for 8 bit video, and removes the git version from the mime type. --- dom/media/platforms/agnostic/AOMDecoder.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'dom') diff --git a/dom/media/platforms/agnostic/AOMDecoder.cpp b/dom/media/platforms/agnostic/AOMDecoder.cpp index 9999aac8f..d4ce299b4 100644 --- a/dom/media/platforms/agnostic/AOMDecoder.cpp +++ b/dom/media/platforms/agnostic/AOMDecoder.cpp @@ -62,6 +62,7 @@ AOMDecoder::Init() PodZero(&config); config.threads = decode_threads; config.w = config.h = 0; // set after decode + config.allow_lowbitdepth = true; aom_codec_flags_t flags = 0; @@ -101,7 +102,6 @@ highbd_img_downshift(aom_image_t *dst, aom_image_t *src, int down_shift) { case AOM_IMG_FMT_I420: case AOM_IMG_FMT_I422: case AOM_IMG_FMT_I444: - case AOM_IMG_FMT_I440: break; default: return AOM_CODEC_INVALID_PARAM; @@ -110,7 +110,6 @@ highbd_img_downshift(aom_image_t *dst, aom_image_t *src, int down_shift) { case AOM_IMG_FMT_I42016: case AOM_IMG_FMT_I42216: case AOM_IMG_FMT_I44416: - case AOM_IMG_FMT_I44016: break; default: // We don't support anything that's not 16 bit @@ -150,7 +149,7 @@ AOMDecoder::DoDecode(MediaRawData* aSample) "AOM Decode Keyframe error sample->mKeyframe and si.si_kf out of sync"); #endif - if (aom_codec_err_t r = aom_codec_decode(&mCodec, aSample->Data(), aSample->Size(), nullptr, 0)) { + if (aom_codec_err_t r = aom_codec_decode(&mCodec, aSample->Data(), aSample->Size(), nullptr)) { LOG("AOM Decode error: %s", aom_codec_err_to_string(r)); return MediaResult( NS_ERROR_DOM_MEDIA_DECODE_ERR, @@ -305,13 +304,7 @@ AOMDecoder::IsAV1(const nsACString& aMimeType) 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("d14c5bb4f336ef1842046089849dee4a301fbbf0"); - return aCodecType.EqualsLiteral("av1") || - aCodecType.Equals(version); + return aCodecType.EqualsLiteral("av1"); } /* static */ -- cgit v1.2.3