Fork me on GitHub
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtp.h
Go to the documentation of this file.
1 
13 #ifndef _JANUS_RTP_H
14 #define _JANUS_RTP_H
15 
16 #include <arpa/inet.h>
17 #ifdef __MACH__
18 #include <machine/endian.h>
19 #else
20 #include <endian.h>
21 #endif
22 #include <inttypes.h>
23 #include <string.h>
24 
25 #define RTP_HEADER_SIZE 12
26 
28 typedef struct rtp_header
29 {
30 #if __BYTE_ORDER == __BIG_ENDIAN
31  uint16_t version:2;
32  uint16_t padding:1;
33  uint16_t extension:1;
34  uint16_t csrccount:4;
35  uint16_t markerbit:1;
36  uint16_t type:7;
37 #elif __BYTE_ORDER == __LITTLE_ENDIAN
38  uint16_t csrccount:4;
39  uint16_t extension:1;
40  uint16_t padding:1;
41  uint16_t version:2;
42  uint16_t type:7;
43  uint16_t markerbit:1;
44 #endif
45  uint16_t seq_number;
46  uint32_t timestamp;
47  uint32_t ssrc;
48  uint32_t csrc[16];
49 } rtp_header;
50 
52 typedef struct janus_rtp_packet {
53  char *data;
54  gint length;
57 
58 #endif