VLC  4.0.0-dev

RTP is a somewhat simplistic protocol to carry multiplexed and timestamped data over an unreliable network. More...

Collaboration diagram for RTP payload formats:

Data Structures

struct  vlc_sdp_pt
 Payload type mapping. More...
 
struct  vlc_rtp_pktinfo
 RTP packet infos. More...
 
struct  vlc_rtp_pt_operations
 RTP payload type operations. More...
 
struct  vlc_rtp_pt_owner_operations
 RTP payload type owner operations. More...
 
struct  vlc_rtp_pt_owner
 RTP payload type owner. More...
 
struct  vlc_rtp_pt
 RTP payload type. More...
 
struct  vlc_rtp_es_operations
 RTP abstract output stream operations. More...
 
struct  vlc_rtp_es
 RTP abstract output stream. More...
 

Macros

#define set_rtp_parser_callback(cb)
 Helper to set the RTP payload format parser module capability and callback. More...
 

Typedefs

typedef int(* vlc_rtp_parser_cb) (vlc_object_t *obj, struct vlc_rtp_pt *pt, const struct vlc_sdp_pt *desc)
 Callback prototype for RTP parser module. More...
 

Functions

void vlc_rtp_pt_release (struct vlc_rtp_pt *pt)
 Destroys a payload type parameter set. More...
 
static void * vlc_rtp_pt_begin (struct vlc_rtp_pt *pt)
 Binds a payload type to a source. More...
 
static void vlc_rtp_pt_end (struct vlc_rtp_pt *pt, void *data)
 Unbinds a payload type from a source. More...
 
static void vlc_rtp_pt_decode (struct vlc_rtp_pt *pt, void *data, block_t *pkt, const struct vlc_rtp_pktinfo *restrict info)
 Processes a payload packet. More...
 
static struct vlc_rtp_esvlc_rtp_pt_request_es (struct vlc_rtp_pt *pt, const es_format_t *restrict fmt)
 Starts an elementary stream (ES). More...
 
static struct vlc_rtp_esvlc_rtp_pt_request_mux (struct vlc_rtp_pt *pt, const char *name)
 Starts a complete multiplex. More...
 
static void vlc_rtp_es_destroy (struct vlc_rtp_es *es)
 Destroys an vlc_rtp_es. More...
 
static void vlc_rtp_es_send (struct vlc_rtp_es *es, block_t *block)
 Sends coded data for output. More...
 
int vlc_rtp_pt_instantiate (vlc_object_t *obj, struct vlc_rtp_pt *restrict pt, const struct vlc_sdp_pt *restrict desc)
 
void rtp_autodetect (vlc_object_t *, rtp_session_t *, const struct vlc_rtp_pt_owner *restrict)
 
static uint8_t rtp_ptype (const block_t *block)
 

Variables

struct vlc_rtp_es *const vlc_rtp_es_dummy
 A (pointer to a) dummy output that discards data. More...
 

Detailed Description

RTP is a somewhat simplistic protocol to carry multiplexed and timestamped data over an unreliable network.

It cannot be used as is: depending on the concrete type and subtype of data, a format must be selected which specifically defines how the data is carried as the payload of RTP packets. This format is known as an RTP payload format.

A given RTP session (rtp_session_t) can use up to 128 different payload types (vlc_rtp_pt). Each payload type is identified by a 7-bit value and designates a payload format and an associated set of format-dependent parameters specified by a payload type mapping (vlc_sdp_pt).

Macro Definition Documentation

◆ set_rtp_parser_callback

#define set_rtp_parser_callback (   cb)
Value:
{ \
vlc_rtp_parser_cb cb__ = (cb); (void) cb__; \
set_callback(cb); \
set_capability("rtp parser", 0); \
}

Helper to set the RTP payload format parser module capability and callback.

Typedef Documentation

◆ vlc_rtp_parser_cb

typedef int(* vlc_rtp_parser_cb) (vlc_object_t *obj, struct vlc_rtp_pt *pt, const struct vlc_sdp_pt *desc)

Callback prototype for RTP parser module.

This is the callback prototype for any RTP payload format parser module.

Parameters
objVLC object for logging and configuration
ptRTP payload type
desc[in]SDP payload format description and type mapping
Returns
VLC_SUCCESS on success, an error code on failure.

Function Documentation

◆ rtp_autodetect()

void rtp_autodetect ( vlc_object_t ,
rtp_session_t ,
const struct vlc_rtp_pt_owner restrict 
)

Referenced by OpenURL().

◆ rtp_ptype()

static uint8_t rtp_ptype ( const block_t block)
inlinestatic

◆ vlc_rtp_es_destroy()

◆ vlc_rtp_es_send()

static void vlc_rtp_es_send ( struct vlc_rtp_es es,
block_t block 
)
inlinestatic

◆ vlc_rtp_pt_begin()

static void* vlc_rtp_pt_begin ( struct vlc_rtp_pt pt)
inlinestatic

Binds a payload type to a source.

A given SDP media can have multiple alternative payload types, each with their set of parameters. The RTP session can then have multiple concurrent RTP sources (SSRC). This function starts an association of a given payload type with an unique RTP source.

Parameters
ptRTP payload type to associate with a source
Returns
private data for the type-source association

References vlc_rtp_pt_operations::init, and vlc_rtp_pt::ops.

Referenced by rtp_decode().

◆ vlc_rtp_pt_decode()

static void vlc_rtp_pt_decode ( struct vlc_rtp_pt pt,
void *  data,
block_t pkt,
const struct vlc_rtp_pktinfo *restrict  info 
)
inlinestatic

Processes a payload packet.

This passes a data payload from an RTP packet for processing to the payload type bound to the source of the packet. The payload type is determined from the RTP header PT field and the source from the SSRC field.

References vlc_rtp_pt_owner::data, vlc_rtp_pt_operations::decode, and vlc_rtp_pt::ops.

Referenced by rtp_decode().

◆ vlc_rtp_pt_end()

static void vlc_rtp_pt_end ( struct vlc_rtp_pt pt,
void *  data 
)
inlinestatic

Unbinds a payload type from a source.

This removes an association between a payload type and a source created by vlc_rtp_pt_begin().

Parameters
ptRTP payload type to deassociate
dataprivate data as returned by vlc_rtp_pt_begin()

References vlc_rtp_pt_owner::data, vlc_rtp_pt_operations::destroy, and vlc_rtp_pt::ops.

Referenced by rtp_decode(), and rtp_source_destroy().

◆ vlc_rtp_pt_instantiate()

int vlc_rtp_pt_instantiate ( vlc_object_t obj,
struct vlc_rtp_pt *restrict  pt,
const struct vlc_sdp_pt *restrict  desc 
)

◆ vlc_rtp_pt_release()

void vlc_rtp_pt_release ( struct vlc_rtp_pt pt)

Destroys a payload type parameter set.

This function destroys a payload type. It can only be called when the payload type has no active sources.

References vlc_rtp_pt::ops, and vlc_rtp_pt_operations::release.

Referenced by rtp_session_destroy(), and vlc_rtp_add_media_types().

◆ vlc_rtp_pt_request_es()

static struct vlc_rtp_es* vlc_rtp_pt_request_es ( struct vlc_rtp_pt pt,
const es_format_t *restrict  fmt 
)
inlinestatic

Starts an elementary stream (ES).

This function is used by an active RTP payload type to create an elementary (audio, video or subtitle) stream to process encoded data extracted from an RTP source.

A given payload type normally maintains one such elementary stream per active type-source association (vlc_rtp_pt_begin).

References vlc_rtp_pt_owner::ops, vlc_rtp_pt::owner, and vlc_rtp_pt_owner_operations::request_es.

Referenced by gsm_init(), qcelp_init(), rtp_ac3_begin(), rtp_g722_init(), rtp_g726_init(), rtp_h264_init(), rtp_mpa_init(), rtp_mpv_init(), rtp_opus_init(), rtp_pcm_init(), rtp_raw_begin(), and xiph_decode().

◆ vlc_rtp_pt_request_mux()

static struct vlc_rtp_es* vlc_rtp_pt_request_mux ( struct vlc_rtp_pt pt,
const char *  name 
)
inlinestatic

Starts a complete multiplex.

This function creates a complete multiplexed multimedia stream to process data extracted from RTP packets. This should be avoided as much as possible as RTP is designed to carry raw elementary streams.

References name, vlc_rtp_pt_owner::ops, vlc_rtp_pt::owner, and vlc_rtp_pt_owner_operations::request_mux.

Referenced by rtp_mp2p_init(), and rtp_mp2t_init().

Variable Documentation

◆ vlc_rtp_es_dummy

struct vlc_rtp_es* const vlc_rtp_es_dummy
extern

A (pointer to a) dummy output that discards data.

Referenced by es_dummy_decode(), es_dummy_destroy(), vlc_rtp_es_request(), and vlc_rtp_mux_request().