UniMRCP  1.7.0
mpf_rtp_header.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MPF_RTP_HEADER_H
18 #define MPF_RTP_HEADER_H
19 
20 /**
21  * @file mpf_rtp_header.h
22  * @brief RTP Header Definition
23  */
24 
25 #include "mpf.h"
26 
28 
29 /** Protocol version */
30 #define RTP_VERSION 2
31 
32 /** RTP header declaration */
33 typedef struct rtp_header_t rtp_header_t;
34 /** RTP extension header declaration */
36 
37 
38 /** RTP header */
39 struct rtp_header_t {
40 #if (APR_IS_BIGENDIAN == 1)
41  /** protocol version */
42  apr_uint32_t version: 2;
43  /** padding flag */
44  apr_uint32_t padding: 1;
45  /** header extension flag */
46  apr_uint32_t extension: 1;
47  /** CSRC count */
48  apr_uint32_t count: 4;
49  /** marker bit */
50  apr_uint32_t marker: 1;
51  /** payload type */
52  apr_uint32_t type: 7;
53 #else
54  /** CSRC count */
55  apr_uint32_t count: 4;
56  /** header extension flag */
57  apr_uint32_t extension: 1;
58  /** padding flag */
59  apr_uint32_t padding: 1;
60  /** protocol version */
61  apr_uint32_t version: 2;
62  /** payload type */
63  apr_uint32_t type: 7;
64  /** marker bit */
65  apr_uint32_t marker: 1;
66 #endif
67 
68  /** sequence number */
69  apr_uint32_t sequence: 16;
70  /** timestamp */
71  apr_uint32_t timestamp;
72  /** synchronization source */
73  apr_uint32_t ssrc;
74 };
75 
76 /** RTP extension header */
78  /** profile */
79  apr_uint16_t profile;
80  /** length */
81  apr_uint16_t length;
82 };
83 
85 
86 #endif /* MPF_RTP_HEADER_H */
apr_uint32_t padding
Definition: mpf_rtp_header.h:59
#define APT_END_EXTERN_C
Definition: apt.h:38
apr_uint32_t version
Definition: mpf_rtp_header.h:61
apr_uint32_t timestamp
Definition: mpf_rtp_header.h:71
Definition: mpf_rtp_header.h:39
apr_uint32_t ssrc
Definition: mpf_rtp_header.h:73
apr_uint32_t marker
Definition: mpf_rtp_header.h:65
apr_uint16_t length
Definition: mpf_rtp_header.h:81
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
apr_uint32_t type
Definition: mpf_rtp_header.h:63
apr_uint32_t sequence
Definition: mpf_rtp_header.h:69
apr_uint32_t extension
Definition: mpf_rtp_header.h:57
Media Processing Framework Definitions.
Definition: mpf_rtp_header.h:77
apr_uint32_t count
Definition: mpf_rtp_header.h:55
apr_uint16_t profile
Definition: mpf_rtp_header.h:79