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

Martin Storsjö martin at martin.st
Wed May 25 23:51:45 EEST 2022


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.

Finally, I removed the extra "" in the GetProcAddress call - I don't 
remember if you ever responded to why that was there.

With that, this builds fine with MSVC for desktop and for UWP, and with 
mingw for desktop.

As the patch seemed fine otherwise, I went ahead and pushed it. Thanks!

// Martin



More information about the ffmpeg-devel mailing list