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

The SampleFormat class is a simple proxy class for AVSampleFormat. More...

#include <sampleformat.h>

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

Public Types

enum  Alignment { AlignDefault = 0, AlignNone = 1 }
 
using Parent = PixSampleFmtWrapper< SampleFormat, AVSampleFormat >
 

Public Member Functions

 SampleFormat ()=default
 
 SampleFormat (const char *name) noexcept
 
 SampleFormat (const std::string &name) noexcept
 
const char * name (OptionalErrorCode ec=throws()) const
 
SampleFormat alternativeSampleFormat (bool isPlanar) const noexcept
 
SampleFormat packedSampleFormat () const noexcept
 
SampleFormat planarSampleFormat () const noexcept
 
bool isPlanar () const noexcept
 
size_t bytesPerSample (OptionalErrorCode ec=throws()) const
 
size_t bitsPerSample (OptionalErrorCode ec=throws()) const
 
size_t requiredBufferSize (int nbChannels, int nbSamples, int align, OptionalErrorCode ec=throws()) const
 
size_t requiredBufferSize (int nbChannels, int nbSamples, int align, int &lineSize, OptionalErrorCode ec=throws()) const
 
- Public Member Functions inherited from PixSampleFmtWrapper< SampleFormat, AVSampleFormat >
constexpr PixSampleFmtWrapper ()=default
 
constexpr PixSampleFmtWrapper (AVSampleFormat fmt) noexcept
 
 operator AVSampleFormat () const noexcept
 
AVSampleFormat get () const noexcept
 
 operator AVSampleFormat & () noexcept
 
SampleFormat & operator= (AVSampleFormat fmt) noexcept
 
void set (AVSampleFormat fmt) noexcept
 

Static Public Member Functions

static size_t requiredBufferSize (SampleFormat fmt, int nbChannels, int nbSamples, int align, OptionalErrorCode ec=throws())
 
static size_t requiredBufferSize (SampleFormat fmt, int nbChannels, int nbSamples, int align, int &lineSize, OptionalErrorCode ec=throws())
 
static void fillArrays (uint8_t **audioData, int *linesize, const uint8_t *buf, int nbChannels, int nbSamples, SampleFormat fmt, int align, OptionalErrorCode ec=throws())
 
static void setSilence (uint8_t **audioData, int offset, int nbSamples, int nbChannels, SampleFormat fmt)
 

Additional Inherited Members

- Protected Attributes inherited from PixSampleFmtWrapper< SampleFormat, AVSampleFormat >
AVSampleFormat m_fmt
 

Detailed Description

The SampleFormat class is a simple proxy class for AVSampleFormat.

It allows to quckly ask some info about sample format. Only base one is provided.

Member Typedef Documentation

◆ Parent

Member Enumeration Documentation

◆ Alignment

Enumerator
AlignDefault 
AlignNone 

Constructor & Destructor Documentation

◆ SampleFormat() [1/3]

av::SampleFormat::SampleFormat ( )
default

◆ SampleFormat() [2/3]

av::SampleFormat::SampleFormat ( const char *  name)
explicitnoexcept

◆ SampleFormat() [3/3]

av::SampleFormat::SampleFormat ( const std::string &  name)
explicitnoexcept

Member Function Documentation

◆ alternativeSampleFormat()

SampleFormat av::SampleFormat::alternativeSampleFormat ( bool  isPlanar) const
noexcept

◆ bitsPerSample()

size_t av::SampleFormat::bitsPerSample ( OptionalErrorCode  ec = throws()) const

◆ bytesPerSample()

size_t av::SampleFormat::bytesPerSample ( OptionalErrorCode  ec = throws()) const

◆ fillArrays()

void av::SampleFormat::fillArrays ( uint8_t **  audioData,
int *  linesize,
const uint8_t *  buf,
int  nbChannels,
int  nbSamples,
SampleFormat  fmt,
int  align,
OptionalErrorCode  ec = throws() 
)
static

◆ isPlanar()

bool av::SampleFormat::isPlanar ( ) const
noexcept

◆ name()

const char * av::SampleFormat::name ( OptionalErrorCode  ec = throws()) const

◆ packedSampleFormat()

SampleFormat av::SampleFormat::packedSampleFormat ( ) const
noexcept

◆ planarSampleFormat()

SampleFormat av::SampleFormat::planarSampleFormat ( ) const
noexcept

◆ requiredBufferSize() [1/4]

size_t av::SampleFormat::requiredBufferSize ( int  nbChannels,
int  nbSamples,
int  align,
int &  lineSize,
OptionalErrorCode  ec = throws() 
) const

◆ requiredBufferSize() [2/4]

size_t av::SampleFormat::requiredBufferSize ( int  nbChannels,
int  nbSamples,
int  align,
OptionalErrorCode  ec = throws() 
) const

◆ requiredBufferSize() [3/4]

size_t av::SampleFormat::requiredBufferSize ( SampleFormat  fmt,
int  nbChannels,
int  nbSamples,
int  align,
int &  lineSize,
OptionalErrorCode  ec = throws() 
)
static

◆ requiredBufferSize() [4/4]

size_t av::SampleFormat::requiredBufferSize ( SampleFormat  fmt,
int  nbChannels,
int  nbSamples,
int  align,
OptionalErrorCode  ec = throws() 
)
static

◆ setSilence()

void av::SampleFormat::setSilence ( uint8_t **  audioData,
int  offset,
int  nbSamples,
int  nbChannels,
SampleFormat  fmt 
)
static

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