JRTPLIB  3.11.1
rtcppacket.h
Go to the documentation of this file.
1 /*
2 
3  This file is a part of JRTPLIB
4  Copyright (c) 1999-2017 Jori Liesenborgs
5 
6  Contact: jori.liesenborgs@gmail.com
7 
8  This library was developed at the Expertise Centre for Digital Media
9  (http://www.edm.uhasselt.be), a research center of the Hasselt University
10  (http://www.uhasselt.be). The library is based upon work done for
11  my thesis at the School for Knowledge Technology (Belgium/The Netherlands).
12 
13  Permission is hereby granted, free of charge, to any person obtaining a
14  copy of this software and associated documentation files (the "Software"),
15  to deal in the Software without restriction, including without limitation
16  the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  and/or sell copies of the Software, and to permit persons to whom the
18  Software is furnished to do so, subject to the following conditions:
19 
20  The above copyright notice and this permission notice shall be included
21  in all copies or substantial portions of the Software.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29  IN THE SOFTWARE.
30 
31 */
32 
37 #ifndef RTCPPACKET_H
38 
39 #define RTCPPACKET_H
40 
41 #include "rtpconfig.h"
42 #include "rtptypes.h"
43 
44 namespace jrtplib
45 {
46 
47 class RTCPCompoundPacket;
48 
50 class JRTPLIB_IMPORTEXPORT RTCPPacket
51 {
52 public:
54  enum PacketType
55  {
56  SR,
57  RR,
58  SDES,
59  BYE,
60  APP,
61  Unknown
62  };
63 protected:
64  RTCPPacket(PacketType t,uint8_t *d,size_t dlen) : data(d),datalen(dlen),packettype(t) { knownformat = false; }
65 public:
66  virtual ~RTCPPacket() { }
67 
69  bool IsKnownFormat() const { return knownformat; }
70 
72  PacketType GetPacketType() const { return packettype; }
73 
75  uint8_t *GetPacketData() { return data; }
76 
78  size_t GetPacketLength() const { return datalen; }
79 
80 #ifdef RTPDEBUG
81  virtual void Dump();
82 #endif // RTPDEBUG
83 protected:
84  uint8_t *data;
85  size_t datalen;
86  bool knownformat;
87 private:
88  const PacketType packettype;
89 };
90 
91 } // end namespace
92 
93 #endif // RTCPPACKET_H
94 
An RTCP bye packet.
Definition: rtcppacket.h:59
An RTCP packet containing application specific data.
Definition: rtcppacket.h:60
bool IsKnownFormat() const
Returns true if the subclass was able to interpret the data and false otherwise.
Definition: rtcppacket.h:69
size_t GetPacketLength() const
Returns the length of this RTCP packet.
Definition: rtcppacket.h:78
uint8_t * GetPacketData()
Returns a pointer to the data of this RTCP packet.
Definition: rtcppacket.h:75
PacketType GetPacketType() const
Returns the actual packet type which the subclass implements.
Definition: rtcppacket.h:72
PacketType
Identifies the specific kind of RTCP packet.
Definition: rtcppacket.h:54
An RTCP source description packet.
Definition: rtcppacket.h:58
Definition: rtpfaketransmitter.h:64
An RTCP receiver report.
Definition: rtcppacket.h:57
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:50
An RTCP sender report.
Definition: rtcppacket.h:56