• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java KurentoClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: updateStats

import org.kurento.client.KurentoClient; //导入依赖的package包/类
public synchronized KmsStats updateStats() {

		KurentoClient kurentoClient = createKurentoClient(kmsWsUri);

		startIteration();

		try {
			crunchKms(kurentoClient);
		} catch (Throwable t) {
			clean();
			throw new RuntimeException("Unexpected error while updating stats",
					t);
		} finally {
			kurentoClient.destroy();
		}
		return stopIteration();
	}
 
开发者ID:lulop-k,项目名称:kms-monitoring-java,代码行数:18,代码来源:KmsMonitor.java


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


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


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


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


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


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


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


示例9: crunchKms

import org.kurento.client.KurentoClient; //导入依赖的package包/类
private void crunchKms(KurentoClient kurentoClient) {
	ServerManager serverManager = kurentoClient.getServerManager();
	List<MediaPipeline> mediaPipelines = serverManager.getPipelines();
	numPipelines.addSample(mediaPipelines.size());
	for (MediaPipeline p : mediaPipelines) {
		crunchPipeline(p);
	}
}
 
开发者ID:lulop-k,项目名称:kms-monitoring-java,代码行数:9,代码来源:KmsMonitor.java


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


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


示例12: TestPipeline

import org.kurento.client.KurentoClient; //导入依赖的package包/类
public TestPipeline(KurentoClient kurento, String room, String pipeDescription) {
  this.kurento = kurento;
  if (room != null) {
    this.room = room;
  }
  if (pipeDescription != null) {
    this.description = pipeDescription;
  }
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:10,代码来源:TestPipeline.java


示例13: newParticipant

import org.kurento.client.KurentoClient; //导入依赖的package包/类
public void newParticipant(String name, String playerUri, boolean autoMedia, boolean loopMedia,
    KurentoClient kurento) {
  TestPipeline pipeline = getOrCreatePipeline(kurento);
  pipeline.createPipeline();
  FakeParticipant participant = new FakeParticipant(serviceUrl, name, room, playerUri,
      pipeline.getPipeline(), autoMedia, loopMedia);
  participants.put(name, participant);
  participant.joinRoom();
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:10,代码来源:FakeSession.java


示例14: getOrCreatePipeline

import org.kurento.client.KurentoClient; //导入依赖的package包/类
private TestPipeline getOrCreatePipeline(KurentoClient kurento) {
  TestPipeline pipeline = this.pipelines.get(kurento);
  if (pipeline == null) {
    String desc = kurento.getServerManager().getId();
    pipeline = this.pipelines.putIfAbsent(kurento, new TestPipeline(kurento, room, desc));
    if (pipeline != null) {
      log.debug("Pipeline already created for room '{}' and kurento '{}'", room, desc);
    }
    pipeline = this.pipelines.get(kurento);
  }
  return pipeline;
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:13,代码来源:FakeSession.java


示例15: parallelJoinFakeUsers

import org.kurento.client.KurentoClient; //导入依赖的package包/类
public CountDownLatch parallelJoinFakeUsers(final List<String> relativePaths, final String room,
    final KurentoClient kurento) {
  if (relativePaths == null || relativePaths.isEmpty()) {
    execExceptions.put("parallelJoinFakeUsers-" + room, new Exception(
        "Null or empty play paths list"));
    return null;
  }
  int userThreads = relativePaths.size();
  log.info("Joining room '{}': {} fake users with relative play paths:\n{}", room, userThreads,
      relativePaths);

  final CountDownLatch joinLatch = new CountDownLatch(userThreads);
  parallelTasks(userThreads, USER_FAKE_PREFIX, "parallelJoinFakeUsers-" + room, new Task() {
    @Override
    public void exec(int numTask) throws Exception {
      try {
        String userName = getFakeKey(numTask);
        FakeSession s = createSession(room);
        String fullPlayPath = getPlaySourcePath(userName, relativePaths.get(numTask));
        if (kurento == null) {
          s.newParticipant(userName, fullPlayPath, true, true);
        } else {
          s.newParticipant(userName, fullPlayPath, true, true, kurento);
        }
      } finally {
        joinLatch.countDown();
      }
    }
  });
  return joinLatch;
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:32,代码来源:RoomClientFakeTest.java


示例16: Room

import org.kurento.client.KurentoClient; //导入依赖的package包/类
public Room(String roomName, KurentoClient kurentoClient, RoomHandler roomHandler,
    boolean destroyKurentoClient) {
  this.name = roomName;
  this.kurentoClient = kurentoClient;
  this.destroyKurentoClient = destroyKurentoClient;
  this.roomHandler = roomHandler;
  log.debug("New ROOM instance, named '{}'", roomName);
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:9,代码来源:Room.java


示例17: createRoom

import org.kurento.client.KurentoClient; //导入依赖的package包/类
/**
 * Creates a room if it doesn't already exist. The room's name will be indicated by the session
 * info bean.
 *
 * @param kcSessionInfo bean that will be passed to the {@link KurentoClientProvider} in order
 *                      to obtain the
 *                      {@link KurentoClient} that will be used by the room
 * @throws RoomException in case of error while creating the room
 */
public void createRoom(KurentoClientSessionInfo kcSessionInfo) throws RoomException {
  String roomName = kcSessionInfo.getRoomName();
  Room room = rooms.get(kcSessionInfo);
  if (room != null) {
    throw new RoomException(Code.ROOM_CANNOT_BE_CREATED_ERROR_CODE,
        "Room '" + roomName + "' already exists");
  }
  KurentoClient kurentoClient = kcProvider.getKurentoClient(kcSessionInfo);

  room = new Room(roomName, kurentoClient, roomHandler, kcProvider.destroyWhenUnused());

  Room oldRoom = rooms.putIfAbsent(roomName, room);
  if (oldRoom != null) {
    log.warn("Room '{}' has just been created by another thread", roomName);
    return;
    // throw new RoomException(
    // Code.ROOM_CANNOT_BE_CREATED_ERROR_CODE,
    // "Room '"
    // + roomName
    // + "' already exists (has just been created by another thread)");
  }
  String kcName = "[NAME NOT AVAILABLE]";
  if (kurentoClient.getServerManager() != null) {
    kcName = kurentoClient.getServerManager().getName();
  }
  log.warn("No room '{}' exists yet. Created one " + "using KurentoClient '{}'.", roomName,
      kcName);
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:38,代码来源:RoomManager.java


示例18: getKurentoClient

import org.kurento.client.KurentoClient; //导入依赖的package包/类
@Override
public KurentoClient getKurentoClient(KurentoClientSessionInfo sessionInfo) throws RoomException {
  if (!(sessionInfo instanceof DefaultKurentoClientSessionInfo)) {
    throw new RoomException(Code.GENERIC_ERROR_CODE, "Unkown session info bean type (expected "
        + DefaultKurentoClientSessionInfo.class.getName() + ")");
  }
  return getKms((DefaultKurentoClientSessionInfo) sessionInfo).getKurentoClient();
}
 
开发者ID:Kurento,项目名称:kurento-room,代码行数:9,代码来源:KmsManager.java


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


示例20: kurentoClient

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XSSFDrawing类代码示例发布时间:2022-05-22
下一篇:
Java LDAPException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap