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

MP3 format for RTSP https://en.wikipedia.org/wiki/RTP_payload_formats. More...

#include <RTSPFormat.h>

Inheritance diagram for RTSPFormatMP3:
RTSPFormat

Public Member Functions

 RTSPFormatMP3 ()
 
 RTSPFormatMP3 (AudioEncoder &encoder)
 Provide dynamic frame duration if encoder is available.
 
AudioInfo audioInfo ()
 Provides the AudioInfo.
 
void begin (AudioInfo info) override
 
virtual void begin (RTSPVideoInfo info)
 
virtual int convert (void *data, int sampleCount)
 
AudioInfo defaultConfig ()
 
virtual RTSPVideoInfo defaultVideoConfig ()
 
const char * format (char *buffer, int len) override
 
int fragmentSize () override
 
virtual MediaType mediaType ()
 
virtual const char * name ()
 
virtual int readHeader (uint8_t *data)
 Optional header: e.g. rfc2250.
 
int readHeader (unsigned char *buffer) override
 rfc2250 header before the playload
 
int rtpPayloadType () override
 default dynamic
 
void setEncoder (AudioEncoder &encoder)
 
void setFragmentSize (int fragmentSize)
 Defines the fragment size in bytes.
 
void setName (const char *name)
 Defines the name of the stream.
 
virtual void setProfileLevelId (const char *)
 
virtual void setSpropParameterSets (const char *, const char *)
 
void setTimerPeriodUs (int period)
 Defines the timer period in microseconds.
 
void setUseRfc2250Header (bool enable)
 Optional: Configure RFC2250 header usage (default: no-op)
 
int timerPeriodUs ()
 Timer period in microseconds.
 
virtual int timestampIncrement ()
 Fragment size in samples (for audio) or timestamp increment (for video)
 
bool useRfc2250Header () const override
 
virtual RTSPVideoInfo videoInfo ()
 

Protected Attributes

AudioInfo cfg {16000, 1, 16}
 
int fragment_size = 640
 
const char * name_str = "RTSPAudioTools"
 
AudioEncoderp_encoder = nullptr
 
const char * STD_URL_PRE_SUFFIX = "trackID"
 
int timer_period_us = 10000
 
bool use_rfc2250_header_ = false
 
RTSPVideoInfo video_cfg {640, 480, 30.0f, RTSPVideoFormat::MJPEG, 24}
 

Detailed Description

MP3 format for RTSP https://en.wikipedia.org/wiki/RTP_payload_formats.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ RTSPFormatMP3() [1/2]

RTSPFormatMP3 ( )
inline

◆ RTSPFormatMP3() [2/2]

RTSPFormatMP3 ( AudioEncoder encoder)
inline

Provide dynamic frame duration if encoder is available.

Member Function Documentation

◆ audioInfo()

AudioInfo audioInfo ( )
inlinevirtual

Provides the AudioInfo.

Reimplemented from RTSPFormat.

◆ begin() [1/2]

void begin ( AudioInfo  info)
inlineoverridevirtual

Reimplemented from RTSPFormat.

◆ begin() [2/2]

virtual void begin ( RTSPVideoInfo  info)
inlinevirtualinherited

◆ convert()

virtual int convert ( void *  data,
int  sampleCount 
)
inlinevirtualinherited

Reimplemented in RTSPFormatPCM.

◆ defaultConfig()

AudioInfo defaultConfig ( )
inlinevirtual

Implements RTSPFormat.

◆ defaultVideoConfig()

virtual RTSPVideoInfo defaultVideoConfig ( )
inlinevirtualinherited

Reimplemented in RTSPFormatMJPEG, and RTSPFormatH264.

◆ format()

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

Implements RTSPFormat.

◆ fragmentSize()

int fragmentSize ( )
inlineoverridevirtual

Sized to match one actual encoded frame once the encoder has parsed one (encoder->frameSize() > 0), instead of the fixed constructor guess. A fragment size covering several frames' worth of bytes, sent at the one-frame pace of timerPeriodUs(), overruns real-time bandwidth - harmless over TCP (just buffers ahead) but causes packet loss over UDP, which has no flow control.

Reimplemented from RTSPFormat.

◆ mediaType()

virtual MediaType mediaType ( )
inlinevirtualinherited

Reimplemented in RTSPFormatMJPEG, RTSPFormatH264, and RTSPFormatMTS.

◆ name()

virtual const char * name ( )
inlinevirtualinherited

◆ readHeader() [1/2]

virtual int readHeader ( uint8_t *  data)
inlinevirtualinherited

Optional header: e.g. rfc2250.

◆ readHeader() [2/2]

int readHeader ( unsigned char *  buffer)
inlineoverride

rfc2250 header before the playload

◆ rtpPayloadType()

int rtpPayloadType ( )
inlineoverridevirtual

default dynamic

Reimplemented from RTSPFormat.

◆ setEncoder()

void setEncoder ( AudioEncoder encoder)
inline

◆ setFragmentSize()

void setFragmentSize ( int  fragmentSize)
inlineinherited

Defines the fragment size in bytes.

◆ setName()

void setName ( const char *  name)
inlineinherited

Defines the name of the stream.

◆ setProfileLevelId()

virtual void setProfileLevelId ( const char *  )
inlinevirtualinherited

Optional: receives the 3-byte profile-level-id (as 6 hex digits) once an encoder has parsed it from the SPS. Default no-op; only RTSPFormatH264 acts on it.

Reimplemented in RTSPFormatH264.

◆ setSpropParameterSets()

virtual void setSpropParameterSets ( const char *  ,
const char *   
)
inlinevirtualinherited

Optional: receives base64-encoded SPS/PPS once an encoder has learned them (H.264 sprop-parameter-sets). Default no-op; only RTSPFormatH264 acts on it. Declared here (rather than only on RTSPFormatH264) so video encoders (see RTSPVideoEncoder) can push this through a generic RTSPFormat* without needing to know the concrete format type.

Reimplemented in RTSPFormatH264.

◆ setTimerPeriodUs()

void setTimerPeriodUs ( int  period)
inlineinherited

Defines the timer period in microseconds.

◆ setUseRfc2250Header()

void setUseRfc2250Header ( bool  )
inlinevirtual

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

Reimplemented from RTSPFormat.

◆ timerPeriodUs()

int timerPeriodUs ( )
inlinevirtual

Timer period in microseconds.

Reimplemented from RTSPFormat.

◆ timestampIncrement()

virtual int timestampIncrement ( )
inlinevirtual

Fragment size in samples (for audio) or timestamp increment (for video)

Reimplemented from RTSPFormat.

◆ useRfc2250Header()

bool useRfc2250Header ( ) const
inlineoverridevirtual

Reimplemented from RTSPFormat.

◆ videoInfo()

virtual RTSPVideoInfo videoInfo ( )
inlinevirtualinherited

Member Data Documentation

◆ cfg

AudioInfo cfg {16000, 1, 16}
protectedinherited

◆ fragment_size

int fragment_size = 640
protectedinherited

◆ name_str

const char* name_str = "RTSPAudioTools"
protectedinherited

◆ p_encoder

AudioEncoder* p_encoder = nullptr
protected

◆ STD_URL_PRE_SUFFIX

const char* STD_URL_PRE_SUFFIX = "trackID"
protectedinherited

◆ timer_period_us

int timer_period_us = 10000
protectedinherited

◆ use_rfc2250_header_

bool use_rfc2250_header_ = false
protected

◆ video_cfg

RTSPVideoInfo video_cfg {640, 480, 30.0f, RTSPVideoFormat::MJPEG, 24}
protectedinherited

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