|
@@ -18,9 +18,6 @@ import browser from '../browser';
|
18
|
18
|
import SDPUtil from '../sdp/SDPUtil';
|
19
|
19
|
|
20
|
20
|
const logger = getLogger('modules/RTC/TPCUtils');
|
21
|
|
-const DD_HEADER_EXT_URI
|
22
|
|
- = 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension';
|
23
|
|
-const DD_HEADER_EXT_ID = 11;
|
24
|
21
|
const VIDEO_CODECS = [ CodecMimeType.AV1, CodecMimeType.H264, CodecMimeType.VP8, CodecMimeType.VP9 ];
|
25
|
22
|
|
26
|
23
|
/**
|
|
@@ -921,53 +918,4 @@ export class TPCUtils {
|
921
|
918
|
|
922
|
919
|
return mungedSdp;
|
923
|
920
|
}
|
924
|
|
-
|
925
|
|
- /**
|
926
|
|
- * Checks if the AV1 Dependency descriptors are negotiated on the bridge peerconnection and removes them from the
|
927
|
|
- * SDP when codec selected is VP8 or VP9.
|
928
|
|
- *
|
929
|
|
- * @param {transform.SessionDescription} parsedSdp that needs to be munged.
|
930
|
|
- * @returns {string} the munged SDP.
|
931
|
|
- */
|
932
|
|
- updateAv1DdHeaders(parsedSdp) {
|
933
|
|
- if (!browser.supportsDDExtHeaders()) {
|
934
|
|
- return parsedSdp;
|
935
|
|
- }
|
936
|
|
- const mungedSdp = parsedSdp;
|
937
|
|
- const mLines = mungedSdp.media.filter(m => m.type === MediaType.VIDEO);
|
938
|
|
-
|
939
|
|
- mLines.forEach((mLine, idx) => {
|
940
|
|
- const senderMids = Array.from(this.pc.localTrackTransceiverMids.values());
|
941
|
|
- const isSender = senderMids.length
|
942
|
|
- ? senderMids.find(mid => mLine.mid.toString() === mid.toString())
|
943
|
|
- : idx === 0;
|
944
|
|
- const payload = mLine.payloads.split(' ')[0];
|
945
|
|
- let { codec } = mLine.rtp.find(rtp => rtp.payload === Number(payload));
|
946
|
|
-
|
947
|
|
- codec = codec.toLowerCase();
|
948
|
|
-
|
949
|
|
- if (isSender && mLine.ext?.length) {
|
950
|
|
- const headerIndex = mLine.ext.findIndex(ext => ext.uri === DD_HEADER_EXT_URI);
|
951
|
|
- const shouldNegotiateHeaderExts = codec === CodecMimeType.AV1 || codec === CodecMimeType.H264
|
952
|
|
-
|
953
|
|
- // Removing DD ext header lines from the sdp breaks the scalability for FF with version 136+.
|
954
|
|
- || (codec === CodecMimeType.VP8 && browser.isFirefox());
|
955
|
|
-
|
956
|
|
- if (!this.supportsDDHeaderExt && headerIndex >= 0) {
|
957
|
|
- this.supportsDDHeaderExt = true;
|
958
|
|
- }
|
959
|
|
-
|
960
|
|
- if (this.supportsDDHeaderExt && shouldNegotiateHeaderExts && headerIndex < 0) {
|
961
|
|
- mLine.ext.push({
|
962
|
|
- value: DD_HEADER_EXT_ID,
|
963
|
|
- uri: DD_HEADER_EXT_URI
|
964
|
|
- });
|
965
|
|
- } else if (!shouldNegotiateHeaderExts && headerIndex >= 0) {
|
966
|
|
- mLine.ext.splice(headerIndex, 1);
|
967
|
|
- }
|
968
|
|
- }
|
969
|
|
- });
|
970
|
|
-
|
971
|
|
- return mungedSdp;
|
972
|
|
- }
|
973
|
921
|
}
|