Audacity  3.0.3
Public Member Functions | Public Attributes | Private Attributes | List of all members
FFmpegLibs Class Reference

Class used to dynamically load FFmpeg libraries. More...

#include <FFmpeg.h>

Collaboration diagram for FFmpegLibs:
[legend]

Public Member Functions

 FFmpegLibs ()
 
 ~FFmpegLibs ()
 
bool FindLibs (wxWindow *parent)
 
bool LoadLibs (wxWindow *parent, bool showerr)
 
bool ValidLibsLoaded ()
 
bool InitLibs (const wxString &libpath_codec, bool showerr)
 
void FreeLibs ()
 ! Frees (unloads) loaded libraries More...
 
wxString GetLibraryVersion ()
 
FileNames::FileTypes GetLibraryTypes ()
 
wxString GetLibAVFormatPath ()
 
wxString GetLibAVFormatName ()
 
wxString GetLibAVCodecName ()
 
wxString GetLibAVUtilName ()
 

Public Attributes

int refcount
 

Private Attributes

wxString mLibAVFormatPath
 ! Stored path to libavformat library More...
 
wxString mAVCodecVersion
 ! Stored library version More...
 
wxString mAVFormatVersion
 
wxString mAVUtilVersion
 
std::unique_ptr< wxDynamicLibrary > avformat
 ! wx interfaces for dynamic libraries More...
 
std::unique_ptr< wxDynamicLibrary > avcodec
 
std::unique_ptr< wxDynamicLibrary > avutil
 
bool mLibsLoaded
 ! true if libraries are loaded, false otherwise More...
 

Detailed Description

Class used to dynamically load FFmpeg libraries.

Manages liabv* libraries - loads/unloads libraries, imports symbols. Only one instance of this class should exist at each given moment. function definitions are taken from FFmpeg headers manually, eventually (at next major FFmpeg version change) we'll have to review them and update if necessary.

Definition at line 204 of file FFmpeg.h.

Constructor & Destructor Documentation

◆ FFmpegLibs()

FFmpegLibs::FFmpegLibs ( )

Definition at line 629 of file FFmpeg.cpp.

630 {
631  mLibsLoaded = false;
632  refcount = 1;
633  if (gPrefs) {
634  mLibAVFormatPath = gPrefs->Read(wxT("/FFmpeg/FFmpegLibPath"), wxT(""));
635  }
636 
637 }

References gPrefs.

◆ ~FFmpegLibs()

FFmpegLibs::~FFmpegLibs ( )

Definition at line 639 of file FFmpeg.cpp.

640 {
641  FreeLibs();
642 };

References FreeLibs().

Here is the call graph for this function:

Member Function Documentation

◆ FindLibs()

bool FFmpegLibs::FindLibs ( wxWindow *  parent)

! Finds libav* libraries

Returns
true if found, false if not found

Definition at line 644 of file FFmpeg.cpp.

645 {
646  wxString path;
647  wxString name;
648 
649  // If we're looking for the lib, use the standard name, as the
650  // configured name is not found.
652  wxLogMessage(wxT("Looking for FFmpeg libraries..."));
653  if (!mLibAVFormatPath.empty()) {
654  wxLogMessage(wxT("mLibAVFormatPath ('%s') is not empty."), mLibAVFormatPath);
655  const wxFileName fn{ mLibAVFormatPath };
656  path = fn.GetPath();
657  }
658  else {
659  path = GetLibAVFormatPath();
660  wxLogMessage(wxT("mLibAVFormatPath is empty, starting with path '%s', name '%s'."),
661  path, name);
662  }
663 
664  FindFFmpegDialog fd(parent,
665  path,
666  name,
667  GetLibraryTypes());
668 
669  if (fd.ShowModal() == wxID_CANCEL) {
670  wxLogMessage(wxT("User canceled the dialog. Failed to find FFmpeg libraries."));
671  return false;
672  }
673 
674  path = fd.GetLibPath();
675 
676  wxLogMessage(wxT("User-specified path = '%s'"), path);
677  if (!::wxFileExists(path)) {
678  wxLogError(wxT("User-specified file does not exist. Failed to find FFmpeg libraries."));
679  return false;
680  }
681  wxLogMessage(wxT("User-specified FFmpeg file exists. Success."));
682  mLibAVFormatPath = path;
683  gPrefs->Write(wxT("/FFmpeg/FFmpegLibPath"), mLibAVFormatPath);
684  gPrefs->Flush();
685 
686  return true;
687 }

References FileConfig::Flush(), fn, GetLibAVFormatName(), GetLibAVFormatPath(), FindFFmpegDialog::GetLibPath(), GetLibraryTypes(), gPrefs, mLibAVFormatPath, and name.

Referenced by ExportFFmpeg::CheckFileName(), and ExportFFmpegCustomOptions::OnOpen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeLibs()

void FFmpegLibs::FreeLibs ( )

! Frees (unloads) loaded libraries

Definition at line 1016 of file FFmpeg.cpp.

1017 {
1018  avformat.reset();
1019  avcodec.reset();
1020  avutil.reset();
1021  mLibsLoaded = false;
1022  return;
1023 }

References avcodec, avformat, avutil, and mLibsLoaded.

Referenced by ExportFFmpeg::CheckFileName(), InitLibs(), LoadLibs(), ExportFFmpegCustomOptions::OnOpen(), and ~FFmpegLibs().

Here is the caller graph for this function:

◆ GetLibAVCodecName()

wxString FFmpegLibs::GetLibAVCodecName ( )
inline

Definition at line 334 of file FFmpeg.h.

335  {
336  return (wxT("libavcodec.so.") wxT(AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)));
337  }

Referenced by InitLibs().

Here is the caller graph for this function:

◆ GetLibAVFormatName()

wxString FFmpegLibs::GetLibAVFormatName ( )
inline

Definition at line 329 of file FFmpeg.h.

330  {
331  return (wxT("libavformat.so.") wxT(AV_STRINGIFY(LIBAVFORMAT_VERSION_MAJOR)));
332  }

Referenced by FindLibs(), and LoadLibs().

Here is the caller graph for this function:

◆ GetLibAVFormatPath()

wxString FFmpegLibs::GetLibAVFormatPath ( )
inline

Definition at line 324 of file FFmpeg.h.

325  {
326  return wxT("");
327  }

Referenced by FindLibs(), and LoadLibs().

Here is the caller graph for this function:

◆ GetLibAVUtilName()

wxString FFmpegLibs::GetLibAVUtilName ( )
inline

Definition at line 339 of file FFmpeg.h.

340  {
341  return (wxT("libavutil.so.") wxT(AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR)));
342  }

Referenced by InitLibs().

Here is the caller graph for this function:

◆ GetLibraryTypes()

FileNames::FileTypes FFmpegLibs::GetLibraryTypes ( )
inline

Definition at line 315 of file FFmpeg.h.

316  {
317  return {
318  { XO("Only libavformat.so"), { wxT("libavformat*.so*") } },
321  };
322  }

References FileNames::AllFiles, FileNames::DynamicLibraries, and XO.

Referenced by FindLibs().

Here is the caller graph for this function:

◆ GetLibraryVersion()

wxString FFmpegLibs::GetLibraryVersion ( )
inline

! Returns library version as string

Returns
libavformat library version or empty string?

Definition at line 233 of file FFmpeg.h.

234  {
235  return wxString::Format(wxT("F(%s),C(%s),U(%s)"),mAVFormatVersion,mAVCodecVersion,mAVUtilVersion);
236  }

References mAVCodecVersion, mAVFormatVersion, and mAVUtilVersion.

◆ InitLibs()

bool FFmpegLibs::InitLibs ( const wxString &  libpath_codec,
bool  showerr 
)

! Initializes the libraries. Call after LoadLibs (when ValidLibsLoaded returns true)

Parameters
libpath_codec- full file path to the libavformat library
showerr- controls whether or not to show an error dialog if libraries cannot be loaded
Returns
true if initialization completed without errors, false otherwise do not call (it is called by FindLibs automatically)

Definition at line 771 of file FFmpeg.cpp.

772 {
773 #if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
774  FreeLibs();
775 
776 #if defined(__WXMSW__)
777  wxString oldpath;
778  wxString syspath;
779  bool pathExisted = false;
780 
781  // Return PATH to normal
782  auto restorePath = finally([&]()
783  {
784  if (oldpath != syspath)
785  {
786  if (pathExisted)
787  {
788  wxLogMessage(wxT("Returning PATH to previous setting: %s"), oldpath);
789  wxSetEnv(wxT("PATH"), oldpath);
790  }
791  else
792  {
793  wxLogMessage(wxT("Removing PATH environment variable"));
794  wxUnsetEnv(wxT("PATH"));
795  }
796  }
797  });
798 
799  wxLogMessage(wxT("Looking up PATH environment variable..."));
800  // First take PATH environment variable and store its content.
801  pathExisted = wxGetEnv(wxT("PATH"),&syspath);
802  oldpath = syspath;
803 
804  wxLogMessage(wxT("PATH = '%s'"), syspath);
805 
806  const wxString &fmtdir{ wxPathOnly(libpath_format) };
807  wxString fmtdirsc = fmtdir + wxT(";");
808  wxString scfmtdir = wxT(";") + fmtdir;
809 
810  if (syspath.Left(1) == wxT(';'))
811  {
812  wxLogMessage(wxT("Temporarily prepending '%s' to PATH..."), fmtdir);
813  syspath.Prepend(scfmtdir);
814  }
815  else
816  {
817  wxLogMessage(wxT("Temporarily prepending '%s' to PATH..."), scfmtdir);
818  syspath.Prepend(fmtdirsc);
819  }
820 
821  if (!wxSetEnv(wxT("PATH"),syspath))
822  {
823  wxLogSysError(wxT("Setting PATH via wxSetEnv('%s') failed."), syspath);
824  }
825 #endif
826 
827  //Load libavformat
828  // Initially we don't know where are the avcodec and avutl libs
829  wxDynamicLibrary *codec = NULL;
830  wxDynamicLibrary *util = NULL;
831  wxFileName avcodec_filename;
832  wxFileName avutil_filename;
833  wxFileName name{ libpath_format };
834  wxString nameFull{name.GetFullPath()};
835  bool gotError = false;
836 
837  // Check for a monolithic avformat
838  avformat = std::make_unique<wxDynamicLibrary>();
839  wxLogMessage(wxT("Checking for monolithic avformat from '%s'."), nameFull);
840  gotError = !avformat->Load(nameFull, wxDL_LAZY);
841 
842  // Verify it really is monolithic
843  if (!gotError) {
844  avutil_filename = FileNames::PathFromAddr(avformat->GetSymbol(wxT("avutil_version")));
845  avcodec_filename = FileNames::PathFromAddr(avformat->GetSymbol(wxT("avcodec_version")));
846  if (avutil_filename.GetFullPath() == nameFull) {
847  if (avcodec_filename.GetFullPath() == nameFull) {
848  util = avformat.get();
849  codec = avformat.get();
850  }
851  }
852  if (!avcodec_filename.FileExists()) {
853  avcodec_filename = GetLibAVCodecName();
854  }
855  if (!avutil_filename.FileExists()) {
856  avutil_filename = GetLibAVUtilName();
857  }
858 
859  if (util == NULL || codec == NULL) {
860  wxLogMessage(wxT("avformat not monolithic"));
861  avformat->Unload();
862  util = NULL;
863  codec = NULL;
864  }
865  else {
866  wxLogMessage(wxT("avformat is monolithic"));
867  }
868  }
869 
870  // The two wxFileNames don't change after this
871  const wxString avcodec_filename_full{ avcodec_filename.GetFullPath() };
872  const wxString avutil_filename_full{ avutil_filename.GetFullPath() };
873 
874  if (!util) {
875  util = (avutil = std::make_unique<wxDynamicLibrary>()).get();
876  wxLogMessage(wxT("Loading avutil from '%s'."), avutil_filename_full);
877  util->Load(avutil_filename_full, wxDL_LAZY);
878  }
879 
880  if (!codec) {
881  codec = (avcodec = std::make_unique<wxDynamicLibrary>()).get();
882  wxLogMessage(wxT("Loading avcodec from '%s'."), avcodec_filename_full);
883  codec->Load(avcodec_filename_full, wxDL_LAZY);
884  }
885 
886  if (!avformat->IsLoaded()) {
887  name.SetFullName(libpath_format);
888  nameFull = name.GetFullPath();
889  wxLogMessage(wxT("Loading avformat from '%s'."), nameFull);
890  gotError = !avformat->Load(nameFull, wxDL_LAZY);
891  }
892 
893  if (gotError) {
894  wxLogError(wxT("Failed to load FFmpeg libraries."));
895  FreeLibs();
896  return false;
897  }
898 
899  // Show the actual libraries loaded
900  if (avutil) {
901  wxLogMessage(wxT("Actual avutil path %s"),
902  FileNames::PathFromAddr(avutil->GetSymbol(wxT("avutil_version"))));
903  }
904  if (avcodec) {
905  wxLogMessage(wxT("Actual avcodec path %s"),
906  FileNames::PathFromAddr(avcodec->GetSymbol(wxT("avcodec_version"))));
907  }
908  if (avformat) {
909  wxLogMessage(wxT("Actual avformat path %s"),
910  FileNames::PathFromAddr(avformat->GetSymbol(wxT("avformat_version"))));
911  }
912 
913  wxLogMessage(wxT("Importing symbols..."));
914  FFMPEG_INITDYN(avformat, av_register_all);
915  FFMPEG_INITDYN(avformat, avformat_find_stream_info);
916  FFMPEG_INITDYN(avformat, av_read_frame);
917  FFMPEG_INITDYN(avformat, av_seek_frame);
918  FFMPEG_INITDYN(avformat, avformat_close_input);
919  FFMPEG_INITDYN(avformat, avformat_write_header);
920  FFMPEG_INITDYN(avformat, av_interleaved_write_frame);
921  FFMPEG_INITDYN(avformat, av_oformat_next);
922  FFMPEG_INITDYN(avformat, avformat_new_stream);
923  FFMPEG_INITDYN(avformat, avformat_alloc_context);
924  FFMPEG_INITDYN(avformat, av_write_trailer);
925  FFMPEG_INITDYN(avformat, av_codec_get_tag);
926  FFMPEG_INITDYN(avformat, avformat_version);
927  FFMPEG_INITDYN(avformat, avformat_open_input);
928  FFMPEG_INITDYN(avformat, avio_size);
929  FFMPEG_INITDYN(avformat, avio_alloc_context);
930  FFMPEG_INITALT(avformat, av_guess_format, avformat, guess_format);
931  FFMPEG_INITDYN(avformat, avformat_free_context);
932 
933  FFMPEG_INITDYN(avcodec, av_init_packet);
934  FFMPEG_INITDYN(avcodec, av_free_packet);
935  FFMPEG_INITDYN(avcodec, avcodec_find_encoder);
936  FFMPEG_INITDYN(avcodec, avcodec_find_encoder_by_name);
937  FFMPEG_INITDYN(avcodec, avcodec_find_decoder);
938  FFMPEG_INITDYN(avcodec, avcodec_get_name);
939  FFMPEG_INITDYN(avcodec, avcodec_open2);
940  FFMPEG_INITDYN(avcodec, avcodec_decode_audio4);
941  FFMPEG_INITDYN(avcodec, avcodec_encode_audio2);
942  FFMPEG_INITDYN(avcodec, avcodec_close);
943  FFMPEG_INITDYN(avcodec, avcodec_register_all);
944  FFMPEG_INITDYN(avcodec, avcodec_version);
945  FFMPEG_INITDYN(avcodec, av_codec_next);
946  FFMPEG_INITDYN(avcodec, av_codec_is_encoder);
947  FFMPEG_INITDYN(avcodec, avcodec_fill_audio_frame);
948 
949  FFMPEG_INITDYN(avutil, av_free);
950  FFMPEG_INITDYN(avutil, av_dict_free);
951  FFMPEG_INITDYN(avutil, av_dict_get);
952  FFMPEG_INITDYN(avutil, av_dict_set);
953  FFMPEG_INITDYN(avutil, av_get_bytes_per_sample);
954  FFMPEG_INITDYN(avutil, av_log_set_callback);
955  FFMPEG_INITDYN(avutil, av_log_default_callback);
956  FFMPEG_INITDYN(avutil, av_fifo_alloc);
957  FFMPEG_INITDYN(avutil, av_fifo_generic_read);
958  FFMPEG_INITDYN(avutil, av_fifo_realloc2);
959  FFMPEG_INITDYN(avutil, av_fifo_free);
960  FFMPEG_INITDYN(avutil, av_fifo_size);
961  FFMPEG_INITDYN(avutil, av_malloc);
962  FFMPEG_INITDYN(avutil, av_fifo_generic_write);
963  // FFMPEG_INITDYN(avutil, av_freep);
964  FFMPEG_INITDYN(avutil, av_rescale_q);
965  FFMPEG_INITDYN(avutil, avutil_version);
966  FFMPEG_INITALT(avutil, av_frame_alloc, avcodec, avcodec_alloc_frame);
967  FFMPEG_INITALT(avutil, av_frame_free, avcodec, avcodec_free_frame);
968  FFMPEG_INITDYN(avutil, av_samples_get_buffer_size);
969  FFMPEG_INITDYN(avutil, av_get_default_channel_layout);
970  FFMPEG_INITDYN(avutil, av_strerror);
971 
972  wxLogMessage(wxT("All symbols loaded successfully. Initializing the library."));
973 #endif
974 
975  //FFmpeg initialization
976  avcodec_register_all();
977  av_register_all();
978 
979  wxLogMessage(wxT("Retrieving FFmpeg library version numbers:"));
980  int avfver = avformat_version();
981  int avcver = avcodec_version();
982  int avuver = avutil_version();
983  mAVCodecVersion = wxString::Format(wxT("%d.%d.%d"),avcver >> 16 & 0xFF, avcver >> 8 & 0xFF, avcver & 0xFF);
984  mAVFormatVersion = wxString::Format(wxT("%d.%d.%d"),avfver >> 16 & 0xFF, avfver >> 8 & 0xFF, avfver & 0xFF);
985  mAVUtilVersion = wxString::Format(wxT("%d.%d.%d"),avuver >> 16 & 0xFF, avuver >> 8 & 0xFF, avuver & 0xFF);
986 
987  wxLogMessage(wxT(" AVCodec version 0x%06x - %s (built against 0x%06x - %s)"),
988  avcver, mAVCodecVersion, LIBAVCODEC_VERSION_INT,
989  wxString::FromUTF8(AV_STRINGIFY(LIBAVCODEC_VERSION)));
990  wxLogMessage(wxT(" AVFormat version 0x%06x - %s (built against 0x%06x - %s)"),
991  avfver, mAVFormatVersion, LIBAVFORMAT_VERSION_INT,
992  wxString::FromUTF8(AV_STRINGIFY(LIBAVFORMAT_VERSION)));
993  wxLogMessage(wxT(" AVUtil version 0x%06x - %s (built against 0x%06x - %s)"),
994  avuver,mAVUtilVersion, LIBAVUTIL_VERSION_INT,
995  wxString::FromUTF8(AV_STRINGIFY(LIBAVUTIL_VERSION)));
996 
997  int avcverdiff = (avcver >> 16 & 0xFF) - (int)(LIBAVCODEC_VERSION_MAJOR);
998  int avfverdiff = (avfver >> 16 & 0xFF) - (int)(LIBAVFORMAT_VERSION_MAJOR);
999  int avuverdiff = (avuver >> 16 & 0xFF) - (int)(LIBAVUTIL_VERSION_MAJOR);
1000  if (avcverdiff != 0)
1001  wxLogError(wxT("AVCodec version mismatch = %d"), avcverdiff);
1002  if (avfverdiff != 0)
1003  wxLogError(wxT("AVFormat version mismatch = %d"), avfverdiff);
1004  if (avuverdiff != 0)
1005  wxLogError(wxT("AVUtil version mismatch = %d"), avuverdiff);
1006  //make sure that header and library major versions are the same
1007  if (avcverdiff != 0 || avfverdiff != 0 || avuverdiff != 0)
1008  {
1009  wxLogError(wxT("Version mismatch. FFmpeg libraries are unusable."));
1010  return false;
1011  }
1012 
1013  return true;
1014 }

References avcodec, avformat, avutil, FFMPEG_INITALT, FFMPEG_INITDYN, FreeLibs(), GetLibAVCodecName(), GetLibAVUtilName(), mAVCodecVersion, mAVFormatVersion, mAVUtilVersion, name, and FileNames::PathFromAddr().

Referenced by LoadLibs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadLibs()

bool FFmpegLibs::LoadLibs ( wxWindow *  parent,
bool  showerr 
)

! Loads libav* libraries

Parameters
showerr- controls whether or not to show an error dialog if libraries cannot be loaded
Returns
true if loaded, false if not loaded

Definition at line 689 of file FFmpeg.cpp.

690 {
691 #if defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
692  mLibsLoaded = InitLibs(wxEmptyString, showerr);
693  return mLibsLoaded;
694 #endif
695 
696  wxLogMessage(wxT("Trying to load FFmpeg libraries..."));
697  if (ValidLibsLoaded()) {
698  wxLogMessage(wxT("FFmpeg libraries are already loaded."));
699  FreeLibs();
700  }
701 
702  // First try loading it from a previously located path
703  if (!mLibAVFormatPath.empty()) {
704  wxLogMessage(wxT("mLibAVFormatPath ('%s') is not empty. Loading from it."),mLibAVFormatPath);
706  }
707 
708  // If not successful, try loading it from default path
709  if (!mLibsLoaded && !GetLibAVFormatPath().empty()) {
710  const wxFileName fn{ GetLibAVFormatPath(), GetLibAVFormatName() };
711  wxString path = fn.GetFullPath();
712  wxLogMessage(wxT("Trying to load FFmpeg libraries from default path, '%s'."), path);
713  mLibsLoaded = InitLibs(path,showerr);
714  if (mLibsLoaded) {
715  mLibAVFormatPath = path;
716  }
717  }
718 
719 #if defined(__WXMAC__)
720  // If not successful, try loading it from legacy path
721  if (!mLibsLoaded && !GetLibAVFormatPath().empty()) {
722  const wxFileName fn{wxT("/usr/local/lib/audacity"), GetLibAVFormatName()};
723  wxString path = fn.GetFullPath();
724  wxLogMessage(wxT("Trying to load FFmpeg libraries from legacy path, '%s'."), path);
725  mLibsLoaded = InitLibs(path,showerr);
726  if (mLibsLoaded) {
727  mLibAVFormatPath = path;
728  }
729  }
730 #endif
731 
732  // If not successful, try loading using system search paths
733  if (!ValidLibsLoaded()) {
734  wxString path = GetLibAVFormatName();
735  wxLogMessage(wxT("Trying to load FFmpeg libraries from system paths. File name is '%s'."), path);
736  mLibsLoaded = InitLibs(path,showerr);
737  if (mLibsLoaded) {
738  mLibAVFormatPath = path;
739  }
740  }
741 
742  // If libraries aren't loaded - nag user about that
743  /*
744  if (!ValidLibsLoaded())
745  {
746  wxLogError(wxT("Failed to load libraries altogether."));
747  int dontShowDlg;
748  gPrefs->Read(wxT("/FFmpeg/NotFoundDontShow"),&dontShowDlg,0);
749  if ((dontShowDlg == 0) && (showerr))
750  FFmpegNotFoundDialog{nullptr}.ShowModal();
751  }
752  */
753  // Oh well, just give up
754  if (!ValidLibsLoaded()) {
755  auto msg = XO("Failed to find compatible FFmpeg libraries.");
756  if (showerr)
757  AudacityMessageBox( msg );
758  wxLogError(msg.Debug());
759  return false;
760  }
761 
762  wxLogMessage(wxT("FFmpeg libraries loaded successfully."));
763  return true;
764 }

References AudacityMessageBox(), fn, FreeLibs(), GetLibAVFormatName(), GetLibAVFormatPath(), InitLibs(), mLibAVFormatPath, mLibsLoaded, ValidLibsLoaded(), and XO.

Here is the call graph for this function:

◆ ValidLibsLoaded()

bool FFmpegLibs::ValidLibsLoaded ( )

! Checks if libraries are loaded

Returns
true if libraries are loaded, false otherwise

Definition at line 766 of file FFmpeg.cpp.

767 {
768  return mLibsLoaded;
769 }

References mLibsLoaded.

Referenced by ExportFFmpeg::ExportFFmpeg(), and LoadLibs().

Here is the caller graph for this function:

Member Data Documentation

◆ avcodec

std::unique_ptr<wxDynamicLibrary> FFmpegLibs::avcodec
private

Definition at line 361 of file FFmpeg.h.

Referenced by FreeLibs(), and InitLibs().

◆ avformat

std::unique_ptr<wxDynamicLibrary> FFmpegLibs::avformat
private

! wx interfaces for dynamic libraries

Definition at line 361 of file FFmpeg.h.

Referenced by FreeLibs(), and InitLibs().

◆ avutil

std::unique_ptr<wxDynamicLibrary> FFmpegLibs::avutil
private

Definition at line 361 of file FFmpeg.h.

Referenced by FreeLibs(), and InitLibs().

◆ mAVCodecVersion

wxString FFmpegLibs::mAVCodecVersion
private

! Stored library version

Definition at line 356 of file FFmpeg.h.

Referenced by GetLibraryVersion(), and InitLibs().

◆ mAVFormatVersion

wxString FFmpegLibs::mAVFormatVersion
private

Definition at line 357 of file FFmpeg.h.

Referenced by GetLibraryVersion(), and InitLibs().

◆ mAVUtilVersion

wxString FFmpegLibs::mAVUtilVersion
private

Definition at line 358 of file FFmpeg.h.

Referenced by GetLibraryVersion(), and InitLibs().

◆ mLibAVFormatPath

wxString FFmpegLibs::mLibAVFormatPath
private

! Stored path to libavformat library

Definition at line 353 of file FFmpeg.h.

Referenced by FindLibs(), and LoadLibs().

◆ mLibsLoaded

bool FFmpegLibs::mLibsLoaded
private

! true if libraries are loaded, false otherwise

Definition at line 364 of file FFmpeg.h.

Referenced by FreeLibs(), LoadLibs(), and ValidLibsLoaded().

◆ refcount

int FFmpegLibs::refcount

Ugly reference counting. I thought of using wxStuff for that, but decided that wx reference counting is not useful, since there's no data sharing - object is shared because libraries are.

Definition at line 348 of file FFmpeg.h.


The documentation for this class was generated from the following files:
fn
static const auto fn
Definition: WaveformView.cpp:1102
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:68
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
FFmpegLibs::FreeLibs
void FreeLibs()
! Frees (unloads) loaded libraries
Definition: FFmpeg.cpp:1016
FFMPEG_INITALT
#define FFMPEG_INITALT(w, f, x, a)
Definition: FFmpeg.h:478
XO
#define XO(s)
Definition: Internat.h:31
FFmpegLibs::ValidLibsLoaded
bool ValidLibsLoaded()
Definition: FFmpeg.cpp:766
FFmpegLibs::InitLibs
bool InitLibs(const wxString &libpath_codec, bool showerr)
Definition: FFmpeg.cpp:771
FFmpegLibs::mLibsLoaded
bool mLibsLoaded
! true if libraries are loaded, false otherwise
Definition: FFmpeg.h:364
FileNames::AllFiles
AUDACITY_DLL_API const FileType AllFiles
Definition: FileNames.h:74
FFmpegLibs::GetLibAVUtilName
wxString GetLibAVUtilName()
Definition: FFmpeg.h:339
FFmpegLibs::refcount
int refcount
Definition: FFmpeg.h:348
FFmpegLibs::GetLibAVCodecName
wxString GetLibAVCodecName()
Definition: FFmpeg.h:334
FFmpegLibs::GetLibraryTypes
FileNames::FileTypes GetLibraryTypes()
Definition: FFmpeg.h:315
FileNames::PathFromAddr
AUDACITY_DLL_API FilePath PathFromAddr(void *addr)
FFmpegLibs::mAVCodecVersion
wxString mAVCodecVersion
! Stored library version
Definition: FFmpeg.h:356
FFmpegLibs::GetLibAVFormatName
wxString GetLibAVFormatName()
Definition: FFmpeg.h:329
name
const TranslatableString name
Definition: Distortion.cpp:98
FFMPEG_INITDYN
#define FFMPEG_INITDYN(w, f)
Definition: FFmpeg.h:467
FFmpegLibs::mAVUtilVersion
wxString mAVUtilVersion
Definition: FFmpeg.h:358
FFmpegLibs::mLibAVFormatPath
wxString mLibAVFormatPath
! Stored path to libavformat library
Definition: FFmpeg.h:353
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:153
FileNames::DynamicLibraries
AUDACITY_DLL_API const FileType DynamicLibraries
Definition: FileNames.h:76
FFmpegLibs::mAVFormatVersion
wxString mAVFormatVersion
Definition: FFmpeg.h:357
FFmpegLibs::GetLibAVFormatPath
wxString GetLibAVFormatPath()
Definition: FFmpeg.h:324
FFmpegLibs::avformat
std::unique_ptr< wxDynamicLibrary > avformat
! wx interfaces for dynamic libraries
Definition: FFmpeg.h:361
FFmpegLibs::avutil
std::unique_ptr< wxDynamicLibrary > avutil
Definition: FFmpeg.h:361
FindFFmpegDialog
Allows user to locate libav* libraries.
Definition: FFmpeg.cpp:453
FFmpegLibs::avcodec
std::unique_ptr< wxDynamicLibrary > avcodec
Definition: FFmpeg.h:361