本文整理汇总了Java中org.kurento.client.IceCandidate类的典型用法代码示例。如果您正苦于以下问题:Java IceCandidate类的具体用法?Java IceCandidate怎么用?Java IceCandidate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IceCandidate类属于org.kurento.client包,在下文中一共展示了IceCandidate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: internalAddIceCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
private void internalAddIceCandidate(IceCandidate candidate) throws RoomException {
if (webEndpoint == null) {
throw new RoomException(Code.MEDIA_WEBRTC_ENDPOINT_ERROR_CODE,
"Can't add existing ICE candidates to null WebRtcEndpoint (ep: " + endpointName + ")");
}
this.webEndpoint.addIceCandidate(candidate, new Continuation<Void>() {
@Override
public void onSuccess(Void result) throws Exception {
log.trace("Ice candidate added to the internal endpoint");
}
@Override
public void onError(Throwable cause) throws Exception {
log.warn("EP {}: Failed to add ice candidate to the internal endpoint", endpointName, cause);
}
});
}
开发者ID:Kurento,项目名称:kurento-room,代码行数:18,代码来源:MediaEndpoint.java
示例2: addCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addCandidate(IceCandidate candidate, String name) {
if (this.name.compareTo(name) == 0) {
outgoingMedia.addIceCandidate(candidate);
} else {
WebRtcEndpoint webRtc = incomingMedia.get(name);
if (webRtc != null) {
webRtc.addIceCandidate(candidate);
}
}
}
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:11,代码来源:UserSession.java
示例3: handleTextMessage
import org.kurento.client.IceCandidate; //导入依赖的package包/类
@Override
public void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
final JsonObject jsonMessage = gson.fromJson(message.getPayload(), JsonObject.class);
final UserSession user = registry.getBySession(session);
if (user != null) {
log.debug("Incoming message from user '{}': {}", user.getName(), jsonMessage);
} else {
log.debug("Incoming message from new user: {}", jsonMessage);
}
switch (jsonMessage.get("id").getAsString()) {
case "joinRoom":
joinRoom(jsonMessage, session);
break;
case "receiveVideoFrom":
final String senderName = jsonMessage.get("sender").getAsString();
final UserSession sender = registry.getByName(senderName);
final String sdpOffer = jsonMessage.get("sdpOffer").getAsString();
user.receiveVideoFrom(sender, sdpOffer);
break;
case "leaveRoom":
leaveRoom(user);
break;
case "onIceCandidate":
JsonObject candidate = jsonMessage.get("candidate").getAsJsonObject();
if (user != null) {
IceCandidate cand = new IceCandidate(candidate.get("candidate").getAsString(),
candidate.get("sdpMid").getAsString(), candidate.get("sdpMLineIndex").getAsInt());
user.addCandidate(cand, jsonMessage.get("name").getAsString());
}
break;
default:
break;
}
}
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:39,代码来源:CallHandler.java
示例4: handleIceCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
/**
* Receive ICE candidate for participant and add to UserCall
* @param params
* @param session
* @throws WSMessageException
*/
private void handleIceCandidate(JsonObject params, WebSocketSession session) throws WSMessageException {
final UserSession userSession = getUserSession(session);
JsonObject candidateObj = parser.getJsonObjectParameter(params, "candidate");
long participantId = parser.getLongParameter(params, "participantId");
IceCandidate candidate = new IceCandidate(candidateObj.get("candidate").getAsString(),
candidateObj.get("sdpMid").getAsString(), candidateObj.get("sdpMLineIndex").getAsInt());
callCommService.handleIceCandidate(userSession, participantId, candidate);
}
开发者ID:zralock,项目名称:CTUConference,代码行数:15,代码来源:CallMessageReceiver.java
示例5: addCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addCandidate(IceCandidate candidate, long userId) {
if (userSession.getUserId() == userId) {
outgoingMedia.addIceCandidate(candidate);
} else {
WebRtcEndpoint webRtc = incomingMedia.get(userId);
if (webRtc != null) {
webRtc.addIceCandidate(candidate);
}
}
}
开发者ID:zralock,项目名称:CTUConference,代码行数:11,代码来源:UserCall.java
示例6: setWebRtcEndpoint
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void setWebRtcEndpoint(WebRtcEndpoint webRtcEndpoint) {
this.webRtcEndpoint = webRtcEndpoint;
if (this.webRtcEndpoint != null) {
for (IceCandidate e : candidateList) {
this.webRtcEndpoint.addIceCandidate(e);
}
this.candidateList.clear();
}
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:11,代码来源:UserSession.java
示例7: addCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addCandidate(IceCandidate candidate) {
if (this.webRtcEndpoint != null) {
this.webRtcEndpoint.addIceCandidate(candidate);
} else {
candidateList.add(candidate);
}
if (this.playingWebRtcEndpoint != null) {
this.playingWebRtcEndpoint.addIceCandidate(candidate);
}
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:12,代码来源:UserSession.java
示例8: setWebRtcEndpoint
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void setWebRtcEndpoint(WebRtcEndpoint webRtcEndpoint) {
this.webRtcEndpoint = webRtcEndpoint;
for (IceCandidate e : candidateList) {
this.webRtcEndpoint.addIceCandidate(e);
}
this.candidateList.clear();
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:9,代码来源:UserSession.java
示例9: addCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addCandidate(IceCandidate candidate) {
if (this.webRtcEndpoint != null) {
this.webRtcEndpoint.addIceCandidate(candidate);
} else {
candidateList.add(candidate);
}
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:8,代码来源:UserSession.java
示例10: onIceCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
@Override
public void onIceCandidate(String roomName, String participantId, String endpointName,
IceCandidate candidate) {
JsonObject params = new JsonObject();
params.addProperty(ProtocolElements.ICECANDIDATE_EPNAME_PARAM, endpointName);
params.addProperty(ProtocolElements.ICECANDIDATE_SDPMLINEINDEX_PARAM,
candidate.getSdpMLineIndex());
params.addProperty(ProtocolElements.ICECANDIDATE_SDPMID_PARAM, candidate.getSdpMid());
params.addProperty(ProtocolElements.ICECANDIDATE_CANDIDATE_PARAM, candidate.getCandidate());
notifService.sendNotification(participantId, ProtocolElements.ICECANDIDATE_METHOD, params);
}
开发者ID:Kurento,项目名称:kurento-room,代码行数:12,代码来源:DefaultNotificationRoomHandler.java
示例11: addIceCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addIceCandidate(String endpointName, IceCandidate iceCandidate) {
if (this.name.equals(endpointName)) {
this.publisher.addIceCandidate(iceCandidate);
} else {
this.getNewOrExistingSubscriber(endpointName).addIceCandidate(iceCandidate);
}
}
开发者ID:Kurento,项目名称:kurento-room,代码行数:8,代码来源:Participant.java
示例12: addIceCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
/**
* Add a new {@link IceCandidate} received gathered by the remote peer of this
* {@link WebRtcEndpoint}.
*
* @param candidate
* the remote candidate
*/
public synchronized void addIceCandidate(IceCandidate candidate) throws RoomException {
if (!this.isWeb()) {
throw new RoomException(Code.MEDIA_NOT_A_WEB_ENDPOINT_ERROR_CODE, "Operation not supported");
}
if (webEndpoint == null) {
candidates.addLast(candidate);
} else {
internalAddIceCandidate(candidate);
}
}
开发者ID:Kurento,项目名称:kurento-room,代码行数:18,代码来源:MediaEndpoint.java
示例13: addCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addCandidate(IceCandidate candidate) {
webRtcEndpoint.addIceCandidate(candidate);
}
开发者ID:jake-kent,项目名称:TLIVideoConferencingv2,代码行数:4,代码来源:UserSession.java
示例14: IceCandidateDTO
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public IceCandidateDTO(long participantId, IceCandidate candidate) {
this.participantId = participantId;
this.candidate = candidate;
}
开发者ID:zralock,项目名称:CTUConference,代码行数:5,代码来源:IceCandidateDTO.java
示例15: getCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public IceCandidate getCandidate() {
return candidate;
}
开发者ID:zralock,项目名称:CTUConference,代码行数:4,代码来源:IceCandidateDTO.java
示例16: setCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void setCandidate(IceCandidate candidate) {
this.candidate = candidate;
}
开发者ID:zralock,项目名称:CTUConference,代码行数:4,代码来源:IceCandidateDTO.java
示例17: handleIceCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
@Override
public void handleIceCandidate(UserSession userSession, long participantId, IceCandidate candidate) {
userSession.getUserCall().addCandidate(candidate, participantId);
}
开发者ID:zralock,项目名称:CTUConference,代码行数:5,代码来源:CallCommServiceImpl.java
示例18: handleTextMessage
import org.kurento.client.IceCandidate; //导入依赖的package包/类
@Override
public void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
JsonObject jsonMessage = gson.fromJson(message.getPayload(), JsonObject.class);
log.debug("Incoming message: {}", jsonMessage);
switch (jsonMessage.get("id").getAsString()) {
case "start":
try {
start(session, jsonMessage);
} catch (Throwable t) {
sendError(session, t.getMessage());
}
break;
case "stop":
this.pipeline.removeWebRtcEndpoint(session.getId());
break;
case "updateFeed":
updateFeed(jsonMessage);
break;
case "changeProcessingWidth":
changeProcessingWidth(jsonMessage.get("width").getAsInt());
break;
case "onIceCandidate": {
JsonObject candidate = jsonMessage.get("candidate").getAsJsonObject();
IceCandidate cand = new IceCandidate(candidate.get("candidate").getAsString(),
candidate.get("sdpMid").getAsString(), candidate.get("sdpMLineIndex").getAsInt());
this.pipeline.addCandidate(cand, session.getId());
break;
}
default:
sendError(session, "Invalid message with id " + jsonMessage.get("id").getAsString());
break;
}
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:42,代码来源:CrowdDetectorHandler.java
示例19: addCandidate
import org.kurento.client.IceCandidate; //导入依赖的package包/类
public void addCandidate(IceCandidate candidate, String session) {
WebRtcEndpoint endpoint = this.webRtcEndpoints.get(session);
if (endpoint != null) {
endpoint.addIceCandidate(candidate);
}
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:7,代码来源:Pipeline.java
示例20: handleTextMessage
import org.kurento.client.IceCandidate; //导入依赖的package包/类
@Override
public void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
JsonObject jsonMessage = gson.fromJson(message.getPayload(), JsonObject.class);
UserSession user = registry.getBySession(session);
if (user != null) {
log.debug("Incoming message from user '{}': {}", user.getName(), jsonMessage);
} else {
log.debug("Incoming message from new user: {}", jsonMessage);
}
switch (jsonMessage.get("id").getAsString()) {
case "register":
register(session, jsonMessage);
break;
case "call":
call(user, jsonMessage);
break;
case "incomingCallResponse":
incomingCallResponse(user, jsonMessage);
break;
case "play":
play(user, jsonMessage);
break;
case "onIceCandidate": {
JsonObject candidate = jsonMessage.get("candidate").getAsJsonObject();
if (user != null) {
IceCandidate cand =
new IceCandidate(candidate.get("candidate").getAsString(), candidate.get("sdpMid")
.getAsString(), candidate.get("sdpMLineIndex").getAsInt());
user.addCandidate(cand);
}
break;
}
case "stop":
stop(session);
releasePipeline(user);
break;
case "stopPlay":
releasePipeline(user);
break;
default:
break;
}
}
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:47,代码来源:CallHandler.java
注:本文中的org.kurento.client.IceCandidate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论