Bug 1445683 - Updates to AOMDecoder; r=jya

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.

MozReview-Commit-ID: GuTvnPkR1Er

--HG--
extra : rebase_source : 1f0ce4367b38023408c65e05187251ac0a0020f3
This commit is contained in:
Dan Minor 2018-04-23 16:03:27 -04:00
Родитель b0db8f0d4c
Коммит e1fef53faf
1 изменённых файлов: 3 добавлений и 10 удалений

Просмотреть файл

@ -77,6 +77,7 @@ InitContext(AOMDecoder& aAOMDecoder,
PodZero(&config); PodZero(&config);
config.threads = decode_threads; config.threads = decode_threads;
config.w = config.h = 0; // set after decode config.w = config.h = 0; // set after decode
config.allow_lowbitdepth = true;
aom_codec_flags_t flags = 0; aom_codec_flags_t flags = 0;
@ -154,7 +155,6 @@ highbd_img_downshift(aom_image_t *dst, aom_image_t *src, int down_shift) {
case AOM_IMG_FMT_I420: case AOM_IMG_FMT_I420:
case AOM_IMG_FMT_I422: case AOM_IMG_FMT_I422:
case AOM_IMG_FMT_I444: case AOM_IMG_FMT_I444:
case AOM_IMG_FMT_I440:
break; break;
default: default:
return AOM_CODEC_INVALID_PARAM; return AOM_CODEC_INVALID_PARAM;
@ -163,7 +163,6 @@ highbd_img_downshift(aom_image_t *dst, aom_image_t *src, int down_shift) {
case AOM_IMG_FMT_I42016: case AOM_IMG_FMT_I42016:
case AOM_IMG_FMT_I42216: case AOM_IMG_FMT_I42216:
case AOM_IMG_FMT_I44416: case AOM_IMG_FMT_I44416:
case AOM_IMG_FMT_I44016:
break; break;
default: default:
// We don't support anything that's not 16 bit // We don't support anything that's not 16 bit
@ -203,7 +202,7 @@ AOMDecoder::ProcessDecode(MediaRawData* aSample)
"AOM Decode Keyframe error sample->mKeyframe and si.si_kf out of sync"); "AOM Decode Keyframe error sample->mKeyframe and si.si_kf out of sync");
#endif #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_RESULT(r, "Decode error!"); LOG_RESULT(r, "Decode error!");
return DecodePromise::CreateAndReject( return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
@ -345,13 +344,7 @@ AOMDecoder::IsAV1(const nsACString& aMimeType)
bool bool
AOMDecoder::IsSupportedCodec(const nsAString& aCodecType) AOMDecoder::IsSupportedCodec(const nsAString& aCodecType)
{ {
// While AV1 is under development, we describe support return aCodecType.EqualsLiteral("av1");
// 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);
} }
/* static */ /* static */