本文整理汇总了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);
}
});
}
示例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);
}
示例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);
}
示例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();
}
}
}
示例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"));
}
}
示例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");
}
示例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();
}