openvidu-server: remove ForceCodec=NONE for mediasoup

Allow forcing a specific codec when mediasoup is the media server. This
requires changes in the recording! Otherwise, incompatible combinations
might occur. For example, currently WEBM is a container that works ok
for VP8 and VP9 video, but won't work with H.264.
pull/658/head
Juan Navarro 2021-10-26 10:32:57 +02:00
parent 59af2871d8
commit 88d5fd97a7
2 changed files with 4 additions and 13 deletions

View File

@ -117,10 +117,6 @@ public class KurentoSessionManager extends SessionManager {
// Insecure user directly call joinRoom RPC method, without REST API use
SessionProperties.Builder builder = new SessionProperties.Builder().mediaMode(MediaMode.ROUTED)
.recordingMode(RecordingMode.ALWAYS);
// forcedVideoCodec to NONE if mediasoup
if (MediaServer.mediasoup.equals(openviduConfig.getMediaServer())) {
builder.forcedVideoCodec(VideoCodec.NONE);
}
sessionNotActive = new Session(sessionId, builder.build(), openviduConfig, recordingManager);
}
@ -767,7 +763,7 @@ public class KurentoSessionManager extends SessionManager {
/**
* Creates a session with the already existing not-active session in the
* indicated KMS, if it doesn't already exist
*
*
* @throws OpenViduException in case of error while creating the session
*/
public KurentoSession createSession(Session sessionNotActive, Kms kms) throws OpenViduException {

View File

@ -762,15 +762,10 @@ public class SessionRestController {
}
builder = builder.customSessionId(customSessionId);
}
// forcedVideoCodec to NONE if mediasoup
if (MediaServer.mediasoup.equals(openviduConfig.getMediaServer())) {
builder = builder.forcedVideoCodec(VideoCodec.NONE);
if (forcedVideoCodec != null) {
builder = builder.forcedVideoCodec(VideoCodec.valueOf(forcedVideoCodec));
} else {
if (forcedVideoCodec != null) {
builder = builder.forcedVideoCodec(VideoCodec.valueOf(forcedVideoCodec));
} else {
builder = builder.forcedVideoCodec(openviduConfig.getOpenviduForcedCodec());
}
builder = builder.forcedVideoCodec(openviduConfig.getOpenviduForcedCodec());
}
if (allowTranscoding != null) {
builder = builder.allowTranscoding(allowTranscoding);