[FFmpeg-devel] [PATCH v6] avcodec/mfenc: Dynamically load MFPlat.DLL

Timo Rothenpieler timo at rothenpieler.org
Thu May 26 00:16:36 EEST 2022


On 25/05/2022 22:51, Martin Storsjö wrote:
> On Wed, 25 May 2022, Trystan Mata wrote:
> 
>> Changes since the v5:
>>  - Library handle and function pointer are back in MFContext.
>>    - MFTEnumEx has been move to it too.
>>  - dlopen and dlclose are preferred.
>>
>> This will avoid multiple look up on one context. And each context will
>> have his own library handle.
> 
> Thanks, this looks mostly good to me!
> 
> In testing of it, I noted that you still need to link against -lmfuuid 
> when building with MSVC (but in mingw, those UUIDs are defined inline in 
> headers I think).
> 
> Additionally, I realized I do prefer to keep using plain LoadLibraryA 
> and FreeLibrary instead of using the wrapper, as this file is all quite 
> Windows specific code; using the direct Windows APIs makes it clearer 
> what's going on.

There is quite a bit of work put into the wrapper to eliminate a bunch 
of common attack vectors with LoadLibrary and pitfalls with it on Windows.
So I'd strongly recommend to use it.


More information about the ffmpeg-devel mailing list