UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
rtp_callback.h File Reference
#include "rtp/rtp.h"
#include "rtp/rtp_types.h"
Include dependency graph for rtp_callback.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void call_display_frame (void)
 
int check_for_frame_completion (struct rtp *)
 
int handle_with_buffer (struct rtp *session, rtp_event *e)
 
void process_packet_for_display (char *)
 
void rtp_recv_callback (struct rtp *session, rtp_event *e)
 

Function Documentation

◆ call_display_frame()

void call_display_frame ( void )

◆ check_for_frame_completion()

int check_for_frame_completion ( struct rtp * )

◆ handle_with_buffer()

int handle_with_buffer ( struct rtp * session,
rtp_event * e )

◆ process_packet_for_display()

void process_packet_for_display ( char * )

◆ rtp_recv_callback()

void rtp_recv_callback ( struct rtp * session,
rtp_event * e )

Definition at line 212 of file rtp_callback.c.

213{
214 rtcp_app *pckt_app = (rtcp_app *) e->data;
215 rtp_packet *pckt_rtp = (rtp_packet *) e->data;
216 struct pdb *participants = (struct pdb *)rtp_get_userdata(session);
217 struct pdb_e *state = pdb_get(participants, e->ssrc);
218
219 switch (e->type) {
220 case RX_RTP:
221 tfrc_recv_data(state->tfrc_state, get_time_in_ns(), pckt_rtp->seq,
222 pckt_rtp->data_len + 40);
223 if (pckt_rtp->data_len > 0) { /* Only process packets that contain data... */
224 pbuf_insert(state->playout_buffer, pckt_rtp);
225 }
226 break;
227 case RX_TFRC_RX:
228 /* compute TCP friendly data rate */
229 break;
230 case RX_RTCP_START:
231 break;
232 case RX_RTCP_FINISH:
233 break;
234 case RX_SR:
235 break;
236 case RX_RR:
237 process_rr(session, e);
238 break;
239 case RX_RR_EMPTY:
240 break;
241 case RX_SDES:
242 process_sdes(participants, e->ssrc, (rtcp_sdes_item *) e->data);
243 break;
244 case RX_APP:
245 if (strncmp(pckt_app->name, "RTT_", 4) == 0) {
246 assert(pckt_app->length == 3);
247 assert(pckt_app->subtype == 0);
248// tfrc_recv_rtt(state->tfrc_state, get_time_in_ns(), ntohl(*((int *) pckt_app->data)));
249 }
250 break;
251 case RX_BYE:
252 break;
253 case SOURCE_DELETED:
254 {
255 struct pdb_e *pdb_item = NULL;
256 if(pdb_remove(participants, e->ssrc, &pdb_item) == 0) {
257 pdb_destroy_item(pdb_item);
258 }
259 }
260 break;
261 case SOURCE_CREATED:
262 pdb_add(participants, e->ssrc);
263 break;
264 case RR_TIMEOUT:
265 break;
266 default:
267 debug_msg("Unknown RTP event (type=%d)\n", e->type);
268 }
269}
void ** state
#define debug_msg(...)
#define debug_msg(...) log_msg(LOG_LEVEL_DEBUG, "[pid/%d +%d %s] ", getpid(), LINE,...
Definition debug.h:92
void pbuf_insert(struct pbuf *playout_buf, rtp_packet *pkt)
Definition pbuf.c:420
int pdb_add(struct pdb *db, uint32_t ssrc)
Definition pdb.c:299
void pdb_destroy_item(struct pdb_e *item)
Definition pdb.c:370
int pdb_remove(struct pdb *db, uint32_t ssrc, struct pdb_e **item)
Definition pdb.c:346
struct pdb_e * pdb_get(struct pdb *db, uint32_t ssrc)
Definition pdb.c:332
uint8_t * rtp_get_userdata(struct rtp *session)
Definition rtp.c:1386
rtp_packet
Definition rtp.h:126
@ RX_RTP
Definition rtp.h:180
@ RR_TIMEOUT
Definition rtp.h:192
@ RX_SDES
Definition rtp.h:185
@ RX_APP
Definition rtp.h:193
@ RX_RTCP_START
Definition rtp.h:190
@ RX_TFRC_RX
Definition rtp.h:184
@ RX_SR
Definition rtp.h:182
@ SOURCE_CREATED
Definition rtp.h:187
@ RX_RTCP_FINISH
Definition rtp.h:191
@ SOURCE_DELETED
Definition rtp.h:188
@ RX_RR_EMPTY
Definition rtp.h:189
@ RX_BYE
Definition rtp.h:186
@ RX_RR
Definition rtp.h:183
static void process_sdes(struct pdb *participants, uint32_t ssrc, rtcp_sdes_item *d)
static void process_rr(struct rtp *session, rtp_event *e)
Definition pdb.h:72
Definition pdb.c:84
rtp_event_type type
Definition rtp.h:199
uint32_t ssrc
Definition rtp.h:198
void * data
Definition rtp.h:200
void tfrc_recv_data(struct tfrc *state, time_ns_t curr_time, uint16_t seqnum, unsigned length)
Definition tfrc.c:436
static time_ns_t get_time_in_ns()
Definition tv.h:101

References rtp_event::data, debug_msg, get_time_in_ns(), rtcp_app::length, rtcp_app::name, pbuf_insert(), pdb_add(), pdb_destroy_item(), pdb_get(), pdb_remove(), process_rr(), process_sdes(), RR_TIMEOUT, rtp_get_userdata(), rtp_packet, RX_APP, RX_BYE, RX_RR, RX_RR_EMPTY, RX_RTCP_FINISH, RX_RTCP_START, RX_RTP, RX_SDES, RX_SR, RX_TFRC_RX, SOURCE_CREATED, SOURCE_DELETED, rtp_event::ssrc, state, rtcp_app::subtype, tfrc_recv_data(), and rtp_event::type.

Referenced by initialize_audio_network(), rtp_video_rxtx::initialize_network(), and vidcap_rtsp_init().

Here is the call graph for this function: