arduino-audio-tools
Loading...
Searching...
No Matches
OggContainerOutput Class Reference

Output class for the OggContainerEncoder. Each write is ending up as container entry. More...

#include <ContainerOgg.h>

Inheritance diagram for OggContainerOutput:
AudioOutput Print AudioInfoSupport AudioInfoSource Print AudioInfoSupport AudioInfoSource OpusOggWriter

Public Member Functions

 OggContainerOutput ()=default
virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
virtual AudioInfo audioInfo () override
 provides the actual input AudioInfo
virtual AudioInfo audioInfo () override
 provides the actual input AudioInfo
virtual AudioInfo audioInfoOut ()
virtual AudioInfo audioInfoOut ()
virtual int availableForWrite () override
virtual int availableForWrite () override
virtual bool begin (AudioInfo info)
virtual bool begin () override
 starts the processing using the actual AudioInfo
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
void end () override
 stops the processing
virtual void flush ()
virtual void flush ()
virtual bool isDeletable ()
 If true we need to release the related memory in the destructor.
virtual bool isDeletable ()
 If true we need to release the related memory in the destructor.
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
bool isOpen ()
virtual operator bool ()
virtual operator bool ()
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
virtual void setAudioInfo (AudioInfo newInfo) override
 Defines the input AudioInfo.
virtual void setAudioInfo (AudioInfo newInfo) override
 Defines the input AudioInfo.
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active).
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active).
void setOutput (Print &print)
 Defines the output Stream.
virtual size_t write (uint8_t ch) override
virtual size_t write (const uint8_t *data, size_t len) override
 Writes raw data to be encoded and packaged.
virtual void writeSilence (size_t len)
virtual void writeSilence (size_t len)

Protected Member Functions

void notifyAudioChange (AudioInfo info)
void notifyAudioChange (AudioInfo info)
virtual bool writeFooter ()
virtual bool writeHeader ()
virtual bool writePacket (ogg_packet &op, int flag=0)

Static Protected Member Functions

static size_t ogg_io_write (void *user_handle, void *buf, size_t n)

Protected Attributes

int _timeout = 10
AudioInfo cfg
size_t granulepos = 0
bool is_active = false
bool is_audio = false
bool is_notify_active = true
bool is_open = false
Vector< AudioInfoSupport * > notify_vector
ogg_packet oh
ogg_packet op
OGGZ * p_oggz = nullptr
Print * p_out = nullptr
size_t packetno = 0
long serialno = -1
SingleBuffer< uint8_t > tmp { 8 }
int tmpPos = 0

Detailed Description

Output class for the OggContainerEncoder. Each write is ending up as container entry.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ OggContainerOutput()

OggContainerOutput ( )
default

Member Function Documentation

◆ addNotifyAudioChange() [1/2]

virtual void addNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Adds target to be notified about audio changes.

Reimplemented in CodecNOP, CodecNOP, EncodedAudioOutput, and EncodedAudioStream.

◆ addNotifyAudioChange() [2/2]

virtual void addNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Adds target to be notified about audio changes.

Reimplemented in CodecNOP, CodecNOP, EncodedAudioOutput, and EncodedAudioStream.

◆ audioInfo() [1/2]

virtual AudioInfo audioInfo ( )
inlineoverridevirtualinherited

◆ audioInfo() [2/2]

virtual AudioInfo audioInfo ( )
inlineoverridevirtualinherited

◆ audioInfoOut() [1/2]

◆ audioInfoOut() [2/2]

◆ availableForWrite() [1/2]

◆ availableForWrite() [2/2]

◆ begin() [1/2]

virtual bool begin ( AudioInfo info)
inlinevirtualinherited

◆ begin() [2/2]

virtual bool begin ( )
inlineoverridevirtual

starts the processing using the actual AudioInfo

Reimplemented from AudioOutput.

◆ clearNotifyAudioChange() [1/2]

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

◆ clearNotifyAudioChange() [2/2]

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

◆ end()

void end ( )
inlineoverridevirtual

stops the processing

Reimplemented from AudioOutput.

Reimplemented in OpusOggWriter.

◆ flush() [1/2]

virtual void flush ( )
inlinevirtualinherited

Reimplemented from Print.

Reimplemented in HexDumpOutput, HexDumpOutput, MultiOutput, HexDumpOutput, and MultiOutput.

◆ flush() [2/2]

virtual void flush ( )
inlinevirtualinherited

Reimplemented from Print.

Reimplemented in HexDumpOutput, HexDumpOutput, MultiOutput, HexDumpOutput, and MultiOutput.

◆ isDeletable() [1/2]

virtual bool isDeletable ( )
inlinevirtualinherited

If true we need to release the related memory in the destructor.

Reimplemented in AdapterAudioStreamToAudioOutput, AdapterPrintToAudioOutput, AdapterAudioStreamToAudioOutput, and AdapterPrintToAudioOutput.

◆ isDeletable() [2/2]

virtual bool isDeletable ( )
inlinevirtualinherited

If true we need to release the related memory in the destructor.

Reimplemented in AdapterAudioStreamToAudioOutput, AdapterPrintToAudioOutput, AdapterAudioStreamToAudioOutput, and AdapterPrintToAudioOutput.

◆ isNotifyActive() [1/2]

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ isNotifyActive() [2/2]

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ isOpen()

bool isOpen ( )
inline

◆ notifyAudioChange() [1/2]

void notifyAudioChange ( AudioInfo info)
inlineprotectedinherited

◆ notifyAudioChange() [2/2]

void notifyAudioChange ( AudioInfo info)
inlineprotectedinherited

◆ ogg_io_write()

size_t ogg_io_write ( void * user_handle,
void * buf,
size_t n )
inlinestaticprotected

◆ operator bool() [1/2]

virtual operator bool ( )
inlinevirtualinherited

◆ operator bool() [2/2]

virtual operator bool ( )
inlinevirtualinherited

◆ removeNotifyAudioChange() [1/2]

virtual bool removeNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

◆ removeNotifyAudioChange() [2/2]

virtual bool removeNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

◆ setAudioInfo() [1/2]

virtual void setAudioInfo ( AudioInfo info)
inlineoverridevirtualinherited

◆ setAudioInfo() [2/2]

virtual void setAudioInfo ( AudioInfo info)
inlineoverridevirtualinherited

◆ setNotifyActive() [1/2]

void setNotifyActive ( bool flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active).

◆ setNotifyActive() [2/2]

void setNotifyActive ( bool flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active).

◆ setOutput()

void setOutput ( Print & print)
inline

Defines the output Stream.

◆ write() [1/2]

virtual size_t write ( uint8_t ch)
inlineoverridevirtualinherited

Reimplemented in MultiOutput, MetaDataOutput, and MultiOutput.

◆ write() [2/2]

virtual size_t write ( const uint8_t * data,
size_t len )
inlineoverridevirtual

Writes raw data to be encoded and packaged.

Implements AudioOutput.

Reimplemented in OpusOggWriter.

◆ writeFooter()

virtual bool writeFooter ( )
inlineprotectedvirtual

◆ writeHeader()

virtual bool writeHeader ( )
inlineprotectedvirtual

Reimplemented in OpusOggWriter.

◆ writePacket()

virtual bool writePacket ( ogg_packet & op,
int flag = 0 )
inlineprotectedvirtual

◆ writeSilence() [1/2]

virtual void writeSilence ( size_t len)
inlinevirtualinherited

Writes n 0 values (= silence)

Parameters
len

◆ writeSilence() [2/2]

virtual void writeSilence ( size_t len)
inlinevirtualinherited

Writes n 0 values (= silence)

Parameters
len

Member Data Documentation

◆ _timeout

int _timeout = 10
protectedinherited

◆ cfg

AudioInfo cfg
protectedinherited

◆ granulepos

size_t granulepos = 0
protected

◆ is_active

bool is_active = false
protectedinherited

◆ is_audio

bool is_audio = false
protected

◆ is_notify_active

bool is_notify_active = true
protectedinherited

◆ is_open

bool is_open = false
protected

◆ notify_vector

Vector< AudioInfoSupport * > notify_vector
protectedinherited

◆ oh

ogg_packet oh
protected

◆ op

ogg_packet op
protected

◆ p_oggz

OGGZ* p_oggz = nullptr
protected

◆ p_out

Print* p_out = nullptr
protected

◆ packetno

size_t packetno = 0
protected

◆ serialno

long serialno = -1
protected

◆ tmp

SingleBuffer< uint8_t > tmp { 8 }
protectedinherited

◆ tmpPos

int tmpPos = 0
protectedinherited

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