|
@@ -1684,44 +1684,42 @@ public class CallActivity extends CallBaseActivity {
|
|
ncSignalingMessage.getRoomType());
|
|
ncSignalingMessage.getRoomType());
|
|
}
|
|
}
|
|
|
|
|
|
- if (("offer".equals(type) ||
|
|
|
|
- "answer".equals(type) ||
|
|
|
|
- "candidate".equals(type) ||
|
|
|
|
- "endOfCandidates".equals(type)) &&
|
|
|
|
- peerConnectionWrapper != null) {
|
|
|
|
- switch (type) {
|
|
|
|
- case "offer":
|
|
|
|
- case "answer":
|
|
|
|
- peerConnectionWrapper.setNick(ncSignalingMessage.getPayload().getNick());
|
|
|
|
- SessionDescription sessionDescriptionWithPreferredCodec;
|
|
|
|
-
|
|
|
|
- String sessionDescriptionStringWithPreferredCodec = MagicWebRTCUtils.preferCodec
|
|
|
|
- (ncSignalingMessage.getPayload().getSdp(),
|
|
|
|
- "H264", false);
|
|
|
|
-
|
|
|
|
- sessionDescriptionWithPreferredCodec = new SessionDescription(
|
|
|
|
- SessionDescription.Type.fromCanonicalForm(type),
|
|
|
|
- sessionDescriptionStringWithPreferredCodec);
|
|
|
|
-
|
|
|
|
- if (peerConnectionWrapper.getPeerConnection() != null) {
|
|
|
|
- peerConnectionWrapper.getPeerConnection().setRemoteDescription(
|
|
|
|
- peerConnectionWrapper.getMagicSdpObserver(),
|
|
|
|
- sessionDescriptionWithPreferredCodec);
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case "candidate":
|
|
|
|
- NCIceCandidate ncIceCandidate = ncSignalingMessage.getPayload().getIceCandidate();
|
|
|
|
- IceCandidate iceCandidate = new IceCandidate(ncIceCandidate.getSdpMid(),
|
|
|
|
- ncIceCandidate.getSdpMLineIndex(),
|
|
|
|
- ncIceCandidate.getCandidate());
|
|
|
|
- peerConnectionWrapper.addCandidate(iceCandidate);
|
|
|
|
- break;
|
|
|
|
- case "endOfCandidates":
|
|
|
|
- peerConnectionWrapper.drainIceCandidates();
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ if (peerConnectionWrapper == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (type) {
|
|
|
|
+ case "offer":
|
|
|
|
+ case "answer":
|
|
|
|
+ peerConnectionWrapper.setNick(ncSignalingMessage.getPayload().getNick());
|
|
|
|
+ SessionDescription sessionDescriptionWithPreferredCodec;
|
|
|
|
+
|
|
|
|
+ String sessionDescriptionStringWithPreferredCodec = MagicWebRTCUtils.preferCodec
|
|
|
|
+ (ncSignalingMessage.getPayload().getSdp(),
|
|
|
|
+ "H264", false);
|
|
|
|
+
|
|
|
|
+ sessionDescriptionWithPreferredCodec = new SessionDescription(
|
|
|
|
+ SessionDescription.Type.fromCanonicalForm(type),
|
|
|
|
+ sessionDescriptionStringWithPreferredCodec);
|
|
|
|
+
|
|
|
|
+ if (peerConnectionWrapper.getPeerConnection() != null) {
|
|
|
|
+ peerConnectionWrapper.getPeerConnection().setRemoteDescription(
|
|
|
|
+ peerConnectionWrapper.getMagicSdpObserver(),
|
|
|
|
+ sessionDescriptionWithPreferredCodec);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "candidate":
|
|
|
|
+ NCIceCandidate ncIceCandidate = ncSignalingMessage.getPayload().getIceCandidate();
|
|
|
|
+ IceCandidate iceCandidate = new IceCandidate(ncIceCandidate.getSdpMid(),
|
|
|
|
+ ncIceCandidate.getSdpMLineIndex(),
|
|
|
|
+ ncIceCandidate.getCandidate());
|
|
|
|
+ peerConnectionWrapper.addCandidate(iceCandidate);
|
|
|
|
+ break;
|
|
|
|
+ case "endOfCandidates":
|
|
|
|
+ peerConnectionWrapper.drainIceCandidates();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
Log.e(TAG, "unexpected RoomType while processing NCSignalingMessage");
|
|
Log.e(TAG, "unexpected RoomType while processing NCSignalingMessage");
|