Audacity  3.0.3
Classes | Functions | Variables
FFmpegFunctions.cpp File Reference
#include "FFmpegFunctions.h"
#include <wx/string.h>
#include <wx/dynlib.h>
#include <wx/log.h>
#include <dlfcn.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
 

Functions

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

Variables

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

Function Documentation

◆ BuildAVFormatPaths()

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

Definition at line 125 of file FFmpegFunctions.cpp.

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

Referenced by FFmpegFunctions::Load().

Here is the caller graph for this function:

◆ GetSymbolFromProcess()

void* GetSymbolFromProcess ( const char *  name)

Definition at line 38 of file FFmpegFunctions.cpp.

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

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 296 of file FFmpegFunctions.cpp.

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

name
const TranslatableString name
Definition: Distortion.cpp:98