RTPPacket.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Packets_DefaultBundle_RTPPacket_
18 #define HH_SENF_Packets_DefaultBundle_RTPPacket_ 1
19 
20 // Custom includes
21 #include <senf/Packets/Packets.hh>
22 
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 namespace senf {
25 
27  {
28 # include SENF_PARSER()
29  SENF_PARSER_BITFIELD ( version, 2, unsigned ); // Version (RFC 3550)
30  SENF_PARSER_BITFIELD ( padding, 1, bool ); // 1 if padding behind payload
31  SENF_PARSER_BITFIELD ( extension, 1, bool );
32  SENF_PARSER_BITFIELD_RO( csrcCount, 4, unsigned ); // 0-15,define the number of contributing sources
33  SENF_PARSER_BITFIELD ( marker, 1, bool ); // Marker M=1, used to signal speech silent compression; further use in combination with PT to be defined
34  SENF_PARSER_BITFIELD ( payloadType, 7, unsigned ); // Payload Type; e.g. PCM=8 (RFC 3550)
35 
36  SENF_PARSER_FIELD( seqNumber, UInt16Parser ); // random number to identify initial segment of a stream, increment by 1 used to resequence segments at receiver
37  SENF_PARSER_FIELD( timeStamp, UInt32Parser ); // signals sampling time of 1st byte of payload; initialized; used to calculate Jitter between segments
38  SENF_PARSER_FIELD( synSourceId, UInt32Parser ); // Synchronization source identifier; identifier of RFTP stream source (random number) in case of conferencing identifier of mixer
39 
41 
43 
44  bool valid() const { return version() == 2; }
45  };
46 
48  : public PacketTypeBase,
49  public PacketTypeMixin<RTPPacketType>
50  {
54 
55  using mixin::nextPacketRange;
56  using mixin::init;
57  using mixin::initSize;
58 
59  static void dump(packet p, std::ostream & os);
60  };
61 
64 
65 }
66 
67 //-/////////////////////////////////////////////////////////////////////////////////////////////////
68 #endif
ConcretePacket< RTPPacketType > packet
Definition: RTPPacket.hh:52
#define SENF_PARSER_BITFIELD(name, bits, type)
Define bit-field.
RTPPacketParser parser
Definition: RTPPacket.hh:53
Mixin to provide standard implementations for nextPacketRange and nextPacketType. ...
Definition: PacketType.hh:300
Packets public header.
#define SENF_PARSER_FIELD(name, type)
Define normal parser field.
UInt32Parser synSourceId() const
senf::FlagParser<?> padding() const
#define SENF_PARSER_FINALIZE(name)
Generate parser control members.
UInt32Parser timeStamp() const
senf::UIntFieldParser<?,?+7 > payloadType() const
void dump(std::ostream &os, DirectoryNode &dir=root())
Protocol specific packet handle.
Definition: Packet.hh:87
senf::VectorParser< UInt32Parser > csrcOpt() const
Helper base-class implementing the PacketType interface.
Definition: PacketType.hh:100
#define SENF_PARSER_VECTOR(name, size, elt_type)
Define VectorParser field.
#define SENF_PARSER_BITFIELD_RO(name, bits, type)
Define bit-field (read-only)
senf::UIntFieldParser<?,?+2 > version() const
SENF_PACKET_PREVENT_TEMPLATE_INSTANTIATION(RadiotapPacket)
senf::FlagParser<?> marker() const
UInt16Parser seqNumber() const
ConcretePacket< RTPPacketType > RTPPacket
Definition: RTPPacket.hh:62
Parser Base class.
bool valid() const
Definition: RTPPacket.hh:44
Parse 32bit unsigned byte aligned integer.
Definition: IntParser.hh:310
senf::UIntFieldParser<?,?+4 >::value_type csrcCount() const
Parse 16bit unsigned byte aligned integer.
Definition: IntParser.hh:174
senf::FlagParser<?> extension() const
PacketTypeMixin< RTPPacketType > mixin
Definition: RTPPacket.hh:51