UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
rtp_types.h
Go to the documentation of this file.
1/*
2 * FILE: rtp_types.h
3 * AUTHOR: Colin Perkins <csp@csperkins.org>
4 * Martin Pulec <pulec@cesnet.cz>
5 *
6 * Copyright (c) 2001-2003 University of Southern California
7 * Copyright (c) 2005-2024 CESNET
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, is permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 *
23 * This product includes software developed by the University of Southern
24 * California Information Sciences Institute.
25 *
26 * 4. Neither the name of the University nor of the Institute may be used
27 * to endorse or promote products derived from this software without
28 * specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
31 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
32 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
33 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
34 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
35 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
41 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 *
43 */
44
45#ifndef RTP_RTP_TYPES_H_EB786480_8B49_4BB4_9707_FF4AD8ED5A50
46#define RTP_RTP_TYPES_H_EB786480_8B49_4BB4_9707_FF4AD8ED5A50
47
48#ifdef __cplusplus
49#include <cstdint>
50#else
51#include <stdint.h>
52#endif
53
63#define PT_ITU_T_G711_PCMU 0 /* mU-law std */
64#define PT_ITU_T_G711_PCMA 8 /* A-law std */
65#define PT_MPA 14
66#define PT_VIDEO 20
67#define PT_AUDIO 21
68#define PT_VIDEO_LDGM 22
69#define PT_ENCRYPT_VIDEO 24
70#define PT_ENCRYPT_AUDIO 25
71#define PT_JPEG 26 /* standard, RFC 2435 (assigned in RFC 3551) */
72#define PT_VIDEO_RS 27
73#define PT_ENCRYPT_VIDEO_LDGM 29
74#define PT_ENCRYPT_VIDEO_RS 30
75#define PT_AUDIO_RS 35
76#define PT_ENCRYPT_AUDIO_RS 36
77#define PT_Unassign_Type95 95 /* reserved for future, backward compatible use with UG (metadata etc.) */
78#define PT_DynRTP_Type96 96 /* usually H.264 */
79#define PT_DynRTP_Type97 97 /* mU-law stereo amongst others */
80/*
81 * Video payload
82 *
83 * 1st word
84 * bits 0 - 9 substream
85 * bits 10 - 31 buffer
86 *
87 * 2nd word
88 * bits 0 - 31 offset
89 *
90 * 3rd word
91 * bits 0 - 31 length
92 *
93 * 4rd word
94 * bits 0-15 horizontal resolution
95 * bits 16-31 vertical resolution
96 *
97 * 5th word
98 * bits 0 - 31 FourCC
99 *
100 * 6th word
101 * bits 0 - 2 interlace flag
102 * bits 3 - 12 FPS
103 * bits 13 - 16 FPSd
104 * bit 17 Fd
105 * bit 18 Fi
106 */
107typedef uint32_t video_payload_hdr_t[6];
108
109/*
110 * Audio payload
111 *
112 * 1st word
113 * bits 0 - 9 substream
114 * bits 10 - 31 buffer
115 *
116 * 2nd word
117 * bits 0 - 31 offset
118 *
119 * 3rd word
120 * bits 0 - 31 length
121 *
122 * 4rd word
123 * bits 0-5 audio quantization
124 * bits 6-31 audio sample rate
125 *
126 * 5th word
127 * bits 0 - 31 AudioTag
128 */
129typedef uint32_t audio_payload_hdr_t[5];
130
131/*
132 * FEC payload
133 *
134 * 1st word
135 * bits 0 - 9 substream
136 * bits 10 - 31 buffer
137 *
138 * 2nd word
139 * bits 0 - 31 offset
140 *
141 * 3rd word
142 * bits 0 - 31 length
143 *
144 * 4rd word
145 * bits 0-12 K
146 * bits 13-25 M
147 * bits 26-31 C
148 *
149 * 5th word
150 * bits 0 - 31 LDGM random generator seed
151 */
152typedef uint32_t fec_payload_hdr_t[5];
153
154/*
155 * Crypto video payload
156 *
157 * 1st word
158 * bits 0 - 8 crypto type, value of @ref openssl_mode
159 * bits 9 - 31 currently unused
160 */
161typedef uint32_t crypto_payload_hdr_t[1];
162
163typedef uint32_t mpa_hdr_t;
164
165#define PT_AUDIO_HAS_FEC(pt) ((pt) == PT_AUDIO_RS || (pt) == PT_ENCRYPT_AUDIO_RS)
166#define PT_AUDIO_IS_ENCRYPTED(pt) ((pt) == PT_ENCRYPT_AUDIO || (pt) == PT_ENCRYPT_AUDIO_RS)
167#define PT_IS_AUDIO(pt) ((pt) == PT_AUDIO || (pt) == PT_AUDIO_RS || (pt) == PT_ENCRYPT_AUDIO || (pt) == PT_ENCRYPT_AUDIO_RS)
168#define PT_VIDEO_HAS_FEC(pt) (pt == PT_VIDEO_LDGM || pt == PT_ENCRYPT_VIDEO_LDGM || pt == PT_VIDEO_RS || pt == PT_ENCRYPT_VIDEO_RS)
169#define PT_VIDEO_IS_ENCRYPTED(pt) (pt == PT_ENCRYPT_VIDEO || pt == PT_ENCRYPT_VIDEO_LDGM || pt == PT_ENCRYPT_VIDEO_RS)
170
171#define BUFNUM_BITS 22U
172
173enum {
174 FPS_MAX = 1024,
175};
176
177#endif // deined RTP_RTP_TYPES_H_EB786480_8B49_4BB4_9707_FF4AD8ED5A50
uint32_t mpa_hdr_t
Definition rtp_types.h:163
@ FPS_MAX
given by UG RTP payload header
Definition rtp_types.h:174
uint32_t audio_payload_hdr_t[5]
Definition rtp_types.h:129
uint32_t fec_payload_hdr_t[5]
Definition rtp_types.h:152
uint32_t crypto_payload_hdr_t[1]
Definition rtp_types.h:161
uint32_t video_payload_hdr_t[6]
Definition rtp_types.h:107