21 #ifndef GV_RTPPACKET__H
22 #define GV_RTPPACKET__H
47 G_EXCEPTION( Error ,
"rtp packet error" ) ;
60 std::string
reason()
const ;
63 std::string
str()
const ;
75 unsigned int seq()
const ;
81 unsigned long src()
const ;
86 unsigned int type()
const ;
96 const char *
begin()
const ;
99 const char *
end()
const ;
105 size_t size()
const ;
108 const unsigned char *
ubegin()
const ;
111 const unsigned char *
uend()
const ;
117 static unsigned int make_word(
const unsigned char * p ) ;
118 static unsigned long make_dword(
const unsigned char * p ) ;
121 const unsigned char * m_p ;
123 unsigned int m_version ;
130 unsigned long m_timestamp ;
131 unsigned long m_src_id ;
133 unsigned int m_padsize ;
134 size_t m_header_size ;
135 size_t m_payload_size ;
136 std::string m_reason ;
const char * end() const
Returns the payload end iterator.
bool valid() const
Returns true if a valid packet.
bool typeJpeg() const
Returns true if the payload type is 26.
static size_t smallest()
Returns the smallest valid packet size.
std::string str() const
Returns a one-line summary of header fields.
size_t size() const
Returns the payload size.
std::string hexdump() const
Returns a complete hex dump.
const char * begin() const
Returns the payload begin iterator.
const unsigned char * ubegin() const
Returns the payload begin iterator.
An RTP packet parser, as per RFC 3550 (section 5).
bool typeDynamic() const
Returns true if the payload type is in the dynamic range, 96 to 127.
const unsigned char * uend() const
Returns the payload end iterator.
unsigned long timestamp() const
Returns the timestamp.
RtpPacket(const char *p, size_t n)
Constructor.
size_t offset() const
Returns the payload offset.
unsigned int seq() const
Returns the sequence number.
bool marker() const
Returns the marker bit.
unsigned int type() const
Returns the payload type.
unsigned long src() const
Returns the source id.
std::string reason() const
Returns the in-valid() reason.