Skip to content

Commit

Permalink
Reserve 25 points per media session (instead to default option, i.e. 50)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Oct 10, 2016
1 parent e401754 commit 4bf5832
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.kurento.client.KurentoClient;
import org.kurento.client.MediaPipeline;
import org.kurento.client.OnIceCandidateEvent;
import org.kurento.client.Properties;
import org.kurento.client.WebRtcEndpoint;
import org.kurento.jsonrpc.JsonUtils;
import org.slf4j.Logger;
Expand All @@ -42,6 +43,8 @@ public class UserSession {

private final Logger log = LoggerFactory.getLogger(UserSession.class);

private final static int POINTS_PER_SESSION = 25;

private MagicMirrorHandler handler;
private WebRtcEndpoint webRtcEndpoint;
private MediaPipeline mediaPipeline;
Expand All @@ -54,8 +57,10 @@ public UserSession(String sessionId, MagicMirrorHandler handler) {
}

public String startSession(final WebSocketSession session, String sdpOffer) {
// One KurentoClient instance per session
kurentoClient = KurentoClient.create();
// One KurentoClient instance per session (reserving points per session)
Properties properties = new Properties();
properties.add("loadPoints", POINTS_PER_SESSION);
kurentoClient = KurentoClient.create(properties);
log.info("Created kurentoClient (session {})", sessionId);

// Media logic (pipeline and media elements connectivity)
Expand Down

0 comments on commit 4bf5832

Please sign in to comment.