当前位置: 首页>>代码示例>>Java>>正文


Java KurentoClient.create方法代码示例

本文整理汇总了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;
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:26,代码来源:ExtraKmsFakeUsers.java

示例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;
}
 
开发者ID:nubomedia,项目名称:nubomedia-magic-mirror,代码行数:34,代码来源:UserSession.java

示例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);
	}
}
 
开发者ID:sergiobanegas,项目名称:perseus,代码行数:8,代码来源:FixedNKmsManager.java

示例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);
	}
}
 
开发者ID:lulop-k,项目名称:kms-monitoring-java,代码行数:10,代码来源:KmsMonitor.java

示例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);
  }
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:8,代码来源:FixedNKmsManager.java

示例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"));
  }
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:37,代码来源:KurentoClientKmsConnectionTest.java

示例7: kurentoClient

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create();
}
 
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:5,代码来源:GroupCallApp.java

示例8: kurentoClient

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Bean
public KurentoClient kurentoClient() {
    return KurentoClient.create(System.getProperty("kms.ws.uri", DEFAULT_KMS_WS_URI));
}
 
开发者ID:zralock,项目名称:CTUConference,代码行数:5,代码来源:KurentoConfig.java

示例9: kurentoClient

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
@Bean
public KurentoClient kurentoClient() {
  return KurentoClient.create("ws://localhost:8888/kurento");
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:5,代码来源:KurentoRoomServerApp.java

示例10: createKurentoClient

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public KurentoClient createKurentoClient() {
  return KurentoClient.create(wsUri);
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:4,代码来源:KmsService.java

示例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");
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:56,代码来源:ConnectionListenerTest.java

示例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();
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:22,代码来源:ConnectionListenerTest.java

示例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));

}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:7,代码来源:AutodiscoveryKurentoClientProvider.java

示例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);
    }
  }
}
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:53,代码来源:KurentoClientKmsProviderTest.java


注:本文中的org.kurento.client.KurentoClient.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。