Audacity 3.2.0
Classes | Macros | Functions | Variables
FFmpegFunctions.cpp File Reference
#include "FFmpegFunctions.h"
#include <wx/string.h>
#include <wx/dynlib.h>
#include <wx/log.h>
#include <wx/utils.h>
#include <wx/buffer.h>
#include <wx/msw/registry.h>
#include <windows.h>
#include <psapi.h>
#include "Prefs.h"
#include "FileNames.h"
#include "impl/avutil/AVUtilFunctionsLoader.h"
#include "impl/avcodec/AVCodecFunctionsLoader.h"
#include "impl/avformat/AVFormatFunctionsLoader.h"
#include "impl/FFmpegAPIResolver.h"
#include "impl/FFmpegLog.h"
Include dependency graph for FFmpegFunctions.cpp:

Go to the source code of this file.

Classes

struct  EnvSetter
 
struct  FFmpegFunctions::Private
 

Macros

#define WIN32_LEAN_AND_MEAN
 

Functions

void * GetSymbolFromProcess (const char *name)
 
std::vector< wxString > BuildAVFormatPaths (int version)
 

Variables

StringSetting AVFormatPath { L"/FFmpeg/FFmpegLibPath", L"" }
 

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 22 of file FFmpegFunctions.cpp.

Function Documentation

◆ BuildAVFormatPaths()

std::vector< wxString > BuildAVFormatPaths ( int  version)

Definition at line 126 of file FFmpegFunctions.cpp.

127{
128 return {
129#if defined(__WXMSW__)
130 wxString::Format("avformat-%d.dll", version),
131#elif defined(__WXMAC__)
132 wxString::Format("ffmpeg.%d.64bit.dylib", version),
133 wxString::Format("libavformat.%d.dylib", version),
134#else
135 wxString::Format("libavformat.so.%d", version)
136#endif
137};
138}

Referenced by FFmpegFunctions::Load().

Here is the caller graph for this function:

◆ GetSymbolFromProcess()

void * GetSymbolFromProcess ( const char *  name)

Definition at line 39 of file FFmpegFunctions.cpp.

40{
41#if defined(__WXMSW__)
42 std::vector<HMODULE> handles(256);
43
44 DWORD neededMemory;
45
46 if (!EnumProcessModules(
47 GetCurrentProcess(), handles.data(), sizeof(HMODULE) * handles.size(),
48 &neededMemory))
49 {
50 return nullptr;
51 }
52
53 const int modulesCount = neededMemory / sizeof(HMODULE);
54
55 if (modulesCount > handles.size())
56 {
57 handles.resize(modulesCount);
58
59 if (!EnumProcessModules(
60 GetCurrentProcess(), handles.data(),
61 sizeof(HMODULE) * handles.size(), &neededMemory))
62 {
63 return nullptr;
64 }
65 }
66
67 for (HMODULE handle : handles)
68 {
69 void* addr = GetProcAddress(handle, name);
70
71 if (addr != nullptr)
72 return addr;
73 }
74
75 return nullptr;
76#else
77 return dlsym(RTLD_DEFAULT, name);
78#endif
79}
const TranslatableString name
Definition: Distortion.cpp:82

References name.

Referenced by FFmpegFunctions::Private::LibraryWithSymbol().

Here is the caller graph for this function:

Variable Documentation

◆ AVFormatPath

StringSetting AVFormatPath { L"/FFmpeg/FFmpegLibPath", L"" }

Definition at line 298 of file FFmpegFunctions.cpp.

Referenced by FindFFmpegLibs(), and FFmpegFunctions::GetSearchPaths().