14#ifndef FFMPEGVIRTUALFILE_H
15#define FFMPEGVIRTUALFILE_H
24 #include <libavformat/avio.h>
28struct AVFormatContext;
34class EXPCL_FFMPEG FfmpegVirtualFile {
37 FfmpegVirtualFile(
const FfmpegVirtualFile ©) =
delete;
40 FfmpegVirtualFile &operator = (
const FfmpegVirtualFile ©) =
delete;
53 static int read_packet(
void *opaque, uint8_t *buf,
int buf_size);
54 static int64_t seek(
void *opaque, int64_t offset,
int whence);
56 static void log_callback(
void *ptr,
int level,
const char *fmt, va_list v1);
59 AVIOContext *_io_context;
60 AVFormatContext *_format_context;
61 std::streampos _start;
62 std::streamsize _size;
static void register_protocol()
Should be called at startup to attach the appropriate hooks between Panda and FFMpeg.
bool open_vfs(const Filename &filename)
Opens the movie file via Panda's VFS.
bool open_subfile(const SubfileInfo &info)
Opens the movie file directly from a file on disk (does not go through the VFS).
bool is_open() const
Returns true if the stream is successfully opened, false otherwise.
AVFormatContext * get_format_context() const
Returns a pointer to the opened ffmpeg context, or NULL if the file was not successfully opened.
void close()
Explicitly closes the opened file.
The name of a file, such as a texture file or an Egg file.
This class records a particular byte sub-range within an existing file on disk.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.