Audacity 3.2.0
DynamicLibraryHelpers.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 DynamicLibraryHelpers.cpp
6
7 Dmitry Vedenko
8
9**********************************************************************/
10
12
13#include <wx/dynlib.h>
14
15#include "FFmpegTypes.h"
16
17using GetVersionFn = unsigned (*)();
18
20 const wxDynamicLibrary& lib, const char* name, FFMPegVersion& version)
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}
const TranslatableString name
Definition: Distortion.cpp:76
unsigned(*)() GetVersionFn
bool GetAVVersion(const wxDynamicLibrary &lib, const char *name, FFMPegVersion &version)
unsigned Major
Definition: FFmpegTypes.h:169
unsigned Micro
Definition: FFmpegTypes.h:171
unsigned Minor
Definition: FFmpegTypes.h:170