美文网首页
How to setup a typical call usin

How to setup a typical call usin

作者: 吸霾少年 | 来源:发表于2018-03-10 10:48 被阅读0次

    [peer_connection_interface.h]

    // The PeerConnectionFactory class provides factory methods to create
    // PeerConnection, MediaStream and MediaStreamTrack objects.
    //
    // The following steps are needed to setup a typical call using WebRTC:
    //
    // 1. Create a PeerConnectionFactoryInterface. Check constructors for more
    // information about input parameters.
    //
    // 2. Create a PeerConnection object. Provide a configuration struct which
    // points to STUN and/or TURN servers used to generate ICE candidates, and
    // provide an object that implements the PeerConnectionObserver interface,
    // which is used to receive callbacks from the PeerConnection.
    //
    // 3. Create local MediaStreamTracks using the PeerConnectionFactory and add
    // them to PeerConnection by calling AddTrack (or legacy method, AddStream).
    //
    // 4. Create an offer, call SetLocalDescription with it, serialize it, and send
    // it to the remote peer
    //
    // 5. Once an ICE candidate has been gathered, the PeerConnection will call the
    // observer function OnIceCandidate. The candidates must also be serialized and
    // sent to the remote peer.
    //
    // 6. Once an answer is received from the remote peer, call
    // SetRemoteDescription with the remote answer.
    //
    // 7. Once a remote candidate is received from the remote peer, provide it to
    // the PeerConnection by calling AddIceCandidate.
    //
    // The receiver of a call (assuming the application is "call"-based) can decide
    // to accept or reject the call; this decision will be taken by the application,
    // not the PeerConnection.
    //
    // If the application decides to accept the call, it should:
    //
    // 1. Create PeerConnectionFactoryInterface if it doesn't exist.
    //
    // 2. Create a new PeerConnection.
    //
    // 3. Provide the remote offer to the new PeerConnection object by calling
    // SetRemoteDescription.
    //
    // 4. Generate an answer to the remote offer by calling CreateAnswer and send it
    // back to the remote peer.
    //
    // 5. Provide the local answer to the new PeerConnection by calling
    // SetLocalDescription with the answer.
    //
    // 6. Provide the remote ICE candidates by calling AddIceCandidate.
    //
    // 7. Once a candidate has been gathered, the PeerConnection will call the
    // observer function OnIceCandidate. Send these candidates to the remote peer.
    

    相关文章

      网友评论

          本文标题:How to setup a typical call usin

          本文链接:https://www.haomeiwen.com/subject/sjmvfftx.html