avcpp 3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
av::Format< T > Struct Template Reference

Common interface of input and output format descriptors. More...

#include <format.h>

Inheritance diagram for av::Format< T >:

Public Member Functions

const char * name () const noexcept
 Short format name, as FFmpeg spells it.
const char * longName () const noexcept
 Human-readable format name.
int32_t flags () const noexcept
 Raw AVFMT_* flags of the format.
bool isFlags (int32_t flags) const noexcept
 Whether all given flags are set.
void setFormat (T *format) noexcept
 Point the descriptor at another format.
bool codecSupported (const class Codec &codec) const noexcept
 Whether the format can carry a codec.
bool codecSupported (AVCodecID codec_id) const noexcept
 Whether the format can carry a codec identifier.
Public Member Functions inherited from FFWrapperPtr< T >
 FFWrapperPtr ()=default
 Create an empty wrapper; isNull() is true.
 FFWrapperPtr (T *raw)
 Wrap an existing object.
const T * raw () const
 Read access to the wrapped object.
T * raw ()
 Write access to the wrapped object.
void reset (T *raw=nullptr)
 Replace the stored pointer.
bool isNull () const
 Whether the wrapper is empty.
void _log (int level, const char *fmt) const
 Log through the FFmpeg log system, using this wrapper as the context.
template<typename... Args>
void _log (int level, const char *fmt, const Args &... args) const
 Log through the FFmpeg log system with arguments.

Additional Inherited Members

Protected Attributes inherited from FFWrapperPtr< T >
T * m_raw = nullptr
 The wrapped pointer; owned by the derived class, not by this template.

Detailed Description

template<typename T>
struct av::Format< T >

The template is instantiated with the const or non-const FFmpeg type, depending on how old the FFmpeg headers are, so the same code compiles against both.

Template Parameters
TAVInputFormat or AVOutputFormat, possibly const

Member Function Documentation

◆ codecSupported() [1/2]

template<typename T>
bool av::Format< T >::codecSupported ( AVCodecID codec_id) const
inlinenoexcept
Parameters
codec_idthe AV_CODEC_ID_* value to test
Returns
true when the muxer or demuxer knows a tag for it

◆ codecSupported() [2/2]

template<typename T>
bool av::Format< T >::codecSupported ( const class Codec & codec) const
inlinenoexcept
Parameters
codecthe codec to test
Returns
true when the muxer or demuxer knows the codec's tag

◆ flags()

template<typename T>
int32_t av::Format< T >::flags ( ) const
inlinenoexcept
Returns
the flag mask, or zero when the format is not set

◆ isFlags()

template<typename T>
bool av::Format< T >::isFlags ( int32_t flags) const
inlinenoexcept
Parameters
flagsthe AVFMT_* bits to test
Returns
true when every bit is present

◆ longName()

template<typename T>
const char * av::Format< T >::longName ( ) const
inlinenoexcept
Returns
a static description, or nullptr when the format is not set

◆ name()

template<typename T>
const char * av::Format< T >::name ( ) const
inlinenoexcept
Returns
a static string such as "mp4", or nullptr when the format is not set

◆ setFormat()

template<typename T>
void av::Format< T >::setFormat ( T * format)
inlinenoexcept
Parameters
formatthe format to wrap; the wrapper does not own it

The documentation for this struct was generated from the following file: