avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Public Member Functions | Static Public Attributes | List of all members
av::FormatContext Class Reference

#include <formatcontext.h>

Inheritance diagram for av::FormatContext:
Inheritance graph
[legend]
Collaboration diagram for av::FormatContext:
Collaboration graph
[legend]

Public Member Functions

 FormatContext ()
 
 ~FormatContext ()
 
void setSocketTimeout (int64_t timeout)
 
void setInterruptCallback (const AvioInterruptCb &cb)
 
void setFormat (const InputFormat &format)
 
void setFormat (const OutputFormat &format)
 
InputFormat inputFormat () const
 
OutputFormat outputFormat () const
 
bool isOutput () const
 
bool isOpened () const
 
void flush ()
 
void close ()
 
void dump () const
 
size_t streamsCount () const
 
Stream stream (size_t idx)
 
Stream stream (size_t idx, OptionalErrorCode ec)
 
Stream addStream (const Codec &codec, OptionalErrorCode ec=throws())
 
Stream addStream (OptionalErrorCode ec=throws())
 
Stream addStream (const class VideoEncoderContext &encCtx, OptionalErrorCode ec=throws())
 
Stream addStream (const class AudioEncoderContext &encCtx, OptionalErrorCode ec=throws())
 
bool seekable () const noexcept
 
void seek (const Timestamp &timestamp, OptionalErrorCode ec=throws())
 
void seek (const Timestamp &timestamp, size_t streamIndex, OptionalErrorCode ec=throws())
 
void seek (const Timestamp &timestamp, bool anyFrame, OptionalErrorCode ec=throws())
 
void seek (const Timestamp &timestamp, size_t streamIndex, bool anyFrame, OptionalErrorCode ec=throws())
 
void seek (int64_t position, int streamIndex, int flags, OptionalErrorCode ec=throws())
 
Timestamp startTime () const noexcept
 
Timestamp duration () const noexcept
 
void substractStartTime (bool enable)
 
int eventFlags () const noexcept
 Flags to the user to detect events happening on the file. More...
 
bool eventFlags (int flags) const noexcept
 
void eventFlagsClear (int flags) noexcept
 
void openInput (const std::string &uri, OptionalErrorCode ec=throws())
 
void openInput (const std::string &uri, Dictionary &formatOptions, OptionalErrorCode ec=throws())
 
void openInput (const std::string &uri, Dictionary &&formatOptions, OptionalErrorCode ec=throws())
 
void openInput (const std::string &uri, InputFormat format, OptionalErrorCode ec=throws())
 
void openInput (const std::string &uri, Dictionary &formatOptions, InputFormat format, OptionalErrorCode ec=throws())
 
void openInput (const std::string &uri, Dictionary &&formatOptions, InputFormat format, OptionalErrorCode ec=throws())
 
void openInput (CustomIO *io, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void openInput (CustomIO *io, Dictionary &formatOptions, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void openInput (CustomIO *io, Dictionary &&formatOptions, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void openInput (CustomIO *io, InputFormat format, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void openInput (CustomIO *io, Dictionary &formatOptions, InputFormat format, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void openInput (CustomIO *io, Dictionary &&formatOptions, InputFormat format, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void findStreamInfo (OptionalErrorCode ec=throws())
 
void findStreamInfo (DictionaryArray &streamsOptions, OptionalErrorCode ec=throws())
 
void findStreamInfo (DictionaryArray &&streamsOptions, OptionalErrorCode ec=throws())
 
Packet readPacket (OptionalErrorCode ec=throws())
 
void openOutput (const std::string &uri, OptionalErrorCode ec=throws())
 
void openOutput (const std::string &uri, Dictionary &options, OptionalErrorCode ec=throws())
 
void openOutput (const std::string &uri, Dictionary &&options, OptionalErrorCode ec=throws())
 
void openOutput (CustomIO *io, OptionalErrorCode ec=throws(), size_t internalBufferSize=CUSTOM_IO_DEFAULT_BUFFER_SIZE)
 
void writeHeader (OptionalErrorCode ec=throws())
 
void writeHeader (Dictionary &options, OptionalErrorCode ec=throws())
 
void writeHeader (Dictionary &&options, OptionalErrorCode ec=throws())
 
void writePacket (OptionalErrorCode ec=throws())
 
void writePacket (const Packet &pkt, OptionalErrorCode ec=throws())
 
void writePacketDirect (OptionalErrorCode ec=throws())
 
void writePacketDirect (const Packet &pkt, OptionalErrorCode ec=throws())
 
bool checkUncodedFrameWriting (size_t streamIndex, std::error_code &ec) noexcept
 
bool checkUncodedFrameWriting (size_t streamIndex) noexcept
 
void writeUncodedFrame (class VideoFrame &frame, size_t streamIndex, OptionalErrorCode ec=throws())
 
void writeUncodedFrameDirect (class VideoFrame &frame, size_t streamIndex, OptionalErrorCode ec=throws())
 
void writeUncodedFrame (class AudioSamples &frame, size_t streamIndex, OptionalErrorCode ec=throws())
 
void writeUncodedFrameDirect (class AudioSamples &frame, size_t streamIndex, OptionalErrorCode ec=throws())
 
void writeTrailer (OptionalErrorCode ec=throws())
 
- Public Member Functions inherited from FFWrapperPtr< AVFormatContext >
 FFWrapperPtr ()=default
 
 FFWrapperPtr (AVFormatContext *raw)
 
const AVFormatContext * raw () const
 
AVFormatContext * raw ()
 
void reset (AVFormatContext *raw=nullptr)
 
bool isNull () const
 
void _log (int level, const char *fmt) const
 
void _log (int level, const char *fmt, const Args &... args) const
 

Static Public Attributes

static constexpr size_t CUSTOM_IO_DEFAULT_BUFFER_SIZE = 200000
 

Additional Inherited Members

- Protected Member Functions inherited from av::noncopyable
 noncopyable ()=default
 
 noncopyable (const noncopyable &)=delete
 
void operator= (const noncopyable &)=delete
 
- Protected Attributes inherited from FFWrapperPtr< AVFormatContext >
AVFormatContext * m_raw
 

Constructor & Destructor Documentation

◆ FormatContext()

av::FormatContext::FormatContext ( )

◆ ~FormatContext()

av::FormatContext::~FormatContext ( )

Member Function Documentation

◆ addStream() [1/4]

Stream av::FormatContext::addStream ( const class AudioEncoderContext encCtx,
OptionalErrorCode  ec = throws() 
)

◆ addStream() [2/4]

Stream av::FormatContext::addStream ( const class VideoEncoderContext encCtx,
OptionalErrorCode  ec = throws() 
)

◆ addStream() [3/4]

Stream av::FormatContext::addStream ( const Codec codec,
OptionalErrorCode  ec = throws() 
)

◆ addStream() [4/4]

Stream av::FormatContext::addStream ( OptionalErrorCode  ec = throws())

◆ checkUncodedFrameWriting() [1/2]

bool av::FormatContext::checkUncodedFrameWriting ( size_t  streamIndex)
noexcept

◆ checkUncodedFrameWriting() [2/2]

bool av::FormatContext::checkUncodedFrameWriting ( size_t  streamIndex,
std::error_code &  ec 
)
noexcept

◆ close()

void av::FormatContext::close ( )

◆ dump()

void av::FormatContext::dump ( ) const

◆ duration()

Timestamp av::FormatContext::duration ( ) const
noexcept

◆ eventFlags() [1/2]

int av::FormatContext::eventFlags ( ) const
noexcept

Flags to the user to detect events happening on the file.

A combination of AVFMT_EVENT_FLAG_*. Must be cleared by the user.

See also
AVFormatContext::event_flags
Returns

◆ eventFlags() [2/2]

bool av::FormatContext::eventFlags ( int  flags) const
noexcept

◆ eventFlagsClear()

void av::FormatContext::eventFlagsClear ( int  flags)
noexcept

◆ findStreamInfo() [1/3]

void av::FormatContext::findStreamInfo ( DictionaryArray &&  streamsOptions,
OptionalErrorCode  ec = throws() 
)

◆ findStreamInfo() [2/3]

void av::FormatContext::findStreamInfo ( DictionaryArray streamsOptions,
OptionalErrorCode  ec = throws() 
)

◆ findStreamInfo() [3/3]

void av::FormatContext::findStreamInfo ( OptionalErrorCode  ec = throws())

◆ flush()

void av::FormatContext::flush ( )

◆ inputFormat()

InputFormat av::FormatContext::inputFormat ( ) const

◆ isOpened()

bool av::FormatContext::isOpened ( ) const

◆ isOutput()

bool av::FormatContext::isOutput ( ) const

◆ openInput() [1/12]

void av::FormatContext::openInput ( const std::string &  uri,
Dictionary &&  formatOptions,
InputFormat  format,
OptionalErrorCode  ec = throws() 
)

◆ openInput() [2/12]

void av::FormatContext::openInput ( const std::string &  uri,
Dictionary &&  formatOptions,
OptionalErrorCode  ec = throws() 
)

◆ openInput() [3/12]

void av::FormatContext::openInput ( const std::string &  uri,
Dictionary formatOptions,
InputFormat  format,
OptionalErrorCode  ec = throws() 
)

◆ openInput() [4/12]

void av::FormatContext::openInput ( const std::string &  uri,
Dictionary formatOptions,
OptionalErrorCode  ec = throws() 
)

◆ openInput() [5/12]

void av::FormatContext::openInput ( const std::string &  uri,
InputFormat  format,
OptionalErrorCode  ec = throws() 
)

◆ openInput() [6/12]

void av::FormatContext::openInput ( const std::string &  uri,
OptionalErrorCode  ec = throws() 
)

◆ openInput() [7/12]

void av::FormatContext::openInput ( CustomIO io,
Dictionary &&  formatOptions,
InputFormat  format,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)

◆ openInput() [8/12]

void av::FormatContext::openInput ( CustomIO io,
Dictionary &&  formatOptions,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)
inline

◆ openInput() [9/12]

void av::FormatContext::openInput ( CustomIO io,
Dictionary formatOptions,
InputFormat  format,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)

◆ openInput() [10/12]

void av::FormatContext::openInput ( CustomIO io,
Dictionary formatOptions,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)
inline

◆ openInput() [11/12]

void av::FormatContext::openInput ( CustomIO io,
InputFormat  format,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)

◆ openInput() [12/12]

void av::FormatContext::openInput ( CustomIO io,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)
inline

◆ openOutput() [1/4]

void av::FormatContext::openOutput ( const std::string &  uri,
Dictionary &&  options,
OptionalErrorCode  ec = throws() 
)

◆ openOutput() [2/4]

void av::FormatContext::openOutput ( const std::string &  uri,
Dictionary options,
OptionalErrorCode  ec = throws() 
)

◆ openOutput() [3/4]

void av::FormatContext::openOutput ( const std::string &  uri,
OptionalErrorCode  ec = throws() 
)

◆ openOutput() [4/4]

void av::FormatContext::openOutput ( CustomIO io,
OptionalErrorCode  ec = throws(),
size_t  internalBufferSize = CUSTOM_IO_DEFAULT_BUFFER_SIZE 
)

◆ outputFormat()

OutputFormat av::FormatContext::outputFormat ( ) const

◆ readPacket()

Packet av::FormatContext::readPacket ( OptionalErrorCode  ec = throws())

◆ seek() [1/5]

void av::FormatContext::seek ( const Timestamp timestamp,
bool  anyFrame,
OptionalErrorCode  ec = throws() 
)

◆ seek() [2/5]

void av::FormatContext::seek ( const Timestamp timestamp,
OptionalErrorCode  ec = throws() 
)

◆ seek() [3/5]

void av::FormatContext::seek ( const Timestamp timestamp,
size_t  streamIndex,
bool  anyFrame,
OptionalErrorCode  ec = throws() 
)

◆ seek() [4/5]

void av::FormatContext::seek ( const Timestamp timestamp,
size_t  streamIndex,
OptionalErrorCode  ec = throws() 
)

◆ seek() [5/5]

void av::FormatContext::seek ( int64_t  position,
int  streamIndex,
int  flags,
OptionalErrorCode  ec = throws() 
)

◆ seekable()

bool av::FormatContext::seekable ( ) const
noexcept

◆ setFormat() [1/2]

void av::FormatContext::setFormat ( const InputFormat format)

◆ setFormat() [2/2]

void av::FormatContext::setFormat ( const OutputFormat format)

◆ setInterruptCallback()

void av::FormatContext::setInterruptCallback ( const AvioInterruptCb cb)

◆ setSocketTimeout()

void av::FormatContext::setSocketTimeout ( int64_t  timeout)

◆ startTime()

Timestamp av::FormatContext::startTime ( ) const
noexcept

◆ stream() [1/2]

Stream av::FormatContext::stream ( size_t  idx)

◆ stream() [2/2]

Stream av::FormatContext::stream ( size_t  idx,
OptionalErrorCode  ec 
)

◆ streamsCount()

size_t av::FormatContext::streamsCount ( ) const

◆ substractStartTime()

void av::FormatContext::substractStartTime ( bool  enable)

◆ writeHeader() [1/3]

void av::FormatContext::writeHeader ( Dictionary &&  options,
OptionalErrorCode  ec = throws() 
)

◆ writeHeader() [2/3]

void av::FormatContext::writeHeader ( Dictionary options,
OptionalErrorCode  ec = throws() 
)

◆ writeHeader() [3/3]

void av::FormatContext::writeHeader ( OptionalErrorCode  ec = throws())

◆ writePacket() [1/2]

void av::FormatContext::writePacket ( const Packet pkt,
OptionalErrorCode  ec = throws() 
)

◆ writePacket() [2/2]

void av::FormatContext::writePacket ( OptionalErrorCode  ec = throws())

◆ writePacketDirect() [1/2]

void av::FormatContext::writePacketDirect ( const Packet pkt,
OptionalErrorCode  ec = throws() 
)

◆ writePacketDirect() [2/2]

void av::FormatContext::writePacketDirect ( OptionalErrorCode  ec = throws())

◆ writeTrailer()

void av::FormatContext::writeTrailer ( OptionalErrorCode  ec = throws())

◆ writeUncodedFrame() [1/2]

void av::FormatContext::writeUncodedFrame ( class AudioSamples frame,
size_t  streamIndex,
OptionalErrorCode  ec = throws() 
)

◆ writeUncodedFrame() [2/2]

void av::FormatContext::writeUncodedFrame ( class VideoFrame frame,
size_t  streamIndex,
OptionalErrorCode  ec = throws() 
)

◆ writeUncodedFrameDirect() [1/2]

void av::FormatContext::writeUncodedFrameDirect ( class AudioSamples frame,
size_t  streamIndex,
OptionalErrorCode  ec = throws() 
)

◆ writeUncodedFrameDirect() [2/2]

void av::FormatContext::writeUncodedFrameDirect ( class VideoFrame frame,
size_t  streamIndex,
OptionalErrorCode  ec = throws() 
)

Member Data Documentation

◆ CUSTOM_IO_DEFAULT_BUFFER_SIZE

constexpr size_t av::FormatContext::CUSTOM_IO_DEFAULT_BUFFER_SIZE = 200000
staticconstexpr

The documentation for this class was generated from the following files: