GNU Radio's RTP Package
rtp.h File Reference
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  string_table
struct  pt_table
struct  rtp_header
struct  rtp_state
struct  rtcp_sr
struct  rtcp_rr
struct  rtcp_sdes
struct  packet

Macros

#define DEFAULT_MCAST_PORT   ((uint16_t)5004)
#define DEFAULT_RTP_PORT   ((uint16_t)5004)
#define DEFAULT_RTCP_PORT   ((uint16_t)5005)
#define DEFAULT_STAT_PORT   ((uint16_t)5006)
#define NTP_EPOCH   2208988800UL
#define RTP_MIN_SIZE   12
#define RTP_VERS   2U
#define RTP_MARKER   0x80
#define OPUS_SAMPRATE   (48000)
#define PKTSIZE   65536

Enumerations

enum  encoding {
  NO_ENCODING = 0 , S16LE , S16BE , OPUS ,
  F32LE , AX25 , F16LE , OPUS_VOIP ,
  F32BE , F16BE , MULAW , ALAW ,
  UNUSED_ENCODING
}
enum  sdes_type {
  CNAME =1 , NAME =2 , EMAIL =3 , PHONE =4 ,
  LOC =5 , TOOL =6 , NOTE =7 , PRIV =8
}

Functions

void const * ntoh_rtp (struct rtp_header *, void const *)
void * hton_rtp (void *, struct rtp_header const *)
int add_pt (int type, int samprate, int channels, enum encoding encoding)
int rtp_process (struct rtp_state *state, struct rtp_header const *rtp, size_t samples)
uint8_t * gen_sdes (uint8_t *output, size_t bufsize, uint32_t ssrc, struct rtcp_sdes const *sdes, int sc)
uint8_t * gen_bye (uint8_t *output, size_t bufsize, uint32_t const *ssrcs, int sc)
uint8_t * gen_sr (uint8_t *output, size_t bufsize, struct rtcp_sr const *sr, struct rtcp_rr const *rr, int rc)
uint8_t * gen_rr (uint8_t *output, size_t bufsize, uint32_t ssrc, struct rtcp_rr const *rr, int rc)
int opus_bandwidth (char const **str, int code)
char const * opus_application_string (int)
int opus_bandwidth_to_code (int bw)
bool legal_opus_size (int n)
bool legal_opus_samprate (int n)
int samprate_from_pt (int type)
int channels_from_pt (int type)
enum encoding encoding_from_pt (int type)
int pt_from_info (int samprate, int channels, enum encoding)
char const * encoding_string (enum encoding)
uint8_t float_to_mulaw (float fsample)
float mulaw_to_float (uint8_t ulaw)
uint8_t float_to_alaw (float fsample)
float alaw_to_float (uint8_t alaw)

Variables

struct pt_table PT_table []
int const Opus_pt
int const AX25_pt
int Opus_blocksizes []
int Opus_samprates []
struct string_table Opus_application []
struct string_table Opus_signal []

Macro Definition Documentation

◆ DEFAULT_MCAST_PORT

#define DEFAULT_MCAST_PORT   ((uint16_t)5004)

◆ DEFAULT_RTCP_PORT

#define DEFAULT_RTCP_PORT   ((uint16_t)5005)

◆ DEFAULT_RTP_PORT

#define DEFAULT_RTP_PORT   ((uint16_t)5004)

◆ DEFAULT_STAT_PORT

#define DEFAULT_STAT_PORT   ((uint16_t)5006)

◆ NTP_EPOCH

#define NTP_EPOCH   2208988800UL

◆ OPUS_SAMPRATE

#define OPUS_SAMPRATE   (48000)

◆ PKTSIZE

#define PKTSIZE   65536

◆ RTP_MARKER

#define RTP_MARKER   0x80

◆ RTP_MIN_SIZE

#define RTP_MIN_SIZE   12

◆ RTP_VERS

#define RTP_VERS   2U

Enumeration Type Documentation

◆ encoding

enum encoding
Enumerator
NO_ENCODING 
S16LE 
S16BE 
OPUS 
F32LE 
AX25 
F16LE 
OPUS_VOIP 
F32BE 
F16BE 
MULAW 
ALAW 
UNUSED_ENCODING 

◆ sdes_type

enum sdes_type
Enumerator
CNAME 
NAME 
EMAIL 
PHONE 
LOC 
TOOL 
NOTE 
PRIV 

Function Documentation

◆ add_pt()

int add_pt ( int type,
int samprate,
int channels,
enum encoding encoding )

◆ alaw_to_float()

float alaw_to_float ( uint8_t alaw)

◆ channels_from_pt()

int channels_from_pt ( int type)

◆ encoding_from_pt()

enum encoding encoding_from_pt ( int type)

◆ encoding_string()

char const * encoding_string ( enum encoding)

◆ float_to_alaw()

uint8_t float_to_alaw ( float fsample)

◆ float_to_mulaw()

uint8_t float_to_mulaw ( float fsample)

◆ gen_bye()

uint8_t * gen_bye ( uint8_t * output,
size_t bufsize,
uint32_t const * ssrcs,
int sc )

◆ gen_rr()

uint8_t * gen_rr ( uint8_t * output,
size_t bufsize,
uint32_t ssrc,
struct rtcp_rr const * rr,
int rc )

◆ gen_sdes()

uint8_t * gen_sdes ( uint8_t * output,
size_t bufsize,
uint32_t ssrc,
struct rtcp_sdes const * sdes,
int sc )

◆ gen_sr()

uint8_t * gen_sr ( uint8_t * output,
size_t bufsize,
struct rtcp_sr const * sr,
struct rtcp_rr const * rr,
int rc )

◆ hton_rtp()

void * hton_rtp ( void * ,
struct rtp_header const *  )

◆ legal_opus_samprate()

bool legal_opus_samprate ( int n)

◆ legal_opus_size()

bool legal_opus_size ( int n)

◆ mulaw_to_float()

float mulaw_to_float ( uint8_t ulaw)

◆ ntoh_rtp()

void const * ntoh_rtp ( struct rtp_header * ,
void const *  )

◆ opus_application_string()

char const * opus_application_string ( int )

◆ opus_bandwidth()

int opus_bandwidth ( char const ** str,
int code )

◆ opus_bandwidth_to_code()

int opus_bandwidth_to_code ( int bw)

◆ pt_from_info()

int pt_from_info ( int samprate,
int channels,
enum encoding )

◆ rtp_process()

int rtp_process ( struct rtp_state * state,
struct rtp_header const * rtp,
size_t samples )

◆ samprate_from_pt()

int samprate_from_pt ( int type)

Variable Documentation

◆ AX25_pt

int const AX25_pt
extern

Referenced by gen_rr().

◆ Opus_application

struct string_table Opus_application[]
extern

Referenced by gen_rr().

◆ Opus_blocksizes

int Opus_blocksizes[]
extern

Referenced by gen_rr().

◆ Opus_pt

int const Opus_pt
extern

Referenced by gen_rr().

◆ Opus_samprates

int Opus_samprates[]
extern

Referenced by gen_rr().

◆ Opus_signal

struct string_table Opus_signal[]
extern

Referenced by gen_rr().

◆ PT_table

struct pt_table PT_table[]
extern

Referenced by gen_rr().