|
@@ -2575,12 +2575,20 @@ TraceablePeerConnection.prototype.setSenderVideoConstraints = function(frameHeig
|
2575
|
2575
|
return Promise.resolve();
|
2576
|
2576
|
}
|
2577
|
2577
|
|
2578
|
|
- // Updating video sender parameters as wrapped-up promise to have ability
|
2579
|
|
- // to chain promises sequentially later and avoid chrome problem with transaction id
|
2580
|
|
- // which is reset at the end of video sender setParameters method and can affect
|
2581
|
|
- // next on-fly update
|
|
2578
|
+ return this._updateVideoSenderParameters(this._updateVideoSenderEncodings(frameHeight, localVideoTrack));
|
|
2579
|
+};
|
|
2580
|
+
|
|
2581
|
+/**
|
|
2582
|
+ * Returns a wrapped-up promise so that the setParameters() call on the RTCRtpSender for video sources are chained.
|
|
2583
|
+ * This is needed on Chrome as it resets the transaction id after executing setParameters() and can affect the next on
|
|
2584
|
+ * the fly updates if they are not chained.
|
|
2585
|
+ * https://chromium.googlesource.com/external/webrtc/+/master/pc/rtp_sender.cc#340
|
|
2586
|
+ * @param {Promise} promise - The promise that needs to be chained.
|
|
2587
|
+ * @returns {Promise}
|
|
2588
|
+ */
|
|
2589
|
+TraceablePeerConnection.prototype._updateVideoSenderParameters = function(promise) {
|
2582
|
2590
|
const nextPromise = this._lastVideoSenderUpdatePromise
|
2583
|
|
- .finally(() => this._updateVideoSenderParameters(frameHeight, localVideoTrack));
|
|
2591
|
+ .finally(() => promise);
|
2584
|
2592
|
|
2585
|
2593
|
this._lastVideoSenderUpdatePromise = nextPromise;
|
2586
|
2594
|
|
|
@@ -2594,7 +2602,7 @@ TraceablePeerConnection.prototype.setSenderVideoConstraints = function(frameHeig
|
2594
|
2602
|
* @param {JitsiLocalTrack} - The local track for which the sender constraints have to be applied.
|
2595
|
2603
|
* @returns {Promise} promise that will be resolved when the operation is successful and rejected otherwise.
|
2596
|
2604
|
*/
|
2597
|
|
-TraceablePeerConnection.prototype._updateVideoSenderParameters = function(frameHeight, localVideoTrack) {
|
|
2605
|
+TraceablePeerConnection.prototype._updateVideoSenderEncodings = function(frameHeight, localVideoTrack) {
|
2598
|
2606
|
const videoSender = this.findSenderForTrack(localVideoTrack.getTrack());
|
2599
|
2607
|
|
2600
|
2608
|
if (!videoSender) {
|