org.appspot.apprtc.AppRTCClient.SignalingParameters Java Examples

The following examples show how to use org.appspot.apprtc.AppRTCClient.SignalingParameters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PeerConnectionClient.java    From Yahala-Messenger with MIT License 6 votes vote down vote up
public void createPeerConnection(
        final EGLContext renderEGLContext,
        final VideoRenderer.Callbacks localRender,
        final VideoRenderer.Callbacks remoteRender,
        final SignalingParameters signalingParameters) {
    if (peerConnectionParameters == null) {
        Log.e(TAG, "Creating peer connection without initializing factory.");
        return;
    }
    this.localRender = localRender;
    this.remoteRender = remoteRender;
    this.signalingParameters = signalingParameters;
    executor.execute(new Runnable() {
        @Override
        public void run() {
            createMediaConstraintsInternal();
            createPeerConnectionInternal(renderEGLContext);
        }
    });
}
 
Example #2
Source File: CallActivity.java    From Yahala-Messenger with MIT License 5 votes vote down vote up
private void onConnectedToRoomInternal(final SignalingParameters params) {
    final long delta = System.currentTimeMillis() - callStartedTimeMs;

    signalingParameters = params;
    logAndToast("Creating peer connection, delay=" + delta + "ms");
    peerConnectionClient.createPeerConnection(rootEglBase.getContext(),
            localRender, remoteRender, signalingParameters);

    if (signalingParameters.initiator) {
        logAndToast("Creating OFFER...");
        // Create offer. Offer SDP will be sent to answering client in
        // PeerConnectionEvents.onLocalDescription event.
        peerConnectionClient.createOffer();
    } else {
        if (params.offerSdp != null) {
            peerConnectionClient.setRemoteDescription(params.offerSdp);
            logAndToast("Creating ANSWER...");
            // Create answer. Answer SDP will be sent to offering client in
            // PeerConnectionEvents.onLocalDescription event.
            peerConnectionClient.createAnswer();
        }
        if (params.iceCandidates != null) {
            // Add remote ICE candidates from room.
            for (IceCandidate iceCandidate : params.iceCandidates) {
                peerConnectionClient.addRemoteIceCandidate(iceCandidate);
            }
        }
    }
}
 
Example #3
Source File: CallActivity.java    From Yahala-Messenger with MIT License 5 votes vote down vote up
@Override
public void onConnectedToRoom(final SignalingParameters params) {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            onConnectedToRoomInternal(params);
        }
    });
}
 
Example #4
Source File: PeerConnectionClient.java    From sample-videoRTC with Apache License 2.0 4 votes vote down vote up
public void createPeerConnection(final VideoSink localRender,
    final VideoRenderer.Callbacks remoteRender, final VideoCapturer videoCapturer,
    final SignalingParameters signalingParameters) {
  createPeerConnection(
      localRender, Collections.singletonList(remoteRender), videoCapturer, signalingParameters);
}
 
Example #5
Source File: RoomParametersFetcher.java    From sample-videoRTC with Apache License 2.0 2 votes vote down vote up
/**
 * Callback fired once the room's signaling parameters
 * SignalingParameters are extracted.
 */
void onSignalingParametersReady(final SignalingParameters params);
 
Example #6
Source File: RoomParametersFetcher.java    From Yahala-Messenger with MIT License 2 votes vote down vote up
/**
 * Callback fired once the room's signaling parameters
 * SignalingParameters are extracted.
 */
public void onSignalingParametersReady(final SignalingParameters params);