Amazon Kinesis Webrtc C SDK
 
Loading...
Searching...
No Matches
SessionDescription.h
Go to the documentation of this file.
1/*******************************************
2SessionDescription 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
10extern "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 (PCHAR) "level-id=93;profile-id=1"
56#define DEFAULT_OPUS_FMTP (PCHAR) "minptime=10;useinbandfec=1"
57#define H264_PROFILE_42E01F 0x42e01f
58// profile-level-id:
59// A base16 [7] (hexadecimal) representation of the following
60// three bytes in the sequence parameter set NAL unit is specified
61// in [1]: 1) profile_idc, 2) a byte herein referred to as
62// profile-iop, composed of the values of constraint_set0_flag,
63// constraint_set1_flag, constraint_set2_flag,
64// constraint_set3_flag, constraint_set4_flag,
65// constraint_set5_flag, and reserved_zero_2bits in bit-
66// significance order, starting from the most-significant bit, and
67// 3) level_id.
68//
69// Reference: https://tools.ietf.org/html/rfc6184#section-8.1
70#define H264_FMTP_SUBPROFILE_MASK 0xFFFF00
71#define H264_FMTP_PROFILE_LEVEL_MASK 0x0000FF
72
73#define DTLS_ROLE_ACTPASS (PCHAR) "actpass"
74#define DTLS_ROLE_ACTIVE (PCHAR) "active"
75
76#define VIDEO_CLOCKRATE (UINT64) 90000
77#define OPUS_CLOCKRATE (UINT64) 48000
78#define PCM_CLOCKRATE (UINT64) 8000
79
80// https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01
81#define TWCC_SDP_ATTR "transport-cc"
82#define TWCC_EXT_URL (PCHAR) "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
83
84#define CODEC_RTPMAP_PAYLOAD_TYPES_HASH_TABLE_BUCKET_LENGTH 2
85
86STATUS setPayloadTypesFromOffer(PHashTable, PHashTable, PSessionDescription);
87STATUS setPayloadTypesForOffer(PHashTable);
88
89STATUS setTransceiverPayloadTypes(PHashTable, PHashTable, PDoubleList);
92STATUS setReceiversSsrc(PSessionDescription, PDoubleList);
94UINT64 getH264FmtpScore(PCHAR);
95
96#ifdef __cplusplus
97}
98#endif
99#endif /* __KINESIS_VIDEO_WEBRTC_CLIENT_PEERCONNECTION_SESSIONDESCRIPTION__ */
PCHAR fmtpForPayloadType(UINT64, PSessionDescription)
Definition SessionDescription.c:353
STATUS setPayloadTypesFromOffer(PHashTable, PHashTable, PSessionDescription)
Definition SessionDescription.c:162
STATUS findTransceiversByRemoteDescription(PKvsPeerConnection, PSessionDescription, PHashTable, PHashTable)
Definition SessionDescription.c:1212
STATUS setTransceiverPayloadTypes(PHashTable, PHashTable, PDoubleList)
Definition SessionDescription.c:299
STATUS setPayloadTypesForOffer(PHashTable)
Definition SessionDescription.c:141
STATUS setReceiversSsrc(PSessionDescription, PDoubleList)
Definition SessionDescription.c:1423
UINT64 getH264FmtpScore(PCHAR)
Definition SessionDescription.c:414
STATUS populateSessionDescription(PKvsPeerConnection, PSessionDescription, PSessionDescription)
Definition SessionDescription.c:1089
Definition PeerConnection.h:72
Definition Sdp.h:185