|
|
@@ -1521,6 +1521,21 @@ TraceablePeerConnection.prototype._mungeCodecOrder = function(description) {
|
|
1521
|
1521
|
if (this.codecPreference.mimeType === CodecMimeType.H264 && browser.isReactNative() && this.isP2P) {
|
|
1522
|
1522
|
SDPUtil.stripCodec(mLine, this.codecPreference.mimeType, true /* high profile */);
|
|
1523
|
1523
|
}
|
|
|
1524
|
+
|
|
|
1525
|
+ // Set the max bitrate here on the SDP so that the configured max. bitrate is effective
|
|
|
1526
|
+ // as soon as the browser switches to VP9.
|
|
|
1527
|
+ if (this.codecPreference.mimeType === CodecMimeType.VP9) {
|
|
|
1528
|
+ const bitrates = Object.values(this.videoBitrates.VP9 || this.videoBitrates);
|
|
|
1529
|
+ const localVideoTrack = this.getLocalVideoTrack();
|
|
|
1530
|
+ const isSharingScreen = localVideoTrack && localVideoTrack.videoType === VideoType.DESKTOP;
|
|
|
1531
|
+
|
|
|
1532
|
+ // Use only the HD bitrate for now as there is no API available yet for configuring
|
|
|
1533
|
+ // the bitrates on the individual SVC layers.
|
|
|
1534
|
+ mLine.bandwidth = [ {
|
|
|
1535
|
+ type: 'AS',
|
|
|
1536
|
+ limit: isSharingScreen ? HD_BITRATE : Math.floor(bitrates[2] / 1000)
|
|
|
1537
|
+ } ];
|
|
|
1538
|
+ }
|
|
1524
|
1539
|
} else {
|
|
1525
|
1540
|
SDPUtil.stripCodec(mLine, this.codecPreference.mimeType);
|
|
1526
|
1541
|
}
|
|
|
@@ -2119,9 +2134,9 @@ TraceablePeerConnection.prototype.setSenderVideoDegradationPreference = function
|
|
2119
|
2134
|
* @returns {Promise<void>}
|
|
2120
|
2135
|
*/
|
|
2121
|
2136
|
TraceablePeerConnection.prototype.setMaxBitRate = function() {
|
|
2122
|
|
- if (!this.peerconnection.getSenders) {
|
|
2123
|
|
- logger.debug('Browser doesn\'t support RTCRtpSender');
|
|
2124
|
|
-
|
|
|
2137
|
+ // For VP9, max bitrate is configured by setting b=AS value in SDP. Browsers do
|
|
|
2138
|
+ // not yet support setting max bitrates for individual VP9 SVC layers.
|
|
|
2139
|
+ if (this.getConfiguredVideoCodec() === CodecMimeType.VP9 || !window.RTCRtpSender) {
|
|
2125
|
2140
|
return Promise.resolve();
|
|
2126
|
2141
|
}
|
|
2127
|
2142
|
const localVideoTrack = this.getLocalVideoTrack();
|