arduino-audio-tools
|
RTSPOutput - Audio Output Stream for RTSP Streaming. More...
#include <RTSPOutput.h>
Public Member Functions | |
RTSPOutput ()=default | |
Construct RTSPOutput with default PCM format (no encoding) | |
RTSPOutput (RTSPFormat &format, AudioEncoder &encoder) | |
Construct RTSPOutput with specific encoder and format. | |
virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
Adds target to be notified about audio changes. | |
virtual AudioInfo | audioInfo () override |
provides the actual input AudioInfo | |
virtual AudioInfo | audioInfoOut () |
int | availableForWrite () |
Get available space for writing audio data. | |
bool | begin () |
Initialize RTSPOutput with current audio configuration. | |
bool | begin (AudioInfo info) |
Initialize RTSPOutput with specific audio configuration. | |
virtual void | clearNotifyAudioChange () |
Deletes all change notify subscriptions. | |
void | end () |
Stop RTSP streaming and cleanup resources. | |
virtual void | flush () |
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. | |
operator bool () | |
Check if RTSP streaming is active. | |
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. | |
void | setFormat (RTSPFormat &format) |
void | setNotifyActive (bool flag) |
Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
RTSPAudioStreamer< Platform > & | streamer () |
Get access to the underlying RTSP streamer. | |
size_t | write (const uint8_t *data, size_t len) override |
Write PCM audio data for encoding and streaming. | |
virtual size_t | write (uint8_t ch) override |
virtual void | writeSilence (size_t len) |
Protected Member Functions | |
void | notifyAudioChange (AudioInfo info) |
Protected Attributes | |
int | _timeout = 10 |
AudioInfo | cfg |
CopyEncoder | copy_encoder |
Pass-through encoder for PCM mode. | |
bool | is_active = false |
bool | is_notify_active = true |
DynamicMemoryStream | memory_stream {false, 1024, 10} |
Memory stream for internal buffer. | |
Vector< AudioInfoSupport * > | notify_vector |
AudioEncoder * | p_encoder |
Active encoder (PCM or codec-specific) | |
RTSPFormat * | p_format = &pcm |
Active format handler. | |
RTSPFormatPCM | pcm |
Default PCM format handler (merged class) | |
RTSPAudioSource | rtsp_source |
Provides encoded audio to streamer. | |
RTSPAudioStreamer< Platform > | rtsp_streamer |
Handles RTP packet transmission. | |
SingleBuffer< uint8_t > | tmp {MAX_SINGLE_CHARS} |
int | tmpPos = 0 |
RTSPOutput - Audio Output Stream for RTSP Streaming.
Accepts PCM audio data, encodes it using the specified encoder, and makes it available for RTSP streaming via an integrated RTSPAudioStreamer.
Data flow: PCM input → encoder → internal queue → RTSP source → RTP packets
Platform | Platform-specific implementation (RTSPPlatformWiFi, etc.) |
|
inline |
Construct RTSPOutput with specific encoder and format.
format | Format handler providing SDP configuration and timing |
encoder | Audio encoder for PCM compression |
bufferSize | Internal buffer size in bytes (default: 2KB) |
|
default |
Construct RTSPOutput with default PCM format (no encoding)
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in AdapterPrintToAudioOutput, EncodedAudioOutput, and AdapterAudioStreamToAudioOutput.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlinevirtual |
Get available space for writing audio data.
Reimplemented from AudioOutput.
|
inlinevirtual |
Initialize RTSPOutput with current audio configuration.
Reimplemented from AudioOutput.
|
inlinevirtual |
Initialize RTSPOutput with specific audio configuration.
info | Audio configuration (sample rate, channels, bits per sample) |
Reimplemented from AudioOutput.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlinevirtual |
Stop RTSP streaming and cleanup resources.
Reimplemented from AudioOutput.
|
inlinevirtualinherited |
Reimplemented from Print.
|
inlinevirtualinherited |
If true we need to release the related memory in the destructor.
Reimplemented in AdapterPrintToAudioOutput, and AdapterAudioStreamToAudioOutput.
|
inlinevirtual |
Check if RTSP streaming is active.
Reimplemented from AudioOutput.
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineoverridevirtualinherited |
Defines the input AudioInfo.
Implements AudioInfoSupport.
Reimplemented in ChannelsSelectOutput, AdapterPrintToAudioOutput, MultiOutput, AdapterAudioStreamToAudioOutput, CsvOutput< T >, PWMAudioOutput, and EncodedAudioOutput.
|
inline |
Get access to the underlying RTSP streamer.
|
inlineoverridevirtual |
Write PCM audio data for encoding and streaming.
data | Pointer to PCM audio data buffer |
len | Number of bytes to write |
Implements AudioOutput.
|
inlinevirtualinherited |
Writes n 0 values (= silence)
len |
|
protected |
Active encoder (PCM or codec-specific)