ROHC compression/decompression library
rtp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007,2008 CNES
3  * Copyright 2011,2012,2013 Didier Barvaux
4  * Copyright 2007,2008 Thales Alenia Space
5  * Copyright 2007,2010 Viveris Technologies
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file rtp.h
24  * @brief RTP header
25  * @author David Moreau from TAS
26  * @author Didier Barvaux <didier@barvaux.org>
27  *
28  * See section 5.1 of RFC 1889 for details.
29  */
30 
31 #ifndef ROHC_PROTOCOLS_RTP_H
32 #define ROHC_PROTOCOLS_RTP_H
33 
34 #include <stdint.h>
35 
36 #ifdef __KERNEL__
37 # include <endian.h>
38 #else
39 # include "config.h" /* for WORDS_BIGENDIAN */
40 #endif
41 
42 
43 /**
44  * @brief The RTP header
45  *
46  * See section 5.1 of RFC 1889 for details.
47  */
48 struct rtphdr
49 {
50 #if WORDS_BIGENDIAN == 1
51  uint16_t version:2;
52  uint16_t padding:1;
53  uint16_t extension:1;
54  uint16_t cc:4;
55  uint16_t m:1;
56  uint16_t pt:7;
57 #else
58  uint16_t cc:4; ///< CSRC Count
59  uint16_t extension:1; ///< Extension bit
60  uint16_t padding:1; ///< Padding bit
61  uint16_t version:2; ///< RTP version
62  uint16_t pt:7; ///< Payload Type
63  uint16_t m:1; ///< Marker
64 #endif
65  uint16_t sn; ///< Sequence Number
66  uint32_t timestamp; ///< Timestamp
67  uint32_t ssrc; ///< Synchronization SouRCe (SSRC) identifier
68 } __attribute__((packed));
69 
70 
71 #endif
72 
uint16_t m
Marker.
Definition: rtp.h:63
uint16_t padding
Padding bit.
Definition: rtp.h:60
uint16_t extension
Extension bit.
Definition: rtp.h:59
uint16_t cc
CSRC Count.
Definition: rtp.h:58
uint32_t timestamp
Timestamp.
Definition: rtp.h:66
uint16_t pt
Payload Type.
Definition: rtp.h:62
The RTP header.
Definition: rtp.h:48
uint16_t sn
Sequence Number.
Definition: rtp.h:65
uint16_t version
RTP version.
Definition: rtp.h:61
uint32_t ssrc
Synchronization SouRCe (SSRC) identifier.
Definition: rtp.h:67