AmRtpPacket.h
Go to the documentation of this file.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
00028 #ifndef _AmRtpPacket_h_
00029 #define _AmRtpPacket_h_
00030
00031 #include <sys/time.h>
00032 #include <sys/types.h>
00033 #include <netinet/in.h>
00034
00035 class AmRtpPacketTracer;
00036
00038 class AmRtpPacket {
00039
00040 unsigned char buffer[4096];
00041 unsigned int b_size;
00042
00043 unsigned int data_offset;
00044 unsigned int d_size;
00045
00046 public:
00047 unsigned char payload;
00048 bool marker;
00049 unsigned short sequence;
00050 unsigned int timestamp;
00051 unsigned int ssrc;
00052
00053 struct timeval recv_time;
00054
00055 #ifdef SUPPORT_IPV6
00056 struct sockaddr_storage addr;
00057 #else
00058 struct sockaddr_in addr;
00059 #endif
00060
00061
00062 AmRtpPacket();
00063 ~AmRtpPacket();
00064
00065 #ifdef SUPPORT_IPV6
00066 void setAddr(struct sockaddr_storage* a);
00067 void getAddr(struct sockaddr_storage* a);
00068 #else
00069 void setAddr(struct sockaddr_in* a);
00070 void getAddr(struct sockaddr_in* a);
00071 #endif
00072
00073
00074 int compile(unsigned char* data_buf, unsigned int size);
00075
00076 int compile_raw(unsigned char* data_buf, unsigned int size);
00077
00078 int send(int sd);
00079 int recv(int sd);
00080
00081 int parse();
00082
00083 unsigned int getDataSize() const { return d_size; }
00084 unsigned char* getData();
00085
00086 unsigned int getBufferSize() const { return b_size; }
00087 unsigned char* getBuffer();
00088 void setBufferSize(unsigned int b) { b_size = b; }
00089
00090 void copy(const AmRtpPacket* p);
00091
00092 friend class AmRtpPacketTracer;
00093 };
00094
00095 #endif
00096
00097
Generated on Fri May 16 12:02:05 2008 for SEMS by
1.5.1