VLC  4.0.0-dev
Data Structures | Typedefs | Functions
session.c File Reference

RTP session handling. More...

Include dependency graph for session.c:

Data Structures

struct  rtp_session_t
 State for a RTP session: More...
 
struct  rtp_source_t
 State for an RTP source. More...
 

Typedefs

typedef struct rtp_source_t rtp_source_t
 

Functions

static rtp_source_trtp_source_create (demux_t *demux, const rtp_session_t *session, uint32_t ssrc, uint16_t init_seq)
 Initializes a new RTP source within an RTP session. More...
 
static void rtp_source_destroy (demux_t *demux, const rtp_session_t *session, rtp_source_t *source)
 Destroys an RTP source and its associated streams. More...
 
static void rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
 Decodes one RTP packet. More...
 
rtp_session_trtp_session_create (demux_t *demux)
 Creates a new RTP session. More...
 
void rtp_session_destroy (demux_t *demux, rtp_session_t *session)
 Destroys an RTP session. More...
 
static void * no_init (demux_t *demux)
 
static void no_destroy (demux_t *demux, void *opaque)
 
static void no_decode (demux_t *demux, void *opaque, block_t *block)
 
int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt)
 Adds a payload type to an RTP session. More...
 
static uint16_t rtp_seq (const block_t *block)
 
static uint32_t rtp_timestamp (const block_t *block)
 
static const struct rtp_pt_trtp_find_ptype (const rtp_session_t *session, rtp_source_t *source, const block_t *block, void **pt_data)
 
void rtp_queue (demux_t *demux, rtp_session_t *session, block_t *block)
 Receives an RTP packet and queues it. More...
 
bool rtp_dequeue (demux_t *demux, const rtp_session_t *session, vlc_tick_t *restrict deadlinep)
 Dequeues RTP packets and pass them to decoder. More...
 

Detailed Description

RTP session handling.

Typedef Documentation

◆ rtp_source_t

typedef struct rtp_source_t rtp_source_t

Function Documentation

◆ no_decode()

static void no_decode ( demux_t demux,
void *  opaque,
block_t block 
)
static

References block_Release().

Referenced by rtp_add_type().

◆ no_destroy()

static void no_destroy ( demux_t demux,
void *  opaque 
)
static

Referenced by rtp_add_type().

◆ no_init()

static void* no_init ( demux_t demux)
static

Referenced by rtp_add_type().

◆ rtp_add_type()

int rtp_add_type ( demux_t demux,
rtp_session_t ses,
const rtp_pt_t pt 
)

◆ rtp_decode()

static void rtp_decode ( demux_t demux,
const rtp_session_t session,
rtp_source_t src 
)
static

◆ rtp_dequeue()

bool rtp_dequeue ( demux_t demux,
const rtp_session_t session,
vlc_tick_t *restrict  deadlinep 
)

Dequeues RTP packets and pass them to decoder.

Not cancellation-safe(?). A packet is decoded if it is the next in sequence order, or if we have given up waiting on the missing packets (time out) from the last one already decoded.

Parameters
demuxVLC demux object
sessionRTP session receiving the packet
deadlineppointer to deadline to call rtp_dequeue() again
Returns
true if the buffer is not empty, false otherwise. In the later case, *deadlinep is undefined.

References rtp_source_t::blocks, rtp_pt_t::frequency, block_t::i_pts, rtp_source_t::jitter, rtp_source_t::last_seq, rtp_decode(), rtp_find_ptype(), rtp_seq(), rtp_session_t::srcc, rtp_session_t::srcv, VLC_TICK_FROM_MS, vlc_tick_from_samples(), VLC_TICK_MAX, and vlc_tick_now().

◆ rtp_find_ptype()

static const struct rtp_pt_t* rtp_find_ptype ( const rtp_session_t session,
rtp_source_t source,
const block_t block,
void **  pt_data 
)
static

◆ rtp_queue()

void rtp_queue ( demux_t demux,
rtp_session_t session,
block_t block 
)

◆ rtp_seq()

static uint16_t rtp_seq ( const block_t block)
inlinestatic

◆ rtp_session_create()

rtp_session_t* rtp_session_create ( demux_t demux)

Creates a new RTP session.

payload format

References rtp_session_t::ptc, rtp_session_t::ptv, rtp_session_t::srcc, and rtp_session_t::srcv.

Referenced by OpenSDP(), and OpenURL().

◆ rtp_session_destroy()

void rtp_session_destroy ( demux_t demux,
rtp_session_t session 
)

Destroys an RTP session.

References rtp_session_t::ptv, rtp_source_destroy(), rtp_session_t::srcc, and rtp_session_t::srcv.

Referenced by Close(), OpenSDP(), and OpenURL().

◆ rtp_source_create()

static rtp_source_t * rtp_source_create ( demux_t demux,
const rtp_session_t session,
uint32_t  ssrc,
uint16_t  init_seq 
)
static

◆ rtp_source_destroy()

static void rtp_source_destroy ( demux_t demux,
const rtp_session_t session,
rtp_source_t source 
)
static

◆ rtp_timestamp()

static uint32_t rtp_timestamp ( const block_t block)
inlinestatic

References GetDWBE, block_t::i_buffer, and block_t::p_buffer.

Referenced by rtp_decode(), and rtp_queue().