#include <AVIOContextWrapper.h>
|
virtual int | Read (uint8_t *buf, int size)=0 |
|
|
static int | FileRead (void *opaque, uint8_t *buf, int size) |
|
static int | FileWrite (void *opaque, const uint8_t *buf, int size) |
|
static int64_t | FileSeek (void *opaque, int64_t pos, int whence) |
|
Definition at line 21 of file AVIOContextWrapper.h.
◆ OpenResult
Enumerator |
---|
Success | |
FileOpenFailed | |
NoMemory | |
InternalError | |
Definition at line 24 of file AVIOContextWrapper.h.
25 {
27 FileOpenFailed,
28 NoMemory,
29 InternalError
30 };
◆ AVIOContextWrapper() [1/3]
◆ AVIOContextWrapper() [2/3]
◆ AVIOContextWrapper() [3/3]
◆ ~AVIOContextWrapper()
AVIOContextWrapper::~AVIOContextWrapper |
( |
| ) |
|
|
virtual |
◆ FileRead()
int AVIOContextWrapper::FileRead |
( |
void * |
opaque, |
|
|
uint8_t * |
buf, |
|
|
int |
size |
|
) |
| |
|
staticprivate |
◆ FileSeek()
int64_t AVIOContextWrapper::FileSeek |
( |
void * |
opaque, |
|
|
int64_t |
pos, |
|
|
int |
whence |
|
) |
| |
|
staticprivate |
Definition at line 102 of file AVIOContextWrapper.cpp.
103{
105 if (!(wrapper && wrapper->
mpFile))
106 return {};
107
108 wxSeekMode mode = wxFromStart;
109
111 {
112 case (SEEK_SET):
113 mode = wxFromStart;
114 break;
115 case (SEEK_CUR):
116 mode = wxFromCurrent;
117 break;
118 case (SEEK_END):
119 mode = wxFromEnd;
120 break;
122 return wrapper->
mpFile->Length();
123 }
124
125
126 return wrapper->
mpFile->Seek(pos, mode);
127}
std::unique_ptr< wxFile > mpFile
This is held indirectly by unique_ptr just so it can be swapped.
References AVSEEK_FORCE, AVSEEK_SIZE, and mpFile.
Referenced by Open().
◆ FileWrite()
int AVIOContextWrapper::FileWrite |
( |
void * |
opaque, |
|
|
const uint8_t * |
buf, |
|
|
int |
size |
|
) |
| |
|
staticprivate |
◆ GetBufEnd()
virtual unsigned char * AVIOContextWrapper::GetBufEnd |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetBuffer()
virtual unsigned char * AVIOContextWrapper::GetBuffer |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetBufferSize()
virtual int AVIOContextWrapper::GetBufferSize |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetBufPtr()
virtual unsigned char * AVIOContextWrapper::GetBufPtr |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetDirect()
virtual int AVIOContextWrapper::GetDirect |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetEofReached()
virtual int AVIOContextWrapper::GetEofReached |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetError()
virtual int AVIOContextWrapper::GetError |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetOpaque()
virtual void * AVIOContextWrapper::GetOpaque |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetPos()
virtual int64_t AVIOContextWrapper::GetPos |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetSeekable()
virtual int AVIOContextWrapper::GetSeekable |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ GetWrappedValue() [1/2]
const AVIOContext * AVIOContextWrapper::GetWrappedValue |
( |
| ) |
const |
|
noexcept |
◆ GetWrappedValue() [2/2]
◆ GetWriteFlag()
virtual int AVIOContextWrapper::GetWriteFlag |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ Open()
Definition at line 48 of file AVIOContextWrapper.cpp.
49{
50 auto pFile = std::make_unique<wxFile>();
51 if (!pFile->Open(fileName, forWriting ? wxFile::write : wxFile::read))
53
54 unsigned char* buffer =
56
57 if (buffer == nullptr)
59
60
61
62
63
64
65
66
69 static_cast<int>(forWriting),
70 this,
72 );
73
77 }
78
80
82}
static int64_t FileSeek(void *opaque, int64_t pos, int whence)
static int FileRead(void *opaque, uint8_t *buf, int size)
static int FileWrite(void *opaque, const uint8_t *buf, int size)
void *(* av_malloc)(size_t size)
References AVUtilFunctions::av_free, AVUtilFunctions::av_malloc, AVFormatFunctions::avio_alloc_context, BufferSize, FileOpenFailed, FileRead(), FileSeek(), FileWrite(), mAVIOContext, mFFmpeg, mpFile, NoMemory, and Success.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Read()
virtual int AVIOContextWrapper::Read |
( |
uint8_t * |
buf, |
|
|
int |
size |
|
) |
| |
|
protectedpure virtual |
◆ SetDirect()
virtual void AVIOContextWrapper::SetDirect |
( |
int |
direct | ) |
|
|
pure virtualnoexcept |
◆ SetError()
virtual void AVIOContextWrapper::SetError |
( |
int |
error | ) |
|
|
pure virtualnoexcept |
◆ SetOpaque()
virtual void AVIOContextWrapper::SetOpaque |
( |
void * |
opaque | ) |
|
|
pure virtualnoexcept |
◆ SetSeekable()
virtual void AVIOContextWrapper::SetSeekable |
( |
int |
seekable | ) |
|
|
pure virtualnoexcept |
◆ SetWriteFlag()
virtual void AVIOContextWrapper::SetWriteFlag |
( |
int |
write_flag | ) |
|
|
pure virtualnoexcept |
◆ mAVIOContext
AVIOContext* AVIOContextWrapper::mAVIOContext { nullptr } |
|
protected |
◆ mFFmpeg
◆ mpFile
std::unique_ptr<wxFile> AVIOContextWrapper::mpFile |
|
protected |
The documentation for this class was generated from the following files: