FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Arduino-AppleMIDI-Library/src/rtp_Defs.h at master · lathoub/Arduino-AppleMIDI-Library · GitHub
lathoub
Arduino-AppleMIDI-Library
Repository navigation
Code
Issues
1
(1)
Pull requests
Discussions
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Arduino-AppleMIDI-Library
/
src
/
rtp_Defs.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (40 loc) · 1.4 KB
Breadcrumbs
Arduino-AppleMIDI-Library
/
src
/
rtp_Defs.h
Copy path
File metadata and controls
55 lines (40 loc) · 1.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma
once
#include
"AppleMIDI_Namespace.h"
BEGIN_APPLEMIDI_NAMESPACE
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | V |P|X| CC |M| PT | Sequence number |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#define
RTP_VERSION_2
2
// first octet
#define
RTP_P_FIELD
0x20
#define
RTP_X_FIELD
0x10
#define
RTP_CC_FIELD
0x0F
// second octet
#define
RTP_M_FIELD
0x80
#define
RTP_PT_FIELD
0x7F
/* magic number */
#define
PAYLOADTYPE_RTPMIDI
97
/* Version is the first 2 bits of the first octet*/
#define
RTP_VERSION
(
octet
) (((octet) >> 6) & 0x03)
/* Padding is the third bit; No need to shift, because true is any value
other than 0! */
#define
RTP_PADDING
(
octet
) ((octet)&RTP_P_FIELD)
/* Extension bit is the fourth bit */
#define
RTP_EXTENSION
(
octet
) ((octet)&RTP_X_FIELD)
/* CSRC count is the last four bits */
#define
RTP_CSRC_COUNT
(
octet
) ((octet)&RTP_CC_FIELD)
/* Marker is the first bit of the second octet */
#define
RTP_MARKER
(
octet
) ((octet)&RTP_M_FIELD)
/* Payload type is the last 7 bits */
#define
RTP_PAYLOAD_TYPE
(
octet
) ((octet)&RTP_PT_FIELD)
typedef
struct
PACKED
Rtp
{
uint8_t
vpxcc
;
uint8_t
mpayload
;
uint16_t
sequenceNr
;
uint32_t
timestamp
;
ssrc_t
ssrc
;
}
Rtp_t
;
END_APPLEMIDI_NAMESPACE
Back
|
FazBrowse Home
|
New Git URL