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


Java KurentoClient.createMediaPipeline方法代码示例

本文整理汇总了Java中org.kurento.client.KurentoClient.createMediaPipeline方法的典型用法代码示例。如果您正苦于以下问题:Java KurentoClient.createMediaPipeline方法的具体用法?Java KurentoClient.createMediaPipeline怎么用?Java KurentoClient.createMediaPipeline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kurento.client.KurentoClient的用法示例。


在下文中一共展示了KurentoClient.createMediaPipeline方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PlayMediaPipeline

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public PlayMediaPipeline(KurentoClient kurento, String user, final WebSocketSession session) {
  // Media pipeline
  pipeline = kurento.createMediaPipeline();

  // Media Elements (WebRtcEndpoint, PlayerEndpoint)
  webRtc = new WebRtcEndpoint.Builder(pipeline).build();
  player = new PlayerEndpoint.Builder(pipeline, RECORDING_PATH + user + RECORDING_EXT).build();

  // Connection
  player.connect(webRtc);

  // Player listeners
  player.addErrorListener(new EventListener<ErrorEvent>() {
    @Override
    public void onEvent(ErrorEvent event) {
      log.info("ErrorEvent: {}", event.getDescription());
      sendPlayEnd(session);
    }
  });
}
 
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:21,代码来源:PlayMediaPipeline.java

示例2: CallMediaPipeline

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public CallMediaPipeline(KurentoClient kurento, String from, String to) {

    // Media pipeline
    pipeline = kurento.createMediaPipeline();

    // Media Elements (WebRtcEndpoint, RecorderEndpoint)
    webRtcCaller = new WebRtcEndpoint.Builder(pipeline).build();
    webRtcCallee = new WebRtcEndpoint.Builder(pipeline).build();

    recorderCaller = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + from + RECORDING_EXT)
        .build();
    recorderCallee = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + to + RECORDING_EXT)
        .build();

    // Connections
    webRtcCaller.connect(webRtcCallee);
    webRtcCaller.connect(recorderCaller);

    webRtcCallee.connect(webRtcCaller);
    webRtcCallee.connect(recorderCallee);
  }
 
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:22,代码来源:CallMediaPipeline.java

示例3: CallMediaPipeline

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public CallMediaPipeline(KurentoClient kurento, String from, String to) {

    // Media pipeline
    pipeline = kurento.createMediaPipeline();

    // Media Elements (WebRtcEndpoint, RecorderEndpoint, FaceOverlayFilter)
    webRtcCaller = new WebRtcEndpoint.Builder(pipeline).build();
    webRtcCallee = new WebRtcEndpoint.Builder(pipeline).build();

    recorderCaller = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + from + RECORDING_EXT)
        .build();
    recorderCallee = new RecorderEndpoint.Builder(pipeline, RECORDING_PATH + to + RECORDING_EXT)
        .build();

    String appServerUrl = System.getProperty("app.server.url",
        One2OneCallAdvApp.DEFAULT_APP_SERVER_URL);
    FaceOverlayFilter faceOverlayFilterCaller = new FaceOverlayFilter.Builder(pipeline).build();
    faceOverlayFilterCaller.setOverlayedImage(appServerUrl + "/img/mario-wings.png", -0.35F, -1.2F,
        1.6F, 1.6F);

    FaceOverlayFilter faceOverlayFilterCallee = new FaceOverlayFilter.Builder(pipeline).build();
    faceOverlayFilterCallee.setOverlayedImage(appServerUrl + "/img/Hat.png", -0.2F, -1.35F, 1.5F,
        1.5F);

    // Connections
    webRtcCaller.connect(faceOverlayFilterCaller);
    faceOverlayFilterCaller.connect(webRtcCallee);
    faceOverlayFilterCaller.connect(recorderCaller);

    webRtcCallee.connect(faceOverlayFilterCallee);
    faceOverlayFilterCallee.connect(webRtcCaller);
    faceOverlayFilterCallee.connect(recorderCallee);
  }
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:34,代码来源:CallMediaPipeline.java

示例4: CallMediaPipeline

import org.kurento.client.KurentoClient; //导入方法依赖的package包/类
public CallMediaPipeline(KurentoClient kurento) {
  try {
    this.pipeline = kurento.createMediaPipeline();
    this.callerWebRtcEp = new WebRtcEndpoint.Builder(pipeline).build();
    this.calleeWebRtcEp = new WebRtcEndpoint.Builder(pipeline).build();

    this.callerWebRtcEp.connect(this.calleeWebRtcEp);
    this.calleeWebRtcEp.connect(this.callerWebRtcEp);
  } catch (Throwable t) {
    if (this.pipeline != null) {
      pipeline.release();
    }
  }
}
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:15,代码来源:CallMediaPipeline.java

示例5: 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

示例6: 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

示例7: 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


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