Skip to content

Commit

Permalink
ref(TPC) Pass bare objects to methods that take SDP instead of passin…
Browse files Browse the repository at this point in the history
…g an instance of RTCSessionDescription.

The constructor for RTCSessionDescription has been deprecated - https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription/RTCSessionDescription.
  • Loading branch information
jallamsetty1 committed Nov 25, 2024
1 parent 76c66eb commit 60e680e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
24 changes: 12 additions & 12 deletions modules/RTC/TPCUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ export class TPCUtils {
mLine.ssrcs = reorderedSsrcs;
});

return new RTCSessionDescription({
return {
type: description.type,
sdp: transform.write(parsedSdp)
});
};
}

/**
Expand Down Expand Up @@ -626,10 +626,10 @@ export class TPCUtils {
}
});

return new RTCSessionDescription({
return {
type: desc.type,
sdp: transform.write(sdp)
});
};
}

/**
Expand Down Expand Up @@ -703,10 +703,10 @@ export class TPCUtils {
}
}

return new RTCSessionDescription({
return {
type: description.type,
sdp: transform.write(parsedSdp)
});
};
}

/**
Expand Down Expand Up @@ -776,10 +776,10 @@ export class TPCUtils {
fmtpOpus.config = mungedConfig.trim();
}

return new RTCSessionDescription({
return {
type: description.type,
sdp: transform.write(parsedSdp)
});
};
}

/**
Expand Down Expand Up @@ -842,10 +842,10 @@ export class TPCUtils {
}
}

return new RTCSessionDescription({
return {
type: description.type,
sdp: transform.write(parsedSdp)
});
};
}

/**
Expand Down Expand Up @@ -892,9 +892,9 @@ export class TPCUtils {
}
});

return new RTCSessionDescription({
return {
type: description.type,
sdp: transform.write(parsedSdp)
});
};
}
}
12 changes: 6 additions & 6 deletions modules/RTC/TraceablePeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,10 +1233,10 @@ TraceablePeerConnection.prototype._injectSsrcGroupForUnifiedSimulcast = function
}
}

return new RTCSessionDescription({
return {
type: desc.type,
sdp: transform.write(sdp)
});
};
};

/* eslint-disable-next-line vars-on-top */
Expand Down Expand Up @@ -1797,10 +1797,10 @@ TraceablePeerConnection.prototype._adjustRemoteMediaDirection = function(remoteD
});
});

return new RTCSessionDescription({
return {
type: remoteDescription.type,
sdp: transformer.toRawSDP()
});
};
};

/**
Expand Down Expand Up @@ -2458,10 +2458,10 @@ TraceablePeerConnection.prototype._createOfferOrAnswer = function(isOffer, const

if (!this.options.disableRtx && browser.usesSdpMungingForSimulcast()) {
// eslint-disable-next-line no-param-reassign
resultSdp = new RTCSessionDescription({
resultSdp = {
type: resultSdp.type,
sdp: this.rtxModifier.modifyRtxSsrcs(resultSdp.sdp)
});
};

this.trace(
`create${logName}`
Expand Down
4 changes: 2 additions & 2 deletions modules/sdp/LocalSdpMunger.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ export default class LocalSdpMunger {
this._transformMediaIdentifiers(videoMLine, ssrcMap);
}

return new RTCSessionDescription({
return {
type: sessionDesc.type,
sdp: transformer.toRawSDP()
});
};
}
}
4 changes: 2 additions & 2 deletions modules/sdp/SdpSimulcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ export default class SdpSimulcast {
}
}

return new RTCSessionDescription({
return {
type: description.type,
sdp: transform.write(session)
});
};
}
}
8 changes: 4 additions & 4 deletions modules/xmpp/JingleSessionPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,10 @@ export default class JingleSessionPC extends JingleSession {
return Promise.reject(error);
}

const remoteDescription = new RTCSessionDescription({
const remoteDescription = {
type: 'offer',
sdp: remoteSdp
});
};

const oldLocalSDP = this.peerconnection.localDescription.sdp;

Expand Down Expand Up @@ -2062,10 +2062,10 @@ export default class JingleSessionPC extends JingleSession {

const newRemoteSdp = this._processNewJingleOfferIq(jingleAnswer);
const oldLocalSdp = new SDP(this.peerconnection.localDescription.sdp);
const remoteDescription = new RTCSessionDescription({
const remoteDescription = {
type: 'answer',
sdp: newRemoteSdp.raw
});
};

this.peerconnection.setRemoteDescription(remoteDescription)
.then(() => {
Expand Down

0 comments on commit 60e680e

Please sign in to comment.