Skip to content

Commit

Permalink
fix(quality) Do not set b:AS line in SDP for SVC codecs when codec se…
Browse files Browse the repository at this point in the history
…lection API is used.

This was needed in older versions since the browser didn't apply maxBitrates from RTCRtpEncoderParameters on the encoder. In the newer versions this seems to be no longer the case. Also, when the codec selection API is used, we no longer renegotiate locally so if we switched codec from AV1->VP9-VP9, the AV1 bitrate setting in the SDP will still be effective resulting in a lower send resolution because of b/w limitation.
  • Loading branch information
jallamsetty1 committed Sep 6, 2024
1 parent 776819a commit 9c4db25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/RTC/TraceablePeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,12 @@ TraceablePeerConnection.prototype._setMaxBitrates = function(description, isLoca
const localTrack = this.getLocalVideoTracks()
.find(track => this._localTrackTransceiverMids.get(track.rtcId) === mLine.mid.toString());

if ((isDoingVp9KSvc || this.tpcUtils._isRunningInFullSvcMode(currentCodec)) && localTrack) {
if (localTrack
&& (isDoingVp9KSvc

// Setting bitrates in the SDP for SVC codecs is no longer needed in the newer versions where
// maxBitrates from the RTCRtpEncodingParameters directly affect the target bitrate for the encoder.
|| (this.tpcUtils._isRunningInFullSvcMode(currentCodec) && !this.usesCodecSelectionAPI()))) {
let maxBitrate;

if (localTrack.getVideoType() === VideoType.DESKTOP) {
Expand Down

0 comments on commit 9c4db25

Please sign in to comment.