4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Philipp Batroff <pug@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.
24 \brief RTPPacket public header */
27 #ifndef HH_SENF_Packets_DefaultBundle_RTPPacket_
28 #define HH_SENF_Packets_DefaultBundle_RTPPacket_
30 #include "../../Packets/Packets.hh"
31 #include "../../Socket/Protocols/INet/INet6Address.hh"
36 struct RTPPacketParser : public PacketParserBase
38 # include SENF_PARSER()
39 SENF_PARSER_BITFIELD ( version, 2, unsigned ); //Version (RFC 3550)
40 SENF_PARSER_BITFIELD ( padding, 1, bool ); //1 if padding behind payload
41 SENF_PARSER_BITFIELD ( extension, 1, bool );
42 SENF_PARSER_BITFIELD_RO ( csrcCount, 4, unsigned ); //0-15,define the number of contributing sources
43 SENF_PARSER_BITFIELD ( marker, 1, bool ); //Marker M=1, used to signal speech silent compression; further use in combination with PT to be defined
44 SENF_PARSER_BITFIELD ( payloadType, 7, unsigned ); //Payload Type; e.g. PCM=8 (RFC 3550)
45 SENF_PARSER_FIELD ( seqNumber, UInt16Parser ); //random number to identify initial segment of a stream, increment by 1 used to resequence segments at receiver
46 SENF_PARSER_FIELD ( timeStamp, UInt32Parser ); //signals sampling time of 1st byte of payload; initialised; used to calculate Jitter between segments
47 SENF_PARSER_FIELD ( synSourceId, UInt32Parser ); //Synchronisation source identifier; identifier of RFTP stream source (random number) in case of conferencing identifier of mixer
48 SENF_PARSER_VECTOR (csrcOpt, csrcCount, UInt32Parser );
50 bool valid() const {return version() == 2;}
51 SENF_PARSER_FINALIZE(RTPPacketParser);
55 : public PacketTypeBase,
56 public PacketTypeMixin<RTPPacketType>
58 typedef PacketTypeMixin<RTPPacketType> mixin;
59 typedef ConcretePacket<RTPPacketType> packet;
60 typedef RTPPacketParser parser;
62 using mixin::nextPacketRange;
64 using mixin::initSize;
66 static void dump(packet p, std::ostream &os);
69 typedef RTPPacketType::packet RTPPacket;