本文整理汇总了Java中org.kurento.client.KurentoClient.create方法的典型用法代码示例。如果您正苦于以下问题:Java KurentoClient.create方法的具体用法?Java KurentoClient.create怎么用?Java KurentoClient.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kurento.client.KurentoClient
的用法示例。
在下文中一共展示了KurentoClient.create方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTestExtraFakeKurento
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
protected synchronized KurentoClient getTestExtraFakeKurento() {
if (testExtraFakeKurento == null) {
testExtraFakeKurento = KurentoClient.create(testExtraFakeKmsWsUri,
new KurentoConnectionListener() {
@Override
public void connected() {
}
@Override
public void connectionFailed() {
}
@Override
public void disconnected() {
testExtraFakeKurento = null;
}
@Override
public void reconnected(boolean sameServer) {
}
});
}
return testExtraFakeKurento;
}
示例2: startSession
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public String startSession(final WebSocketSession session, String sdpOffer) {
// 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)
mediaPipeline = kurentoClient.createMediaPipeline();
log.info("Created Media Pipeline {} (session {})", mediaPipeline.getId(), sessionId);
webRtcEndpoint = new WebRtcEndpoint.Builder(mediaPipeline).build();
FaceOverlayFilter faceOverlayFilter = new FaceOverlayFilter.Builder(mediaPipeline).build();
faceOverlayFilter.setOverlayedImage("http://files.kurento.org/img/mario-wings.png", -0.35F,
-1.2F, 1.6F, 1.6F);
webRtcEndpoint.connect(faceOverlayFilter);
faceOverlayFilter.connect(webRtcEndpoint);
// WebRTC negotiation
webRtcEndpoint.addOnIceCandidateListener(new EventListener<OnIceCandidateEvent>() {
@Override
public void onEvent(OnIceCandidateEvent event) {
JsonObject response = new JsonObject();
response.addProperty("id", "iceCandidate");
response.add("candidate", JsonUtils.toJsonObject(event.getCandidate()));
handler.sendMessage(session, new TextMessage(response.toString()));
}
});
String sdpAnswer = webRtcEndpoint.processOffer(sdpOffer);
webRtcEndpoint.gatherCandidates();
return sdpAnswer;
}
示例3: FixedNKmsManager
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public FixedNKmsManager(List<String> kmsWsUri, int kmsLoadLimit) {
for (String uri : kmsWsUri) {
Kms kms = new Kms(KurentoClient.create(uri), uri);
kms.setLoadManager(new MaxWebRtcLoadManager(kmsLoadLimit));
this.addKms(kms);
}
}
示例4: createKurentoClient
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
private KurentoClient createKurentoClient(String kmsWsUri) {
try {
KurentoClient kurentoClient = KurentoClient.create(kmsWsUri);
return kurentoClient;
} catch (Throwable t) {
throw new RuntimeException("Cannot connect to KMS instance in URI "
+ kmsWsUri, t);
}
}
示例5: FixedNKmsManager
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public FixedNKmsManager(List<String> kmsWsUri, int kmsLoadLimit) {
for (String uri : kmsWsUri) {
Kms kms = new Kms(KurentoClient.create(uri), uri);
kms.setLoadManager(new MaxWebRtcLoadManager(kmsLoadLimit));
this.addKms(kms);
}
}
示例6: errorSendingClosedKmsTest
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Test
public void errorSendingClosedKmsTest() throws Exception {
String kmsUrl = kms.getWsUri();
KurentoClient kurento = KurentoClient.create(kmsUrl, new KurentoConnectionListener() {
@Override
public void reconnected(boolean sameServer) {
}
@Override
public void disconnected() {
log.debug("Disconnected");
}
@Override
public void connectionFailed() {
}
@Override
public void connected() {
}
});
kurento.createMediaPipeline();
kms.stopKms();
try {
kurento.createMediaPipeline();
fail("KurentoException should be thrown");
} catch (KurentoException e) {
assertThat(e.getMessage(), containsString("Exception connecting to WebSocket"));
}
}
示例7: kurentoClient
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Bean
public KurentoClient kurentoClient() {
return KurentoClient.create();
}
示例8: kurentoClient
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Bean
public KurentoClient kurentoClient() {
return KurentoClient.create(System.getProperty("kms.ws.uri", DEFAULT_KMS_WS_URI));
}
示例9: kurentoClient
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Bean
public KurentoClient kurentoClient() {
return KurentoClient.create("ws://localhost:8888/kurento");
}
示例10: createKurentoClient
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public KurentoClient createKurentoClient() {
return KurentoClient.create(wsUri);
}
示例11: disconnectionEventTest
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Test
public void disconnectionEventTest() throws InterruptedException, IOException {
final CountDownLatch disconnectedLatch = new CountDownLatch(1);
String kmsUrl = kms.getWsUri();
log.debug("Connecting to KMS in " + kmsUrl);
KurentoClient kurentoClient = KurentoClient.create(kmsUrl, new KurentoConnectionListener() {
@Override
public void disconnected() {
log.debug("disconnected from KMS");
disconnectedLatch.countDown();
}
@Override
public void connectionFailed() {
}
@Override
public void connected() {
}
@Override
public void reconnected(boolean sameServer) {
}
});
MediaPipeline pipeline = kurentoClient.createMediaPipeline();
PlayerEndpoint player =
new PlayerEndpoint.Builder(pipeline, "http://" + getTestFilesHttpPath()
+ "/video/format/small.webm").build();
HttpPostEndpoint httpEndpoint = new HttpPostEndpoint.Builder(pipeline).build();
player.connect(httpEndpoint);
try {
kms.stopKms();
} catch (Exception e) {
fail("Exception thrown when destroying kms. " + e);
}
log.debug("Waiting for disconnection event");
if (!disconnectedLatch.await(60, TimeUnit.SECONDS)) {
fail("Event disconnected should be thrown when kcs is destroyed");
}
log.debug("Disconnection event received");
}
示例12: reconnectTest
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Test
public void reconnectTest() throws InterruptedException, IOException {
String kmsUrl = kms.getWsUri();
log.debug("Connecting to KMS in " + kmsUrl);
KurentoClient kurentoClient = KurentoClient.create(kmsUrl);
kurentoClient.createMediaPipeline();
kms.stopKms();
Thread.sleep(3000);
kms.start();
kurentoClient.createMediaPipeline();
kms.stopKms();
}
示例13: getKurentoClient
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Override
public KurentoClient getKurentoClient(KurentoClientSessionInfo sessionInfo) throws RoomException {
return KurentoClient.create(Properties.of("loadPoints", ROOM_PIPELINE_LOAD_POINTS));
}
示例14: test
import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Test
public void test() throws IOException {
String oldKmsUrl = System.getProperty("kms.url");
System.clearProperty("kms.url");
Path backup = null;
Path configFile = Paths.get(StandardSystemProperty.USER_HOME.value(), ".kurento",
"config.properties");
try {
if (Files.exists(configFile)) {
backup = configFile.getParent().resolve("config.properties.old");
if (Files.exists(backup)) {
Files.delete(backup);
}
Files.move(configFile, backup);
}
Files.createDirectories(configFile.getParent());
try (BufferedWriter writer = Files.newBufferedWriter(configFile, StandardCharsets.UTF_8)) {
writer.write("kms.url.provider: " + TestKmsUrlProvider.class.getName() + "\r\n");
}
KurentoClient kurento = KurentoClient.create();
expectMethodCall("reserveKms(id)");
kurento.destroy();
expectMethodCall("releaseKms(id)");
} finally {
Files.delete(configFile);
if (backup != null) {
Files.move(backup, configFile);
}
if (oldKmsUrl != null) {
System.setProperty("kms.url", oldKmsUrl);
}
}
}