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

Dummy no implmentation Codec. This is used so that we can initialize some pointers to decoders and encoders to make sure that they do not point to null. More...

#include <CodecOpusOgg.h>

Inheritance diagram for CodecNOP:
AudioDecoder AudioEncoder AudioDecoder AudioEncoder MimeSource AudioWriter MimeSource AudioWriter AudioInfoSource AudioWriter AudioInfoSource AudioWriter MimeSource AudioWriter MimeSource AudioWriter AudioInfoSource AudioWriter AudioInfoSource AudioWriter

Public Member Functions

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 ()
 provides the actual input AudioInfo
virtual AudioInfo audioInfo ()
 provides the actual input AudioInfo
virtual AudioInfo audioInfoOut ()
virtual AudioInfo audioInfoOut ()
virtual bool begin (AudioInfo info) override
virtual bool begin ()
virtual bool begin ()
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
virtual void end ()
virtual void end ()
virtual uint32_t frameDurationUs ()
 Optional rtsp function: provide the frame duration in microseconds.
virtual uint32_t frameDurationUs ()
 Optional rtsp function: provide the frame duration in microseconds.
virtual int frameSize ()
virtual int frameSize ()
Print * getOutput ()
Print * getOutput ()
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
virtual bool isResultPCM ()
 Returns true to indicate that the decoding result is PCM data.
virtual bool isResultPCM ()
 Returns true to indicate that the decoding result is PCM data.
virtual const char * mime ()
 Provides the mime type of the data that is expected by this decoder.
virtual const char * mime ()
 Provides the mime type of the data that is expected by this decoder.
virtual operator bool ()
virtual operator bool ()
virtual int readStream (Stream &in)
virtual int readStream (Stream &in)
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 uint16_t samplesPerFrame ()
 Optional rtsp function: provide samples per the frame.
virtual uint16_t samplesPerFrame ()
 Optional rtsp function: provide samples per the frame.
virtual void setAudioInfo (AudioInfo info)
 for most decoders this is not needed
virtual void setAudioInfo (AudioInfo info)
 for most decoders this is not needed
virtual bool setCodecConfig (const uint8_t *data, size_t len)
 Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
virtual bool setCodecConfig (const uint8_t *data, size_t len)
 Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active).
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active).
virtual void setOutput (AudioOutput &out_stream)
 Defines where the decoded result is written to.
virtual void setOutput (AudioStream &out_stream)
 Defines where the decoded result is written to.
virtual void setOutput (Print &out_stream)
 Defines where the decoded result is written to.
virtual void setOutput (Print &out_stream)
 Defines where the decoded result is written to.
virtual size_t write (const uint8_t *data, size_t len)
virtual size_t write (const uint8_t *data, size_t len)

Static Public Member Functions

static CodecNOP * instance ()
static CodecNOP * instance ()

Public Attributes

int id
 custom id to be used by application

Protected Member Functions

void notifyAudioChange (AudioInfo info)
void notifyAudioChange (AudioInfo info)
void writeBlocking (Print *out, uint8_t *data, size_t len)
void writeBlocking (Print *out, uint8_t *data, size_t len)

Protected Attributes

AudioInfo info
AudioInfo info
bool is_notify_active = true
Vector< AudioInfoSupport * > notify_vector
Print * p_print = nullptr

Detailed Description

Dummy no implmentation Codec. This is used so that we can initialize some pointers to decoders and encoders to make sure that they do not point to null.

Author
Phil Schatzmann

Member Function Documentation

◆ addNotifyAudioChange() [1/2]

virtual void addNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtual

Adds target to be notified about audio changes.

Reimplemented from AudioInfoSource.

◆ addNotifyAudioChange() [2/2]

virtual void addNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtual

Adds target to be notified about audio changes.

Reimplemented from AudioInfoSource.

◆ audioInfo() [1/2]

virtual AudioInfo audioInfo ( )
inlinevirtual

provides the actual input AudioInfo

Reimplemented from AudioDecoder.

◆ audioInfo() [2/2]

virtual AudioInfo audioInfo ( )
inlinevirtual

provides the actual input AudioInfo

Reimplemented from AudioDecoder.

◆ audioInfoOut() [1/2]

◆ audioInfoOut() [2/2]

◆ begin() [1/3]

virtual bool begin ( AudioInfo info)
inlineoverridevirtualinherited

Reimplemented from AudioWriter.

◆ begin() [2/3]

virtual bool begin ( )
inlinevirtual

Reimplemented from AudioDecoder.

◆ begin() [3/3]

virtual bool begin ( )
inlinevirtual

Reimplemented from AudioDecoder.

◆ clearNotifyAudioChange() [1/2]

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

◆ clearNotifyAudioChange() [2/2]

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

◆ end() [1/2]

virtual void end ( )
inlinevirtual

Reimplemented from AudioDecoder.

◆ end() [2/2]

virtual void end ( )
inlinevirtual

Reimplemented from AudioDecoder.

◆ frameDurationUs() [1/2]

virtual uint32_t frameDurationUs ( )
inlinevirtualinherited

Optional rtsp function: provide the frame duration in microseconds.

Reimplemented in ADPCMEncoder, MetaDataFilterEncoder, MP3EncoderShine, MP3ParserEncoder, and OpusOggEncoder.

◆ frameDurationUs() [2/2]

virtual uint32_t frameDurationUs ( )
inlinevirtualinherited

Optional rtsp function: provide the frame duration in microseconds.

Reimplemented in ADPCMEncoder, MetaDataFilterEncoder, MP3EncoderShine, MP3ParserEncoder, and OpusOggEncoder.

◆ frameSize() [1/2]

virtual int frameSize ( )
inlinevirtualinherited

Optional rtsp function: provide the encoded size (in bytes) of one frame, once known (e.g. after the encoder has seen real data). Lets an RTSPFormat size its RTP fragments to match one frame instead of a fixed guess, so throughput actually tracks frameDurationUs() - a fragment size covering several frames' worth of bytes sent at one-frame timing overruns real-time bandwidth and, over UDP (no flow control), causes packet loss. Returns 0 if not yet known/not applicable (fixed-frame-size codecs have no need to override this).

Reimplemented in ADPCMEncoder, AMRNBEncoder, AMRWBEncoder, EncoderALAC, and MP3ParserEncoder.

◆ frameSize() [2/2]

virtual int frameSize ( )
inlinevirtualinherited

Optional rtsp function: provide the encoded size (in bytes) of one frame, once known (e.g. after the encoder has seen real data). Lets an RTSPFormat size its RTP fragments to match one frame instead of a fixed guess, so throughput actually tracks frameDurationUs() - a fragment size covering several frames' worth of bytes sent at one-frame timing overruns real-time bandwidth and, over UDP (no flow control), causes packet loss. Returns 0 if not yet known/not applicable (fixed-frame-size codecs have no need to override this).

Reimplemented in ADPCMEncoder, AMRNBEncoder, AMRWBEncoder, EncoderALAC, and MP3ParserEncoder.

◆ getOutput() [1/2]

Print * getOutput ( )
inlineinherited

◆ getOutput() [2/2]

Print * getOutput ( )
inlineinherited

◆ instance() [1/2]

CodecNOP * instance ( )
inlinestatic

◆ instance() [2/2]

CodecNOP * instance ( )
inlinestatic

◆ 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.

◆ isResultPCM() [1/2]

virtual bool isResultPCM ( )
inlinevirtualinherited

Returns true to indicate that the decoding result is PCM data.

Reimplemented in ContainerM4A, CopyDecoder, and DecoderNetworkFormat.

◆ isResultPCM() [2/2]

virtual bool isResultPCM ( )
inlinevirtualinherited

Returns true to indicate that the decoding result is PCM data.

Reimplemented in ContainerM4A, CopyDecoder, and DecoderNetworkFormat.

◆ mime() [1/2]

virtual const char * mime ( )
inlinevirtual

Provides the mime type of the data that is expected by this decoder.

Implements AudioDecoder.

◆ mime() [2/2]

virtual const char * mime ( )
inlinevirtual

Provides the mime type of the data that is expected by this decoder.

Implements AudioDecoder.

◆ notifyAudioChange() [1/2]

void notifyAudioChange ( AudioInfo info)
inlineprotectedinherited

◆ notifyAudioChange() [2/2]

void notifyAudioChange ( AudioInfo info)
inlineprotectedinherited

◆ operator bool() [1/2]

virtual operator bool ( )
inlinevirtual

Implements AudioWriter.

◆ operator bool() [2/2]

virtual operator bool ( )
inlinevirtual

Implements AudioWriter.

◆ readStream() [1/2]

virtual int readStream ( Stream & in)
inlinevirtual

◆ readStream() [2/2]

virtual int readStream ( Stream & in)
inlinevirtual

◆ 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.

◆ samplesPerFrame() [1/2]

virtual uint16_t samplesPerFrame ( )
inlinevirtualinherited

Optional rtsp function: provide samples per the frame.

Reimplemented in MetaDataFilterEncoder, MP3EncoderShine, MP3ParserEncoder, OpusAudioEncoder, and OpusMultiStreamAudioEncoder.

◆ samplesPerFrame() [2/2]

virtual uint16_t samplesPerFrame ( )
inlinevirtualinherited

Optional rtsp function: provide samples per the frame.

Reimplemented in MetaDataFilterEncoder, MP3EncoderShine, MP3ParserEncoder, OpusAudioEncoder, and OpusMultiStreamAudioEncoder.

◆ setAudioInfo() [1/2]

virtual void setAudioInfo ( AudioInfo from)
inlinevirtual

for most decoders this is not needed

Reimplemented from AudioDecoder.

◆ setAudioInfo() [2/2]

virtual void setAudioInfo ( AudioInfo from)
inlinevirtual

for most decoders this is not needed

Reimplemented from AudioDecoder.

◆ setCodecConfig() [1/2]

virtual bool setCodecConfig ( const uint8_t * data,
size_t len )
inlinevirtualinherited

Some decoders need e.g. a magic cookie to provide the relevant info for decoding.

Reimplemented in DecoderALAC, and MultiDecoder.

◆ setCodecConfig() [2/2]

virtual bool setCodecConfig ( const uint8_t * data,
size_t len )
inlinevirtualinherited

Some decoders need e.g. a magic cookie to provide the relevant info for decoding.

Reimplemented in DecoderALAC, and MultiDecoder.

◆ 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() [1/4]

virtual void setOutput ( AudioOutput & out_stream)
inlinevirtualinherited

Defines where the decoded result is written to.

◆ setOutput() [2/4]

virtual void setOutput ( AudioStream & out_stream)
inlinevirtualinherited

Defines where the decoded result is written to.

◆ setOutput() [3/4]

virtual void setOutput ( Print & out_stream)
inlinevirtual

Defines where the decoded result is written to.

Reimplemented from AudioDecoder.

◆ setOutput() [4/4]

virtual void setOutput ( Print & out_stream)
inlinevirtual

Defines where the decoded result is written to.

Reimplemented from AudioDecoder.

◆ write() [1/2]

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

Implements AudioWriter.

◆ write() [2/2]

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

Implements AudioWriter.

◆ writeBlocking() [1/2]

void writeBlocking ( Print * out,
uint8_t * data,
size_t len )
inlineprotectedinherited

◆ writeBlocking() [2/2]

void writeBlocking ( Print * out,
uint8_t * data,
size_t len )
inlineprotectedinherited

Member Data Documentation

◆ id

int id
inherited

custom id to be used by application

◆ info [1/2]

AudioInfo info
protectedinherited

◆ info [2/2]

AudioInfo info
protectedinherited

◆ is_notify_active

bool is_notify_active = true
protectedinherited

◆ notify_vector

Vector< AudioInfoSupport * > notify_vector
protectedinherited

◆ p_print

Print * p_print = nullptr
protectedinherited

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