rtp_buffer.c File Reference

#include "rtp.h"
#include "rtpptdefs.h"
#include "bufferpool.h"

Include dependency graph for rtp_buffer.c:

Go to the source code of this file.

Functions

int rtp_fill_buffers (rtp_thread *rtp_th)
int rtp_fill_buffer (rtp_ssrc *stm_src, rtp_frame *fr, rtp_buff *config)
double rtp_get_next_ts (rtp_ssrc *stm_src)
int16_t rtp_get_next_pt (rtp_ssrc *stm_src)
void rtp_update_fps (rtp_ssrc *stm_src, uint32_t timestamp, unsigned pt)
float rtp_get_fps (rtp_ssrc *stm_src)
rtp_pktrtp_get_n_pkt (rtp_ssrc *stm_src, unsigned int *len, unsigned int pkt_num)
rtp_pktrtp_get_pkt (rtp_ssrc *stm_src, size_t *len)
int rtp_rm_pkt (rtp_ssrc *stm_src)
static void socket_clear (rtp_ssrc *stm_src)
void rtp_rm_all_pkts (rtp_ssrc *stm_src)


Detailed Description

This file contains the functions that perform playout buffer and make possible to access packets pending on the buffer.

Definition in file rtp_buffer.c.


Function Documentation

rtp_pkt* rtp_get_n_pkt ( rtp_ssrc *  stm_src,
unsigned int *  len,
unsigned int  pkt_num 
)

Returns a pointer to Nth 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.
pkt_num The index of the packet we want to get. shawill: this function put his dirty hands on bufferpool internals!!!
Returns:
the pointer to next packet in buffer or NULL if playout buffer is empty.

Definition at line 175 of file rtp_buffer.c.

static void socket_clear ( rtp_ssrc *  stm_src  )  [static]

Clears the buffer of the socket removing every pending packet

Parameters:
stm_src The source for which to clear the socket buffer

Definition at line 249 of file rtp_buffer.c.

References BP_SLOT_SIZE.

Referenced by rtp_rm_all_pkts().


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