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
00037 #ifndef RTCPAPPPACKET_H
00038
00039 #define RTCPAPPPACKET_H
00040
00041 #include "rtpconfig.h"
00042 #include "rtcppacket.h"
00043 #include "rtpstructs.h"
00044 #if ! (defined(WIN32) || defined(_WIN32_WCE))
00045 #include <netinet/in.h>
00046 #endif // WIN32
00047
00048 class RTCPCompoundPacket;
00049
00051 class RTCPAPPPacket : public RTCPPacket
00052 {
00053 public:
00059 RTCPAPPPacket(uint8_t *data,size_t datalen);
00060 ~RTCPAPPPacket() { }
00061
00063 uint8_t GetSubType() const;
00064
00066 uint32_t GetSSRC() const;
00067
00071 uint8_t *GetName();
00072
00074 uint8_t *GetAPPData();
00075
00077 size_t GetAPPDataLength() const;
00078 #ifdef RTPDEBUG
00079 void Dump();
00080 #endif // RTPDEBUG
00081 private:
00082 size_t appdatalen;
00083 };
00084
00085 inline uint8_t RTCPAPPPacket::GetSubType() const
00086 {
00087 if (!knownformat)
00088 return 0;
00089 RTCPCommonHeader *hdr = (RTCPCommonHeader *)data;
00090 return hdr->count;
00091 }
00092
00093 inline uint32_t RTCPAPPPacket::GetSSRC() const
00094 {
00095 if (!knownformat)
00096 return 0;
00097
00098 uint32_t *ssrc = (uint32_t *)(data+sizeof(RTCPCommonHeader));
00099 return ntohl(*ssrc);
00100 }
00101
00102 inline uint8_t *RTCPAPPPacket::GetName()
00103 {
00104 if (!knownformat)
00105 return 0;
00106
00107 return (data+sizeof(RTCPCommonHeader)+sizeof(uint32_t));
00108 }
00109
00110 inline uint8_t *RTCPAPPPacket::GetAPPData()
00111 {
00112 if (!knownformat)
00113 return 0;
00114 if (appdatalen == 0)
00115 return 0;
00116 return (data+sizeof(RTCPCommonHeader)+sizeof(uint32_t)*2);
00117 }
00118
00119 inline size_t RTCPAPPPacket::GetAPPDataLength() const
00120 {
00121 if (!knownformat)
00122 return 0;
00123 return appdatalen;
00124 }
00125
00126 #endif // RTCPAPPPACKET_H
00127