use of im.actor.runtime.webrtc.sdp.SDPScheme in project actor-platform by actorapp.
the class SDPOptimizer method optimize.
public static WebRTCSessionDescription optimize(WebRTCSessionDescription src) {
SDPScheme sdpScheme = SDP.parse(src.getSdp());
// Prefer ISAC over other audio codecs
for (SDPMedia media : sdpScheme.getMediaLevel()) {
SDPCodec isacCodec = null;
for (SDPCodec codec : media.getCodecs()) {
if (codec.getName().toLowerCase().equals("isac")) {
isacCodec = codec;
break;
}
}
if (isacCodec != null) {
media.getCodecs().remove(isacCodec);
media.getCodecs().add(0, isacCodec);
}
}
return new WebRTCSessionDescription(src.getType(), sdpScheme.toSDP());
}
Aggregations