1 /*****************************************************************************
2 * rtcp.h: RTP/RTCP headerfile
3 *****************************************************************************
4 * Copyright (C) 2005 M2X
8 * Authors: Jean-Paul Saman <jpsaman #_at_# videolan dot org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
28 /* RTCP packet types */
34 /* End of RTCP packet types */
37 #define RTCP_INFO_CNAME 1
38 #define RTCP_INFO_NAME 2
39 #define RTCP_INFO_EMAIL 3
40 #define RTCP_INFO_PHONE 4
41 #define RTCP_INFO_LOC 5
42 #define RTCP_INFO_TOOL 6
43 #define RTCP_INFO_NOTE 7
44 #define RTCP_INFO_PRIV 8
45 /* End of RTCP Info */
47 #define RTCP_HEADER_LEN 3
52 unsigned int ntp_timestampH;
53 unsigned int ntp_timestampL;
54 unsigned int rtp_timestamp;
55 unsigned int u_pkt_count;
56 unsigned int u_octet_count;
59 typedef struct _RTCP_header_RR
67 unsigned char u_fract_lost;
68 unsigned char u_pck_lost[3];
69 unsigned int u_highest_seq_no;
70 unsigned int u_jitter;
71 unsigned int u_last_SR;
72 unsigned int u_delay_last_SR;
73 } rtcp_report_block_SR;
78 unsigned char u_attr_name;
79 unsigned char u_length;
86 unsigned char u_length;
91 unsigned char u_length;
96 * structure rtcp_stats_t
100 unsigned int u_RR_received; /*< RR records received */
101 unsigned int u_SR_received; /*< SR records received */
102 unsigned long l_dest_SSRC; /*< SSRC */
103 unsigned int u_pkt_count; /*< count of packets received */
104 unsigned int u_octet_count; /*< ? */
105 unsigned int u_pkt_lost; /*< count of packets lost */
106 unsigned int u_fract_lost; /*< count of fractional packets lost */
107 unsigned int u_highest_seq_no;/*< highest sequence number found */
108 unsigned int u_jitter; /*< jitter calculated */
109 unsigned int u_last_SR; /*< last SR record received */
110 unsigned int u_last_RR; /*< last RR record received */
111 mtime_t u_delay_since_last_SR; /*< delay since last SR record received */
112 mtime_t u_delay_since_last_RR; /*< delay since last RR record received */
116 int fd; /*< socket descriptor of rtcp stream */
118 unsigned int u_count; /*< packet count */
119 unsigned int u_version; /*< RTCP version number */
120 unsigned int u_length; /*< lenght of packet */
121 unsigned int u_payload_type; /*< type of RTCP payload */
122 rtcp_stats_t stats; /*< RTCP statistics */
125 rtcp_SR sr; /*< SR record */
126 rtcp_RR rr; /*< RR record */
127 rtcp_SDES sdes; /*< SDES record */
128 rtcp_BYE bye; /*< BYE record */
129 rtcp_APP app; /*< APP record */
132 /*int (*pf_connect)( void *p_userdata, char *p_server, int i_port );
133 int (*pf_disconnect)( void *p_userdata );
134 int (*pf_read)( void *p_userdata, uint8_t *p_buffer, int i_buffer );
135 int (*pf_write)( void *p_userdata, uint8_t *p_buffer, int i_buffer );*/
141 * Decode incoming RTCP packet and inspect the records types.
143 int rtcp_decode( vlc_object_t *p_this, rtcp_t *p_rtcp, block_t *p_block );
144 //VLC_EXPORT( int, rtcp_decode, ( rtcp_t *p_rtcp, block_t *p_block ) );
145 block_t *rtcp_encode( vlc_object_t *p_this, int type );