Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::rtp Namespace Reference

RTP protocol support. More...

Classes

class  Composer
 RTP packet composer. More...
 
struct  Encoding
 RTP encoding. More...
 
class  EncodingMap
 RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any thread. More...
 
struct  FilterConfig
 RTP filter parameters. More...
 
class  Filter
 RTP filter. More...
 
class  Header
 RTP header. More...
 
class  ExtentionHeader
 RTP extension header. More...
 
class  Identity
 RTP participant identity. More...
 
class  LinkMeter
 RTP link meter. More...
 
class  Parser
 RTP packet parser. More...
 
class  Sequencer
 RTP packet sequencer. More...
 
class  TimestampExtractor
 Remembers a recent pair of capture timestamp and rtp ts. More...
 
class  TimestampInjector
 Fills capture timestamps in rtp packets. More...
 

Enumerations

enum  Version { V2 = 2 }
 RTP protocol version. More...
 
enum  PayloadType { PayloadType_L16_Stereo = 10 , PayloadType_L16_Mono = 11 }
 RTP payload type. More...
 

Functions

ROC_ATTR_NODISCARD bool parse_encoding (const char *str, Encoding &result)
 Parse RTP encoding from string. More...
 

Detailed Description

RTP protocol support.

Enumeration Type Documentation

◆ PayloadType

RTP payload type.

Enumerator
PayloadType_L16_Stereo 

Audio, 16-bit PCM, 2 channels, 44100 Hz.

PayloadType_L16_Mono 

Audio, 16-bit PCM, 1 channel, 44100 Hz.

Definition at line 30 of file headers.h.

◆ Version

RTP protocol version.

Enumerator
V2 

RTP version 2.

Definition at line 25 of file headers.h.

Function Documentation

◆ parse_encoding()

ROC_ATTR_NODISCARD bool roc::rtp::parse_encoding ( const char *  str,
Encoding result 
)

Parse RTP encoding from string.

Remarks
The input string should have the form:
  • "<id>:<spec>"

Where:

  • "<id>" is payload id, a positive integer
  • "<spec>" is sample spec, in form "<format>/<rate>/<channel>"

See audio::parse_sample_spec() for details on "<spec>" format.

Examples:

  • "55:s16/44100/stereo"
  • "77:f32/96000/20-30"
Returns
false if string can't be parsed.