mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: always apply heavy munging
parent
da527b4816
commit
31002b2ffc
|
@ -387,7 +387,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
// Modify sdp if forced codec is defined
|
// Modify sdp if forced codec is defined
|
||||||
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
||||||
kurentoOptions.sdpOffer = sdpMunging.forceCodec(kurentoOptions.sdpOffer, participant, true, false,
|
kurentoOptions.sdpOffer = sdpMunging.forceCodec(kurentoOptions.sdpOffer, participant, true, false,
|
||||||
isTranscodingAllowed, forcedVideoCodec, false);
|
isTranscodingAllowed, forcedVideoCodec);
|
||||||
CDR.log(new WebrtcDebugEvent(participant, streamId, WebrtcDebugEventIssuer.client,
|
CDR.log(new WebrtcDebugEvent(participant, streamId, WebrtcDebugEventIssuer.client,
|
||||||
WebrtcDebugEventOperation.publish, WebrtcDebugEventType.sdpOfferMunged, kurentoOptions.sdpOffer));
|
WebrtcDebugEventOperation.publish, WebrtcDebugEventType.sdpOfferMunged, kurentoOptions.sdpOffer));
|
||||||
}
|
}
|
||||||
|
@ -575,7 +575,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
// Modify server's SDPOffer if forced codec is defined
|
// Modify server's SDPOffer if forced codec is defined
|
||||||
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
||||||
sdpOffer = sdpMunging.forceCodec(sdpOffer, participant, false, false, isTranscodingAllowed,
|
sdpOffer = sdpMunging.forceCodec(sdpOffer, participant, false, false, isTranscodingAllowed,
|
||||||
forcedVideoCodec, true);
|
forcedVideoCodec);
|
||||||
|
|
||||||
CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.server,
|
CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.server,
|
||||||
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpOfferMunged, sdpOffer));
|
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpOfferMunged, sdpOffer));
|
||||||
|
@ -648,7 +648,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
// Modify sdp if forced codec is defined
|
// Modify sdp if forced codec is defined
|
||||||
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
||||||
sdpOffer = sdpMunging.forceCodec(sdpString, participant, false, false, isTranscodingAllowed,
|
sdpOffer = sdpMunging.forceCodec(sdpString, participant, false, false, isTranscodingAllowed,
|
||||||
forcedVideoCodec, false);
|
forcedVideoCodec);
|
||||||
|
|
||||||
CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.client,
|
CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.client,
|
||||||
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpOfferMunged, sdpOffer));
|
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpOfferMunged, sdpOffer));
|
||||||
|
@ -1195,7 +1195,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
// Modify sdp if forced codec is defined
|
// Modify sdp if forced codec is defined
|
||||||
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
if (forcedVideoCodec != VideoCodec.NONE && !participant.isIpcam()) {
|
||||||
return sdpMunging.forceCodec(sdpOffer, participant, isPublisher, true, isTranscodingAllowed,
|
return sdpMunging.forceCodec(sdpOffer, participant, isPublisher, true, isTranscodingAllowed,
|
||||||
forcedVideoCodec, false);
|
forcedVideoCodec);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class SDPMunging {
|
||||||
* ordering of formats. Browsers (tested with Chrome 84) honor this change and
|
* ordering of formats. Browsers (tested with Chrome 84) honor this change and
|
||||||
* use the first codec provided in the answer, so this operation actually works.
|
* use the first codec provided in the answer, so this operation actually works.
|
||||||
*/
|
*/
|
||||||
public String setCodecPreference(VideoCodec codec, String sdp, boolean applyHeavyMunging) throws OpenViduException {
|
public String setCodecPreference(VideoCodec codec, String sdp) throws OpenViduException {
|
||||||
String codecStr = codec.name();
|
String codecStr = codec.name();
|
||||||
log.info("[setCodecPreference] codec: {}", codecStr);
|
log.info("[setCodecPreference] codec: {}", codecStr);
|
||||||
|
|
||||||
|
@ -156,9 +156,8 @@ public class SDPMunging {
|
||||||
lines[sl] = newLine.toString().trim();
|
lines[sl] = newLine.toString().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applyHeavyMunging) {
|
lines = cleanLinesWithRemovedCodecs(unusedCodecPts, lines);
|
||||||
lines = cleanLinesWithRemovedCodecs(unusedCodecPts, lines);
|
|
||||||
}
|
|
||||||
return String.join("\r\n", lines) + "\r\n";
|
return String.join("\r\n", lines) + "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,8 +165,7 @@ public class SDPMunging {
|
||||||
* Return a SDP modified to force a specific codec
|
* Return a SDP modified to force a specific codec
|
||||||
*/
|
*/
|
||||||
public String forceCodec(String sdp, Participant participant, boolean isPublisher, boolean isReconnecting,
|
public String forceCodec(String sdp, Participant participant, boolean isPublisher, boolean isReconnecting,
|
||||||
boolean isTranscodingAllowed, VideoCodec forcedVideoCodec, boolean applyHeavyMunging)
|
boolean isTranscodingAllowed, VideoCodec forcedVideoCodec) throws OpenViduException {
|
||||||
throws OpenViduException {
|
|
||||||
try {
|
try {
|
||||||
if (supportedVideoCodecs.contains(forcedVideoCodec)) {
|
if (supportedVideoCodecs.contains(forcedVideoCodec)) {
|
||||||
String mungedSdpOffer;
|
String mungedSdpOffer;
|
||||||
|
@ -178,7 +176,7 @@ public class SDPMunging {
|
||||||
participant.getParticipantPublicId(), participant.getSessionId(), isPublisher, !isPublisher,
|
participant.getParticipantPublicId(), participant.getSessionId(), isPublisher, !isPublisher,
|
||||||
isReconnecting, sdp);
|
isReconnecting, sdp);
|
||||||
|
|
||||||
mungedSdpOffer = this.setCodecPreference(forcedVideoCodec, sdp, applyHeavyMunging);
|
mungedSdpOffer = this.setCodecPreference(forcedVideoCodec, sdp);
|
||||||
|
|
||||||
log.debug(
|
log.debug(
|
||||||
"PARTICIPANT '{}' in Session '{}'. Is Publisher: '{}'. Is Subscriber: '{}'."
|
"PARTICIPANT '{}' in Session '{}'. Is Publisher: '{}'. Is Subscriber: '{}'."
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class SDPMungingTest {
|
||||||
|
|
||||||
private void initTestsSetCodecPrevalence(VideoCodec codec, String sdpNameFile) throws IOException {
|
private void initTestsSetCodecPrevalence(VideoCodec codec, String sdpNameFile) throws IOException {
|
||||||
this.oldSdp = getSdpFile(sdpNameFile);
|
this.oldSdp = getSdpFile(sdpNameFile);
|
||||||
this.newSdp = this.sdpMungin.setCodecPreference(codec, oldSdp, false);
|
this.newSdp = this.sdpMungin.setCodecPreference(codec, oldSdp);
|
||||||
this.forceCodecPayloads = new ArrayList<>();
|
this.forceCodecPayloads = new ArrayList<>();
|
||||||
|
|
||||||
// Get all Payload-Type for video Codec
|
// Get all Payload-Type for video Codec
|
||||||
|
|
Loading…
Reference in New Issue