Android-cuttlefish cvd tool
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
cuttlefish::webrtc_streaming::ConnectionController Class Reference

#include <connection_controller.h>

Inheritance diagram for cuttlefish::webrtc_streaming::ConnectionController:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::webrtc_streaming::ConnectionController:
Collaboration graph
[legend]

Classes

class  Observer
 

Public Member Functions

 ConnectionController (PeerSignalingHandler &sig_handler, PeerConnectionBuilder &connection_builder, Observer &observer)
 
 ~ConnectionController () override=default
 
Result< void > RequestOffer (const std::vector< webrtc::PeerConnectionInterface::IceServer > &ice_servers)
 
void HandleSignalingMessage (const Json::Value &msg)
 
rtc::scoped_refptr< webrtc::PeerConnectionInterface > peer_connection ()
 
void OnSignalingChange (webrtc::PeerConnectionInterface::SignalingState new_state) override
 
void OnAddStream (rtc::scoped_refptr< webrtc::MediaStreamInterface > stream) override
 
void OnRemoveStream (rtc::scoped_refptr< webrtc::MediaStreamInterface > stream) override
 
void OnDataChannel (rtc::scoped_refptr< webrtc::DataChannelInterface > data_channel) override
 
void OnRenegotiationNeeded () override
 
void OnStandardizedIceConnectionChange (webrtc::PeerConnectionInterface::IceConnectionState new_state) override
 
void OnConnectionChange (webrtc::PeerConnectionInterface::PeerConnectionState new_state) override
 
void OnIceGatheringChange (webrtc::PeerConnectionInterface::IceGatheringState new_state) override
 
void OnIceCandidate (const webrtc::IceCandidateInterface *candidate) override
 
void OnIceCandidateError (const std::string &address, int port, const std::string &url, int error_code, const std::string &error_text) override
 
void OnIceCandidatesRemoved (const std::vector< cricket::Candidate > &candidates) override
 
void OnTrack (rtc::scoped_refptr< webrtc::RtpTransceiverInterface > transceiver) override
 
void OnRemoveTrack (rtc::scoped_refptr< webrtc::RtpReceiverInterface > receiver) override
 

Private Member Functions

void CreateOffer ()
 
void AddPendingIceCandidates ()
 
void FailConnection (const std::string &message)
 
Result< void > HandleSignalingMessageInner (const Json::Value &message)
 
Result< void > OnOfferRequestMsg (const std::vector< webrtc::PeerConnectionInterface::IceServer > &ice_servers)
 
Result< void > OnOfferMsg (std::unique_ptr< webrtc::SessionDescriptionInterface > offer)
 
Result< void > OnAnswerMsg (std::unique_ptr< webrtc::SessionDescriptionInterface > answer)
 
Result< void > OnIceCandidateMsg (std::unique_ptr< webrtc::IceCandidateInterface > ice_candidate)
 
Result< void > OnErrorMsg (const std::string &msg)
 
webrtc::CreateSessionDescriptionObserver * ThisAsCreateSDPObserver ()
 
webrtc::SetSessionDescriptionObserver * ThisAsSetSDPObserver ()
 
rtc::scoped_refptr< webrtc::SetRemoteDescriptionObserverInterface > ThisAsSetRemoteSDPObserver ()
 
Result< void > OnCreateSDPSuccess (webrtc::SessionDescriptionInterface *desc)
 
void OnCreateSDPFailure (const webrtc::RTCError &error)
 
void OnSetLocalDescriptionSuccess ()
 
void OnSetLocalDescriptionFailure (const webrtc::RTCError &error)
 
void OnSetRemoteDescriptionComplete (const webrtc::RTCError &error)
 

Private Attributes

PeerSignalingHandlersig_handler_
 
PeerConnectionBuilderconnection_builder_
 
Observerobserver_
 
rtc::scoped_refptr< webrtc::PeerConnectionInterface > peer_connection_
 
std::vector< std::unique_ptr< webrtc::IceCandidateInterface > > pending_ice_candidates_
 
std::mutex status_mtx_
 
std::condition_variable status_cond_var_
 
Result< webrtc::PeerConnectionInterface::PeerConnectionState > connection_status_
 

Friends

class CreateSessionDescriptionObserverIntermediate
 
class SetSessionDescriptionObserverIntermediate
 
class SetRemoteDescriptionObserverIntermediate
 

Constructor & Destructor Documentation

◆ ConnectionController()

cuttlefish::webrtc_streaming::ConnectionController::ConnectionController ( PeerSignalingHandler sig_handler,
PeerConnectionBuilder connection_builder,
ConnectionController::Observer observer 
)

◆ ~ConnectionController()

cuttlefish::webrtc_streaming::ConnectionController::~ConnectionController ( )
overridedefault

Member Function Documentation

◆ AddPendingIceCandidates()

void cuttlefish::webrtc_streaming::ConnectionController::AddPendingIceCandidates ( )
private

◆ CreateOffer()

void cuttlefish::webrtc_streaming::ConnectionController::CreateOffer ( )
private

◆ FailConnection()

void cuttlefish::webrtc_streaming::ConnectionController::FailConnection ( const std::string &  message)
private

◆ HandleSignalingMessage()

void cuttlefish::webrtc_streaming::ConnectionController::HandleSignalingMessage ( const Json::Value &  msg)

◆ HandleSignalingMessageInner()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::HandleSignalingMessageInner ( const Json::Value &  message)
private

◆ OnAddStream()

void cuttlefish::webrtc_streaming::ConnectionController::OnAddStream ( rtc::scoped_refptr< webrtc::MediaStreamInterface >  stream)
override

◆ OnAnswerMsg()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::OnAnswerMsg ( std::unique_ptr< webrtc::SessionDescriptionInterface >  answer)
private

◆ OnConnectionChange()

void cuttlefish::webrtc_streaming::ConnectionController::OnConnectionChange ( webrtc::PeerConnectionInterface::PeerConnectionState  new_state)
override

◆ OnCreateSDPFailure()

void cuttlefish::webrtc_streaming::ConnectionController::OnCreateSDPFailure ( const webrtc::RTCError &  error)
private

◆ OnCreateSDPSuccess()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::OnCreateSDPSuccess ( webrtc::SessionDescriptionInterface *  desc)
private

◆ OnDataChannel()

void cuttlefish::webrtc_streaming::ConnectionController::OnDataChannel ( rtc::scoped_refptr< webrtc::DataChannelInterface >  data_channel)
override

◆ OnErrorMsg()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::OnErrorMsg ( const std::string &  msg)
private

◆ OnIceCandidate()

void cuttlefish::webrtc_streaming::ConnectionController::OnIceCandidate ( const webrtc::IceCandidateInterface *  candidate)
override

◆ OnIceCandidateError()

void cuttlefish::webrtc_streaming::ConnectionController::OnIceCandidateError ( const std::string &  address,
int  port,
const std::string &  url,
int  error_code,
const std::string &  error_text 
)
override

◆ OnIceCandidateMsg()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::OnIceCandidateMsg ( std::unique_ptr< webrtc::IceCandidateInterface >  ice_candidate)
private

◆ OnIceCandidatesRemoved()

void cuttlefish::webrtc_streaming::ConnectionController::OnIceCandidatesRemoved ( const std::vector< cricket::Candidate > &  candidates)
override

◆ OnIceGatheringChange()

void cuttlefish::webrtc_streaming::ConnectionController::OnIceGatheringChange ( webrtc::PeerConnectionInterface::IceGatheringState  new_state)
override

◆ OnOfferMsg()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::OnOfferMsg ( std::unique_ptr< webrtc::SessionDescriptionInterface >  offer)
private

◆ OnOfferRequestMsg()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::OnOfferRequestMsg ( const std::vector< webrtc::PeerConnectionInterface::IceServer > &  ice_servers)
private

◆ OnRemoveStream()

void cuttlefish::webrtc_streaming::ConnectionController::OnRemoveStream ( rtc::scoped_refptr< webrtc::MediaStreamInterface >  stream)
override

◆ OnRemoveTrack()

void cuttlefish::webrtc_streaming::ConnectionController::OnRemoveTrack ( rtc::scoped_refptr< webrtc::RtpReceiverInterface >  receiver)
override

◆ OnRenegotiationNeeded()

void cuttlefish::webrtc_streaming::ConnectionController::OnRenegotiationNeeded ( )
override

◆ OnSetLocalDescriptionFailure()

void cuttlefish::webrtc_streaming::ConnectionController::OnSetLocalDescriptionFailure ( const webrtc::RTCError &  error)
private

◆ OnSetLocalDescriptionSuccess()

void cuttlefish::webrtc_streaming::ConnectionController::OnSetLocalDescriptionSuccess ( )
private

◆ OnSetRemoteDescriptionComplete()

void cuttlefish::webrtc_streaming::ConnectionController::OnSetRemoteDescriptionComplete ( const webrtc::RTCError &  error)
private

◆ OnSignalingChange()

void cuttlefish::webrtc_streaming::ConnectionController::OnSignalingChange ( webrtc::PeerConnectionInterface::SignalingState  new_state)
override

◆ OnStandardizedIceConnectionChange()

void cuttlefish::webrtc_streaming::ConnectionController::OnStandardizedIceConnectionChange ( webrtc::PeerConnectionInterface::IceConnectionState  new_state)
override

◆ OnTrack()

void cuttlefish::webrtc_streaming::ConnectionController::OnTrack ( rtc::scoped_refptr< webrtc::RtpTransceiverInterface >  transceiver)
override

◆ peer_connection()

rtc::scoped_refptr< webrtc::PeerConnectionInterface > cuttlefish::webrtc_streaming::ConnectionController::peer_connection ( )
inline

◆ RequestOffer()

Result< void > cuttlefish::webrtc_streaming::ConnectionController::RequestOffer ( const std::vector< webrtc::PeerConnectionInterface::IceServer > &  ice_servers)

◆ ThisAsCreateSDPObserver()

webrtc::CreateSessionDescriptionObserver * cuttlefish::webrtc_streaming::ConnectionController::ThisAsCreateSDPObserver ( )
private

◆ ThisAsSetRemoteSDPObserver()

rtc::scoped_refptr< webrtc::SetRemoteDescriptionObserverInterface > cuttlefish::webrtc_streaming::ConnectionController::ThisAsSetRemoteSDPObserver ( )
private

◆ ThisAsSetSDPObserver()

webrtc::SetSessionDescriptionObserver * cuttlefish::webrtc_streaming::ConnectionController::ThisAsSetSDPObserver ( )
private

Friends And Related Function Documentation

◆ CreateSessionDescriptionObserverIntermediate

◆ SetRemoteDescriptionObserverIntermediate

◆ SetSessionDescriptionObserverIntermediate

Member Data Documentation

◆ connection_builder_

PeerConnectionBuilder& cuttlefish::webrtc_streaming::ConnectionController::connection_builder_
private

◆ connection_status_

Result<webrtc::PeerConnectionInterface::PeerConnectionState> cuttlefish::webrtc_streaming::ConnectionController::connection_status_
private

◆ observer_

Observer& cuttlefish::webrtc_streaming::ConnectionController::observer_
private

◆ peer_connection_

rtc::scoped_refptr<webrtc::PeerConnectionInterface> cuttlefish::webrtc_streaming::ConnectionController::peer_connection_
private

◆ pending_ice_candidates_

std::vector<std::unique_ptr<webrtc::IceCandidateInterface> > cuttlefish::webrtc_streaming::ConnectionController::pending_ice_candidates_
private

◆ sig_handler_

PeerSignalingHandler& cuttlefish::webrtc_streaming::ConnectionController::sig_handler_
private

◆ status_cond_var_

std::condition_variable cuttlefish::webrtc_streaming::ConnectionController::status_cond_var_
private

◆ status_mtx_

std::mutex cuttlefish::webrtc_streaming::ConnectionController::status_mtx_
private

The documentation for this class was generated from the following files: