| 1 |
export type SDPBlob = string; |
| 2 |
export type SDPLine = string; |
| 3 |
export type SDPSection = string; |
| 4 |
|
| 5 |
export type SDPDirection = 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive'; |
| 6 |
|
| 7 |
export interface SDPIceCandidate { |
| 8 |
foundation: string; |
| 9 |
component: 'rtp' | 'rtcp' | number; |
| 10 |
protocol: 'tcp' | 'udp'; |
| 11 |
priority: number; |
| 12 |
ip: string; |
| 13 |
address: string; |
| 14 |
port: number; |
| 15 |
type: 'host' | 'prflx' | 'srflx' | 'relay'; |
| 16 |
relatedAddress?: string; |
| 17 |
relatedPort?: number; |
| 18 |
tcpType?: string; |
| 19 |
ufrag?: string; |
| 20 |
usernameFragment?: string; |
| 21 |
} |
| 22 |
|
| 23 |
export interface SDPIceParameters { |
| 24 |
iceLite?: boolean; |
| 25 |
usernameFragment: string; |
| 26 |
password: string; |
| 27 |
} |
| 28 |
|
| 29 |
export interface SDPCodecParameters { |
| 30 |
payloadType: number; |
| 31 |
preferredPayloadType?: number; |
| 32 |
name: string; |
| 33 |
clockRate: number; |
| 34 |
channels: number; |
| 35 |
numChannels?: number; |
| 36 |
maxptime?: number; |
| 37 |
} |
| 38 |
|
| 39 |
export interface SDPCodecAdditionalParameters { |
| 40 |
[key: string]: string; |
| 41 |
} |
| 42 |
|
| 43 |
export interface SDPHeaderExtension { |
| 44 |
id: number; |
| 45 |
direction?: SDPDirection; |
| 46 |
uri: string; |
| 47 |
atrributes: string | undefined; |
| 48 |
} |
| 49 |
|
| 50 |
export interface SDPFeedbackParameter { |
| 51 |
type: string; |
| 52 |
parameter: string; |
| 53 |
} |
| 54 |
|
| 55 |
export interface SDPFingerprint { |
| 56 |
algorithm: string; |
| 57 |
value: string; |
| 58 |
} |
| 59 |
|
| 60 |
export interface SDPDtlsParameters { |
| 61 |
role: string; |
| 62 |
fingerprints: SDPFingerprint[]; |
| 63 |
} |
| 64 |
|
| 65 |
export interface SDPMediaSource { |
| 66 |
ssrc: number; |
| 67 |
attribute?: string; |
| 68 |
value?: string; |
| 69 |
} |
| 70 |
|
| 71 |
export interface SDPMediaSourceGroup { |
| 72 |
semantics: string; |
| 73 |
ssrcs: number[]; |
| 74 |
} |
| 75 |
|
| 76 |
export interface SDPMediaStreamId { |
| 77 |
stream: string; |
| 78 |
track: string; |
| 79 |
} |
| 80 |
|
| 81 |
export interface SDPCodec extends SDPCodecParameters { |
| 82 |
payloadType: number; |
| 83 |
preferredPayloadType?: number; |
| 84 |
parameters?: SDPCodecAdditionalParameters; |
| 85 |
rtcpFeedback?: SDPFeedbackParameter[]; |
| 86 |
} |
| 87 |
|
| 88 |
export interface SDPGroup { |
| 89 |
semantics: string; |
| 90 |
mids: string[]; |
| 91 |
} |
| 92 |
|
| 93 |
export interface SDPMLine { |
| 94 |
kind: string; |
| 95 |
port?: number; |
| 96 |
protocol: string; |
| 97 |
fmt?: string; |
| 98 |
} |
| 99 |
|
| 100 |
export interface SDPOLine { |
| 101 |
username: string; |
| 102 |
sessionId: string; |
| 103 |
sessionVersion: number; |
| 104 |
netType: string; |
| 105 |
addressType: string; |
| 106 |
address: string; |
| 107 |
} |
| 108 |
|
| 109 |
export interface SDPRtcpParameters { |
| 110 |
cname?: string; |
| 111 |
ssrc?: number; |
| 112 |
reducedSize?: boolean; |
| 113 |
compound?: boolean; |
| 114 |
mux?: boolean; |
| 115 |
} |
| 116 |
|
| 117 |
export interface SDPEncodingParameters { |
| 118 |
ssrc: number; |
| 119 |
codecPayloadType?: number; |
| 120 |
rtx?: { |
| 121 |
ssrc: number; |
| 122 |
}; |
| 123 |
fec?: { |
| 124 |
ssrc: number; |
| 125 |
mechanism: string; |
| 126 |
}; |
| 127 |
} |
| 128 |
|
| 129 |
export interface SDPRtpCapabilities { |
| 130 |
codecs: SDPCodec[]; |
| 131 |
headerExtensions: SDPHeaderExtension[]; |
| 132 |
fecMechanisms: string[]; |
| 133 |
rtcp?: SDPRtcpParameters[]; |
| 134 |
} |
| 135 |
|
| 136 |
export interface SDPSctpDescription { |
| 137 |
port: number; |
| 138 |
protocol: string; |
| 139 |
maxMessageSize?: number; |
| 140 |
} |
| 141 |
|
| 142 |
export const localCname: string; |
| 143 |
|
| 144 |
export function generateIdentifier(): string; |
| 145 |
|
| 146 |
export function splitLines(blob: SDPBlob): SDPLine[]; |
| 147 |
export function splitSections(blob: SDPBlob): SDPSection[]; |
| 148 |
|
| 149 |
export function getDescription(blob: SDPBlob): SDPSection; |
| 150 |
export function getMediaSections(blob: SDPBlob): SDPSection[]; |
| 151 |
|
| 152 |
export function matchPrefix(blob: SDPBlob, prefix: string): SDPLine[]; |
| 153 |
|
| 154 |
export function parseCandidate(line: SDPLine): SDPIceCandidate; |
| 155 |
export function writeCandidate(candidate: SDPIceCandidate): SDPLine; |
| 156 |
|
| 157 |
export function parseIceOptions(line: SDPLine): string[]; |
| 158 |
|
| 159 |
export function parseRtpMap(line: SDPLine): SDPCodecParameters; |
| 160 |
export function writeRtpMap(codec: SDPCodecParameters): SDPLine; |
| 161 |
|
| 162 |
export function parseExtmap(line: SDPLine): SDPHeaderExtension; |
| 163 |
export function writeExtmap(headerExtension: SDPHeaderExtension): SDPLine; |
| 164 |
|
| 165 |
export function parseFmtp(line: SDPLine): SDPCodecAdditionalParameters; |
| 166 |
export function writeFmtp(codec: SDPCodec): SDPLine; |
| 167 |
|
| 168 |
export function parseRtcpFb(line: SDPLine): SDPFeedbackParameter; |
| 169 |
export function writeRtcpFb(codec: SDPCodec): SDPLine[]; |
| 170 |
|
| 171 |
export function parseSsrcMedia(line: SDPLine): SDPMediaSource; |
| 172 |
export function parseSsrcGroup(line: SDPLine): SDPMediaSourceGroup; |
| 173 |
|
| 174 |
export function getMid(mediaSection: SDPSection): string; |
| 175 |
|
| 176 |
export function parseFingerprint(line: SDPLine): SDPFingerprint; |
| 177 |
|
| 178 |
export function getDtlsParameters( |
| 179 |
mediaSection: SDPSection, |
| 180 |
session: SDPSection |
| 181 |
): SDPDtlsParameters; |
| 182 |
export function writeDtlsParameters(params: SDPDtlsParameters, setupType: string): SDPLine; |
| 183 |
|
| 184 |
export function getIceParameters( |
| 185 |
mediaSection: SDPSection, |
| 186 |
session: SDPSection |
| 187 |
): SDPIceParameters; |
| 188 |
export function writeIceParameters(params: SDPIceParameters): SDPLine; |
| 189 |
|
| 190 |
export function parseRtpParameters(mediaSection: SDPSection): SDPRtpCapabilities; |
| 191 |
export function writeRtpDescription(kind: string, caps: SDPRtpCapabilities): SDPSection; |
| 192 |
|
| 193 |
export function parseRtpEncodingParameters(mediaSection: SDPSection): SDPEncodingParameters[]; |
| 194 |
|
| 195 |
export function parseRtcpParameters(mediaSection: SDPSection): SDPRtcpParameters; |
| 196 |
export function writeRtcpParameters(params: SDPRtcpParameters): SDPLine; |
| 197 |
|
| 198 |
export function parseMsid(mediaSection: SDPSection): SDPMediaStreamId; |
| 199 |
|
| 200 |
export function parseSctpDescription(mediaSection: SDPSection): SDPSctpDescription; |
| 201 |
export function writeSctpDescription( |
| 202 |
mediaSection: SDPMLine, |
| 203 |
desc: SDPSctpDescription |
| 204 |
): SDPSection; |
| 205 |
|
| 206 |
export function generateSessionId(): string; |
| 207 |
export function writeSessionBoilerplate( |
| 208 |
sessId?: string, |
| 209 |
sessVer?: number, |
| 210 |
sessUser?: string |
| 211 |
): SDPBlob; |
| 212 |
|
| 213 |
export function getDirection(mediaSection: SDPSection, sessionpart: SDPSection): SDPDirection; |
| 214 |
export function getKind(mediaSection: SDPSection): string; |
| 215 |
export function isRejected(mediaSection: SDPSection): boolean; |
| 216 |
|
| 217 |
export function parseMLine(mediaSection: SDPSection): SDPMLine; |
| 218 |
export function parseOLine(mediaSection: SDPSection): SDPOLine; |
| 219 |
|
| 220 |
export function isValidSDP(blob: SDPBlob): boolean; |