VLC 4.0.0-dev
Loading...
Searching...
No Matches
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.
 
static void rtp_source_destroy (struct vlc_logger *logger, rtp_source_t *source)
 Destroys an RTP source and its associated streams.
 
static void rtp_decode (struct vlc_logger *logger, const rtp_session_t *session, rtp_source_t *src)
 Decodes one RTP packet.
 
rtp_session_trtp_session_create_custom (uint16_t max_dropout, uint16_t max_misorder, uint8_t max_src, vlc_tick_t timeout)
 Creates a new RTP session.
 
rtp_session_trtp_session_create (void)
 
void rtp_session_destroy (struct vlc_logger *logger, rtp_session_t *session)
 Destroys an RTP session.
 
int rtp_add_type (rtp_session_t *ses, rtp_pt_t *pt)
 Adds a payload type to an RTP session.
 
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 (struct vlc_logger *logger, rtp_session_t *session, block_t *block)
 Receives an RTP packet and queues it.
 
bool rtp_dequeue (struct vlc_logger *logger, const rtp_session_t *session, vlc_tick_t now, vlc_tick_t *restrict deadlinep)
 Dequeues RTP packets and pass them to decoder.
 

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 ( struct vlc_logger logger,
const rtp_session_t session,
vlc_tick_t  now,
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
loggerpointer to VLC logger
sessionRTP session receiving the packet
nowmonotonic clock reference for packets timing (ex: vlc_tick_now())
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_decode(), rtp_find_ptype(), rtp_seq(), rtp_session_t::srcc, rtp_session_t::srcv, VLC_TICK_FROM_MS, vlc_tick_from_samples(), and VLC_TICK_MAX.

◆ 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