Audacity 3.2.0
Macros | Functions
DynamicLibraryHelpers.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GET_SYMBOL(name)   (lib.HasSymbol(#name) ? functions.name = reinterpret_cast<decltype(functions.name)>(lib.GetSymbol(#name)) : functions.name = nullptr)
 Does not require the named function to be found in the library. More...
 
#define RESOLVE(name)   if (nullptr == GET_SYMBOL(name)) return false
 Requires the named function to be found in the library, else load fails. More...
 

Functions

bool GetAVVersion (const wxDynamicLibrary &lib, const char *name, FFMPegVersion &version)
 

Macro Definition Documentation

◆ GET_SYMBOL

#define GET_SYMBOL (   name)    (lib.HasSymbol(#name) ? functions.name = reinterpret_cast<decltype(functions.name)>(lib.GetSymbol(#name)) : functions.name = nullptr)

Does not require the named function to be found in the library.

Definition at line 17 of file DynamicLibraryHelpers.h.

◆ RESOLVE

#define RESOLVE (   name)    if (nullptr == GET_SYMBOL(name)) return false

Requires the named function to be found in the library, else load fails.

Definition at line 19 of file DynamicLibraryHelpers.h.

Function Documentation

◆ GetAVVersion()

bool GetAVVersion ( const wxDynamicLibrary &  lib,
const char *  name,
FFMPegVersion version 
)

Definition at line 19 of file DynamicLibraryHelpers.cpp.

21{
22 GetVersionFn versionFn = reinterpret_cast<GetVersionFn>(lib.GetSymbol(name));
23
24 if (nullptr == versionFn)
25 return false;
26
27 const unsigned fullVersion = versionFn();
28
29 version.Major = (fullVersion >> 16) & 0xFF;
30 version.Minor = (fullVersion >> 8) & 0xFF;
31 version.Micro = fullVersion & 0xFF;
32
33 return true;
34}
unsigned(*)() GetVersionFn
wxString name
Definition: TagsEditor.cpp:166
unsigned Major
Definition: FFmpegTypes.h:169
unsigned Micro
Definition: FFmpegTypes.h:171
unsigned Minor
Definition: FFmpegTypes.h:170

References FFMPegVersion::Major, FFMPegVersion::Micro, FFMPegVersion::Minor, and name.

Referenced by LoadAVCodecFunctions(), LoadAVFormatFunctions(), and LoadAVUtilFunctions().

Here is the caller graph for this function: