INET Framework for OMNeT++/OMNEST
inet::rtp::RTPPacket Class Reference

This class represents an RTP data packet. More...

#include <RTPPacket.h>

Inheritance diagram for inet::rtp::RTPPacket:
inet::rtp::RTPPacket_Base

Public Member Functions

 RTPPacket (const char *name=nullptr, int kind=0)
 
 RTPPacket (const RTPPacket &other)
 
RTPPacketoperator= (const RTPPacket &other)
 
virtual RTPPacketdup () const override
 
virtual std::string info () const override
 Writes a one line info about this RTPPacket into the given string. More...
 
virtual void dump () const
 Writes a longer description about this RTPPacket into the given stream. More...
 
virtual int getHeaderLength () const override
 Returns the length of the header (fixed plus variable part) of this RTPPacket. More...
 
virtual void setHeaderLength (int x) override
 
virtual int getPayloadLength () const override
 Returns the size of the payload stored in this RTPPacket. More...
 
virtual void setPayloadLength (int x) override
 
- Public Member Functions inherited from inet::rtp::RTPPacket_Base
virtual ~RTPPacket_Base ()
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual uint8_t getVersion () const
 
virtual void setVersion (uint8_t version)
 
virtual bool getPadding () const
 
virtual void setPadding (bool padding)
 
virtual bool getExtension () const
 
virtual void setExtension (bool extension)
 
virtual bool getMarker () const
 
virtual void setMarker (bool marker)
 
virtual int8_t getPayloadType () const
 
virtual void setPayloadType (int8_t payloadType)
 
virtual uint16_t getSequenceNumber () const
 
virtual void setSequenceNumber (uint16_t sequenceNumber)
 
virtual uint32_t getTimeStamp () const
 
virtual void setTimeStamp (uint32_t timeStamp)
 
virtual uint32_t getSsrc () const
 
virtual void setSsrc (uint32_t ssrc)
 
virtual void setCsrcArraySize (unsigned int size)
 
virtual unsigned int getCsrcArraySize () const
 
virtual uint32_t getCsrc (unsigned int k) const
 
virtual void setCsrc (unsigned int k, uint32_t csrc)
 

Additional Inherited Members

- Protected Member Functions inherited from inet::rtp::RTPPacket_Base
bool operator== (const RTPPacket_Base &)
 
 RTPPacket_Base (const char *name=nullptr, short kind=0)
 
 RTPPacket_Base (const RTPPacket_Base &other)
 
RTPPacket_Baseoperator= (const RTPPacket_Base &other)
 
- Protected Attributes inherited from inet::rtp::RTPPacket_Base
uint8_t version
 
bool padding
 
bool extension
 
bool marker
 
int8_t payloadType
 
uint16_t sequenceNumber
 
uint32_t timeStamp
 
uint32_t ssrc
 
uint32_t * csrc
 
unsigned int csrc_arraysize
 

Detailed Description

This class represents an RTP data packet.

Real data can either be encapsulated or simulated by adding length. Following RTP header fields exist but aren't used: padding, extension, csrcCount. The csrcList can't be used because csrcCount is always 0.

Constructor & Destructor Documentation

inet::rtp::RTPPacket::RTPPacket ( const char *  name = nullptr,
int  kind = 0 
)
inline
37 : RTPPacket_Base(name, kind) {}
RTPPacket_Base(const char *name=nullptr, short kind=0)
inet::rtp::RTPPacket::RTPPacket ( const RTPPacket other)
inline
38 : RTPPacket_Base(other) {}
RTPPacket_Base(const char *name=nullptr, short kind=0)

Member Function Documentation

void inet::rtp::RTPPacket::dump ( ) const
virtual

Writes a longer description about this RTPPacket into the given stream.

Referenced by inet::rtp::RTP::readRet().

35 {
36  EV_INFO << "RTPPacket:" << endl;
37  EV_INFO << " payloadType = " << payloadType << endl;
38  EV_INFO << " sequenceNumber = " << sequenceNumber << endl;
39  EV_INFO << " timeStamp = " << timeStamp << endl;
40  EV_INFO << " payloadLength = " << getPayloadLength() << endl;
41 }
uint16_t sequenceNumber
Definition: RTPPacket_m.h:136
virtual int getPayloadLength() const override
Returns the size of the payload stored in this RTPPacket.
Definition: RTPPacket.cc:50
int8_t payloadType
Definition: RTPPacket_m.h:135
uint32_t timeStamp
Definition: RTPPacket_m.h:137
virtual RTPPacket* inet::rtp::RTPPacket::dup ( ) const
inlineoverridevirtual

Reimplemented from inet::rtp::RTPPacket_Base.

40 { return new RTPPacket(*this); }
RTPPacket(const char *name=nullptr, int kind=0)
Definition: RTPPacket.h:37
int inet::rtp::RTPPacket::getHeaderLength ( ) const
overridevirtual

Returns the length of the header (fixed plus variable part) of this RTPPacket.

Implements inet::rtp::RTPPacket_Base.

Referenced by getPayloadLength().

44 {
45  // fixed header is 12 bytes long,
46  // add 4 bytes for every csrc identifier
48 }
Definition: RTPPacket_m.h:49
virtual unsigned int getCsrcArraySize() const
int inet::rtp::RTPPacket::getPayloadLength ( ) const
overridevirtual

Returns the size of the payload stored in this RTPPacket.

Implements inet::rtp::RTPPacket_Base.

Referenced by dump(), info(), and inet::rtp::RTPSenderInfo::processRTPPacket().

51 {
52  return getByteLength() - getHeaderLength();
53 }
virtual int getHeaderLength() const override
Returns the length of the header (fixed plus variable part) of this RTPPacket.
Definition: RTPPacket.cc:43
std::string inet::rtp::RTPPacket::info ( ) const
overridevirtual

Writes a one line info about this RTPPacket into the given string.

27 {
28  std::stringstream out;
29  out << "RTPPacket: payloadType=" << payloadType
30  << " payloadLength=" << getPayloadLength();
31  return out.str();
32 }
virtual int getPayloadLength() const override
Returns the size of the payload stored in this RTPPacket.
Definition: RTPPacket.cc:50
int8_t payloadType
Definition: RTPPacket_m.h:135
RTPPacket& inet::rtp::RTPPacket::operator= ( const RTPPacket other)
inline
39 { RTPPacket_Base::operator=(other); return *this; }
RTPPacket_Base & operator=(const RTPPacket_Base &other)
virtual void inet::rtp::RTPPacket::setHeaderLength ( int  x)
inlineoverridevirtual

Implements inet::rtp::RTPPacket_Base.

58 { throw cRuntimeError("Don't use SetHeaderLength()"); }
virtual void inet::rtp::RTPPacket::setPayloadLength ( int  x)
inlineoverridevirtual

Implements inet::rtp::RTPPacket_Base.

64 { throw cRuntimeError("Don't use SetPayloadLength()"); }

The documentation for this class was generated from the following files: