Issue #2311 - Part 3 - Add accessor for ffvpx real DFT functions

This commit is contained in:
trav90 2023-09-20 13:49:59 -05:00 committed by roytam1
commit 0e796b1dcd
4 changed files with 35 additions and 0 deletions

View file

@ -48,6 +48,7 @@ FFVPXRuntimeLinker::Init()
return sLinkStatus == LinkStatus_SUCCEEDED;
}
MOZ_ASSERT(NS_IsMainThread());
sLinkStatus = LinkStatus_FAILED;
// We retrieve the path of the lgpllibs library as this is where mozavcodec
@ -109,4 +110,20 @@ FFVPXRuntimeLinker::CreateDecoderModule()
return FFmpegDecoderModule<FFVPX_VERSION>::Create(&sFFVPXLib);
}
/* static */ void
FFVPXRuntimeLinker::GetRDFTFuncs(FFmpegRDFTFuncs* aOutFuncs)
{
MOZ_ASSERT(sLinkStatus != LinkStatus_INIT);
if (sFFVPXLib.av_rdft_init &&
sFFVPXLib.av_rdft_calc &&
sFFVPXLib.av_rdft_end) {
aOutFuncs->init = sFFVPXLib.av_rdft_init;
aOutFuncs->calc = sFFVPXLib.av_rdft_calc;
aOutFuncs->end = sFFVPXLib.av_rdft_end;
} else {
NS_WARNING("RDFT functions expected but not found");
*aOutFuncs = FFmpegRDFTFuncs(); // zero
}
}
} // namespace mozilla