From 4bf58326051c39f3c0eb6f3470e74f76206fe701 Mon Sep 17 00:00:00 2001 From: Boni Garcia Date: Mon, 10 Oct 2016 11:30:41 +0200 Subject: [PATCH] Reserve 25 points per media session (instead to default option, i.e. 50) --- .../eu/nubomedia/tutorial/magicmirror/UserSession.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/nubomedia/tutorial/magicmirror/UserSession.java b/src/main/java/eu/nubomedia/tutorial/magicmirror/UserSession.java index dd2e5de..8847966 100644 --- a/src/main/java/eu/nubomedia/tutorial/magicmirror/UserSession.java +++ b/src/main/java/eu/nubomedia/tutorial/magicmirror/UserSession.java @@ -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; @@ -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; @@ -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)