Miam-Player  0.8.0
A nice music player
QtAV::AudioFormat Class Reference

#include <AudioFormat.h>

Public Types

enum  SampleFormat {
  SampleFormat_Unknown = 0, SampleFormat_Input = SampleFormat_Unknown, SampleFormat_Unsigned8 = 1 | kUnsigned, SampleFormat_Signed8 = 1,
  SampleFormat_Unigned16 = 2 | kUnsigned, SampleFormat_Signed16 = 2, SampleFormat_Unsigned24 = 3 | kUnsigned, SampleFormat_Signed24 = 3,
  SampleFormat_Unsigned32 = 4 | kUnsigned, SampleFormat_Signed32 = 4, SampleFormat_Float = 4 | kFloat, SampleFormat_Double = 8 | kFloat,
  SampleFormat_Unsigned8Planar = SampleFormat_Unsigned8 | kPlanar, SampleFormat_Signed16Planar = SampleFormat_Signed16 | kPlanar, SampleFormat_Signed32Planar = SampleFormat_Signed32 | kPlanar, SampleFormat_FloatPlanar = SampleFormat_Float | kPlanar,
  SampleFormat_DoublePlanar = SampleFormat_Double | kPlanar
}
 The SampleFormat enum s8, u16, u24, s24, u32 are not listed in ffmpeg sample format and have not planar format. More...
 
enum  ChannelLayout {
  ChannelLayout_Left, ChannelLayout_Right, ChannelLayout_Center, ChannelLayout_Mono = ChannelLayout_Center,
  ChannelLayout_Stereo, ChannelLayout_Unsupported
}
 

Public Member Functions

 AudioFormat ()
 
 AudioFormat (const AudioFormat &other)
 
 ~AudioFormat ()
 
AudioFormatoperator= (const AudioFormat &other)
 
bool operator== (const AudioFormat &other) const
 
bool operator!= (const AudioFormat &other) const
 
bool isValid () const
 
bool isFloat () const
 
bool isUnsigned () const
 
bool isPlanar () const
 
int planeCount () const
 
void setSampleRate (int sampleRate)
 
int sampleRate () const
 
void setChannelLayoutFFmpeg (qint64 layout)
 setChannelLayout and setChannelLayoutFFmpeg also sets the correct channels if channels does not match. More...
 
qint64 channelLayoutFFmpeg () const
 
void setChannelLayout (ChannelLayout layout)
 
ChannelLayout channelLayout () const
 
QString channelLayoutName () const
 
void setChannels (int channels)
 setChannels also sets the default layout for this channels if channels does not match. More...
 
int channels () const
 channels For planar format, channel count == plane count. More...
 
void setSampleFormat (SampleFormat sampleFormat)
 
SampleFormat sampleFormat () const
 
void setSampleFormatFFmpeg (int ffSampleFormat)
 
int sampleFormatFFmpeg () const
 
QString sampleFormatName () const
 
qint32 bytesForDuration (qint64 duration) const
 
qint64 durationForBytes (qint32 byteCount) const
 
qint32 bytesForFrames (qint32 frameCount) const
 
qint32 framesForBytes (qint32 byteCount) const
 
qint32 framesForDuration (qint64 duration) const
 
qint64 durationForFrames (qint32 frameCount) const
 
int bytesPerFrame () const
 Returns the number of bytes required to represent one frame (a sample in each channel) in this format. More...
 
int bytesPerSample () const
 Returns the current sample size value, in bytes. More...
 
int sampleSize () const
 
int bitRate () const
 
int bytesPerSecond () const
 

Static Public Member Functions

static ChannelLayout channelLayoutFromFFmpeg (qint64 clff)
 
static qint64 channelLayoutToFFmpeg (ChannelLayout cl)
 
static SampleFormat sampleFormatFromFFmpeg (int fffmt)
 
static int sampleFormatToFFmpeg (SampleFormat fmt)
 
static bool isPlanar (SampleFormat format)
 
static SampleFormat planarSampleFormat (SampleFormat fmt)
 
static SampleFormat packedSampleFormat (SampleFormat fmt)
 

Member Enumeration Documentation

◆ ChannelLayout

Enumerator
ChannelLayout_Left 
ChannelLayout_Right 
ChannelLayout_Center 
ChannelLayout_Mono 
ChannelLayout_Stereo 
ChannelLayout_Unsupported 

◆ SampleFormat

The SampleFormat enum s8, u16, u24, s24, u32 are not listed in ffmpeg sample format and have not planar format.

pcm_s24le will be decoded as s32-24bit in ffmpeg, it's encoded as 32 bits, but raw sample has 24 bits

Enumerator
SampleFormat_Unknown 
SampleFormat_Input 
SampleFormat_Unsigned8 
SampleFormat_Signed8 
SampleFormat_Unigned16 
SampleFormat_Signed16 
SampleFormat_Unsigned24 
SampleFormat_Signed24 
SampleFormat_Unsigned32 
SampleFormat_Signed32 
SampleFormat_Float 
SampleFormat_Double 
SampleFormat_Unsigned8Planar 
SampleFormat_Signed16Planar 
SampleFormat_Signed32Planar 
SampleFormat_FloatPlanar 
SampleFormat_DoublePlanar 

Constructor & Destructor Documentation

◆ AudioFormat() [1/2]

QtAV::AudioFormat::AudioFormat ( )

◆ AudioFormat() [2/2]

QtAV::AudioFormat::AudioFormat ( const AudioFormat other)

◆ ~AudioFormat()

QtAV::AudioFormat::~AudioFormat ( )

Member Function Documentation

◆ bitRate()

int QtAV::AudioFormat::bitRate ( ) const

◆ bytesForDuration()

qint32 QtAV::AudioFormat::bytesForDuration ( qint64  duration) const

◆ bytesForFrames()

qint32 QtAV::AudioFormat::bytesForFrames ( qint32  frameCount) const

◆ bytesPerFrame()

int QtAV::AudioFormat::bytesPerFrame ( ) const

Returns the number of bytes required to represent one frame (a sample in each channel) in this format.

Returns 0 if this format is invalid.

◆ bytesPerSample()

int QtAV::AudioFormat::bytesPerSample ( ) const

Returns the current sample size value, in bytes.

See also
bytesPerFrame()

◆ bytesPerSecond()

int QtAV::AudioFormat::bytesPerSecond ( ) const

◆ channelLayout()

ChannelLayout QtAV::AudioFormat::channelLayout ( ) const

◆ channelLayoutFFmpeg()

qint64 QtAV::AudioFormat::channelLayoutFFmpeg ( ) const

◆ channelLayoutFromFFmpeg()

static ChannelLayout QtAV::AudioFormat::channelLayoutFromFFmpeg ( qint64  clff)
static

◆ channelLayoutName()

QString QtAV::AudioFormat::channelLayoutName ( ) const

◆ channelLayoutToFFmpeg()

static qint64 QtAV::AudioFormat::channelLayoutToFFmpeg ( ChannelLayout  cl)
static

◆ channels()

int QtAV::AudioFormat::channels ( ) const

channels For planar format, channel count == plane count.

For packed format, plane count is 1

Returns

◆ durationForBytes()

qint64 QtAV::AudioFormat::durationForBytes ( qint32  byteCount) const

◆ durationForFrames()

qint64 QtAV::AudioFormat::durationForFrames ( qint32  frameCount) const

◆ framesForBytes()

qint32 QtAV::AudioFormat::framesForBytes ( qint32  byteCount) const

◆ framesForDuration()

qint32 QtAV::AudioFormat::framesForDuration ( qint64  duration) const

◆ isFloat()

bool QtAV::AudioFormat::isFloat ( ) const

◆ isPlanar() [1/2]

static bool QtAV::AudioFormat::isPlanar ( SampleFormat  format)
static

◆ isPlanar() [2/2]

bool QtAV::AudioFormat::isPlanar ( ) const

◆ isUnsigned()

bool QtAV::AudioFormat::isUnsigned ( ) const

◆ isValid()

bool QtAV::AudioFormat::isValid ( ) const

◆ operator!=()

bool QtAV::AudioFormat::operator!= ( const AudioFormat other) const

◆ operator=()

AudioFormat& QtAV::AudioFormat::operator= ( const AudioFormat other)

◆ operator==()

bool QtAV::AudioFormat::operator== ( const AudioFormat other) const

◆ packedSampleFormat()

static SampleFormat QtAV::AudioFormat::packedSampleFormat ( SampleFormat  fmt)
static

◆ planarSampleFormat()

static SampleFormat QtAV::AudioFormat::planarSampleFormat ( SampleFormat  fmt)
static

◆ planeCount()

int QtAV::AudioFormat::planeCount ( ) const

◆ sampleFormat()

SampleFormat QtAV::AudioFormat::sampleFormat ( ) const

◆ sampleFormatFFmpeg()

int QtAV::AudioFormat::sampleFormatFFmpeg ( ) const

◆ sampleFormatFromFFmpeg()

static SampleFormat QtAV::AudioFormat::sampleFormatFromFFmpeg ( int  fffmt)
static

◆ sampleFormatName()

QString QtAV::AudioFormat::sampleFormatName ( ) const

◆ sampleFormatToFFmpeg()

static int QtAV::AudioFormat::sampleFormatToFFmpeg ( SampleFormat  fmt)
static

◆ sampleRate()

int QtAV::AudioFormat::sampleRate ( ) const

◆ sampleSize()

int QtAV::AudioFormat::sampleSize ( ) const

◆ setChannelLayout()

void QtAV::AudioFormat::setChannelLayout ( ChannelLayout  layout)

◆ setChannelLayoutFFmpeg()

void QtAV::AudioFormat::setChannelLayoutFFmpeg ( qint64  layout)

setChannelLayout and setChannelLayoutFFmpeg also sets the correct channels if channels does not match.

◆ setChannels()

void QtAV::AudioFormat::setChannels ( int  channels)

setChannels also sets the default layout for this channels if channels does not match.

◆ setSampleFormat()

void QtAV::AudioFormat::setSampleFormat ( SampleFormat  sampleFormat)

◆ setSampleFormatFFmpeg()

void QtAV::AudioFormat::setSampleFormatFFmpeg ( int  ffSampleFormat)

◆ setSampleRate()

void QtAV::AudioFormat::setSampleRate ( int  sampleRate)

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