1 // $Id: main.test.cc 206 2008-08-06 14:20:52Z pug $
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Definition of non-inline non-template functions
26 #ifndef HH_SENF_Packets_DefaultBundle_RTPPacket_
27 #define HH_SENF_Packets_DefaultBundle_RTPPacket_
29 #include "../../Packets/Packets.hh"
30 #include "../../Socket/Protocols/INet/INet6Address.hh"
31 #include "../../Socket/Protocols/INet.hh"
32 #include "../../Utils/Logger/SenfLog.hh"
36 struct RTPPacketParser : public senf::PacketParserBase
38 SENF_LOG_CLASS_AREA();
39 # include SENF_PARSER()
40 SENF_PARSER_BITFIELD ( version, 2, unsigned ); //Version (RFC 3550)
41 SENF_PARSER_BITFIELD ( padding, 1, bool ); //1 if padding behind payload
42 SENF_PARSER_BITFIELD ( extension, 1, bool );
43 SENF_PARSER_BITFIELD_RO ( csrcCount, 4, unsigned ); //0-15,define the number of contributing sources
44 SENF_PARSER_BITFIELD ( marker, 1, bool ); //Marker M=1, used to signal speech silent compression; further use in combination with PT to be defined
45 SENF_PARSER_BITFIELD ( payloadType, 7, unsigned ); //Payload Type; e.g. PCM=8 (RFC 3550)
46 SENF_PARSER_FIELD ( seqNumber, senf::UInt16Parser ); //random number to identify initial segment of a stream, increment by 1 used to resequence segments at receiver
47 SENF_PARSER_FIELD ( timeStamp, senf::UInt32Parser ); //signals sampling time of 1st byte of payload; initialised; used to calculate Jitter between segments
48 SENF_PARSER_FIELD ( synSourceId, senf::UInt32Parser ); //Synchronisation source identifier; identifier of RFTP stream source (random number) in case of conferencing identifier of mixer
49 SENF_PARSER_VECTOR (csrcOpt, csrcCount, senf::UInt32Parser );
51 bool valid() const {return version() == 2;}
52 SENF_PARSER_FINALIZE(RTPPacketParser);
56 : public senf::PacketTypeBase,
57 public senf::PacketTypeMixin<RTPPacketType>
59 SENF_LOG_CLASS_AREA();
60 typedef senf::PacketTypeMixin<RTPPacketType> mixin;
61 typedef senf::ConcretePacket<RTPPacketType> packet;
62 typedef RTPPacketParser parser;
64 using mixin::nextPacketRange;
66 using mixin::initSize;
68 static void dump(packet p, std::ostream &os);
71 typedef RTPPacketType::packet RTPPacket;