-
Notifications
You must be signed in to change notification settings - Fork 317
/
Include.h
2238 lines (1959 loc) · 104 KB
/
Include.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Main public include file
*/
#ifndef __KINESIS_VIDEO_WEBRTC_CLIENT_INCLUDE__
#define __KINESIS_VIDEO_WEBRTC_CLIENT_INCLUDE__
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
////////////////////////////////////////////////////
// Public headers
////////////////////////////////////////////////////
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
#include <com/amazonaws/kinesis/video/client/Include.h>
#include <com/amazonaws/kinesis/video/common/Include.h>
#include <com/amazonaws/kinesis/video/webrtcclient/NullableDefs.h>
#include <com/amazonaws/kinesis/video/webrtcclient/Stats.h>
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
/* TODO: Potentially move these call to PIC instead. Moving to PIC in the future would not cause any backward compatibility issues */
#define PROFILE_CALL(f, msg) \
do { \
startTimeInMacro = GETTIME(); \
f; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), (GETTIME() - startTimeInMacro) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
} while (FALSE)
#define PROFILE_CALL_WITH_T_OBJ(f, t, msg) \
do { \
startTimeInMacro = GETTIME(); \
f; \
t = (GETTIME() - startTimeInMacro) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), (t)); \
} while (FALSE)
#define PROFILE_WITH_START_TIME(t, msg) \
do { \
DLOGP("[%s] Time taken: %" PRIu64 " ms", msg, (GETTIME() - (t)) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
} while (FALSE)
#define PROFILE_CALL_WITH_START_END_T_OBJ(f, s, e, d, msg) \
do { \
s = GETTIME() / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
f; \
e = GETTIME() / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
d = ((e) - (s)); \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), (d)); \
} while (FALSE)
#define PROFILE_WITH_START_END_TIME_OBJ(t1, t2, d, msg) \
do { \
t1 = (t1 / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
t2 = (GETTIME() / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
d = ((t2) - (t1)); \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), (d)); \
} while (FALSE)
#define PROFILE_WITH_START_TIME_OBJ(t1, t2, msg) \
do { \
t2 = (GETTIME() - (t1)) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), t2); \
} while (FALSE)
/*! \addtogroup StatusCodes
* WEBRTC related status codes. Each value is an positive integer formed by adding
* a base integer inticating the category to an index. Users may run scripts/parse_status.py
* to print a list of all status codes and their hex value.
* @{
*/
#define STATUS_WEBRTC_BASE 0x55000000
/////////////////////////////////////////////////////
/// Session description init related status codes
/////////////////////////////////////////////////////
/*! \addtogroup SessionDescriptionInitStatusCodes
* WEBRTC Session Description initialization related codes. Values are derived
* from STATUS_WEBRTC_BASE (0x55000000)
* @{
*/
#define STATUS_SESSION_DESCRIPTION_INIT_NOT_OBJECT STATUS_WEBRTC_BASE + 0x00000001
#define STATUS_SESSION_DESCRIPTION_INIT_MISSING_SDP_OR_TYPE_MEMBER STATUS_WEBRTC_BASE + 0x00000002
#define STATUS_SESSION_DESCRIPTION_INIT_INVALID_TYPE STATUS_WEBRTC_BASE + 0x00000003
#define STATUS_SESSION_DESCRIPTION_INIT_MISSING_SDP STATUS_WEBRTC_BASE + 0x00000004
#define STATUS_SESSION_DESCRIPTION_INIT_MISSING_TYPE STATUS_WEBRTC_BASE + 0x00000005
#define STATUS_SESSION_DESCRIPTION_INIT_MAX_SDP_LEN_EXCEEDED STATUS_WEBRTC_BASE + 0x00000006
#define STATUS_SESSION_DESCRIPTION_INVALID_SESSION_DESCRIPTION STATUS_WEBRTC_BASE + 0x00000007
#define STATUS_SESSION_DESCRIPTION_MISSING_ICE_VALUES STATUS_WEBRTC_BASE + 0x00000008
#define STATUS_SESSION_DESCRIPTION_MISSING_CERTIFICATE_FINGERPRINT STATUS_WEBRTC_BASE + 0x00000009
#define STATUS_SESSION_DESCRIPTION_MAX_MEDIA_COUNT STATUS_WEBRTC_BASE + 0x0000000A
/*!@} */
/////////////////////////////////////////////////////
/// SDP related status codes
/////////////////////////////////////////////////////
/*! \addtogroup SDPStatusCodes
* WEBRTC SDP packet related codes. Values are derived from STATUS_SDP_BASE
* (0x56000000)
* @{
*/
#define STATUS_SDP_BASE STATUS_WEBRTC_BASE + 0x01000000
#define STATUS_SDP_MISSING_ITEMS STATUS_SDP_BASE + 0x00000001
#define STATUS_SDP_ATTRIBUTES_ERROR STATUS_SDP_BASE + 0x00000002
#define STATUS_SDP_BANDWIDTH_ERROR STATUS_SDP_BASE + 0x00000003
#define STATUS_SDP_CONNECTION_INFORMATION_ERROR STATUS_SDP_BASE + 0x00000004
#define STATUS_SDP_EMAIL_ADDRESS_ERROR STATUS_SDP_BASE + 0x00000005
#define STATUS_SDP_ENCYRPTION_KEY_ERROR STATUS_SDP_BASE + 0x00000006
#define STATUS_SDP_INFORMATION_ERROR STATUS_SDP_BASE + 0x00000007
#define STATUS_SDP_MEDIA_NAME_ERROR STATUS_SDP_BASE + 0x00000008
#define STATUS_SDP_ORIGIN_ERROR STATUS_SDP_BASE + 0x00000009
#define STATUS_SDP_PHONE_NUMBER_ERROR STATUS_SDP_BASE + 0x0000000A
#define STATUS_SDP_TIME_DECRYPTION_ERROR STATUS_SDP_BASE + 0x0000000B
#define STATUS_SDP_TIMEZONE_ERROR STATUS_SDP_BASE + 0x0000000C
#define STATUS_SDP_URI_ERROR STATUS_SDP_BASE + 0x0000000D
#define STATUS_SDP_VERSION_ERROR STATUS_SDP_BASE + 0x0000000E
#define STATUS_SDP_ATTRIBUTE_MAX_EXCEEDED STATUS_SDP_BASE + 0x0000000F
/*!@} */
/////////////////////////////////////////////////////
/// STUN related status codes
/////////////////////////////////////////////////////
/*! \addtogroup STUNStatusCodes
* WEBRTC STUN related codes. Values are derived from STATUS_STUN_BASE (0x57000000)
* @{
*/
#define STATUS_STUN_BASE STATUS_SDP_BASE + 0x01000000
#define STATUS_STUN_MESSAGE_INTEGRITY_NOT_LAST STATUS_STUN_BASE + 0x00000001
#define STATUS_STUN_MESSAGE_INTEGRITY_SIZE_ALIGNMENT STATUS_STUN_BASE + 0x00000002
#define STATUS_STUN_FINGERPRINT_NOT_LAST STATUS_STUN_BASE + 0x00000003
#define STATUS_STUN_MAGIC_COOKIE_MISMATCH STATUS_STUN_BASE + 0x00000004
#define STATUS_STUN_INVALID_ADDRESS_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000005
#define STATUS_STUN_INVALID_USERNAME_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000006
#define STATUS_STUN_INVALID_MESSAGE_INTEGRITY_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000007
#define STATUS_STUN_INVALID_FINGERPRINT_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000008
#define STATUS_STUN_MULTIPLE_MESSAGE_INTEGRITY_ATTRIBUTES STATUS_STUN_BASE + 0x00000009
#define STATUS_STUN_MULTIPLE_FINGERPRINT_ATTRIBUTES STATUS_STUN_BASE + 0x0000000A
#define STATUS_STUN_ATTRIBUTES_AFTER_FINGERPRINT_MESSAGE_INTEGRITY STATUS_STUN_BASE + 0x0000000B
#define STATUS_STUN_MESSAGE_INTEGRITY_AFTER_FINGERPRINT STATUS_STUN_BASE + 0x0000000C
#define STATUS_STUN_MAX_ATTRIBUTE_COUNT STATUS_STUN_BASE + 0x0000000D
#define STATUS_STUN_MESSAGE_INTEGRITY_MISMATCH STATUS_STUN_BASE + 0x0000000E
#define STATUS_STUN_FINGERPRINT_MISMATCH STATUS_STUN_BASE + 0x0000000F
#define STATUS_STUN_INVALID_PRIORITY_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000010
#define STATUS_STUN_INVALID_USE_CANDIDATE_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000011
#define STATUS_STUN_INVALID_LIFETIME_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000012
#define STATUS_STUN_INVALID_REQUESTED_TRANSPORT_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000013
#define STATUS_STUN_INVALID_REALM_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000014
#define STATUS_STUN_INVALID_NONCE_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000015
#define STATUS_STUN_INVALID_ERROR_CODE_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000016
#define STATUS_STUN_INVALID_ICE_CONTROL_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000017
#define STATUS_STUN_INVALID_CHANNEL_NUMBER_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000018
#define STATUS_STUN_INVALID_CHANGE_REQUEST_ATTRIBUTE_LENGTH STATUS_STUN_BASE + 0x00000019
/*!@} */
/////////////////////////////////////////////////////
/// Networking related status codes
/////////////////////////////////////////////////////
/*! \addtogroup NetworkingStatusCodes
* WEBRTC Networking related codes. Values are derived from STATUS_NETWORKING_BASE (0x58000000)
* @{
*/
#define STATUS_NETWORKING_BASE STATUS_STUN_BASE + 0x01000000
#define STATUS_GET_LOCAL_IP_ADDRESSES_FAILED STATUS_NETWORKING_BASE + 0x00000016
#define STATUS_CREATE_UDP_SOCKET_FAILED STATUS_NETWORKING_BASE + 0x00000017
#define STATUS_BINDING_SOCKET_FAILED STATUS_NETWORKING_BASE + 0x00000018
#define STATUS_GET_PORT_NUMBER_FAILED STATUS_NETWORKING_BASE + 0x00000019
#define STATUS_SEND_DATA_FAILED STATUS_NETWORKING_BASE + 0x0000001a
#define STATUS_RESOLVE_HOSTNAME_FAILED STATUS_NETWORKING_BASE + 0x0000001b
#define STATUS_HOSTNAME_NOT_FOUND STATUS_NETWORKING_BASE + 0x0000001c
#define STATUS_SOCKET_CONNECT_FAILED STATUS_NETWORKING_BASE + 0x0000001d
#define STATUS_CREATE_SSL_FAILED STATUS_NETWORKING_BASE + 0x0000001e
#define STATUS_SSL_CONNECTION_FAILED STATUS_NETWORKING_BASE + 0x0000001f
#define STATUS_SECURE_SOCKET_READ_FAILED STATUS_NETWORKING_BASE + 0x00000020
#define STATUS_SOCKET_CONNECTION_NOT_READY_TO_SEND STATUS_NETWORKING_BASE + 0x00000021
#define STATUS_SOCKET_CONNECTION_CLOSED_ALREADY STATUS_NETWORKING_BASE + 0x00000022
#define STATUS_SOCKET_SET_SEND_BUFFER_SIZE_FAILED STATUS_NETWORKING_BASE + 0x00000023
#define STATUS_GET_SOCKET_FLAG_FAILED STATUS_NETWORKING_BASE + 0x00000024
#define STATUS_SET_SOCKET_FLAG_FAILED STATUS_NETWORKING_BASE + 0x00000025
#define STATUS_CLOSE_SOCKET_FAILED STATUS_NETWORKING_BASE + 0x00000026
#define STATUS_CREATE_SOCKET_PAIR_FAILED STATUS_NETWORKING_BASE + 0x00000027
#define STATUS_SOCKET_WRITE_FAILED STATUS_NETWORKING_BASE + 0X00000028
#define STATUS_INVALID_ADDRESS_LENGTH STATUS_NETWORKING_BASE + 0X00000029
/*!@} */
/////////////////////////////////////////////////////
/// DTLS related status codes
/////////////////////////////////////////////////////
/*! \addtogroup DTLSStatusCodes
* WEBRTC DTLS related codes. Values are derived from STATUS_DTLS_BASE (0x59000000)
* @{
*/
#define STATUS_DTLS_BASE STATUS_NETWORKING_BASE + 0x01000000
#define STATUS_CERTIFICATE_GENERATION_FAILED STATUS_DTLS_BASE + 0x00000001
#define STATUS_SSL_CTX_CREATION_FAILED STATUS_DTLS_BASE + 0x00000002
#define STATUS_SSL_REMOTE_CERTIFICATE_VERIFICATION_FAILED STATUS_DTLS_BASE + 0x00000003
#define STATUS_SSL_PACKET_BEFORE_DTLS_READY STATUS_DTLS_BASE + 0x00000004
#define STATUS_SSL_UNKNOWN_SRTP_PROFILE STATUS_DTLS_BASE + 0x00000005
#define STATUS_SSL_INVALID_CERTIFICATE_BITS STATUS_DTLS_BASE + 0x00000006
#define STATUS_DTLS_SESSION_ALREADY_FREED STATUS_DTLS_BASE + 0x00000007
/*!@} */
/////////////////////////////////////////////////////
/// ICE/TURN related status codes
/////////////////////////////////////////////////////
/*! \addtogroup ICEStatusCodes
* WEBRTC ICE related codes. Values are derived from STATUS_ICE_BASE (0x5a000000)
* @{
*/
#define STATUS_ICE_BASE STATUS_DTLS_BASE + 0x01000000
#define STATUS_ICE_AGENT_NO_SELECTED_CANDIDATE_AVAILABLE STATUS_ICE_BASE + 0x00000001
#define STATUS_ICE_CANDIDATE_STRING_MISSING_PORT STATUS_ICE_BASE + 0x00000002
#define STATUS_ICE_CANDIDATE_STRING_MISSING_IP STATUS_ICE_BASE + 0x00000003
#define STATUS_ICE_CANDIDATE_STRING_INVALID_IP STATUS_ICE_BASE + 0x00000004
#define STATUS_ICE_CANDIDATE_STRING_IS_TCP STATUS_ICE_BASE + 0x00000005
#define STATUS_ICE_FAILED_TO_COMPUTE_MD5_FOR_LONG_TERM_CREDENTIAL STATUS_ICE_BASE + 0x00000006
#define STATUS_ICE_URL_INVALID_PREFIX STATUS_ICE_BASE + 0x00000007
#define STATUS_ICE_URL_TURN_MISSING_USERNAME STATUS_ICE_BASE + 0x00000008
#define STATUS_ICE_URL_TURN_MISSING_CREDENTIAL STATUS_ICE_BASE + 0x00000009
#define STATUS_ICE_AGENT_STATE_CHANGE_FAILED STATUS_ICE_BASE + 0x0000000a
#define STATUS_ICE_NO_LOCAL_CANDIDATE_AVAILABLE_AFTER_GATHERING_TIMEOUT STATUS_ICE_BASE + 0x0000000b
#define STATUS_ICE_AGENT_TERMINATED_ALREADY STATUS_ICE_BASE + 0x0000000c
#define STATUS_ICE_NO_CONNECTED_CANDIDATE_PAIR STATUS_ICE_BASE + 0x0000000d
#define STATUS_ICE_CANDIDATE_PAIR_LIST_EMPTY STATUS_ICE_BASE + 0x0000000e
#define STATUS_ICE_NOMINATED_CANDIDATE_NOT_CONNECTED STATUS_ICE_BASE + 0x00000010
#define STATUS_ICE_CANDIDATE_INIT_MALFORMED STATUS_ICE_BASE + 0x00000011
#define STATUS_ICE_CANDIDATE_MISSING_CANDIDATE STATUS_ICE_BASE + 0x00000012
#define STATUS_ICE_FAILED_TO_NOMINATE_CANDIDATE_PAIR STATUS_ICE_BASE + 0x00000013
#define STATUS_ICE_MAX_REMOTE_CANDIDATE_COUNT_EXCEEDED STATUS_ICE_BASE + 0x00000014
#define STATUS_ICE_INVALID_STATE STATUS_ICE_BASE + 0x0000001c
#define STATUS_ICE_NO_LOCAL_HOST_CANDIDATE_AVAILABLE STATUS_ICE_BASE + 0x0000001d
#define STATUS_ICE_NO_NOMINATED_VALID_CANDIDATE_PAIR_AVAILABLE STATUS_ICE_BASE + 0x0000001e
#define STATUS_TURN_CONNECTION_NO_HOST_INTERFACE_FOUND STATUS_ICE_BASE + 0x0000001f
#define STATUS_TURN_CONNECTION_STATE_TRANSITION_TIMEOUT STATUS_ICE_BASE + 0x00000020
#define STATUS_TURN_CONNECTION_FAILED_TO_CREATE_PERMISSION STATUS_ICE_BASE + 0x00000021
#define STATUS_TURN_CONNECTION_FAILED_TO_BIND_CHANNEL STATUS_ICE_BASE + 0x00000022
#define STATUS_TURN_NEW_DATA_CHANNEL_MSG_HEADER_BEFORE_PREVIOUS_MSG_FINISH STATUS_ICE_BASE + 0x00000023
#define STATUS_TURN_MISSING_CHANNEL_DATA_HEADER STATUS_ICE_BASE + 0x00000024
#define STATUS_ICE_FAILED_TO_RECOVER_FROM_DISCONNECTION STATUS_ICE_BASE + 0x00000025
#define STATUS_ICE_NO_AVAILABLE_ICE_CANDIDATE_PAIR STATUS_ICE_BASE + 0x00000026
#define STATUS_TURN_CONNECTION_PEER_NOT_USABLE STATUS_ICE_BASE + 0x00000027
#define STATUS_ICE_SERVER_INDEX_INVALID STATUS_ICE_BASE + 0x00000028
#define STATUS_ICE_CANDIDATE_STRING_MISSING_TYPE STATUS_ICE_BASE + 0x00000029
#define STATUS_TURN_CONNECTION_ALLOCATION_FAILED STATUS_ICE_BASE + 0x0000002a
#define STATUS_TURN_INVALID_STATE STATUS_ICE_BASE + 0x0000002b
#define STATUS_TURN_CONNECTION_GET_CREDENTIALS_FAILED STATUS_ICE_BASE + 0x0000002c
/*!@} */
/////////////////////////////////////////////////////
/// SRTP related status codes
/////////////////////////////////////////////////////
/*! \addtogroup SRTPStatusCodes
* WEBRTC SRTP related codes. Values are derived from STATUS_SRTP_BASE (0x5b000000)
* @{
*/
#define STATUS_SRTP_BASE STATUS_ICE_BASE + 0x01000000
#define STATUS_SRTP_DECRYPT_FAILED STATUS_SRTP_BASE + 0x00000001
#define STATUS_SRTP_ENCRYPT_FAILED STATUS_SRTP_BASE + 0x00000002
#define STATUS_SRTP_TRANSMIT_SESSION_CREATION_FAILED STATUS_SRTP_BASE + 0x00000003
#define STATUS_SRTP_RECEIVE_SESSION_CREATION_FAILED STATUS_SRTP_BASE + 0x00000004
#define STATUS_SRTP_INIT_FAILED STATUS_SRTP_BASE + 0x00000005
#define STATUS_SRTP_NOT_READY_YET STATUS_SRTP_BASE + 0x00000006
/*!@} */
/////////////////////////////////////////////////////
/// RTP related status codes
/////////////////////////////////////////////////////
/*! \addtogroup RTPStatusCodes
* WEBRTC RTP related codes. Values are derived from STATUS_RTP_BASE (0x5c000000)
* @{
*/
#define STATUS_RTP_BASE STATUS_SRTP_BASE + 0x01000000
#define STATUS_RTP_INPUT_PACKET_TOO_SMALL STATUS_RTP_BASE + 0x00000001
#define STATUS_RTP_INPUT_MTU_TOO_SMALL STATUS_RTP_BASE + 0x00000002
#define STATUS_RTP_INVALID_NALU STATUS_RTP_BASE + 0x00000003
#define STATUS_RTP_INVALID_EXTENSION_LEN STATUS_RTP_BASE + 0x00000004
/*!@} */
/////////////////////////////////////////////////////
/// Signaling related status codes
/////////////////////////////////////////////////////
/*! \addtogroup SignalingStatusCodes
* WEBRTC Signaling related codes. Values are derived from STATUS_SIGNALING_BASE (0x5d000000)
* @{
*/
#define STATUS_SIGNALING_BASE STATUS_RTP_BASE + 0x01000000
#define STATUS_SIGNALING_INVALID_READY_STATE STATUS_SIGNALING_BASE + 0x00000001
#define STATUS_SIGNALING_GET_TOKEN_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000002
#define STATUS_SIGNALING_DESCRIBE_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000003
#define STATUS_SIGNALING_CREATE_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000004
#define STATUS_SIGNALING_GET_ENDPOINT_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000005
#define STATUS_SIGNALING_GET_ICE_CONFIG_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000006
#define STATUS_SIGNALING_READY_CALLBACK_FAILED STATUS_SIGNALING_BASE + 0x00000007
#define STATUS_SIGNALING_CONNECT_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000008
#define STATUS_SIGNALING_CONNECTED_CALLBACK_FAILED STATUS_SIGNALING_BASE + 0x00000009
#define STATUS_SIGNALING_INVALID_CHANNEL_INFO_VERSION STATUS_SIGNALING_BASE + 0x0000000A
#define STATUS_SIGNALING_INVALID_SIGNALING_CALLBACKS_VERSION STATUS_SIGNALING_BASE + 0x0000000B
#define STATUS_SIGNALING_INVALID_CHANNEL_NAME_LENGTH STATUS_SIGNALING_BASE + 0x0000000C
#define STATUS_SIGNALING_INVALID_CHANNEL_ARN_LENGTH STATUS_SIGNALING_BASE + 0x0000000D
#define STATUS_SIGNALING_INVALID_REGION_LENGTH STATUS_SIGNALING_BASE + 0x0000000E
#define STATUS_SIGNALING_INVALID_CPL_LENGTH STATUS_SIGNALING_BASE + 0x0000000F
#define STATUS_SIGNALING_INVALID_CERTIFICATE_PATH_LENGTH STATUS_SIGNALING_BASE + 0x00000010
#define STATUS_SIGNALING_INVALID_AGENT_POSTFIX_LENGTH STATUS_SIGNALING_BASE + 0x00000011
#define STATUS_SIGNALING_INVALID_AGENT_LENGTH STATUS_SIGNALING_BASE + 0x00000012
#define STATUS_SIGNALING_INVALID_KMS_KEY_LENGTH STATUS_SIGNALING_BASE + 0x00000013
#define STATUS_SIGNALING_LWS_CREATE_CONTEXT_FAILED STATUS_SIGNALING_BASE + 0x00000014
#define STATUS_SIGNALING_LWS_CLIENT_CONNECT_FAILED STATUS_SIGNALING_BASE + 0x00000015
#define STATUS_SIGNALING_CHANNEL_BEING_DELETED STATUS_SIGNALING_BASE + 0x00000016
#define STATUS_SIGNALING_INVALID_CLIENT_INFO_VERSION STATUS_SIGNALING_BASE + 0x00000017
#define STATUS_SIGNALING_INVALID_CLIENT_INFO_CLIENT_LENGTH STATUS_SIGNALING_BASE + 0x00000018
#define STATUS_SIGNALING_MAX_ICE_CONFIG_COUNT STATUS_SIGNALING_BASE + 0x00000019
#define STATUS_SIGNALING_MAX_ICE_URI_COUNT STATUS_SIGNALING_BASE + 0x0000001A
#define STATUS_SIGNALING_MAX_ICE_URI_LEN STATUS_SIGNALING_BASE + 0x0000001B
#define STATUS_SIGNALING_NO_CONFIG_SPECIFIED STATUS_SIGNALING_BASE + 0x0000001C
#define STATUS_SIGNALING_INVALID_ICE_CONFIG_INFO_VERSION STATUS_SIGNALING_BASE + 0x0000001D
#define STATUS_SIGNALING_NO_CONFIG_URI_SPECIFIED STATUS_SIGNALING_BASE + 0x0000001E
#define STATUS_SIGNALING_NO_ARN_RETURNED_ON_CREATE STATUS_SIGNALING_BASE + 0x0000001F
#define STATUS_SIGNALING_MISSING_ENDPOINTS_IN_GET_ENDPOINT STATUS_SIGNALING_BASE + 0x00000020
#define STATUS_SIGNALING_INVALID_MESSAGE_TYPE STATUS_SIGNALING_BASE + 0x00000021
#define STATUS_SIGNALING_INVALID_SIGNALING_MESSAGE_VERSION STATUS_SIGNALING_BASE + 0x00000022
#define STATUS_SIGNALING_NO_PEER_CLIENT_ID_IN_MESSAGE STATUS_SIGNALING_BASE + 0x00000023
#define STATUS_SIGNALING_MESSAGE_DELIVERY_FAILED STATUS_SIGNALING_BASE + 0x00000024
#define STATUS_SIGNALING_MAX_MESSAGE_LEN_AFTER_ENCODING STATUS_SIGNALING_BASE + 0x00000025
#define STATUS_SIGNALING_RECEIVE_BINARY_DATA_NOT_SUPPORTED STATUS_SIGNALING_BASE + 0x00000026
#define STATUS_SIGNALING_RECEIVE_EMPTY_DATA_NOT_SUPPORTED STATUS_SIGNALING_BASE + 0x00000027
#define STATUS_SIGNALING_RECEIVED_MESSAGE_LARGER_THAN_MAX_DATA_LEN STATUS_SIGNALING_BASE + 0x00000028
#define STATUS_SIGNALING_INVALID_PAYLOAD_LEN_IN_MESSAGE STATUS_SIGNALING_BASE + 0x00000029
#define STATUS_SIGNALING_NO_PAYLOAD_IN_MESSAGE STATUS_SIGNALING_BASE + 0x0000002A
#define STATUS_SIGNALING_DUPLICATE_MESSAGE_BEING_SENT STATUS_SIGNALING_BASE + 0x0000002B
#define STATUS_SIGNALING_ICE_TTL_LESS_THAN_GRACE_PERIOD STATUS_SIGNALING_BASE + 0x0000002C
#define STATUS_SIGNALING_DISCONNECTED_CALLBACK_FAILED STATUS_SIGNALING_BASE + 0x0000002D
#define STATUS_SIGNALING_INVALID_MESSAGE_TTL_VALUE STATUS_SIGNALING_BASE + 0x0000002E
#define STATUS_SIGNALING_ICE_CONFIG_REFRESH_FAILED STATUS_SIGNALING_BASE + 0x0000002F
#define STATUS_SIGNALING_RECONNECT_FAILED STATUS_SIGNALING_BASE + 0x00000030
#define STATUS_SIGNALING_DELETE_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000031
#define STATUS_SIGNALING_INVALID_METRICS_VERSION STATUS_SIGNALING_BASE + 0x00000032
#define STATUS_SIGNALING_INVALID_CLIENT_INFO_CACHE_FILE_PATH_LEN STATUS_SIGNALING_BASE + 0x00000033
#define STATUS_SIGNALING_LWS_CALL_FAILED STATUS_SIGNALING_BASE + 0x00000034
#define STATUS_SIGNALING_INVALID_STREAM_ARN_LENGTH STATUS_SIGNALING_BASE + 0x00000035
#define STATUS_SIGNALING_MISMATCH_MEDIA_STORAGE_CONFIG STATUS_SIGNALING_BASE + 0x00000036
#define STATUS_SIGNALING_UPDATE_MEDIA_STORAGE_CONFIG STATUS_SIGNALING_BASE + 0x00000037
#define STATUS_SIGNALING_MEDIA_STORAGE_DISABLED STATUS_SIGNALING_BASE + 0x00000038
#define STATUS_SIGNALING_INVALID_CHANNEL_ARN STATUS_SIGNALING_BASE + 0x00000039
#define STATUS_SIGNALING_JOIN_SESSION_CALL_FAILED STATUS_SIGNALING_BASE + 0x0000004a
#define STATUS_SIGNALING_JOIN_SESSION_CONNECTED_FAILED STATUS_SIGNALING_BASE + 0x0000004b
#define STATUS_SIGNALING_DESCRIBE_MEDIA_CALL_FAILED STATUS_SIGNALING_BASE + 0x0000004c
/*!@} */
/////////////////////////////////////////////////////
/// Peer connection related status codes
/////////////////////////////////////////////////////
/*! \addtogroup PeerConnectionStatusCodes
* WEBRTC STUN related codes. Values are derived from STATUS_PEERCONNECTION_BASE
* (0x5e000000)
* @{
*/
#define STATUS_PEERCONNECTION_BASE STATUS_SIGNALING_BASE + 0x01000000
#define STATUS_PEERCONNECTION_CREATE_ANSWER_WITHOUT_REMOTE_DESCRIPTION STATUS_PEERCONNECTION_BASE + 0x00000001
#define STATUS_PEERCONNECTION_CODEC_INVALID STATUS_PEERCONNECTION_BASE + 0x00000002
#define STATUS_PEERCONNECTION_CODEC_MAX_EXCEEDED STATUS_PEERCONNECTION_BASE + 0x00000003
#define STATUS_PEERCONNECTION_EARLY_DNS_RESOLUTION_FAILED STATUS_PEERCONNECTION_BASE + 0x00000004
/*!@} */
/////////////////////////////////////////////////////
/// SCTP related status codes
/////////////////////////////////////////////////////
/*! \addtogroup SCTPStatusCodes
* WEBRTC SCTP related codes. Values are derived from STATUS_SCTP_BASE (0x5f000000)
* @{
*/
#define STATUS_SCTP_BASE STATUS_PEERCONNECTION_BASE + 0x01000000
#define STATUS_SCTP_SESSION_SETUP_FAILED STATUS_SCTP_BASE + 0x00000001
#define STATUS_SCTP_INVALID_DCEP_PACKET STATUS_SCTP_BASE + 0x00000002
/*!@} */
/////////////////////////////////////////////////////
/// RTCP related status codes
/////////////////////////////////////////////////////
/*! \addtogroup RTCPStatusCodes
* WEBRTC RTCP related codes. Values are derived from STATUS_RTCP_BASE (0x60000000)
* @{
*/
#define STATUS_RTCP_BASE STATUS_SCTP_BASE + 0x01000000
#define STATUS_RTCP_INPUT_PACKET_TOO_SMALL STATUS_RTCP_BASE + 0x00000001
#define STATUS_RTCP_INPUT_PACKET_INVALID_VERSION STATUS_RTCP_BASE + 0x00000002
#define STATUS_RTCP_INPUT_PACKET_LEN_MISMATCH STATUS_RTCP_BASE + 0x00000003
#define STATUS_RTCP_INPUT_NACK_LIST_INVALID STATUS_RTCP_BASE + 0x00000004
#define STATUS_RTCP_INPUT_SSRC_INVALID STATUS_RTCP_BASE + 0x00000005
#define STATUS_RTCP_INPUT_PARTIAL_PACKET STATUS_RTCP_BASE + 0x00000006
#define STATUS_RTCP_INPUT_REMB_TOO_SMALL STATUS_RTCP_BASE + 0x00000007
#define STATUS_RTCP_INPUT_REMB_INVALID STATUS_RTCP_BASE + 0x00000008
/*!@} */
/////////////////////////////////////////////////////
/// Rolling buffer related status codes
/////////////////////////////////////////////////////
/*! \addtogroup RollingBufferStatusCodes
* WEBRTC Rolling Buffer related codes. Values are derived from STATUS_ROLLING_BUFFER_BASE
* (0x61000000)
* @{
*/
#define STATUS_ROLLING_BUFFER_BASE STATUS_RTCP_BASE + 0x01000000
#define STATUS_ROLLING_BUFFER_NOT_IN_RANGE STATUS_ROLLING_BUFFER_BASE + 0x00000001
/*!@} */
/////////////////////////////////////////////////////
/// Lengths of different character arrays
/////////////////////////////////////////////////////
/*! \addtogroup NameLengths
* Lengths of some string members of different structures
* @{
*/
/**
* Maximum allowed channel name length
*/
#define MAX_CHANNEL_NAME_LEN 256
/**
* Maximum allowed signaling client ID length
*/
#define MAX_SIGNALING_CLIENT_ID_LEN 256
/**
* Maximum allowed ICE configuration user name length
* https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_AWSAcuitySignalingService_GetIceServerConfig.html#API_AWSAcuitySignalingService_GetIceServerConfig_RequestSyntax
*/
#define MAX_ICE_CONFIG_USER_NAME_LEN 256
/**
* Maximum allowed ICE configuration password length
* https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_AWSAcuitySignalingService_IceServer.html#KinesisVideo-Type-AWSAcuitySignalingService_IceServer-Password
*/
#define MAX_ICE_CONFIG_CREDENTIAL_LEN 256
/**
* Maximum allowed signaling URI length
*/
#define MAX_SIGNALING_ENDPOINT_URI_LEN 512
/**
* Maximum allowed ICE URI length
*/
#define MAX_ICE_CONFIG_URI_LEN 256
/**
* Maximum allowed correlation ID length
*/
#define MAX_CORRELATION_ID_LEN 256
/**
* Maximum allowed error string length
*/
#define MAX_ERROR_TYPE_STRING_LEN 256
/**
* Maximum allowed code string length
*/
#define MAX_STATUS_CODE_STRING_LEN 256
/**
* Maximum allowed message description length
*/
#define MAX_MESSAGE_DESCRIPTION_LEN 1024
/**
* Maximum length of SDP member in RtcSessionDescriptionInit
*/
#define MAX_SESSION_DESCRIPTION_INIT_SDP_LEN 25000
/**
* Maximum length of a MediaStream's ID
*/
#define MAX_MEDIA_STREAM_ID_LEN 255
/**
* Max certificates an RtcConfiguration can accept
*/
#define MAX_RTCCONFIGURATION_CERTIFICATES 3
/**
* Maximum length of a MediaStream's Track ID
*/
#define MAX_MEDIA_STREAM_TRACK_ID_LEN 255
/**
* Maximum length of candidate member of ICECandidateInit
*/
#define MAX_ICE_CANDIDATE_INIT_CANDIDATE_LEN 255
/**
* Maximum length of DataChannel name
*/
#define MAX_DATA_CHANNEL_NAME_LEN 255
/**
* Maximum length of DataChannel Protocol
*/
#define MAX_DATA_CHANNEL_PROTOCOL_LEN 255
/**
* Maximum length of signaling message
*/
#define MAX_SIGNALING_MESSAGE_LEN (10 * 1024)
/*!@} */
/////////////////////////////////////////////////////
/// Structure version macros
/////////////////////////////////////////////////////
/*! \addtogroup StructureVersions
* Lengths of some string members of different structures
* @{
*/
/**
* Version of RtcPeerConnection structure
*/
#define PEER_CONNECTION_CURRENT_VERSION 0
/**
* Version of ChannelInfo structure
*/
#define CHANNEL_INFO_CURRENT_VERSION 1
/**
* Version of SignalingClientInfo structure
*/
#define SIGNALING_CLIENT_INFO_CURRENT_VERSION 2
/**
* Version of SignalingClientCallbacks structure
*/
#define SIGNALING_CLIENT_CALLBACKS_CURRENT_VERSION 0
/**
* Version of signaling client
*/
#define SIGNALING_CLIENT_CURRENT_VERSION 1
/**
* Version of SignalingChannelDescription structure
*/
#define SIGNALING_CHANNEL_DESCRIPTION_CURRENT_VERSION 0
/**
* Version of IceConfigInfo structure
*/
#define SIGNALING_ICE_CONFIG_INFO_CURRENT_VERSION 0
/**
* Version of SignalingMessage structure
*/
#define SIGNALING_MESSAGE_CURRENT_VERSION 0
/**
* Version of RtcIceMetrics structure
*/
#define RTC_ICE_METRICS_CURRENT_VERSION 0
/**
* Version of RtcStreamMetrics structure
*/
#define RTC_STREAM_METRICS_CURRENT_VERSION 0
/**
* Version of SignalingClientMetrics structure
*/
#define SIGNALING_CLIENT_METRICS_CURRENT_VERSION 1
/**
* Version of PeerConnectionMetrics structure
*/
#define PEER_CONNECTION_METRICS_CURRENT_VERSION 0
/**
* Version of KvsIceAgentMetrics structure
*/
#define ICE_AGENT_METRICS_CURRENT_VERSION 0
/*!@} */
/////////////////////////////////////////////////////
/// Count related macros
/////////////////////////////////////////////////////
/*! \addtogroup Counts
* Counts of different structure members
* @{
*/
/**
* Maximum number of ICE config URI allowed
*/
#define MAX_ICE_CONFIG_URI_COUNT 4
/**
* Maximum number of ICE configs allowed
*/
#define MAX_ICE_CONFIG_COUNT 5
/**
* Max ice servers for a RtcPeerConnection.
* It is calculated as product of maximum number of ICE configurations and
* maximum number of server URIs plus single STUN (1)
*/
#define MAX_ICE_SERVERS_COUNT (MAX_ICE_CONFIG_COUNT * MAX_ICE_CONFIG_URI_COUNT + 1)
/*!@} */
/////////////////////////////////////////////////////
/// Timeouts related macros
/////////////////////////////////////////////////////
/*! \addtogroup Timeouts
* Timeouts for different activities in the stack
* @{
*/
/**
* Default signaling creation timeout
*/
#define SIGNALING_CREATE_TIMEOUT (10 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default connect sync API timeout
*/
#define SIGNALING_CONNECT_STATE_TIMEOUT (15 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default disconnect sync API timeout
*/
#define SIGNALING_DISCONNECT_STATE_TIMEOUT (15 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default refresh ICE server config API timeout
*/
#define SIGNALING_REFRESH_ICE_CONFIG_STATE_TIMEOUT (20 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default signaling connection establishment timeout
*/
#define SIGNALING_CONNECT_TIMEOUT (5 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default minimum number of threads in the threadpool for the SDK
*/
#define THREADPOOL_MIN_THREADS 3
/**
* Default maximum number of threads in the threadpool for the SDK
*/
#define THREADPOOL_MAX_THREADS 10
/**
* Env to set minimum number of threads in the threadpool for the KVS SDK
*/
#define WEBRTC_THREADPOOL_MIN_THREADS_ENV_VAR (PCHAR) "AWS_KVS_WEBRTC_THREADPOOL_MIN_THREADS"
/**
* Env to set maximum number of threads in the threadpool for the SDK
*/
#define WEBRTC_THREADPOOL_MAX_THREADS_ENV_VAR (PCHAR) "AWS_KVS_WEBRTC_THREADPOOL_MAX_THREADS"
#ifdef _WIN32
/**
* Default timeout for sending data
*/
#define SIGNALING_SEND_TIMEOUT (15 * HUNDREDS_OF_NANOS_IN_A_SECOND)
#else
/**
* Default timeout for sending data
*/
#define SIGNALING_SEND_TIMEOUT (5 * HUNDREDS_OF_NANOS_IN_A_SECOND)
#endif
/**
* Default timeout for deleting a channel
*/
#define SIGNALING_DELETE_TIMEOUT (5 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default signaling message alive time
*/
#define SIGNALING_DEFAULT_MESSAGE_TTL_VALUE (60 * HUNDREDS_OF_NANOS_IN_A_SECOND)
#define SIGNALING_JOIN_STORAGE_SESSION_WAIT_TIMEOUT (6 * HUNDREDS_OF_NANOS_IN_A_SECOND)
/**
* Default jitter buffer tolerated latency, frame will be dropped if it is out of window
*/
#define DEFAULT_JITTER_BUFFER_MAX_LATENCY (2000L * HUNDREDS_OF_NANOS_IN_A_MILLISECOND)
/*!@} */
/**
* Valid ASCII characters for signaling channel name
*/
#define SIGNALING_VALID_NAME_CHARS "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_.-"
/**
* Maximum sequence number in rtp packet/jitter buffer
*/
#define MAX_RTP_SEQUENCE_NUM ((UINT32) MAX_UINT16)
/**
* Maximum timestamp in rtp packet/jitter buffer
*/
#define MAX_RTP_TIMESTAMP ((UINT32) MAX_UINT32)
/**
* Parameterized string for KVS STUN Server
*/
#define KINESIS_VIDEO_STUN_URL_POSTFIX "amazonaws.com"
#define KINESIS_VIDEO_STUN_URL_POSTFIX_CN "amazonaws.com.cn"
#define KINESIS_VIDEO_STUN_URL "stun:stun.kinesisvideo.%s.%s:443"
#define KINESIS_VIDEO_STUN_URL_WITHOUT_PORT "stun.kinesisvideo.%s.%s"
/**
* Default signaling SSL port
*/
#define SIGNALING_DEFAULT_SSL_PORT DEFAULT_SSL_PORT_NUMBER
/**
* Default signaling non SSL port
*/
#define SIGNALING_DEFAULT_NON_SSL_PORT DEFAULT_NON_SSL_PORT_NUMBER
/* CHK_LOG_ERR_NV has been replaced with CHK_LOG_ERR. */
#define CHK_LOG_ERR_NV(condition) DLOGE("CHK_LOG_ERR_NV has been replaced with CHK_LOG_ERR");
/**
* Signaling states default retry count. This will evaluate to the last call being made 20 seconds in which will hit a timeout first.
*/
#define SIGNALING_STATES_DEFAULT_RETRY_COUNT 1
/**
* Signaling caching policy default TTL period
*/
#define SIGNALING_DEFAULT_API_CALL_CACHE_TTL (10 * HUNDREDS_OF_NANOS_IN_AN_HOUR)
/**
* Signaling caching policy TTL period sentinel value which will force the default period.
*/
#define SIGNALING_API_CALL_CACHE_TTL_SENTINEL_VALUE 0
/**
* Signaling caching policy TTL period sentinel value which will force the default period.
*/
#define CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS_SENTINEL_VALUE -1
/**
* @brief Definition of the signaling client handle
*/
typedef UINT64 SIGNALING_CLIENT_HANDLE;
typedef SIGNALING_CLIENT_HANDLE* PSIGNALING_CLIENT_HANDLE;
/**
* @brief This is a sentinel indicating an invalid handle value
*/
#ifndef INVALID_SIGNALING_CLIENT_HANDLE_VALUE
#define INVALID_SIGNALING_CLIENT_HANDLE_VALUE ((SIGNALING_CLIENT_HANDLE) INVALID_PIC_HANDLE_VALUE)
#endif
/**
* @brief Checks for the handle validity
*/
#ifndef IS_VALID_SIGNALING_CLIENT_HANDLE
#define IS_VALID_SIGNALING_CLIENT_HANDLE(h) ((h) != INVALID_SIGNALING_CLIENT_HANDLE_VALUE)
#endif
////////////////////////////////////////////////
/// Public Enums
////////////////////////////////////////////////
/*! \addtogroup PublicEnums
* @{
*/
/**
* @brief RTC_PEER_CONNECTION_STATE Stats of RTC peer connection
*
* Reference: https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum
*/
typedef enum {
RTC_PEER_CONNECTION_STATE_NONE = 0, //!< Starting state of peer connection
RTC_PEER_CONNECTION_STATE_NEW = 1, //!< This state is set when ICE Agent is waiting for remote credential
RTC_PEER_CONNECTION_STATE_CONNECTING = 2, //!< This state is set when ICE agent checks connection
RTC_PEER_CONNECTION_STATE_CONNECTED = 3, //!< This state is set when CIE Agent is ready
RTC_PEER_CONNECTION_STATE_DISCONNECTED = 4, //!< This state is set when ICE Agent is disconnected
RTC_PEER_CONNECTION_STATE_FAILED = 5, //!< This state is set when ICE Agent transitions to fail state
RTC_PEER_CONNECTION_STATE_CLOSED = 6, //!< This state leads to termination of streaming session
RTC_PEER_CONNECTION_TOTAL_STATE_COUNT = 7, //!< This state indicates maximum number of Peer connection states
} RTC_PEER_CONNECTION_STATE;
/**
* The enum specifies the type of SDP being exchanged
*/
typedef enum {
SDP_TYPE_OFFER = 1, //!< SessionDescription is type offer
SDP_TYPE_ANSWER = 2, //!< SessionDescription is type answer
} SDP_TYPE;
/**
* @brief The enum specifies the type of track in the stream
*/
typedef enum {
MEDIA_STREAM_TRACK_KIND_AUDIO = 1, //!< Audio track. Track information is set before add transceiver
MEDIA_STREAM_TRACK_KIND_VIDEO = 2, //!< Video track. Track information is set before add transceiver
} MEDIA_STREAM_TRACK_KIND;
/**
* @brief The enum specifies the codec types for audio and video tracks
*/
typedef enum {
RTC_CODEC_H264_PROFILE_42E01F_LEVEL_ASYMMETRY_ALLOWED_PACKETIZATION_MODE = 1, //!< H264 video codec
RTC_CODEC_OPUS = 2, //!< OPUS audio codec
RTC_CODEC_VP8 = 3, //!< VP8 video codec.
RTC_CODEC_MULAW = 4, //!< MULAW audio codec
RTC_CODEC_ALAW = 5, //!< ALAW audio codec
RTC_CODEC_UNKNOWN = 6,
RTC_CODEC_H265 = 7, //!< H265 video codec
// RTC_CODEC_MAX **MUST** be the last enum in the list **ALWAYS** and not assigned a value
RTC_CODEC_MAX //!< Placeholder for max number of supported codecs
} RTC_CODEC;
/**
* @brief ICE_TRANSPORT_POLICY restrict which ICE candidates are used in a session.
*
* Reference: https://www.w3.org/TR/webrtc/#dom-rtcicetransportpolicy
*/
typedef enum {
ICE_TRANSPORT_POLICY_RELAY = 1, //!< The ICE Agent uses only media relay candidates such as candidates
//!< passing through a TURN server
ICE_TRANSPORT_POLICY_ALL = 2, //!< The ICE Agent can use any type of candidate when this value is specified.
} ICE_TRANSPORT_POLICY;
/**
* @brief RTC_RTP_TRANSCEIVER_DIRECTION indicates direction of a transceiver
*
* Reference: https://www.w3.org/TR/webrtc/#dom-rtcrtptransceiverdirection
*/
typedef enum {
RTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV = 1, //!< This indicates that peer can send and receive data
RTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY = 2, //!< This indicates that the peer can only send information
RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY = 3, //!< This indicates that the peer can only receive information
RTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE = 4, //!< This indicates that the peer can not send or receive data
} RTC_RTP_TRANSCEIVER_DIRECTION;
/**
* @brief Defines channel status as reported by the service
*/
typedef enum {
SIGNALING_CHANNEL_STATUS_CREATING, //!< Signaling channel is being created
SIGNALING_CHANNEL_STATUS_ACTIVE, //!< Signaling channel is active
SIGNALING_CHANNEL_STATUS_UPDATING, //!< Signaling channel is being updated
SIGNALING_CHANNEL_STATUS_DELETING, //!< Signaling channel is being deleted
} SIGNALING_CHANNEL_STATUS;
/**
* @brief Defines different signaling messages
*/
typedef enum {
SIGNALING_MESSAGE_TYPE_OFFER, //!< This message type leads to checks in existence of peer id and payload in the message
SIGNALING_MESSAGE_TYPE_ANSWER, //!< This message type leads to checks in length/existence of payload in the message
SIGNALING_MESSAGE_TYPE_ICE_CANDIDATE, //!< This message type leads to checks in length/existence of payload in the message
SIGNALING_MESSAGE_TYPE_GO_AWAY, //!< This message moves signaling back to describe state
SIGNALING_MESSAGE_TYPE_RECONNECT_ICE_SERVER, //!< This message moves signaling state back to get ICE config
SIGNALING_MESSAGE_TYPE_STATUS_RESPONSE, //!< This message notifies the awaiting send after checking for failure in message delivery
SIGNALING_MESSAGE_TYPE_UNKNOWN, //!< This message type is set when the type of message received is unknown
} SIGNALING_MESSAGE_TYPE;
/**
* @brief Defines different states a signaling client traverses
*/
typedef enum {
SIGNALING_CLIENT_STATE_UNKNOWN, //!< Starting state of signaling client
SIGNALING_CLIENT_STATE_NEW, //!< This state indicates a new client state
SIGNALING_CLIENT_STATE_GET_CREDENTIALS, //!< This state involves getting a token using AWS credentials
SIGNALING_CLIENT_STATE_DESCRIBE, //!< This state is set to get the most current information about the channel
//!< Channel name or ARN needs to be provided t get the information
SIGNALING_CLIENT_STATE_CREATE, //!< This state is set to create the channel with the information supplied
//!< in the describe state
SIGNALING_CLIENT_STATE_GET_ENDPOINT, //!< This state is set to provide an endpoint for sending/receiving messages
SIGNALING_CLIENT_STATE_GET_ICE_CONFIG, //!< This state gets ICE related details such as server list, username,
//!< and passwords
SIGNALING_CLIENT_STATE_READY, //!< On setting this state, if continueOnReady flag is set, a transition is
//!< to the next state is made
SIGNALING_CLIENT_STATE_CONNECTING, //!< In this state, if already connected, nothing needs to be done. This can happen when
//!< we get to this state after ICE refresh
SIGNALING_CLIENT_STATE_CONNECTED, //!< On transitioning to this state, the timeout on the state machine is reset
SIGNALING_CLIENT_STATE_DISCONNECTED, //!< This state transition happens either from connect or connected state
SIGNALING_CLIENT_STATE_DELETE, //!< This state transition happens when the application calls signalingClientDeleteSync API.
SIGNALING_CLIENT_STATE_DELETED, //!< This state transition happens after the channel gets deleted as a result of a signalingClientDeleteSync API.
//!< This is a terminal state.
SIGNALING_CLIENT_STATE_DESCRIBE_MEDIA,
SIGNALING_CLIENT_STATE_JOIN_SESSION,
SIGNALING_CLIENT_STATE_JOIN_SESSION_WAITING,
SIGNALING_CLIENT_STATE_JOIN_SESSION_CONNECTED,
SIGNALING_CLIENT_STATE_MAX_VALUE, //!< This state indicates maximum number of signaling client states
} SIGNALING_CLIENT_STATE,
*PSIGNALING_CLIENT_STATE;
/**
* @brief Channel type as reported by the service
*/
typedef enum {
SIGNALING_CHANNEL_TYPE_UNKNOWN, //!< Channel type is unknown
SIGNALING_CHANNEL_TYPE_SINGLE_MASTER, //!< Channel type is master
} SIGNALING_CHANNEL_TYPE;
/**
* @brief Channel role type
*/
typedef enum {
SIGNALING_CHANNEL_ROLE_TYPE_UNKNOWN, //!< Channel role is unknown
SIGNALING_CHANNEL_ROLE_TYPE_MASTER, //!< Channel role is master
SIGNALING_CHANNEL_ROLE_TYPE_VIEWER, //!< Channel role is viewer
} SIGNALING_CHANNEL_ROLE_TYPE;
/**
* @brief Detected network environment
*/
typedef enum {
NAT_BEHAVIOR_NONE, //!< Dummy placeholder
NAT_BEHAVIOR_NOT_BEHIND_ANY_NAT, //!< Host is not behind any NAT
NAT_BEHAVIOR_NO_UDP_CONNECTIVITY, //!< No UDP connectvity
NAT_BEHAVIOR_ENDPOINT_INDEPENDENT, //!< Nat behavior is irregardless of change in external address
NAT_BEHAVIOR_ADDRESS_DEPENDENT, //!< Nat behavior changes changes when external address is changed, but remain same if only port is changed.
NAT_BEHAVIOR_PORT_DEPENDENT, //!< Nat behavior changes when external address or port is changed.
} NAT_BEHAVIOR;
/**
* @brief Type of caching implementation to use with the signaling client
*/
typedef enum {
SIGNALING_API_CALL_CACHE_TYPE_NONE, //!< No caching. The calls to the backend will be made for every API.
SIGNALING_API_CALL_CACHE_TYPE_DESCRIBE_GETENDPOINT, //!< Cache DeleteSignalingChannel and GetSignalingChannelEndpoint
//!< backend API calls.
//!< In this mode, the actual backend APIs will be
//!< called once and the
//!< information will be cached.
//!< This mode is the recommended mode for most of the
//!< use cases when the
//!< signaling channel is not being constantly
//!< created/deleted by other entities.
SIGNALING_API_CALL_CACHE_TYPE_FILE, //!< Cache DeleteSignalingChannel and GetSignalingChannelEndpoint
//!< backend API calls.
//!< In this mode, the actual backend APIs will be
//!< called once and the
//!< information will be cached into file
//!< which will allow the cache to persist next time the signaling client is created.
} SIGNALING_API_CALL_CACHE_TYPE;
/*!@} */
////////////////////////////////////////////////////
/// Extra callbacks definitions
////////////////////////////////////////////////////
/*! \addtogroup Callbacks
* @{
*/
/**
* @brief RtcOnFrame is fired everytime a frame is received from
* the remote peer. It is available via the RtpRec
*
* NOTE: RtcOnFrame is a KVS specific method
*/
typedef VOID (*RtcOnFrame)(UINT64, PFrame);
/**
* @brief RtcOnBandwidthEstimation is fired everytime a bandwidth estimation value
* is computed. This will be fired for receiver side estimation
*
* NOTE: RtcOnBandwidthEstimation is a KVS specific method
*
*/
typedef VOID (*RtcOnBandwidthEstimation)(UINT64, DOUBLE);