uvgRTP 3.1.3
An open-source library for RTP/SRTP media delivery
Loading...
Searching...
No Matches
util.hh
Go to the documentation of this file.
1
2#pragma once
3
5#ifdef _WIN32
6#include <winsock2.h>
7#include <windows.h>
8#else
9#include <sys/time.h>
10#endif
11
12// ssize_t definition for all systems
13#if defined(_MSC_VER)
14typedef SSIZE_T ssize_t;
15#else
16#include <sys/types.h>
17#endif
18
19#include <stdint.h>
20
22
30typedef enum RTP_ERROR {
32 RTP_MULTIPLE_PKTS_READY = 6,
33 RTP_PKT_READY = 5,
34 RTP_PKT_MODIFIED = 4,
35 RTP_PKT_NOT_HANDLED = 3,
36 RTP_INTERRUPTED = 2,
37 RTP_NOT_READY = 1,
39
40 RTP_OK = 0,
55} rtp_error_t;
56
62typedef enum RTP_FORMAT {
63 // See RFC 3551 for more details
64
65 // static audio profiles
68 // 1 is reserved in RFC 3551
69 // 2 is reserved in RFC 3551
79 // 12 QCELP is unsupported in uvgRTP
80 // 13 CN is unsupported in uvgRTP
81 // 14 MPA is unsupported in uvgRTP
86 // 19 is reserved in RFC 3551
87 // 20 - 23 are unassigned in RFC 3551
88
89 /* static video profiles, unsupported in uvgRTP
90 * 24 is unassigned
91 * 25 is CelB,
92 * 26 is JPEG
93 * 27 is unassigned
94 * 28 is nv
95 * 29 is unassigned
96 * 30 is unassigned
97 * 31 is H261
98 * 32 is MPV
99 * 33 is MP2T
100 * 32 is H263
101 */
102
103 /* Rest of static numbers
104 * 35 - 71 are unassigned
105 * 72 - 76 are reserved
106 * 77 - 95 are unassigned
107 */
108
109 /* Formats with dynamic payload numbers 96 - 127, including default values.
110 * Use RCC_DYN_PAYLOAD_TYPE flag to change the number if desired. */
111
120 // RED is unsupported in uvgRTP
123 // H263-1998 is unsupported in uvgRTP
127 RTP_FORMAT_ATLAS = 109
128
129} rtp_format_t;
130
137typedef enum RTP_FLAGS {
139
141
142 RTP_OBSOLETE = 1,
143 RTP_SLICE = 1, // used to do what RTP_NO_H26X_SCL does, may do something different in the future
145
147 RTP_COPY = 1 << 1,
148
155
157 RTP_H26X_DO_NOT_AGGR = 1 << 3
158
159} rtp_flags_t;
160
170
172 RCE_OBSOLETE = 1,
174
175 // These can be used to specify what the address does for one address create session
176 RCE_SEND_ONLY = 1 << 1,
178
180 RCE_SRTP = 1 << 3,
181
191
201
202
207
211
219
225
228
236
239
242 RCE_RTCP = 1 << 13,
243
249
252
255
258
261
263 RCE_FRAME_RATE = 1 << 19,
264
267
269 RCE_RTCP_MUX = 1 << 21,
270
272 RCE_LAST = 1 << 22
274}; // maximum is 1 << 30 for int
275
276
286 RCC_NO_FLAGS = 0, // This flag has no purpose
288
296
304
312
320
323
326
336
349
357
363
369
383
391
397
399 RCC_LAST
401};
402
403extern thread_local rtp_error_t rtp_errno;
RTP_CTX_ENABLE_FLAGS
RTP context enable flags.
Definition util.hh:168
@ RCE_H26X_DEPENDENCY_ENFORCEMENT
Definition util.hh:210
@ RCE_SRTP_KEYSIZE_256
Definition util.hh:254
@ RCE_RTCP_MUX
Definition util.hh:269
@ RCE_SRTP_KMNGMNT_ZRTP
Definition util.hh:190
@ RCE_SRTP_KMNGMNT_USER
Definition util.hh:200
@ RCE_NO_FLAGS
Use this if you have no RCE flags.
Definition util.hh:169
@ RCE_SRTP_NULL_CIPHER
Definition util.hh:227
@ RCE_ZRTP_DIFFIE_HELLMAN_MODE
Definition util.hh:257
@ RCE_FRAGMENT_GENERIC
Definition util.hh:218
@ RCE_SEND_ONLY
address/port interpreted as remote, no binding to local socket
Definition util.hh:176
@ RCE_SRTP_AUTHENTICATE_RTP
Definition util.hh:235
@ RCE_PACE_FRAGMENT_SENDING
Definition util.hh:266
@ RCE_NO_H26X_PREPEND_SC
Definition util.hh:206
@ RCE_HOLEPUNCH_KEEPALIVE
Definition util.hh:248
@ RCE_ZRTP_MULTISTREAM_MODE
Definition util.hh:260
@ RCE_SYSTEM_CALL_CLUSTERING
Definition util.hh:224
@ RCE_RTCP
Definition util.hh:242
@ RCE_SRTP_REPLAY_PROTECTION
Definition util.hh:238
@ RCE_FRAME_RATE
Definition util.hh:263
@ RCE_SRTP_KEYSIZE_192
Definition util.hh:251
@ RCE_SRTP
Definition util.hh:180
@ RCE_RECEIVE_ONLY
address/port interpreted as local, sending not possible
Definition util.hh:177
RTP_FORMAT
These flags are given to uvgrtp::session::create_stream()
Definition util.hh:62
@ RTP_FORMAT_H266
H.266/VVC.
Definition util.hh:126
@ RTP_FORMAT_G728
G728.
Definition util.hh:82
@ RTP_FORMAT_PCMU
PCMU, ITU-T G.711.
Definition util.hh:67
@ RTP_FORMAT_L16_STEREO
L16 Stereo.
Definition util.hh:77
@ RTP_FORMAT_G722
G722.
Definition util.hh:76
@ RTP_FORMAT_G726_32
G726, 32 kbit/s.
Definition util.hh:113
@ RTP_FORMAT_L16_MONO
L16 Mono.
Definition util.hh:78
@ RTP_FORMAT_GSM_EFR
GSM enhanced full rate speech transcoding.
Definition util.hh:118
@ RTP_FORMAT_OPUS
Opus, see RFC 7587.
Definition util.hh:122
@ RTP_FORMAT_H265
H.265/HEVC, see RFC 7798.
Definition util.hh:125
@ RTP_FORMAT_PCMA
PCMA.
Definition util.hh:75
@ RTP_FORMAT_LPC
LPC.
Definition util.hh:74
@ RTP_FORMAT_G729
G729, 8 kbit/s.
Definition util.hh:85
@ RTP_FORMAT_ATLAS
V3C.
Definition util.hh:127
@ RTP_FORMAT_G726_24
G726, 24 kbit/s.
Definition util.hh:114
@ RTP_FORMAT_VDVI
VDVI, variable-rate DVI4.
Definition util.hh:121
@ RTP_FORMAT_DVI4_441
DVI 44.1 kbit/s.
Definition util.hh:83
@ RTP_FORMAT_GSM
GSM (Group Speciale Mobile)
Definition util.hh:70
@ RTP_FORMAT_G723
G723.
Definition util.hh:71
@ RTP_FORMAT_DVI4_882
DVI 88.2 kbit/s.
Definition util.hh:84
@ RTP_FORMAT_L8
L8, linear audio data samples.
Definition util.hh:119
@ RTP_FORMAT_DVI4_32
DVI 32 kbit/s.
Definition util.hh:72
@ RTP_FORMAT_GENERIC
Same as PCMU.
Definition util.hh:66
@ RTP_FORMAT_H264
H.264/AVC, see RFC 6184.
Definition util.hh:124
@ RTP_FORMAT_G729E
G729E, 11.8 kbit/s.
Definition util.hh:117
@ RTP_FORMAT_DVI4_64
DVI 64 kbit/s.
Definition util.hh:73
@ RTP_FORMAT_G726_16
G726, 16 kbit/s.
Definition util.hh:115
@ RTP_FORMAT_G726_40
G726, 40 kbit/s.
Definition util.hh:112
@ RTP_FORMAT_G729D
G729D, 6.4 kbit/s.
Definition util.hh:116
RTP_ERROR
RTP error codes.
Definition util.hh:30
@ RTP_BIND_ERROR
Failed to bind to interface.
Definition util.hh:43
@ RTP_INITIALIZED
Object already initialized.
Definition util.hh:48
@ RTP_NOT_FOUND
Object not found.
Definition util.hh:53
@ RTP_OK
Success.
Definition util.hh:40
@ RTP_NOT_INITIALIZED
Object has not been initialized.
Definition util.hh:49
@ RTP_INVALID_VALUE
Invalid value.
Definition util.hh:44
@ RTP_SEND_ERROR
System call send(2) or one of its derivatives failed.
Definition util.hh:45
@ RTP_AUTH_TAG_MISMATCH
Authentication tag does not match the RTP packet contents.
Definition util.hh:54
@ RTP_NOT_SUPPORTED
Method/version/extension not supported.
Definition util.hh:50
@ RTP_SSRC_COLLISION
SSRC collision detected.
Definition util.hh:47
@ RTP_RECV_ERROR
System call recv(2) or one of its derivatives failed.
Definition util.hh:51
@ RTP_SOCKET_ERROR
Failed to create socket.
Definition util.hh:42
@ RTP_MEMORY_ERROR
Memory allocation failed.
Definition util.hh:46
@ RTP_TIMEOUT
Operation timed out.
Definition util.hh:52
@ RTP_GENERIC_ERROR
Generic error condition.
Definition util.hh:41
RTP_CTX_CONFIGURATION_FLAGS
RTP context configuration flags.
Definition util.hh:284
@ RCC_REMOTE_SSRC
Definition util.hh:368
@ RCC_FPS_NUMERATOR
Definition util.hh:348
@ RCC_PKT_MAX_DELAY
Definition util.hh:319
@ RCC_MTU_SIZE
Definition util.hh:335
@ RCC_MULTICAST_TTL
Definition util.hh:396
@ RCC_POLL_TIMEOUT
Definition util.hh:390
@ RCC_SESSION_BANDWIDTH
Definition util.hh:382
@ RCC_RING_BUFFER_SIZE
Definition util.hh:311
@ RCC_FPS_DENOMINATOR
Definition util.hh:356
@ RCC_UDP_RCV_BUF_SIZE
Definition util.hh:295
@ RCC_DYN_PAYLOAD_TYPE
Definition util.hh:322
@ RCC_UDP_SND_BUF_SIZE
Definition util.hh:303
@ RCC_SSRC
Definition util.hh:362
@ RCC_CLOCK_RATE
Definition util.hh:325
RTP_FLAGS
These flags are given to uvgrtp::media_stream::push_frame() and they can be OR'ed together.
Definition util.hh:137
@ RTP_H26X_DO_NOT_AGGR
Definition util.hh:157
@ RTP_NO_FLAGS
Use this if you have no RTP flags.
Definition util.hh:138
@ RTP_COPY
Definition util.hh:147
@ RTP_NO_H26X_SCL
Definition util.hh:154