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

Packets and packet processing. More...

Classes

class  Address
 Network address. More...
 
class  address_to_str
 Convert network address to string. More...
 
class  ConcurrentQueue
 Concurrent blocking packet queue. More...
 
class  DelayedReader
 Delayed reader. More...
 
struct  FEC
 FECFRAME packet. More...
 
class  IComposer
 Packet composer interface. More...
 
class  Interleaver
 Interleaves packets to transmit them in pseudo random order. More...
 
class  IParser
 Packet parser interface. More...
 
class  IReader
 Packet reader interface. More...
 
class  IWriter
 Packet writer interface. More...
 
class  Packet
 Packet. More...
 
class  PacketPool
 Packet pool. More...
 
class  Queue
 Packet queue. More...
 
class  Router
 Route packets to writers. More...
 
struct  RTP
 RTP packet. More...
 
class  SortedQueue
 Sorted packet queue. More...
 
struct  UDP
 UDP packet. More...
 

Typedefs

typedef core::SharedPtr< PacketPacketPtr
 Packet smart pointer. More...
 
typedef uint32_t source_t
 Packet source ID identifying packet stream. More...
 
typedef uint16_t seqnum_t
 Packet sequence number in packet stream. More...
 
typedef int16_t seqnum_diff_t
 Packet sequence numbers difference. More...
 
typedef uint32_t timestamp_t
 Audio packet timestamp. More...
 
typedef int32_t timestamp_diff_t
 Audio packet timestamps difference. More...
 
typedef uint32_t channel_mask_t
 Bitmask of channels present in audio packet. More...
 
typedef uint16_t blknum_t
 FEC block number in a packet stream. More...
 
typedef int16_t blknum_diff_t
 FEC block numbers difference. More...
 

Enumerations

enum  FECScheme { FEC_None, FEC_ReedSolomon_M8, FEC_LDPC_Staircase }
 FECFRAME scheme. More...
 
enum  { PrintPayload = (1 << 0) }
 Print flags. More...
 

Functions

const char * fec_scheme_to_str (FECScheme)
 FEC scheme to string. More...
 
void print (const Packet &packet, int flags)
 Print packet to stderr. More...
 
seqnum_diff_t seqnum_diff (seqnum_t a, seqnum_t b)
 Compute difference between two seqnums. More...
 
bool seqnum_lt (seqnum_t a, seqnum_t b)
 Check if a is before b taking possible wrap into account. More...
 
bool seqnum_le (seqnum_t a, seqnum_t b)
 Check if a is before or equal to b taking possible wrap into account. More...
 
timestamp_diff_t timestamp_diff (timestamp_t a, timestamp_t b)
 Compute difference between two timestamps. More...
 
bool timestamp_lt (timestamp_t a, timestamp_t b)
 Check if a is before b taking possible wrap into account. More...
 
bool timestamp_le (timestamp_t a, timestamp_t b)
 Check if a is before or equal to b taking possible wrap into account. More...
 
timestamp_diff_t timestamp_from_ns (core::nanoseconds_t ns, size_t sample_rate)
 Convert nanoseconds to number of samples. More...
 
core::nanoseconds_t timestamp_to_ns (timestamp_diff_t ts, size_t sample_rate)
 Convert number of samples to nanoseconds. More...
 
blknum_diff_t blknum_diff (blknum_t a, blknum_t b)
 Compute difference between two FEC block numbers. More...
 
bool blknum_lt (blknum_t a, blknum_t b)
 Check if a is before b taking possible wrap into account. More...
 
bool blknum_le (blknum_t a, blknum_t b)
 Check if a is before or equal to b taking possible wrap into account. More...
 

Detailed Description

Packets and packet processing.

Typedef Documentation

typedef int16_t roc::packet::blknum_diff_t

FEC block numbers difference.

Definition at line 94 of file units.h.

typedef uint16_t roc::packet::blknum_t

FEC block number in a packet stream.

Definition at line 91 of file units.h.

typedef uint32_t roc::packet::channel_mask_t

Bitmask of channels present in audio packet.

Definition at line 77 of file units.h.

Packet smart pointer.

Definition at line 29 of file packet.h.

typedef int16_t roc::packet::seqnum_diff_t

Packet sequence numbers difference.

Definition at line 28 of file units.h.

typedef uint16_t roc::packet::seqnum_t

Packet sequence number in packet stream.

Definition at line 25 of file units.h.

typedef uint32_t roc::packet::source_t

Packet source ID identifying packet stream.

Definition at line 22 of file units.h.

Audio packet timestamps difference.

Definition at line 49 of file units.h.

typedef uint32_t roc::packet::timestamp_t

Audio packet timestamp.

Definition at line 46 of file units.h.

Enumeration Type Documentation

anonymous enum

Print flags.

Enumerator
PrintPayload 

Print packet payload.

Definition at line 21 of file print.h.

FECFRAME scheme.

Enumerator
FEC_None 

No FEC.

FEC_ReedSolomon_M8 

Reed-Solomon (m=8).

FEC_LDPC_Staircase 

LDPC-Staircase.

Definition at line 23 of file fec.h.

Function Documentation

blknum_diff_t roc::packet::blknum_diff ( blknum_t  a,
blknum_t  b 
)
inline

Compute difference between two FEC block numbers.

Definition at line 97 of file units.h.

bool roc::packet::blknum_le ( blknum_t  a,
blknum_t  b 
)
inline

Check if a is before or equal to b taking possible wrap into account.

Definition at line 107 of file units.h.

bool roc::packet::blknum_lt ( blknum_t  a,
blknum_t  b 
)
inline

Check if a is before b taking possible wrap into account.

Definition at line 102 of file units.h.

const char* roc::packet::fec_scheme_to_str ( FECScheme  )

FEC scheme to string.

void roc::packet::print ( const Packet packet,
int  flags 
)

Print packet to stderr.

seqnum_diff_t roc::packet::seqnum_diff ( seqnum_t  a,
seqnum_t  b 
)
inline

Compute difference between two seqnums.

Definition at line 31 of file units.h.

bool roc::packet::seqnum_le ( seqnum_t  a,
seqnum_t  b 
)
inline

Check if a is before or equal to b taking possible wrap into account.

Definition at line 41 of file units.h.

bool roc::packet::seqnum_lt ( seqnum_t  a,
seqnum_t  b 
)
inline

Check if a is before b taking possible wrap into account.

Definition at line 36 of file units.h.

timestamp_diff_t roc::packet::timestamp_diff ( timestamp_t  a,
timestamp_t  b 
)
inline

Compute difference between two timestamps.

Definition at line 52 of file units.h.

timestamp_diff_t roc::packet::timestamp_from_ns ( core::nanoseconds_t  ns,
size_t  sample_rate 
)
inline

Convert nanoseconds to number of samples.

Definition at line 67 of file units.h.

bool roc::packet::timestamp_le ( timestamp_t  a,
timestamp_t  b 
)
inline

Check if a is before or equal to b taking possible wrap into account.

Definition at line 62 of file units.h.

bool roc::packet::timestamp_lt ( timestamp_t  a,
timestamp_t  b 
)
inline

Check if a is before b taking possible wrap into account.

Definition at line 57 of file units.h.

core::nanoseconds_t roc::packet::timestamp_to_ns ( timestamp_diff_t  ts,
size_t  sample_rate 
)
inline

Convert number of samples to nanoseconds.

Definition at line 72 of file units.h.