#include <RTPPacket.h>
Public Member Functions | |
| RTPPacket (const char *name=NULL) | |
| RTPPacket (const RTPPacket &packet) | |
| virtual | ~RTPPacket () |
| RTPPacket & | operator= (const RTPPacket &packet) |
| virtual cObject * | dup () const |
| virtual const char * | className () const |
| virtual std::string | info () |
| virtual void | writeContents (std::ostream &os) |
| virtual int | marker () |
| virtual void | setMarker (int marker) |
| virtual int | payloadType () |
| virtual void | setPayloadType (int payloadType) |
| virtual u_int16 | sequenceNumber () |
| virtual void | setSequenceNumber (u_int16 sequenceNumber) |
| virtual u_int32 | timeStamp () |
| virtual void | setTimeStamp (u_int32 timeStamp) |
| virtual u_int32 | ssrc () |
| virtual void | setSSRC (u_int32 ssrc) |
| virtual int | headerLength () |
| virtual int | payloadLength () |
Static Public Member Functions | |
| static int | fixedHeaderLength () |
| static int | compareFunction (cObject *packet1, cObject *packet2) |
Protected Attributes | |
| int | _version |
| int | _padding |
| int | _extension |
| int | _csrcCount |
| int | _marker |
| int | _payloadType |
| u_int16 | _sequenceNumber |
| u_int32 | _timeStamp |
| u_int32 | _ssrc |
|
|
Default constructor. 00030 : cPacket(name) {
00031 _version = 2;
00032 _padding = 0;
00033 _extension = 0;
00034 _csrcCount = 0;
00035 _marker = 0;
00036 _payloadType = 0;
00037 _sequenceNumber = 0;
00038 _timeStamp = 0;
00039 _ssrc = 0;
00040
00041 // a standard rtp packet without csrcs and data has a length of 12 bytes
00042 setLength(fixedHeaderLength());
00043 };
|
|
|
Copy constructor. 00046 : cPacket() {
00047 setName(packet.name());
00048 operator=(packet);
00049 };
|
|
|
Destructor. 00052 {
00053 // when csrcList is implemented this
00054 // should free the memory used for it
00055 };
|
|
|
Returns the class name "RTPPacket". 00078 {
00079 return "RTPPacket";
00080 };
|
|
||||||||||||
|
Compares two RTPPacket objects by comparing their sequence numbers. 00164 {
00165 return ((RTPPacket *)packet1)->sequenceNumber() - ((RTPPacket *)packet2)->sequenceNumber();
00166 };
|
|
|
Duplicates the RTPPacket by calling the copy constructor. 00058 {
00059 return new RTPPacket(*this);
00060 };
|
|
|
Returns the length of the fixed header of an RTPPacket. 00148 {
00149 return 12;
00150 };
|
|
|
Returns the length of the header (fixed plus variable part) of this RTPPacket. 00152 {
00153 // fixed header is 12 bytes long,
00154 // add 4 bytes for every csrc identifier
00155 return(fixedHeaderLength() + 4 * _csrcCount);
00156 };
|
|
|
Writes a one line info about this RTPPacket into the given string. 00083 {
00084 std::stringstream out;
00085 out << "RTPPacket: payloadType=" << _payloadType << " payloadLength=" << payloadLength();
00086 return out.str();
00087 };
|
|
|
Returns the value of the marker bit in this RTPPacket. 00099 {
00100 return _marker;
00101 };
|
|
|
Assignment operator. 00063 {
00064 cPacket::operator=(packet);
00065 _version = packet._version;
00066 _padding = packet._padding;
00067 _extension = packet._extension;
00068 _csrcCount = packet._csrcCount;
00069 _marker = packet._marker;
00070 _payloadType = packet._payloadType;
00071 _sequenceNumber = packet._sequenceNumber;
00072 _timeStamp = packet._timeStamp;
00073 _ssrc = packet._ssrc;
00074 return *this;
00075 };
|
|
|
Returns the size of the payload stored in this RTPPacket. 00159 {
00160 return(length() - headerLength());
00161 };
|
|
|
Returns the payload type of this RTPPacket. 00109 {
00110 return _payloadType;
00111 };
|
|
|
Returns the sequence number of this RTPPacket. 00119 {
00120 return _sequenceNumber;
00121 };
|
|
|
Sets the value of the marker bit in this RTPPacket. 00104 {
00105 _marker = marker;
00106 };
|
|
|
Sets the payload type of this RTPPacket. 00114 {
00115 _payloadType = payloadType;
00116 };
|
|
|
Sets the sequence number of this RTPPacket. 00124 {
00125 _sequenceNumber = sequenceNumber;
00126 };
|
|
|
Sets the ssrc identifier of this RTPPacket. 00144 {
00145 _ssrc = ssrc;
00146 };
|
|
|
Sets the rtp time stamp of this RTPPacket. 00134 {
00135 _timeStamp = timeStamp;
00136 };
|
|
|
Returns the ssrc identifier of this RTPPacket. 00139 {
00140 return _ssrc;
00141 };
|
|
|
Returns the rtp time stamp of this RTPPacket. 00129 {
00130 return _timeStamp;
00131 };
|
|
|
Writes a longer description about this RTPPacket into the given stream. 00090 {
00091 os << "RTPPacket:" << endl;
00092 os << " payloadType = " << _payloadType << endl;
00093 os << " sequenceNumber = " << _sequenceNumber << endl;
00094 os << " timeStamp = " << _timeStamp << endl;
00095 os << " payloadLength = " << payloadLength() << endl;
00096 };
|
|
|
Stores the number (0..31) of contributing sources for this RTPPacket. It is always 0 because contributing sources are added by rtp mixers which aren't implemented. |
|
|
Set to 1, if this RTPPacket contains an rtp header extension, 0 otherwise. This implementation doesn't support rtp header extensions, so it is always 0. |
|
|
The marker of this RTPPacket. |
|
|
Set to 1 if padding is used in this RTPPacket, 0 otherwise. This implementation doesn't use padding bytes, so it is always 0. |
|
|
The type of payload carried in this RTPPacket. |
|
|
The sequence number of this RTPPacket. |
|
|
The ssrc identifier of the creator of this RTPPacket. |
|
|
The rtp time stamp of this RTPPacket. |
|
|
The rtp version of this RTPPacket. |
1.4.1