|
VideoTools
|
An RTP packet parser, as per RFC 3550 (section 5). More...
#include <gvrtppacket.h>
Public Member Functions | |
| RtpPacket (const char *p, size_t n) | |
| Constructor. More... | |
| bool | valid () const |
| Returns true if a valid packet. | |
| std::string | reason () const |
| Returns the in-valid() reason. | |
| std::string | str () const |
| Returns a one-line summary of header fields. | |
| std::string | hexdump () const |
| Returns a complete hex dump. More... | |
| bool | marker () const |
| Returns the marker bit. More... | |
| unsigned int | seq () const |
| Returns the sequence number. | |
| unsigned long | timestamp () const |
| Returns the timestamp. | |
| unsigned long | src () const |
| Returns the source id. More... | |
| unsigned int | type () const |
| Returns the payload type. | |
| bool | typeJpeg () const |
| Returns true if the payload type is 26. | |
| bool | typeDynamic () const |
| Returns true if the payload type is in the dynamic range, 96 to 127. More... | |
| const char * | begin () const |
| Returns the payload begin iterator. | |
| const char * | end () const |
| Returns the payload end iterator. | |
| size_t | offset () const |
| Returns the payload offset. | |
| size_t | size () const |
| Returns the payload size. | |
| const unsigned char * | ubegin () const |
| Returns the payload begin iterator. | |
| const unsigned char * | uend () const |
| Returns the payload end iterator. | |
Static Public Member Functions | |
| static size_t | smallest () |
| Returns the smallest valid packet size. | |
An RTP packet parser, as per RFC 3550 (section 5).
An RTP packet contains a header, an optional list of sources (eg. separate cameras with their own sequence numbers), and a payload.
Payload formats are defined wrt. a profile sepecification, eg. RFC 3551 for the "RTP/AVP" profile. The profile defines mappings from a payload type to a payload encoding.
See also RFC 2435 for the JPEG profile.
Definition at line 44 of file gvrtppacket.h.
| Gv::RtpPacket::RtpPacket | ( | const char * | p, |
| size_t | n | ||
| ) |
Constructor.
Beware that the data is not copied so it must remain valid for payload methods (begin(), end() etc). Precondition: n >= smallest()
Definition at line 30 of file gvrtppacket.cpp.
| std::string Gv::RtpPacket::hexdump | ( | ) | const |
| bool Gv::RtpPacket::marker | ( | ) | const |
Returns the marker bit.
The interpretation is defined by the profile.
Definition at line 93 of file gvrtppacket.cpp.
| unsigned long Gv::RtpPacket::src | ( | ) | const |
| bool Gv::RtpPacket::typeDynamic | ( | ) | const |
Returns true if the payload type is in the dynamic range, 96 to 127.
Definition at line 138 of file gvrtppacket.cpp.