RTP Buffer Access
[RTP Layer]

Collaboration diagram for RTP Buffer Access:

Functions

int rtp_fill_buffers (rtp_thread *)
int rtp_fill_buffer (rtp_ssrc *, rtp_frame *, rtp_buff *)
double rtp_get_next_ts (rtp_ssrc *)
int16_t rtp_get_next_pt (rtp_ssrc *)
void rtp_update_fps (rtp_ssrc *stm_src, uint32_t, unsigned)
float rtp_get_fps (rtp_ssrc *)
rtp_pktrtp_get_n_pkt (rtp_ssrc *, unsigned int *, unsigned)
rtp_pktrtp_get_pkt (rtp_ssrc *, size_t *)
int rtp_rm_pkt (rtp_ssrc *)
void rtp_rm_all_pkts (rtp_ssrc *)

Detailed Description

RTP buffer handling

Function Documentation

int rtp_fill_buffer ( rtp_ssrc *  stm_src,
rtp_frame *  fr,
rtp_buff *  config 
)

fills the frame with depacketized data (full frame or sample group) and provides optional extradata if available. The structs MUST be empty and the data delivered MUST not be freed.

Parameters:
stm_src an active ssrc
fr an empty frame structure
config an empty buffer structure
Returns:
RTP_FILL_OK on success

Definition at line 54 of file rtp_buffer.c.

References rtp_get_pkt().

Here is the call graph for this function:

int rtp_fill_buffers ( rtp_thread *  rtp_th  ) 

Waits for rtp thread to be ready and reports if the stream reached the end

Returns:
0 if the stream isn't at the end, 1 if the stream reached the end

Definition at line 37 of file rtp_buffer.c.

float rtp_get_fps ( rtp_ssrc *  stm_src  ) 

Guess the fps based on what is available on the buffer.

Parameters:
stm_src an active ssrc
Returns:
fps

Definition at line 156 of file rtp_buffer.c.

int16_t rtp_get_next_pt ( rtp_ssrc *  stm_src  ) 

Gets the payload type id for the next packet in the buffer

Parameters:
stm_src The source from which to get the packet
Returns:
The payload type id

Definition at line 127 of file rtp_buffer.c.

References rtp_pkt::pt, and rtp_get_pkt().

Here is the call graph for this function:

double rtp_get_next_ts ( rtp_ssrc *  stm_src  ) 

Gets the time in seconds between the first packet of the RTP stream and the next one in the buffer.

Parameters:
stm_src The source from which to get the packet
Returns:
The values in seconds

Definition at line 109 of file rtp_buffer.c.

References rtp_pkt::pt, and rtp_get_pkt().

Here is the call graph for this function:

rtp_pkt* rtp_get_pkt ( rtp_ssrc *  stm_src,
size_t *  len 
)

Returns a pointer to next packet in the bufferpool for given playout buffer. WARNING: the pointer returned is the memory space of the slot inside buffer pool: Once the packet is decoded it must be removed from rtp queue using

See also:
rtp_rm_pkt. WARNING: returned pointer looks at a memory space not locked by mutex. This because we suppose that there is only one reader for each playout buffer. We lock mutex only for potail var reading.
Parameters:
stm_src The source for which to get the packet.
len this is a return parameter for lenght of pkt. NULL value is allowed: in this case, we understand that you are not interested about this value. shawill: this function put its dirty hands on bufferpool internals!!!
Returns:
the pointer to next packet in buffer or NULL if playout buffer is empty.

Definition at line 211 of file rtp_buffer.c.

References rtp_rm_pkt().

Referenced by aac_parse(), h263_parse(), h264_parse(), m4v_parse(), rtp_fill_buffer(), rtp_get_next_pt(), rtp_get_next_ts(), theora_parse(), and vorbis_parse().

Here is the call graph for this function:

void rtp_rm_all_pkts ( rtp_ssrc *  stm_src  ) 

Clears the playoutbuffer and the socket buffer for the given source

Parameters:
stm_src The source for which to remove all the pending packets

Definition at line 276 of file rtp_buffer.c.

References buffer_pool_t::cond_full, buffer_pool_t::fl_mutex, buffer_pool_t::flcount, buffer_pool_t::flhead, buffer_pool_t::freelist, poitem::next, playout_buff_t::po_mutex, playout_buff_t::pobuff, playout_buff_t::pocount, playout_buff_t::pohead, playout_buff_t::potail, poitem::prev, and socket_clear().

Here is the call graph for this function:

int rtp_rm_pkt ( rtp_ssrc *  stm_src  )  [inline]

Removes the first packet from the playout buffer

Parameters:
stm_src The source for which to remove the packet
Returns:
0

Definition at line 239 of file rtp_buffer.c.

References bprmv().

Referenced by aac_parse(), h263_parse(), h264_parse(), m4v_parse(), and rtp_get_pkt().

Here is the call graph for this function:

void rtp_update_fps ( rtp_ssrc *  stm_src,
uint32_t  timestamp,
unsigned  pt 
)

Guess the fps based on timestamps of incoming packets.

Parameters:
stm_src an active ssrc
timestamp the time stamp of the last received packet

Definition at line 142 of file rtp_buffer.c.

Referenced by rtp_recv().


Generated on Tue Feb 3 03:10:03 2009 for libnemesi by  doxygen 1.5.4