15#define AVSEEK_FORCE 0x20000
16#define AVSEEK_SIZE 0x10000
50 auto pFile = std::make_unique<wxFile>();
51 if (!pFile->Open(fileName, forWriting ? wxFile::write : wxFile::read))
54 unsigned char* buffer =
57 if (buffer ==
nullptr)
69 static_cast<int>(forWriting),
88 if (wrapper ==
nullptr)
97 if (!(wrapper && wrapper->
mpFile))
105 if (!(wrapper && wrapper->
mpFile))
108 wxSeekMode mode = wxFromStart;
116 mode = wxFromCurrent;
122 return wrapper->
mpFile->Length();
126 return wrapper->
mpFile->Seek(pos, mode);
#define AUDACITY_AVERROR(e)
static int64_t FileSeek(void *opaque, int64_t pos, int whence)
static int FileRead(void *opaque, uint8_t *buf, int size)
AVIOContext * mAVIOContext
AVIOContext * GetWrappedValue() noexcept
virtual ~AVIOContextWrapper()
virtual int Read(uint8_t *buf, int size)=0
AVIOContextWrapper(const AVIOContextWrapper &)=delete
const FFmpegFunctions & mFFmpeg
OpenResult Open(const wxString &fileName, bool forWriting)
static int FileWrite(void *opaque, const uint8_t *buf, int size)
std::unique_ptr< wxFile > mpFile
This is held indirectly by unique_ptr just so it can be swapped.
void *(* av_malloc)(size_t size)
void(* av_free)(void *ptr)