|
|
@@ -30,6 +30,9 @@ import { SIM_LAYER_RIDS, TPCUtils } from './TPCUtils';
|
|
30
|
30
|
const logger = getLogger(__filename);
|
|
31
|
31
|
const DEGRADATION_PREFERENCE_CAMERA = 'maintain-framerate';
|
|
32
|
32
|
const DEGRADATION_PREFERENCE_DESKTOP = 'maintain-resolution';
|
|
|
33
|
+const DD_HEADER_EXT_URI
|
|
|
34
|
+ = 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension';
|
|
|
35
|
+const DD_HEADER_EXT_ID = 11;
|
|
33
|
36
|
|
|
34
|
37
|
/* eslint-disable max-params */
|
|
35
|
38
|
|
|
|
@@ -336,10 +339,10 @@ export default function TraceablePeerConnection(
|
|
336
|
339
|
|
|
337
|
340
|
/**
|
|
338
|
341
|
* Flag indicating bridge support for AV1 codec. On the bridge connection, it is supported only when support for
|
|
339
|
|
- * AV1 Dependency Descriptor header extensions is offered by Jicofo. H.264 simulcast is also possible when these
|
|
|
342
|
+ * Dependency Descriptor header extensions is offered by Jicofo. H.264 simulcast is also possible when these
|
|
340
|
343
|
* header extensions are negotiated.
|
|
341
|
344
|
*/
|
|
342
|
|
- this._supportsAv1HeaderExts = false;
|
|
|
345
|
+ this._supportsDDHeaderExt = false;
|
|
343
|
346
|
|
|
344
|
347
|
/**
|
|
345
|
348
|
* Holds the RTCRtpTransceiver mids that the local tracks are attached to, mapped per their
|
|
|
@@ -584,7 +587,7 @@ TraceablePeerConnection.prototype._getReceiversByEndpointIds = function(endpoint
|
|
584
|
587
|
*/
|
|
585
|
588
|
TraceablePeerConnection.prototype.isSpatialScalabilityOn = function() {
|
|
586
|
589
|
const h264SimulcastEnabled = this.tpcUtils.codecSettings[CodecMimeType.H264].scalabilityModeEnabled
|
|
587
|
|
- && this._supportsAv1HeaderExts;
|
|
|
590
|
+ && this._supportsDDHeaderExt;
|
|
588
|
591
|
|
|
589
|
592
|
return !this.options.disableSimulcast
|
|
590
|
593
|
&& (this.codecSettings.codecList[0] !== CodecMimeType.H264 || h264SimulcastEnabled);
|
|
|
@@ -1744,7 +1747,6 @@ TraceablePeerConnection.prototype._updateAv1DdHeaders = function(description) {
|
|
1744
|
1747
|
|
|
1745
|
1748
|
const parsedSdp = transform.parse(description.sdp);
|
|
1746
|
1749
|
const mLines = parsedSdp.media.filter(m => m.type === MediaType.VIDEO);
|
|
1747
|
|
- const extUri = 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension';
|
|
1748
|
1750
|
|
|
1749
|
1751
|
if (!mLines.length) {
|
|
1750
|
1752
|
return description;
|
|
|
@@ -1761,17 +1763,17 @@ TraceablePeerConnection.prototype._updateAv1DdHeaders = function(description) {
|
|
1761
|
1763
|
codec = codec.toLowerCase();
|
|
1762
|
1764
|
|
|
1763
|
1765
|
if (isSender && mLine.ext?.length) {
|
|
1764
|
|
- const headerIndex = mLine.ext.findIndex(ext => ext.uri === extUri);
|
|
|
1766
|
+ const headerIndex = mLine.ext.findIndex(ext => ext.uri === DD_HEADER_EXT_URI);
|
|
1765
|
1767
|
const shouldNegotiateHeaderExts = codec === CodecMimeType.AV1 || codec === CodecMimeType.H264;
|
|
1766
|
1768
|
|
|
1767
|
|
- if (!this._supportsAv1HeaderExts && headerIndex >= 0) {
|
|
1768
|
|
- this._supportsAv1HeaderExts = true;
|
|
|
1769
|
+ if (!this._supportsDDHeaderExt && headerIndex >= 0) {
|
|
|
1770
|
+ this._supportsDDHeaderExt = true;
|
|
1769
|
1771
|
}
|
|
1770
|
1772
|
|
|
1771
|
|
- if (this._supportsAv1HeaderExts && shouldNegotiateHeaderExts && headerIndex < 0) {
|
|
|
1773
|
+ if (this._supportsDDHeaderExt && shouldNegotiateHeaderExts && headerIndex < 0) {
|
|
1772
|
1774
|
mLine.ext.push({
|
|
1773
|
|
- value: 11,
|
|
1774
|
|
- uri: extUri
|
|
|
1775
|
+ value: DD_HEADER_EXT_ID,
|
|
|
1776
|
+ uri: DD_HEADER_EXT_URI
|
|
1775
|
1777
|
});
|
|
1776
|
1778
|
} else if (!shouldNegotiateHeaderExts && headerIndex >= 0) {
|
|
1777
|
1779
|
mLine.ext.splice(headerIndex, 1);
|