X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FRTPPacket.hh;h=823487a0b2ef86cc9b1d07680eb9fabedb8b3577;hb=9a988902090d28007578e93bffd809f6bd913155;hp=9f4a6c7878b086b1dbdad01ecd580b07d58782f8;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Packets/RTPPacket.hh b/Packets/RTPPacket.hh index 9f4a6c7..823487a 100644 --- a/Packets/RTPPacket.hh +++ b/Packets/RTPPacket.hh @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) // Stefan Bund @@ -33,9 +33,9 @@ //#include "RTPPacket.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace pkf { - +namespace senf { + + template struct Parse_RTP : public ParserBase { @@ -45,7 +45,7 @@ namespace pkf { Parse_RTP() {} Parse_RTP(Iterator const & i) : ParserBase(i) {} - + /////////////////////////////////////////////////////////////////////////// typedef Parse_UIntField < 0, 2, Iterator > Parse_Version; @@ -57,7 +57,7 @@ namespace pkf { typedef Parse_UInt16 < Iterator > Parse_Seq; typedef Parse_UInt32 < Iterator > Parse_32bit; typedef Parse_Vector < Parse_32bit, Parse_CC, Iterator > Parse_CCVec; - + Parse_Version version() const { return Parse_Version (this->i() ); } Parse_P padding() const { return Parse_P (this->i() ); } Parse_X extension() const { return Parse_X (this->i() ); } @@ -67,16 +67,16 @@ namespace pkf { Parse_Seq seqNumber() const { return Parse_Seq (this->i() + 2 ); } Parse_32bit timestamp() const { return Parse_32bit (this->i() + 4 ); } Parse_32bit ssrc() const { return Parse_32bit (this->i() + 8 ); } - Parse_CCVec csrcList() const { return Parse_CCVec (csrcCount(), this->i() + 12 ); } + Parse_CCVec csrcList() const { return Parse_CCVec (csrcCount(), this->i() + 12 ); } + + - - /////////////////////////////////////////////////////////////////////////// unsigned int bytes() const { return 12 + ( 4 * csrcCount()); } static bool check(Iterator const & b, Iterator const & e) { return e-b>= 12 and unsigned(e-b) >= Parse_RTP(b).bytes(); } - + }; struct RTPTypes { @@ -84,8 +84,8 @@ namespace pkf { }; class RTPPacket - : public Packet, - public Parse_RTP, + : public Packet, + public Parse_RTP, public PacketRegistryMixin { using Packet::registerInterpreter; @@ -99,10 +99,10 @@ namespace pkf { /////////////////////////////////////////////////////////////////////////// typedef Parse_UInt8 < Packet::iterator > Parse_paddingOctet; - - Parse_paddingOctet paddingOctet() const { - return Parse_paddingOctet( end() -1 ); - } + + Parse_paddingOctet paddingOctet() const { + return Parse_paddingOctet( end() -1 ); + } private: template @@ -115,8 +115,8 @@ namespace pkf { friend class Packet; }; - - + + template struct Parse_RTPExtensionBase : public ParserBase { @@ -128,27 +128,27 @@ namespace pkf { Parse_RTPExtensionBase(Iterator const & i) : ParserBase(i) {} /////////////////////////////////////////////////////////////////////////// - + typedef Parse_UInt16 < Iterator > Parse_16bit; Parse_16bit proDef() const { return Parse_16bit(this->i()); }; Parse_16bit length() const { return Parse_16bit(this->i()+2); }; - unsigned int bytes() const { return 4 + length(); } + unsigned int bytes() const { return 4 + length(); } static bool check(Iterator const & b, Iterator const & e) { return e-b>=4 && unsigned(e-b) >= Parse_RTPExtensionBase(b).bytes(); } - }; + }; - class RTPExtensionBasePacket + class RTPExtensionBasePacket : public Packet, public PacketRegistryMixin { using PacketRegistryMixin::registerInterpreter; using Packet::registerInterpreter; public: - /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// typedef ptr_t::ptr ptr; protected: @@ -174,13 +174,13 @@ namespace pkf { Parse_RTPUnknownExtension() {} Parse_RTPUnknownExtension(Iterator const & i) : ParserBase(i) {} - + /////////////////////////////////////////////////////////////////////////// - + typedef Parse_UInt16 < Iterator > Parse_16bit; typedef Parse_UInt8 < Iterator > Parse_8bit; typedef Parse_Vector < Parse_8bit, Parse_16bit, Iterator > Parse_ext; - + Parse_ext ext() const { return Parse_ext (this->length(), this->i() + 4 ); } }; @@ -208,7 +208,7 @@ namespace pkf { friend class Packet; }; -}} +} ///////////////////////////////hh.e//////////////////////////////////////// @@ -220,5 +220,8 @@ namespace pkf { // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" // End: