Amazon Kinesis Webrtc C SDK
SessionDescription.h
Go to the documentation of this file.
1 /*******************************************
2 SessionDescription internal include file
3 *******************************************/
4 #ifndef __KINESIS_VIDEO_WEBRTC_CLIENT_PEERCONNECTION_SESSIONDESCRIPTION__
5 #define __KINESIS_VIDEO_WEBRTC_CLIENT_PEERCONNECTION_SESSIONDESCRIPTION__
6 
7 #pragma once
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #define SESSION_DESCRIPTION_INIT_LINE_ENDING "\\r\\n"
14 #define SESSION_DESCRIPTION_INIT_LINE_ENDING_WITHOUT_CR "\\n"
15 
16 #define SESSION_DESCRIPTION_INIT_TEMPLATE_HEAD "{\"type\": \"%s\", \"sdp\": \""
17 #define SESSION_DESCRIPTION_INIT_TEMPLATE_TAIL "\"}"
18 
19 #define SDP_OFFER_VALUE "offer"
20 #define SDP_ANSWER_VALUE "answer"
21 
22 #define MEDIA_SECTION_AUDIO_VALUE "audio"
23 #define MEDIA_SECTION_VIDEO_VALUE "video"
24 
25 #define SDP_TYPE_KEY "type"
26 #define SDP_KEY "sdp"
27 #define CANDIDATE_KEY "candidate"
28 #define SSRC_KEY "ssrc"
29 #define BUNDLE_KEY "BUNDLE"
30 #define MID_KEY "mid"
31 
32 #define H264_VALUE "H264/90000"
33 #define H265_VALUE "H265/90000"
34 #define OPUS_VALUE "opus/48000"
35 #define VP8_VALUE "VP8/90000"
36 #define MULAW_VALUE "PCMU/8000"
37 #define ALAW_VALUE "PCMA/8000"
38 #define RTX_VALUE "rtx/90000"
39 #define RTX_CODEC_VALUE "apt="
40 #define FMTP_VALUE "fmtp:"
41 #define RTPMAP_VALUE "rtpmap"
42 
43 #define MAX_PAYLOAD_TYPE_LENGTH (UINT64) 10
44 #define DEFAULT_PAYLOAD_MULAW (UINT64) 0
45 #define DEFAULT_PAYLOAD_ALAW (UINT64) 8
46 #define DEFAULT_PAYLOAD_OPUS (UINT64) 111
47 #define DEFAULT_PAYLOAD_VP8 (UINT64) 96
48 #define DEFAULT_PAYLOAD_H264 (UINT64) 125
49 #define DEFAULT_PAYLOAD_H265 (UINT64) 127
50 
51 #define DEFAULT_PAYLOAD_MULAW_STR (PCHAR) "0"
52 #define DEFAULT_PAYLOAD_ALAW_STR (PCHAR) "8"
53 
54 #define DEFAULT_H264_FMTP (PCHAR) "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f"
55 #define DEFAULT_H265_FMTP \
56  (PCHAR) "profile-space=0;profile-id=0;tier-flag=0;level-id=0;interop-constraints=000000000000;sprop-vps=QAEMAf//" \
57  "AIAAAAMAAAMAAAMAAAMAALUCQA==;sprop-sps=QgEBAIAAAAMAAAMAAAMAAAMAAKACgIAtH+W1kkbQzkkktySqSfKSyA==;sprop-pps=RAHBpVgeSA=="
58 #define DEFAULT_OPUS_FMTP (PCHAR) "minptime=10;useinbandfec=1"
59 #define H264_PROFILE_42E01F 0x42e01f
60 // profile-level-id:
61 // A base16 [7] (hexadecimal) representation of the following
62 // three bytes in the sequence parameter set NAL unit is specified
63 // in [1]: 1) profile_idc, 2) a byte herein referred to as
64 // profile-iop, composed of the values of constraint_set0_flag,
65 // constraint_set1_flag, constraint_set2_flag,
66 // constraint_set3_flag, constraint_set4_flag,
67 // constraint_set5_flag, and reserved_zero_2bits in bit-
68 // significance order, starting from the most-significant bit, and
69 // 3) level_id.
70 //
71 // Reference: https://tools.ietf.org/html/rfc6184#section-8.1
72 #define H264_FMTP_SUBPROFILE_MASK 0xFFFF00
73 #define H264_FMTP_PROFILE_LEVEL_MASK 0x0000FF
74 
75 #define DTLS_ROLE_ACTPASS (PCHAR) "actpass"
76 #define DTLS_ROLE_ACTIVE (PCHAR) "active"
77 
78 #define VIDEO_CLOCKRATE (UINT64) 90000
79 #define OPUS_CLOCKRATE (UINT64) 48000
80 #define PCM_CLOCKRATE (UINT64) 8000
81 
82 // https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01
83 #define TWCC_SDP_ATTR "transport-cc"
84 #define TWCC_EXT_URL (PCHAR) "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
85 
86 #define CODEC_RTPMAP_PAYLOAD_TYPES_HASH_TABLE_BUCKET_LENGTH 2
87 
88 STATUS setPayloadTypesFromOffer(PHashTable, PHashTable, PSessionDescription);
89 STATUS setPayloadTypesForOffer(PHashTable);
90 
91 STATUS setTransceiverPayloadTypes(PHashTable, PHashTable, PDoubleList);
94 STATUS setReceiversSsrc(PSessionDescription, PDoubleList);
96 UINT64 getH264FmtpScore(PCHAR);
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 #endif /* __KINESIS_VIDEO_WEBRTC_CLIENT_PEERCONNECTION_SESSIONDESCRIPTION__ */
PCHAR fmtpForPayloadType(UINT64, PSessionDescription)
Definition: SessionDescription.c:329
STATUS setPayloadTypesFromOffer(PHashTable, PHashTable, PSessionDescription)
Definition: SessionDescription.c:152
STATUS findTransceiversByRemoteDescription(PKvsPeerConnection, PSessionDescription, PHashTable, PHashTable)
Definition: SessionDescription.c:1192
STATUS setTransceiverPayloadTypes(PHashTable, PHashTable, PDoubleList)
Definition: SessionDescription.c:289
STATUS setPayloadTypesForOffer(PHashTable)
Definition: SessionDescription.c:131
STATUS setReceiversSsrc(PSessionDescription, PDoubleList)
Definition: SessionDescription.c:1403
UINT64 getH264FmtpScore(PCHAR)
Definition: SessionDescription.c:390
STATUS populateSessionDescription(PKvsPeerConnection, PSessionDescription, PSessionDescription)
Definition: SessionDescription.c:1069
Definition: PeerConnection.h:72
Definition: Sdp.h:185