HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephAudio::FFmpegEncodedAudioBuffer Class Referencefinal

stores the audio data that's encoded via FFmpeg. More...

#include <FFmpegEncodedAudioBuffer.h>

Inheritance diagram for HephAudio::FFmpegEncodedAudioBuffer:
HephAudio::EncodedAudioBuffer Heph::BufferBase< EncodedAudioBuffer, uint8_t >

Public Member Functions

 FFmpegEncodedAudioBuffer ()
 
 FFmpegEncodedAudioBuffer (const AudioFormatInfo &formatInfo)
 
 FFmpegEncodedAudioBuffer (const FFmpegEncodedAudioBuffer &)=delete
 
 FFmpegEncodedAudioBuffer (FFmpegEncodedAudioBuffer &&rhs) noexcept
 
 ~FFmpegEncodedAudioBuffer ()
 
FFmpegEncodedAudioBufferoperator= (const FFmpegEncodedAudioBuffer &)=delete
 
FFmpegEncodedAudioBufferoperator= (FFmpegEncodedAudioBuffer &&rhs) noexcept
 
AVPacket *& operator[] (size_t index) const
 
void Release () override
 
size_t GetFrameCount () const
 
size_t GetBlockAlign () const
 
void SetBlockAlign (size_t blockAlign)
 
size_t GetExtraDataSize () const
 
void * GetExtraData () const
 
void SetExtraData (void *pExtraData, size_t extraDataSize)
 
void Add (AVPacket *packet, size_t frameCount)
 
AVPacket ** begin () const
 
AVPacket ** end () const
 
- Public Member Functions inherited from HephAudio::EncodedAudioBuffer
 EncodedAudioBuffer ()
 
 EncodedAudioBuffer (const AudioFormatInfo &formatInfo)
 
 EncodedAudioBuffer (size_t size, const AudioFormatInfo &formatInfo)
 
 EncodedAudioBuffer (const uint8_t *pData, size_t size, const AudioFormatInfo &formatInfo)
 
 EncodedAudioBuffer (const EncodedAudioBuffer &)=delete
 
 EncodedAudioBuffer (EncodedAudioBuffer &&rhs) noexcept
 
virtual ~EncodedAudioBuffer ()=default
 
EncodedAudioBufferoperator= (const EncodedAudioBuffer &)=delete
 
EncodedAudioBufferoperator= (EncodedAudioBuffer &&rhs) noexcept
 
const AudioFormatInfoGetAudioFormatInfo () const
 
void SetAudioFormatInfo (const AudioFormatInfo &newFormatInfo)
 
void Add (const uint8_t *pData, size_t size)
 

Additional Inherited Members

- Protected Member Functions inherited from Heph::BufferBase< EncodedAudioBuffer, uint8_t >
 BufferBase ()
 
 BufferBase (size_t size)
 
 BufferBase (size_t size, BufferFlags flags)
 
 BufferBase (const std::initializer_list< uint8_t > &rhs)
 
 BufferBase (const BufferBase &rhs)
 
 BufferBase (BufferBase &&rhs) noexcept
 
EncodedAudioBuffer & operator= (const std::initializer_list< uint8_t > &rhs)
 
EncodedAudioBuffer & operator= (const EncodedAudioBuffer &rhs)
 
EncodedAudioBuffer & operator= (EncodedAudioBuffer &&rhs) noexcept
 
virtual ~BufferBase ()
 
virtual EncodedAudioBuffer operator<< (size_t rhs) const
 
virtual EncodedAudioBuffer & operator<<= (size_t rhs)
 
virtual EncodedAudioBuffer operator>> (size_t rhs) const
 
virtual EncodedAudioBuffer & operator>>= (size_t rhs)
 
virtual bool operator== (const EncodedAudioBuffer &rhs) const
 
virtual bool operator!= (const EncodedAudioBuffer &rhs) const
 
uint8_t & operator[] (size_t index) const
 
size_t Size () const
 
size_t SizeAsByte () const
 
uint8_t & At (size_t index) const
 
virtual bool IsEmpty () const
 
virtual void Reset ()
 
virtual EncodedAudioBuffer SubBuffer (size_t index, size_t size) const
 
virtual void Prepend (const EncodedAudioBuffer &rhs)
 
virtual void Append (const EncodedAudioBuffer &rhs)
 
virtual void Insert (const EncodedAudioBuffer &rhs, size_t index)
 
virtual void Cut (size_t index, size_t size)
 
virtual void Replace (const EncodedAudioBuffer &rhs, size_t index)
 
virtual void Replace (const EncodedAudioBuffer &rhs, size_t index, size_t size)
 
virtual void Resize (size_t newSize)
 
virtual void Reverse ()
 
uint8_t * begin () const
 
uint8_t * end () const
 
- Static Protected Member Functions inherited from Heph::BufferBase< EncodedAudioBuffer, uint8_t >
static size_t SizeAsByte (size_t size)
 
static uint8_t * SubBuffer (uint8_t *pThisData, size_t thisSize_byte, size_t index_byte, size_t subBufferSize_byte)
 
static uint8_t * Prepend (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte)
 
static uint8_t * Append (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte)
 
static uint8_t * Insert (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte, size_t index_byte)
 
static uint8_t * Cut (uint8_t *pThisData, size_t thisSize_byte, size_t index_byte, size_t &cutSize_byte)
 
static void Replace (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte, size_t index_byte)
 
static std::enable_if< std::is_class< U >::value >::type Initialize (U *pData, U *pDataEnd)
 
static std::enable_if<!std::is_class< U >::value >::type Initialize (U *pData, U *pDataEnd)
 
static uint8_t * Allocate (size_t size_byte)
 
static uint8_t * AllocateUninitialized (size_t size_byte)
 
- Protected Attributes inherited from HephAudio::EncodedAudioBuffer
AudioFormatInfo formatInfo
 
- Protected Attributes inherited from Heph::BufferBase< EncodedAudioBuffer, uint8_t >
uint8_t * pData
 
size_t size
 

Detailed Description

stores the audio data that's encoded via FFmpeg.

Constructor & Destructor Documentation

◆ FFmpegEncodedAudioBuffer() [1/3]

HephAudio::FFmpegEncodedAudioBuffer::FFmpegEncodedAudioBuffer ( )

creates a new instance and initializes it with default values.

◆ FFmpegEncodedAudioBuffer() [2/3]

HephAudio::FFmpegEncodedAudioBuffer::FFmpegEncodedAudioBuffer ( const AudioFormatInfo & formatInfo)
explicit

creates a new instance and initializes it with the provided values.

Parameters
formatInfoaudio format info of the encoded data.

◆ FFmpegEncodedAudioBuffer() [3/3]

HephAudio::FFmpegEncodedAudioBuffer::FFmpegEncodedAudioBuffer ( FFmpegEncodedAudioBuffer && rhs)
noexcept

creates a new instance and moves the rhs's data to it.

Parameters
rhsinstance whose data will be moved.

◆ ~FFmpegEncodedAudioBuffer()

HephAudio::FFmpegEncodedAudioBuffer::~FFmpegEncodedAudioBuffer ( )

releases the resources and destroys the instance.

Member Function Documentation

◆ operator[]()

AVPacket *& HephAudio::FFmpegEncodedAudioBuffer::operator[] ( size_t index) const

gets the packet at the provided index.

Parameters
indexindex of the packet.

◆ Release()

void HephAudio::FFmpegEncodedAudioBuffer::Release ( )
overridevirtual

releases the resources.

Reimplemented from HephAudio::EncodedAudioBuffer.

◆ GetFrameCount()

size_t HephAudio::FFmpegEncodedAudioBuffer::GetFrameCount ( ) const

gets the frame count.

◆ GetBlockAlign()

size_t HephAudio::FFmpegEncodedAudioBuffer::GetBlockAlign ( ) const

gets the block align.

◆ SetBlockAlign()

void HephAudio::FFmpegEncodedAudioBuffer::SetBlockAlign ( size_t blockAlign)

sets the block align.

◆ GetExtraDataSize()

size_t HephAudio::FFmpegEncodedAudioBuffer::GetExtraDataSize ( ) const

gets the extra data size.

◆ GetExtraData()

void * HephAudio::FFmpegEncodedAudioBuffer::GetExtraData ( ) const

gets the pointer to extra data.

◆ SetExtraData()

void HephAudio::FFmpegEncodedAudioBuffer::SetExtraData ( void * pExtraData,
size_t extraDataSize )

sets the extra data.

◆ Add()

void HephAudio::FFmpegEncodedAudioBuffer::Add ( AVPacket * packet,
size_t frameCount )

adds a new packet to the buffer.

Parameters
frameCountnumber of frames the packet contains.

◆ begin()

AVPacket ** HephAudio::FFmpegEncodedAudioBuffer::begin ( ) const

gets the pointer to the first packet.

◆ end()

AVPacket ** HephAudio::FFmpegEncodedAudioBuffer::end ( ) const

gets the pointer to the end of the last packet.