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

#include <packet.h>

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

Classes

struct  wrap_data
 Wrap data and take owning. More...
 
struct  wrap_data_static
 Wrap static data, do not owning and free. More...
 

Public Member Functions

 Packet ()
 
 Packet (const Packet &packet, OptionalErrorCode ec)
 
 Packet (const Packet &packet)
 
 Packet (Packet &&packet)
 
 Packet (const AVPacket *packet, OptionalErrorCode ec=throws())
 
 Packet (const std::vector< uint8_t > &data)
 
 Packet (const uint8_t *data, size_t size, bool doAllign=true)
 
 Packet (uint8_t *data, size_t size, wrap_data, OptionalErrorCode ec=throws())
 
 Packet (uint8_t *data, size_t size, wrap_data_static, OptionalErrorCode ec=throws())
 
 ~Packet ()
 
bool setData (const std::vector< uint8_t > &newData, OptionalErrorCode ec=throws())
 
bool setData (const uint8_t *newData, size_t size, OptionalErrorCode ec=throws())
 
const uint8_t * data () const
 
uint8_t * data ()
 
Timestamp pts () const
 
Timestamp dts () const
 
Timestamp ts () const
 
size_t size () const
 
attribute_deprecated void setPts (int64_t pts, const Rational &tsTimeBase=Rational(0, 0))
 Set packet PTS field. More...
 
attribute_deprecated void setDts (int64_t dts, const Rational &tsTimeBase=Rational(0, 0))
 
void setPts (const Timestamp &pts)
 
void setDts (const Timestamp &dts)
 
int streamIndex () const
 
bool isKeyPacket () const
 
int duration () const
 
bool isComplete () const
 
bool isNull () const
 
void setStreamIndex (int idx)
 
void setKeyPacket (bool keyPacket)
 
void setDuration (int duration, const Rational &durationTimeBase=Rational(0, 0))
 
void setComplete (bool complete)
 
int flags () const
 
void setFlags (int flags)
 
void addFlags (int flags)
 
void clearFlags (int flags)
 
void dump (const Stream &st, bool dumpPayload=false) const
 
const RationaltimeBase () const
 
void setTimeBase (const Rational &value)
 
bool isReferenced () const
 
int refCount () const
 
AVPacket makeRef (OptionalErrorCode ec=throws()) const
 
Packet clone (OptionalErrorCode ec=throws()) const
 
Packetoperator= (const Packet &rhs)
 
Packetoperator= (Packet &&rhs)
 
Packetoperator= (const AVPacket &rhs)
 
void swap (Packet &other)
 
 operator bool () const
 
- Public Member Functions inherited from FFWrapperRef< AVPacket >
 FFWrapperRef ()=default
 
 FFWrapperRef (const AVPacket &raw)
 
const AVPacket * raw () const
 
AVPacket * raw ()
 
void reset (const AVPacket &raw=AVPacket())
 
bool isNull () const
 
void _log (int level, const char *fmt) const
 
void _log (int level, const char *fmt, const Args &... args) const
 

Additional Inherited Members

- Protected Attributes inherited from FFWrapperRef< AVPacket >
AVPacket m_raw
 

Constructor & Destructor Documentation

◆ Packet() [1/9]

av::Packet::Packet ( )

◆ Packet() [2/9]

av::Packet::Packet ( const Packet packet,
OptionalErrorCode  ec 
)

◆ Packet() [3/9]

av::Packet::Packet ( const Packet packet)

◆ Packet() [4/9]

av::Packet::Packet ( Packet &&  packet)

◆ Packet() [5/9]

av::Packet::Packet ( const AVPacket *  packet,
OptionalErrorCode  ec = throws() 
)
explicit

◆ Packet() [6/9]

av::Packet::Packet ( const std::vector< uint8_t > &  data)
explicit

◆ Packet() [7/9]

av::Packet::Packet ( const uint8_t *  data,
size_t  size,
bool  doAllign = true 
)

◆ Packet() [8/9]

av::Packet::Packet ( uint8_t *  data,
size_t  size,
Packet::wrap_data  ,
OptionalErrorCode  ec = throws() 
)

◆ Packet() [9/9]

av::Packet::Packet ( uint8_t *  data,
size_t  size,
Packet::wrap_data_static  ,
OptionalErrorCode  ec = throws() 
)

◆ ~Packet()

av::Packet::~Packet ( )

Member Function Documentation

◆ addFlags()

void av::Packet::addFlags ( int  flags)

◆ clearFlags()

void av::Packet::clearFlags ( int  flags)

◆ clone()

Packet av::Packet::clone ( OptionalErrorCode  ec = throws()) const

◆ data() [1/2]

uint8_t* av::Packet::data ( )

◆ data() [2/2]

uint8_t * av::Packet::data ( ) const

◆ dts()

Timestamp av::Packet::dts ( ) const

◆ dump()

void av::Packet::dump ( const Stream st,
bool  dumpPayload = false 
) const

◆ duration()

int av::Packet::duration ( ) const

◆ flags()

int av::Packet::flags ( ) const

◆ isComplete()

bool av::Packet::isComplete ( ) const

◆ isKeyPacket()

bool av::Packet::isKeyPacket ( ) const

◆ isNull()

bool av::Packet::isNull ( ) const

◆ isReferenced()

bool av::Packet::isReferenced ( ) const

◆ makeRef()

AVPacket av::Packet::makeRef ( OptionalErrorCode  ec = throws()) const

◆ operator bool()

av::Packet::operator bool ( ) const
inline

◆ operator=() [1/3]

Packet & av::Packet::operator= ( const AVPacket &  rhs)

◆ operator=() [2/3]

Packet & av::Packet::operator= ( const Packet rhs)

◆ operator=() [3/3]

Packet & av::Packet::operator= ( Packet &&  rhs)

◆ pts()

Timestamp av::Packet::pts ( ) const

◆ refCount()

int av::Packet::refCount ( ) const

◆ setComplete()

void av::Packet::setComplete ( bool  complete)

◆ setData() [1/2]

bool av::Packet::setData ( const std::vector< uint8_t > &  newData,
OptionalErrorCode  ec = throws() 
)

◆ setData() [2/2]

bool av::Packet::setData ( const uint8_t *  newData,
size_t  size,
OptionalErrorCode  ec = throws() 
)

◆ setDts() [1/2]

void av::Packet::setDts ( const Timestamp dts)

◆ setDts() [2/2]

void av::Packet::setDts ( int64_t  dts,
const Rational tsTimeBase = Rational(0, 0) 
)

◆ setDuration()

void av::Packet::setDuration ( int  duration,
const Rational durationTimeBase = Rational(0, 0) 
)

◆ setFlags()

void av::Packet::setFlags ( int  flags)

◆ setKeyPacket()

void av::Packet::setKeyPacket ( bool  keyPacket)

◆ setPts() [1/2]

void av::Packet::setPts ( const Timestamp pts)

◆ setPts() [2/2]

void av::Packet::setPts ( int64_t  pts,
const Rational tsTimeBase = Rational(0, 0) 
)

Set packet PTS field.

Parameters
ptsnew presentation timestamp value
tsTimeBaseis a time base of setted timestamp, can be omited or sets to Rational(0,0) that means that time base equal to packet time base.

◆ setStreamIndex()

void av::Packet::setStreamIndex ( int  idx)

◆ setTimeBase()

void av::Packet::setTimeBase ( const Rational value)

◆ size()

size_t av::Packet::size ( ) const

◆ streamIndex()

int av::Packet::streamIndex ( ) const

◆ swap()

void av::Packet::swap ( Packet other)

◆ timeBase()

const Rational& av::Packet::timeBase ( ) const
inline

◆ ts()

Timestamp av::Packet::ts ( ) const

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