00001
00002
00003
00004
00005
00006
00007
00008 #ifdef MICROSOFT_COMPILERS_CAN_BE_TRUSTED
00009 #error Microsoft compilers can *never* be trusted,
00010 #error except to invariably do the wrong thing.
00011 typedef unsigned char u_int8;
00012 typedef unsigned short u_int16;
00013 typedef unsigned long u_int32;
00014 #endif
00015
00016 #define RTP_SEQ_MOD (1<<16)
00017 #define RTP_TS_MOD (0xffffffff)
00018
00019
00020
00021 #define RTP_VERSION 2
00022
00023 #define RTP_MAX_SDES 256
00024
00025 typedef enum {
00026 RTCP_SR = 200,
00027 RTCP_RR = 201,
00028 RTCP_SDES = 202,
00029 RTCP_BYE = 203,
00030 RTCP_APP = 204
00031 } rtcp_type_t;
00032
00033 typedef enum {
00034 RTCP_SDES_END = 0,
00035 RTCP_SDES_CNAME = 1,
00036 RTCP_SDES_NAME = 2,
00037 RTCP_SDES_EMAIL = 3,
00038 RTCP_SDES_PHONE = 4,
00039 RTCP_SDES_LOC = 5,
00040 RTCP_SDES_TOOL = 6,
00041 RTCP_SDES_NOTE = 7,
00042 RTCP_SDES_PRIV = 8,
00043 RTCP_SDES_IMG = 9,
00044 RTCP_SDES_DOOR = 10,
00045 RTCP_SDES_SOURCE = 11
00046 } rtcp_sdes_type_t;
00047
00048 #ifdef MICROSOFT_COMPILERS_CAN_BE_TRUSTED
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 typedef struct {
00059 unsigned int version:2;
00060 unsigned int p:1;
00061 unsigned int x:1;
00062 unsigned int cc:4;
00063 unsigned int m:1;
00064 unsigned int pt:7;
00065 u_int16 seq;
00066 u_int32 ts;
00067 u_int32 ssrc;
00068 u_int32 csrc[1];
00069 } rtp_hdr_t;
00070
00071 typedef struct {
00072 unsigned int version:2;
00073 unsigned int p:1;
00074 unsigned int count:5;
00075 unsigned int pt:8;
00076 u_int16 length;
00077 } rtcp_common_t;
00078
00079
00080 typedef struct {
00081 u_int32 ssrc;
00082 unsigned long fraction:8;
00083 long lost:24;
00084 u_int32 last_seq;
00085 u_int32 jitter;
00086 u_int32 lsr;
00087 u_int32 dlsr;
00088 } rtcp_rr_t;
00089
00090 typedef struct {
00091 u_int8 type;
00092 u_int8 length;
00093 char data[1];
00094 } rtcp_sdes_item_t;
00095
00096
00097 typedef struct {
00098 rtcp_common_t common;
00099 union {
00100
00101 struct {
00102 u_int32 ssrc;
00103 u_int32 ntp_sec;
00104 u_int32 ntp_frac;
00105 u_int32 rtp_ts;
00106 u_int32 psent;
00107 u_int32 osent;
00108
00109 rtcp_rr_t rr[1];
00110 } sr;
00111
00112
00113 struct {
00114 u_int32 ssrc;
00115
00116 rtcp_rr_t rr[1];
00117 } rr;
00118
00119
00120 struct {
00121 u_int32 src[1];
00122
00123 } bye;
00124
00125
00126 struct rtcp_sdes_t {
00127 u_int32 src;
00128 rtcp_sdes_item_t item[1];
00129 } sdes;
00130 } r;
00131 } rtcp_t;
00132 #endif