00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00049 #include "config.h"
00050 #undef PACKAGE
00051 #undef VERSION
00052 #include <cc++/config.h>
00053 #include <cc++/socket.h>
00054 #include <cc++/export.h>
00055 #include "rtp.h"
00056 #include "rtpext.h"
00057
00058
00059
00060 #ifdef HAVE_LIBNANA
00061 # include "nana.h"
00062 # include "DL.h"
00063 #else
00064 # define I(e)
00065 # define DL(e)
00066 # define VDL(e)
00067 #endif
00068
00069 #ifdef HAVE_CSTDLIB
00070 #include <cstdlib>
00071 #else
00072 # ifdef HAVE_STDLIB_H
00073 # include <stdlib.h>
00074 # else
00075 # warning "Your system does not have cstdlib nor stdlib.h"
00076 #define getenv(w) ("unidentifiable_user")
00077 # endif //HAVE_STDLIB_H
00078 #endif //HAVE_CSTDLIB
00079
00080 #ifdef HAVE_SYS_UTSNAME_H
00081 # include <sys/utsname.h>
00082 #else
00083 # error "Portability problem: you do not have sys/utsname.h"
00084 #endif
00085
00086 #ifdef __NAMESPACES__
00087 namespace ost {
00088 #endif
00089
00090
00091
00100
00117 #pragma pack(1)
00118 struct ReceiverInfo
00119 {
00120 uint8 flost;
00121 uint8 lost_msb;
00122 uint16 lost_lsb;
00123 uint32 highest_seqnum;
00124 uint32 jitter;
00125 uint32 lsr;
00126 uint32 dlsr;
00127 };
00128
00132 typedef struct
00133 {
00134 uint32 ssrc;
00135 ReceiverInfo rinfo;
00136 } RRBlock;
00137
00141 struct SenderInfo
00142 {
00143 uint32 NTP_msb;
00144 uint32 NTP_lsb;
00145 uint32 RTPtimestamp;
00146 uint32 packet_count;
00147 uint32 octet_count;
00148 };
00149
00153 typedef struct
00154 {
00155 uint32 ssrc;
00156 SenderInfo sinfo;
00157 RRBlock blocks [0];
00158 } SendReport;
00159
00166 typedef struct
00167 {
00168 uint32 ssrc;
00169 RRBlock blocks [0];
00170 } RecvReport;
00171
00175 typedef struct
00176 {
00177 uint8 type;
00178 uint8 len;
00179 } SDESItem;
00180
00181 typedef struct
00182 {
00183 uint32 ssrc;
00184 SDESItem item;
00185 } SDESChunk;
00186
00187 typedef struct
00188 {
00189 uint32 ssrc;
00190 uint8 length;
00191 } BYEPacket;
00192
00193 typedef struct
00194 {
00195 char name [4];
00196 char* data;
00197 } APPPacket;
00198
00202 struct RTCPPacket
00203 {
00204 RTCPFixedHeader fh;
00205 union
00206 {
00207 SendReport SR;
00208 RecvReport RR;
00209 SDESChunk SDES;
00210 BYEPacket BYE;
00211 APPPacket APP;
00212 } info;
00213 };
00214
00218 typedef struct {
00219 RTCPFixedHeader fh;
00220 uint32 ssrc;
00221 uint8 length;
00222 char const reason[0];
00223 } BYEHeader;
00224
00225 typedef struct {
00226 RTCPFixedHeader fh;
00227 uint32 ssrc;
00228 char name[4];
00229 } RTCPAPPHeader;
00230 #pragma pack()
00231
00232 #ifdef __NAMESPACES__
00233 };
00234 #endif
00235