webrtc-m79-peerconnection_client-收集 host candidate_01

Conductor::OnSuccess中调用 peer_connection_->SetLocalDescription(DummySetSessionDescriptionObserver::Create(), desc);就会触发candidate的收集,具体的收集逻辑如下:


收集 host candidate 流程

===>void PeerConnection::SetLocalDescription(
        SetSessionDescriptionObserver* observer,
        SessionDescriptionInterface* desc_ptr) ===> this_weak_ptr->DoSetLocalDescription(
                                                                                            std::move(desc),
                                                                                            rtc::scoped_refptr<SetLocalDescriptionObserverInterface>(
                                                                                                new rtc::RefCountedObject<SetSessionDescriptionObserverAdapter>(
                                                                                                    this_weak_ptr, observer_refptr)));
        
===> PeerConnection::DoSetLocalDescription(
    std::unique_ptr<SessionDescriptionInterface> desc,
    rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) ===> transport_controller_->MaybeStartGathering();
    
===> JsepTransportController::MaybeStartGathering() ===> dtls->ice_transport()->MaybeStartGathering();
===> P2PTransportChannel::MaybeStartGathering() ===> allocator_sessions_.back()->StartGettingPorts();
===> BasicPortAllocatorSession::StartGettingPorts() ===> network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_START);
===> BasicPortAllocatorSession::OnMessage(rtc::Message* message) ===> GetPortConfigurations();
===> BasicPortAllocatorSession::GetPortConfigurations() ===> ConfigReady(config);
===> BasicPortAllocatorSession::ConfigReady(PortConfiguration* config) ===> network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_READY, config);
===> BasicPortAllocatorSession::OnConfigReady(PortConfiguration* config) ===> AllocatePorts();
===> BasicPortAllocatorSession::AllocatePorts()  ===> network_thread_->Post(RTC_FROM_HERE, this, MSG_ALLOCATE);
===> BasicPortAllocatorSession::OnAllocate() ===> DoAllocate(disable_equivalent_phases);
===> BasicPortAllocatorSession::DoAllocate(bool disable_equivalent) ===> sequence->Start();
===> AllocationSequence::Start() ===> CreateUDPPorts(); 
===> AllocationSequence::CreateUDPPorts() ===> session_->AddAllocatedPort(port.release(), this, true);
===> BasicPortAllocatorSession::AddAllocatedPort ===> port->PrepareAddress();
===> UDPPort::PrepareAddress() ===> OnLocalAddressReady(socket_, socket_->GetLocalAddress());
===> UDPPort::OnLocalAddressReady ===> AddAddress(addr, addr, rtc::SocketAddress(), UDP_PROTOCOL_NAME, "", "",
                                                                                                             LOCAL_PORT_TYPE, ICE_TYPE_PREFERENCE_HOST, 0, "", false);
===> Port::AddAddress ===> FinishAddingAddress(c, is_final);
===> Port::FinishAddingAddress ===> SignalCandidateReady(this, c);
===> BasicPortAllocatorSession::OnCandidateReady ===> SignalCandidatesReady(this, candidates);
===> P2PTransportChannel::OnCandidatesReady ===> SignalCandidateGathered(this, candidates[i]);
===> JsepTransportController::OnTransportCandidateGathered_n ===> SignalIceCandidatesGathered(transport_name, {candidate});
===> PeerConnection::OnTransportControllerCandidatesGathered ===> OnIceCandidate(std::move(candidate)); 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值