arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTSPFormatPCM Class Reference

Linear PCM Format for RTSP Streaming. More...

#include <RTSPFormat.h>

Inheritance diagram for RTSPFormatPCM:
RTSPFormat

Public Member Functions

 RTSPFormatPCM (AudioInfo info, int fragmentSize=640)
 
virtual AudioInfo audioInfo ()
 
void begin (AudioInfo info)
 
int convert (void *data, int samples)
 Convert to network format.
 
AudioInfo defaultConfig () override
 
const char * format (char *buffer, int len) override
 Provide format 10 or 11.
 
virtual int fragmentSize ()
 Fragment (=write) size in bytes.
 
AudioInfo info ()
 
virtual const char * name ()
 
virtual int readHeader (uint8_t *data)
 Optional header: e.g. rfc2250.
 
int rtpPayloadType () override
 default dynamic
 
void setFragmentSize (int fragmentSize)
 Defines the fragment size in bytes.
 
void setName (const char *name)
 Defines the name of the stream.
 
void setTimerPeriodUs (int period)
 Defines the timer period in microseconds.
 
virtual void setUseRfc2250Header (bool)
 Optional: Configure RFC2250 header usage (default: no-op)
 
virtual int timerPeriodUs ()
 Timer period in microseconds.
 
virtual int timestampIncrement ()
 Fragment size in samples.
 
virtual bool useRfc2250Header () const
 

Protected Member Functions

int bytesPerSample ()
 
int channels ()
 
int getTimerPeriod (int fragmentSize)
 Get the timer period for streaming.
 
const char * payloadFormat ()
 
int sampleRate ()
 

Protected Attributes

AudioInfo cfg {16000, 1, 16}
 
int fragment_size = 640
 
const char * name_str = "RTSPAudioTools"
 
char payload_fromat [30]
 
const char * STD_URL_PRE_SUFFIX = "trackID"
 
int timer_period_us = 10000
 

Detailed Description

Linear PCM Format for RTSP Streaming.

RTSPFormatPCM implements the RTSPFormat interface for linear PCM audio, the most common uncompressed audio format. This class:

See also
https://en.wikipedia.org/wiki/RTP_payload_formats
Note
Automatically handles endian conversion for network transmission

Member Function Documentation

◆ audioInfo()

virtual AudioInfo audioInfo ( )
inlinevirtualinherited

Reimplemented in RTSPFormatMP3.

◆ begin()

void begin ( AudioInfo  info)
inlinevirtual

Reimplemented from RTSPFormat.

◆ convert()

int convert ( void *  data,
int  samples 
)
inlinevirtual

Convert to network format.

Parameters
data
byteSize

Reimplemented from RTSPFormat.

◆ defaultConfig()

AudioInfo defaultConfig ( )
inlineoverridevirtual

Implements RTSPFormat.

◆ format()

const char * format ( char *  buffer,
int  len 
)
inlineoverridevirtual

Provide format 10 or 11.

Parameters
buffer
len
Returns
const char*

Implements RTSPFormat.

◆ getTimerPeriod()

int getTimerPeriod ( int  fragmentSize)
inlineprotected

Get the timer period for streaming.

Returns
Timer period in microseconds between audio packets

◆ rtpPayloadType()

int rtpPayloadType ( )
inlineoverridevirtual

default dynamic

Reimplemented from RTSPFormat.

◆ setUseRfc2250Header()

virtual void setUseRfc2250Header ( bool  )
inlinevirtualinherited

Optional: Configure RFC2250 header usage (default: no-op)

Reimplemented in RTSPFormatMP3.

◆ timerPeriodUs()

virtual int timerPeriodUs ( )
inlinevirtualinherited

Timer period in microseconds.

Reimplemented in RTSPFormatADPCM< AudioEncoder >, and RTSPFormatMP3.

◆ timestampIncrement()

virtual int timestampIncrement ( )
inlinevirtualinherited

Fragment size in samples.

Reimplemented in RTSPFormatMP3.


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