]> code.delx.au - pulseaudio/blob - src/modules/bluetooth/rtp.h
Merge commit 'origin/master-tx' into master-tx
[pulseaudio] / src / modules / bluetooth / rtp.h
1 /*
2 *
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2004-2008 Marcel Holtmann <marcel@holtmann.org>
6 *
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library 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 GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 */
23
24 #if __BYTE_ORDER == __LITTLE_ENDIAN
25
26 struct rtp_header {
27 uint8_t cc:4;
28 uint8_t x:1;
29 uint8_t p:1;
30 uint8_t v:2;
31
32 uint8_t pt:7;
33 uint8_t m:1;
34
35 uint16_t sequence_number;
36 uint32_t timestamp;
37 uint32_t ssrc;
38 uint32_t csrc[0];
39 } __attribute__ ((packed));
40
41 struct rtp_payload {
42 uint8_t frame_count:4;
43 uint8_t rfa0:1;
44 uint8_t is_last_fragment:1;
45 uint8_t is_first_fragment:1;
46 uint8_t is_fragmented:1;
47 } __attribute__ ((packed));
48
49 #elif __BYTE_ORDER == __BIG_ENDIAN
50
51 struct rtp_header {
52 uint8_t v:2;
53 uint8_t p:1;
54 uint8_t x:1;
55 uint8_t cc:4;
56
57 uint8_t m:1;
58 uint8_t pt:7;
59
60 uint16_t sequence_number;
61 uint32_t timestamp;
62 uint32_t ssrc;
63 uint32_t csrc[0];
64 } __attribute__ ((packed));
65
66 struct rtp_payload {
67 uint8_t is_fragmented:1;
68 uint8_t is_first_fragment:1;
69 uint8_t is_last_fragment:1;
70 uint8_t rfa0:1;
71 uint8_t frame_count:4;
72 } __attribute__ ((packed));
73
74 #else
75 #error "Unknown byte order"
76 #endif