17#ifndef FFMPEG_FORMATCONTEXT_H
18#define FFMPEG_FORMATCONTEXT_H
113 AVFormatContext*
get();
119 const AVFormatContext*
get()
const;
140 operator AVFormatContext*();
145 operator const AVFormatContext*()
const;
RAII wrapper for AVFormatContext.
~FFmpeg_FormatContext()
Release the owned format context, if any.
void set_type(TYPE type)
Set the context direction used for later cleanup.
AVFormatContext * m_context
Pointer to underlying AVFormatContext.
bool m_custom_io
true if pb was allocated with avio_alloc_context().
TYPE m_type
Input or output context.
TYPE
Managed AVFormatContext direction.
@ OUTPUT
Output context freed with avformat_free_context().
@ INPUT
Input context closed with avformat_close_input().
int alloc_input_context()
Allocate a new input format context.
bool reset()
Free the owned format context and reset the wrapper to empty.
AVFormatContext * get()
Get the owned FFmpeg format context pointer.
AVFormatContext ** address()
Get a writable pointer-to-pointer for FFmpeg APIs.
AVFormatContext * operator->()
Access members of the underlying mutable format context.
AVFormatContext * release()
Release ownership without freeing the format context.
void set_custom_io(bool custom_io=true)
Mark whether the context owns a custom AVIOContext.
void free_custom_io()
Free the custom AVIOContext attached to the format context.
int alloc_output_context(const char *format_name, const char *filename=nullptr)
Allocate a new output format context.
bool empty() const
Check whether the wrapper currently owns a format context.
Various FFmpegfs utility functions.