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

High-level sending/receiving pipelines. More...

Classes

class  Converter
 Converter pipeline. More...
 
struct  ConverterConfig
 Converter parameters. More...
 
class  port_to_str
 Convert pipeline port to string. More...
 
struct  PortConfig
 Port parameters. More...
 
class  Receiver
 Receiver pipeline. More...
 
struct  ReceiverCommonConfig
 Receiver common parameters. More...
 
struct  ReceiverConfig
 Receiver parameters. More...
 
class  ReceiverPort
 Receiver port pipeline. More...
 
class  ReceiverSession
 Receiver session pipeline. More...
 
struct  ReceiverSessionConfig
 Receiver session parameters. More...
 
class  Sender
 Sender pipeline. More...
 
struct  SenderConfig
 Sender parameters. More...
 
class  SenderPort
 Sender port pipeline. More...
 

Enumerations

enum  PortType { Port_AudioSource, Port_AudioRepair }
 Port type. More...
 
enum  PortProtocol {
  Proto_None, Proto_RTP, Proto_RTP_RSm8_Source, Proto_RSm8_Repair,
  Proto_RTP_LDPC_Source, Proto_LDPC_Repair
}
 Port protocol. More...
 

Functions

packet::FECScheme port_fec_scheme (PortProtocol proto)
 Get FEC scheme for given protocol. More...
 
bool validate_port (packet::FECScheme fec_scheme, PortProtocol port_protocol, PortType port_type)
 Validate consistency of a single port and FEC scheme. More...
 
bool validate_ports (packet::FECScheme fec_scheme, PortProtocol source_port, PortProtocol repair_port)
 Validate consistency of two ports and FEC scheme. More...
 
bool parse_port (PortType type, const char *string, PortConfig &result)
 Parse port from string. More...
 
const char * port_type_to_str (PortType type)
 Convert port type to string. More...
 
const char * port_proto_to_str (PortProtocol proto)
 Convert port protocol to string. More...
 

Variables

const size_t DefaultSampleRate = 44100
 Default sample rate, number of samples per second. More...
 
const packet::channel_mask_t DefaultChannelMask = 0x3
 Default channel mask. More...
 
const core::nanoseconds_t DefaultPacketLength = 7 * core::Millisecond
 Default packet length. More...
 
const core::nanoseconds_t DefaultLatency = 200 * core::Millisecond
 Default latency. More...
 
const size_t DefaultInternalFrameSize = 640
 Default internal frame size. More...
 
const int DefaultMinLatencyFactor = -1
 Default minum latency relative to target latency. More...
 
const int DefaultMaxLatencyFactor = 2
 Default maximum latency relative to target latency. More...
 

Detailed Description

High-level sending/receiving pipelines.

Enumeration Type Documentation

Port protocol.

Enumerator
Proto_None 

Protocol is not set.

Proto_RTP 

Bare RTP.

Proto_RTP_RSm8_Source 

RTP source packet + FECFRAME Reed-Solomon footer (m=8).

Proto_RSm8_Repair 

FEC repair packet + FECFRAME Reed-Solomon header (m=8).

Proto_RTP_LDPC_Source 

RTP source packet + FECFRAME LDPC footer.

Proto_LDPC_Repair 

FEC repair packet + FECFRAME LDPC header.

Definition at line 28 of file port.h.

Port type.

Enumerator
Port_AudioSource 

Audio source packets.

Port_AudioRepair 

Audio repair packets.

Definition at line 19 of file port.h.

Function Documentation

bool roc::pipeline::parse_port ( PortType  type,
const char *  string,
PortConfig result 
)

Parse port from string.

Remarks
The input string should be in one of the following forms:
  • "PROTO::PORT" e.g. "rtp::123"
  • "PROTO:IPv4:PORT" e.g. "rtp:1.2.3.4:123"
  • "PROTO:[IPv6]:PORT" e.g. "rtp:[::1]:123"
Returns
false if string can't be parsed.
packet::FECScheme roc::pipeline::port_fec_scheme ( PortProtocol  proto)

Get FEC scheme for given protocol.

const char* roc::pipeline::port_proto_to_str ( PortProtocol  proto)

Convert port protocol to string.

const char* roc::pipeline::port_type_to_str ( PortType  type)

Convert port type to string.

bool roc::pipeline::validate_port ( packet::FECScheme  fec_scheme,
PortProtocol  port_protocol,
PortType  port_type 
)

Validate consistency of a single port and FEC scheme.

bool roc::pipeline::validate_ports ( packet::FECScheme  fec_scheme,
PortProtocol  source_port,
PortProtocol  repair_port 
)

Validate consistency of two ports and FEC scheme.

Variable Documentation

const packet::channel_mask_t roc::pipeline::DefaultChannelMask = 0x3

Default channel mask.

Definition at line 35 of file config.h.

const size_t roc::pipeline::DefaultInternalFrameSize = 640

Default internal frame size.

Definition at line 44 of file config.h.

const core::nanoseconds_t roc::pipeline::DefaultLatency = 200 * core::Millisecond

Default latency.

Definition at line 41 of file config.h.

const int roc::pipeline::DefaultMaxLatencyFactor = 2

Default maximum latency relative to target latency.

Definition at line 50 of file config.h.

const int roc::pipeline::DefaultMinLatencyFactor = -1

Default minum latency relative to target latency.

Definition at line 47 of file config.h.

const core::nanoseconds_t roc::pipeline::DefaultPacketLength = 7 * core::Millisecond

Default packet length.

Definition at line 38 of file config.h.

const size_t roc::pipeline::DefaultSampleRate = 44100

Default sample rate, number of samples per second.

Definition at line 32 of file config.h.