VLC 4.0.0-dev
|
RTP is a somewhat simplistic protocol to carry multiplexed and timestamped data over an unreliable network. More...
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. | |
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. | |
Functions | |
void | vlc_rtp_pt_release (struct vlc_rtp_pt *pt) |
Destroys a payload type parameter set. | |
static void * | vlc_rtp_pt_begin (struct vlc_rtp_pt *pt) |
Binds a payload type to a source. | |
static void | vlc_rtp_pt_end (struct vlc_rtp_pt *pt, void *data) |
Unbinds a payload type from a source. | |
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. | |
static struct vlc_rtp_es * | vlc_rtp_pt_request_es (struct vlc_rtp_pt *pt, const es_format_t *restrict fmt) |
Starts an elementary stream (ES). | |
static struct vlc_rtp_es * | vlc_rtp_pt_request_mux (struct vlc_rtp_pt *pt, const char *name) |
Starts a complete multiplex. | |
static void | vlc_rtp_es_destroy (struct vlc_rtp_es *es) |
Destroys an vlc_rtp_es. | |
static void | vlc_rtp_es_send (struct vlc_rtp_es *es, block_t *block) |
Sends coded data for output. | |
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. | |
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).
#define set_rtp_parser_callback | ( | cb | ) |
Helper to set the RTP payload format parser module capability and callback.
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.
obj | VLC object for logging and configuration | |
pt | RTP payload type | |
[in] | desc | SDP payload format description and type mapping |
void rtp_autodetect | ( | vlc_object_t * | , |
rtp_session_t * | , | ||
const struct vlc_rtp_pt_owner * | restrict | ||
) |
Referenced by OpenURL().
|
inlinestatic |
References vlc_frame_t::p_buffer.
Referenced by rtp_decode(), rtp_find_ptype(), and rtp_process().
|
inlinestatic |
Destroys an vlc_rtp_es.
es | object to release |
References vlc_rtp_es_operations::destroy, and vlc_rtp_es::ops.
Referenced by codec_destroy(), rtp_ac3_end(), rtp_h264_destroy(), rtp_h265_destroy(), rtp_mp2p_destroy(), rtp_mp2t_destroy(), rtp_mpa_destroy(), rtp_mpv_destroy(), rtp_opus_destroy(), rtp_pcm_destroy(), rtp_raw_end(), xiph_decode(), and xiph_destroy().
|
inlinestatic |
Sends coded data for output.
es | output stream to send the data to |
block | data block to process |
References vlc_rtp_es::ops, and vlc_rtp_es_operations::send.
Referenced by codec_decode(), h26x_output(), rtp_ac3_decode_compound(), rtp_ac3_send(), rtp_mp2p_decode(), rtp_mp2t_decode(), rtp_mpa_decode(), rtp_mpa_send(), rtp_mpv_send(), rtp_opus_decode(), rtp_pcm_decode(), rtp_raw_unwrap(), xiph_decode(), and xiph_destroy().
|
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.
pt | RTP payload type to associate with a source |
References vlc_rtp_pt_operations::init, and vlc_rtp_pt::ops.
Referenced by rtp_decode().
|
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().
|
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().
pt | RTP payload type to deassociate |
data | private 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().
int vlc_rtp_pt_instantiate | ( | vlc_object_t * | obj, |
struct vlc_rtp_pt *restrict | pt, | ||
const struct vlc_sdp_pt *restrict | desc | ||
) |
References module_get_name(), msg_Dbg, VLC_EINVAL, VLC_ENOTSUP, vlc_module_map(), vlc_module_match(), vlc_object_logger, and VLC_SUCCESS.
Referenced by vlc_rtp_pt_create().
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().
|
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_h265_init(), rtp_mpa_init(), rtp_mpv_init(), rtp_opus_init(), rtp_pcm_init(), rtp_raw_begin(), and xiph_decode().
|
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().
|
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().