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

#include <codeccontext.h>

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

Public Member Functions

void open (OptionalErrorCode ec=throws())
 
void open (const Codec &codec, OptionalErrorCode ec=throws())
 
void open (class Dictionary &options, OptionalErrorCode ec=throws())
 
void open (class Dictionary &&options, OptionalErrorCode ec=throws())
 
void open (class Dictionary &options, const Codec &codec, OptionalErrorCode ec=throws())
 
void open (class Dictionary &&options, const Codec &codec, OptionalErrorCode ec=throws())
 
void close (OptionalErrorCode ec=throws())
 
bool isOpened () const noexcept
 
bool isValid () const noexcept
 
Rational timeBase () const noexcept
 
void setTimeBase (const Rational &value) noexcept
 
const Streamstream () const noexcept
 
Codec codec () const noexcept
 
void setOption (const std::string &key, const std::string &val, OptionalErrorCode ec=throws())
 
void setOption (const std::string &key, const std::string &val, int flags, OptionalErrorCode ec=throws())
 
int frameSize () const noexcept
 
int64_t frameNumber () const noexcept
 
bool isRefCountedFrames () const noexcept
 
void setRefCountedFrames (bool refcounted) const noexcept
 
int strict () const noexcept
 
void setStrict (int strict) noexcept
 
int64_t bitRate () const noexcept
 
std::pair< int64_t, int64_t > bitRateRange () const noexcept
 
void setBitRate (int64_t bitRate) noexcept
 
void setBitRateRange (const std::pair< int64_t, int64_t > &bitRateRange) noexcept
 
template<typename T >
std::pair< int, const std::error_category * > decodeCommon (T &outFrame, const class Packet &inPacket, size_t offset, int &frameFinished, int(*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *))
 
template<typename T >
std::pair< int, const std::error_category * > encodeCommon (class Packet &outPacket, const T &inFrame, int &gotPacket, int(*encodeProc)(AVCodecContext *, AVPacket *, const AVFrame *, int *))
 
template<typename T >
std::pair< int, const std::error_category * > decodeCommon (T &outFrame, const Packet &inPacket, size_t offset, int &frameFinished, int(*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *))
 
void copyContextFrom (const CodecContext2 &other, OptionalErrorCode ec=throws())
 Copy codec context from codec context associated with given stream or other codec context. More...
 
void setFlags (int flags) noexcept
 Access to CODEC_FLAG_* flags. More...
 
void addFlags (int flags) noexcept
 
void clearFlags (int flags) noexcept
 
int flags () noexcept
 
bool isFlags (int flags) noexcept
 
void setFlags2 (int flags) noexcept
 Access to CODEC_FLAG2_* flags. More...
 
void addFlags2 (int flags) noexcept
 
void clearFlags2 (int flags) noexcept
 
int flags2 () noexcept
 
bool isFlags2 (int flags) noexcept
 
- Public Member Functions inherited from FFWrapperPtr< AVCodecContext >
 FFWrapperPtr ()=default
 
 FFWrapperPtr (AVCodecContext *raw)
 
const AVCodecContext * raw () const
 
AVCodecContext * raw ()
 
void reset (AVCodecContext *raw=nullptr)
 
bool isNull () const
 
void _log (int level, const char *fmt) const
 
void _log (int level, const char *fmt, const Args &... args) const
 

Protected Types

using BaseWrapper = FFWrapperPtr< AVCodecContext >
 

Protected Member Functions

void swap (CodecContext2 &other)
 
 CodecContext2 ()
 
 CodecContext2 (const class Stream &st, const class Codec &codec, Direction direction, AVMediaType type)
 
 CodecContext2 (const class Codec &codec, Direction direction, AVMediaType type)
 
 ~CodecContext2 ()
 
void setCodec (const class Codec &codec, bool resetDefaults, Direction direction, AVMediaType type, OptionalErrorCode ec=throws())
 
AVMediaType codecType (AVMediaType contextType) const noexcept
 
bool isValidForEncode (Direction direction, AVMediaType type) const noexcept
 
bool checkCodec (const Codec &codec, Direction direction, AVMediaType type, OptionalErrorCode ec)
 
void open (const Codec &codec, AVDictionary **options, OptionalErrorCode ec)
 
std::pair< int, const std::error_category * > decodeCommon (AVFrame *outFrame, const class Packet &inPacket, size_t offset, int &frameFinished, int(*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *)) noexcept
 
std::pair< int, const std::error_category * > encodeCommon (class Packet &outPacket, const AVFrame *inFrame, int &gotPacket, int(*encodeProc)(AVCodecContext *, AVPacket *, const AVFrame *, int *)) noexcept
 
- Protected Member Functions inherited from av::noncopyable
 noncopyable ()=default
 
 noncopyable (const noncopyable &)=delete
 
void operator= (const noncopyable &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from FFWrapperPtr< AVCodecContext >
AVCodecContext * m_raw
 

Member Typedef Documentation

◆ BaseWrapper

using av::CodecContext2::BaseWrapper = FFWrapperPtr<AVCodecContext>
protected

Constructor & Destructor Documentation

◆ CodecContext2() [1/3]

av::CodecContext2::CodecContext2 ( )
protected

◆ CodecContext2() [2/3]

av::CodecContext2::CodecContext2 ( const class Stream st,
const class Codec codec,
Direction  direction,
AVMediaType  type 
)
protected

◆ CodecContext2() [3/3]

av::CodecContext2::CodecContext2 ( const class Codec codec,
Direction  direction,
AVMediaType  type 
)
protected

◆ ~CodecContext2()

av::CodecContext2::~CodecContext2 ( )
protected

Member Function Documentation

◆ addFlags()

void av::CodecContext2::addFlags ( int  flags)
noexcept

◆ addFlags2()

void av::CodecContext2::addFlags2 ( int  flags)
noexcept

◆ bitRate()

int64_t av::CodecContext2::bitRate ( ) const
noexcept

◆ bitRateRange()

std::pair< int64_t, int64_t > av::CodecContext2::bitRateRange ( ) const
noexcept

◆ checkCodec()

bool av::CodecContext2::checkCodec ( const Codec codec,
Direction  direction,
AVMediaType  type,
OptionalErrorCode  ec 
)
protected

◆ clearFlags()

void av::CodecContext2::clearFlags ( int  flags)
noexcept

◆ clearFlags2()

void av::CodecContext2::clearFlags2 ( int  flags)
noexcept

◆ close()

void av::CodecContext2::close ( OptionalErrorCode  ec = throws())

◆ codec()

Codec av::CodecContext2::codec ( ) const
noexcept

◆ codecType()

AVMediaType av::CodecContext2::codecType ( AVMediaType  contextType) const
protectednoexcept

◆ copyContextFrom()

void av::CodecContext2::copyContextFrom ( const CodecContext2 other,
OptionalErrorCode  ec = throws() 
)

Copy codec context from codec context associated with given stream or other codec context.

This functionality useful for remuxing without deconding/encoding. In this case you need not open codecs, only copy context.

Parameters
otherstream or codec context

◆ decodeCommon() [1/3]

std::pair<int, const std::error_category*> av::CodecContext2::decodeCommon ( AVFrame *  outFrame,
const class Packet inPacket,
size_t  offset,
int &  frameFinished,
int(*)(AVCodecContext *, AVFrame *, int *, const AVPacket *)  decodeProc 
)
protectednoexcept

◆ decodeCommon() [2/3]

template<typename T >
std::pair<int, const std::error_category*> av::CodecContext2::decodeCommon ( T &  outFrame,
const class Packet inPacket,
size_t  offset,
int &  frameFinished,
int(*)(AVCodecContext *, AVFrame *, int *, const AVPacket *)  decodeProc 
)

◆ decodeCommon() [3/3]

template<typename T >
std::pair<int, const std::error_category*> av::CodecContext2::decodeCommon ( T &  outFrame,
const Packet inPacket,
size_t  offset,
int &  frameFinished,
int(*)(AVCodecContext *, AVFrame *, int *, const AVPacket *)  decodeProc 
)

◆ encodeCommon() [1/2]

std::pair< int, const error_category * > av::CodecContext2::encodeCommon ( class Packet outPacket,
const AVFrame *  inFrame,
int &  gotPacket,
int(*)(AVCodecContext *, AVPacket *, const AVFrame *, int *)  encodeProc 
)
protectednoexcept

◆ encodeCommon() [2/2]

template<typename T >
std::pair< int, const std::error_category * > av::CodecContext2::encodeCommon ( class Packet outPacket,
const T &  inFrame,
int &  gotPacket,
int(*)(AVCodecContext *, AVPacket *, const AVFrame *, int *)  encodeProc 
)

◆ flags()

int av::CodecContext2::flags ( )
noexcept

◆ flags2()

int av::CodecContext2::flags2 ( )
noexcept

◆ frameNumber()

int64_t av::CodecContext2::frameNumber ( ) const
noexcept

◆ frameSize()

int av::CodecContext2::frameSize ( ) const
noexcept

◆ isFlags()

bool av::CodecContext2::isFlags ( int  flags)
noexcept

◆ isFlags2()

bool av::CodecContext2::isFlags2 ( int  flags)
noexcept

◆ isOpened()

bool av::CodecContext2::isOpened ( ) const
noexcept

◆ isRefCountedFrames()

bool av::CodecContext2::isRefCountedFrames ( ) const
noexcept

◆ isValid()

bool av::CodecContext2::isValid ( ) const
noexcept

◆ isValidForEncode()

bool av::CodecContext2::isValidForEncode ( Direction  direction,
AVMediaType  type 
) const
protectednoexcept

◆ open() [1/7]

void av::CodecContext2::open ( class Dictionary &&  options,
const Codec codec,
OptionalErrorCode  ec = throws() 
)

◆ open() [2/7]

void av::CodecContext2::open ( class Dictionary &&  options,
OptionalErrorCode  ec = throws() 
)

◆ open() [3/7]

void av::CodecContext2::open ( class Dictionary options,
const Codec codec,
OptionalErrorCode  ec = throws() 
)

◆ open() [4/7]

void av::CodecContext2::open ( class Dictionary options,
OptionalErrorCode  ec = throws() 
)

◆ open() [5/7]

void av::CodecContext2::open ( const Codec codec,
AVDictionary **  options,
OptionalErrorCode  ec 
)
protected

◆ open() [6/7]

void av::CodecContext2::open ( const Codec codec,
OptionalErrorCode  ec = throws() 
)

◆ open() [7/7]

void av::CodecContext2::open ( OptionalErrorCode  ec = throws())

◆ setBitRate()

void av::CodecContext2::setBitRate ( int64_t  bitRate)
noexcept

◆ setBitRateRange()

void av::CodecContext2::setBitRateRange ( const std::pair< int64_t, int64_t > &  bitRateRange)
noexcept

◆ setCodec()

void av::CodecContext2::setCodec ( const class Codec codec,
bool  resetDefaults,
Direction  direction,
AVMediaType  type,
OptionalErrorCode  ec = throws() 
)
protected

◆ setFlags()

void av::CodecContext2::setFlags ( int  flags)
noexcept

Access to CODEC_FLAG_* flags.

◆ setFlags2()

void av::CodecContext2::setFlags2 ( int  flags)
noexcept

Access to CODEC_FLAG2_* flags.

◆ setOption() [1/2]

void av::CodecContext2::setOption ( const std::string &  key,
const std::string &  val,
int  flags,
OptionalErrorCode  ec = throws() 
)

◆ setOption() [2/2]

void av::CodecContext2::setOption ( const std::string &  key,
const std::string &  val,
OptionalErrorCode  ec = throws() 
)

◆ setRefCountedFrames()

void av::CodecContext2::setRefCountedFrames ( bool  refcounted) const
noexcept

◆ setStrict()

void av::CodecContext2::setStrict ( int  strict)
noexcept

◆ setTimeBase()

void av::CodecContext2::setTimeBase ( const Rational value)
noexcept

◆ stream()

const Stream & av::CodecContext2::stream ( ) const
noexcept

◆ strict()

int av::CodecContext2::strict ( ) const
noexcept

◆ swap()

void av::CodecContext2::swap ( CodecContext2 other)
protected

◆ timeBase()

Rational av::CodecContext2::timeBase ( ) const
noexcept

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