VLC 4.0.0-dev
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 (struct vlc_logger *logger, 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 (struct vlc_logger *logger, rtp_source_t *source)
 Destroys an RTP source and its associated streams. More...
 
static void rtp_decode (struct vlc_logger *logger, const rtp_session_t *session, rtp_source_t *src)
 Decodes one RTP packet. More...
 
rtp_session_trtp_session_create (void)
 Creates a new RTP session. More...
 
void rtp_session_destroy (struct vlc_logger *logger, rtp_session_t *session)
 Destroys an RTP session. More...
 
int rtp_add_type (rtp_session_t *ses, 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 struct vlc_rtp_ptrtp_find_ptype (const rtp_session_t *session, const block_t *block)
 
void rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
 Receives an RTP packet and queues it. More...
 
bool rtp_dequeue (rtp_sys_t *sys, 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

◆ rtp_decode()

◆ rtp_dequeue()

bool rtp_dequeue ( rtp_sys_t sys,
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, vlc_rtp_pt::frequency, vlc_frame_t::i_pts, rtp_source_t::jitter, rtp_source_t::last_seq, rtp_sys_t::logger, 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 struct vlc_rtp_pt * rtp_find_ptype ( const rtp_session_t session,
const block_t block 
)
static

◆ rtp_seq()

static uint16_t rtp_seq ( const block_t block)
inlinestatic

◆ rtp_source_create()

static rtp_source_t * rtp_source_create ( struct vlc_logger logger,
const rtp_session_t session,
uint32_t  ssrc,
uint16_t  init_seq 
)
static

◆ rtp_source_destroy()

static void rtp_source_destroy ( struct vlc_logger logger,
rtp_source_t source 
)
static

◆ rtp_timestamp()

static uint32_t rtp_timestamp ( const block_t block)
inlinestatic