jrtplib  3.6.0
rtpstructs.h
Go to the documentation of this file.
1 /*
2 
3  This file is a part of JRTPLIB
4  Copyright (c) 1999-2006 Jori Liesenborgs
5 
6  Contact: jori.liesenborgs@gmail.com
7 
8  This library was developed at the "Expertisecentrum Digitale 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 RTPSTRUCTS_H
38 
39 #define RTPSTRUCTS_H
40 
41 #include "rtpconfig.h"
42 #include "rtptypes.h"
43 
44 struct RTPHeader
45 {
46 #ifdef RTP_BIG_ENDIAN
47  uint8_t version:2;
48  uint8_t padding:1;
49  uint8_t extension:1;
50  uint8_t csrccount:4;
51 
52  uint8_t marker:1;
53  uint8_t payloadtype:7;
54 #else // little endian
55  uint8_t csrccount:4;
56  uint8_t extension:1;
57  uint8_t padding:1;
58  uint8_t version:2;
59 
60  uint8_t payloadtype:7;
61  uint8_t marker:1;
62 #endif // RTP_BIG_ENDIAN
63 
64  uint16_t sequencenumber;
65  uint32_t timestamp;
66  uint32_t ssrc;
67 };
68 
69 struct RTPExtensionHeader
70 {
71  uint16_t extid;
72  uint16_t length;
73 };
74 
75 struct RTPSourceIdentifier
76 {
77  uint32_t ssrc;
78 };
79 
80 struct RTCPCommonHeader
81 {
82 #ifdef RTP_BIG_ENDIAN
83  uint8_t version:2;
84  uint8_t padding:1;
85  uint8_t count:5;
86 #else // little endian
87  uint8_t count:5;
88  uint8_t padding:1;
89  uint8_t version:2;
90 #endif // RTP_BIG_ENDIAN
91 
92  uint8_t packettype;
93  uint16_t length;
94 };
95 
96 struct RTCPSenderReport
97 {
98  uint32_t ntptime_msw;
99  uint32_t ntptime_lsw;
100  uint32_t rtptimestamp;
101  uint32_t packetcount;
102  uint32_t octetcount;
103 };
104 
105 struct RTCPReceiverReport
106 {
107  uint32_t ssrc; // Identifies about which SSRC's data this report is...
108  uint8_t fractionlost;
109  uint8_t packetslost[3];
110  uint32_t exthighseqnr;
111  uint32_t jitter;
112  uint32_t lsr;
113  uint32_t dlsr;
114 };
115 
116 struct RTCPSDESHeader
117 {
118  uint8_t sdesid;
119  uint8_t length;
120 };
121 
122 #endif // RTPSTRUCTS
123