Go to the documentation of this file.
3 #ifndef REMOTEAVFORMATCONTEXT_H
4 #define REMOTEAVFORMATCONTEXT_H
12 #include <libavformat/avformat.h>
13 #include <libavformat/avio.h>
61 AVProbeData probe_data;
62 memset(&probe_data, 0,
sizeof(AVProbeData));
63 probe_data.filename =
"stream";
67 const AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
75 int ret = avformat_open_input(&
m_inputFC,
"stream", fmt,
nullptr);
81 int ret = avformat_open_input(&
m_inputFC, qPrintable(
filename),
nullptr,
nullptr);
111 operator AVFormatContext * ()
const {
return m_inputFC; }
115 static int ReadFunc(
void *opaque, uint8_t *buf,
int buf_size)
117 auto *rf =
reinterpret_cast< RemoteFile*
>(opaque);
118 return rf->
Read(buf, buf_size);
124 static int64_t
SeekFunc(
void *opaque, int64_t offset,
int whence)
126 auto *rf =
reinterpret_cast< RemoteFile*
>(opaque);
127 if (whence == AVSEEK_SIZE)
130 return rf->Seek(offset, whence);
140 #endif // REMOTEAVFORMATCONTEXT_H
AVFormatContext * operator->() const
long long GetFileSize(void) const
GetFileSize: returns the remote file's size at the time it was first opened Will query the server in ...
AVFormatContext * m_inputFC
static int64_t SeekFunc(void *opaque, int64_t offset, int whence)
AVIOContext * m_byteIOContext
static int WriteFunc(void *, const uint8_t *, int)
long long Seek(long long pos, int whence, long long curpos=-1)
static int ReadFunc(void *opaque, uint8_t *buf, int buf_size)
~ArchiveRemoteAVFormatContext()
bool Open(const QString &filename)
static constexpr qint64 BUFFER_SIZE
ArchiveRemoteAVFormatContext(const QString &filename="")
int Read(void *data, int size)