mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[feat] use an adapter layer to convert SystemClock into webrtc Clock
This commit is contained in:
@@ -184,6 +184,7 @@ int PeerConnection::Init(PeerConnectionParams params,
|
||||
}
|
||||
};
|
||||
|
||||
clock_ = std::make_shared<SystemClock>();
|
||||
ws_transport_ = std::make_shared<WsClient>(on_receive_ws_msg_, on_ws_status_);
|
||||
uri_ = "ws://" + cfg_signal_server_ip_ + ":" + cfg_signal_server_port_;
|
||||
if (ws_transport_) {
|
||||
@@ -595,8 +596,8 @@ void PeerConnection::ProcessIceWorkMsg(const IceWorkMsg &msg) {
|
||||
|
||||
for (auto &remote_user_id : user_id_list) {
|
||||
ice_transport_list_[remote_user_id] = std::make_shared<IceTransport>(
|
||||
true, transmission_id, user_id_, remote_user_id, ws_transport_,
|
||||
on_ice_status_change_, user_data_);
|
||||
clock_, true, transmission_id, user_id_, remote_user_id,
|
||||
ws_transport_, on_ice_status_change_, user_data_);
|
||||
|
||||
ice_transport_list_[remote_user_id]->SetLocalCapabilities(
|
||||
hardware_acceleration_, trickle_ice_, reliable_ice_, enable_turn_,
|
||||
@@ -639,8 +640,8 @@ void PeerConnection::ProcessIceWorkMsg(const IceWorkMsg &msg) {
|
||||
ice_transport_list_.find(remote_user_id)) {
|
||||
// Enable TURN for answer peer by default
|
||||
ice_transport_list_[remote_user_id] = std::make_shared<IceTransport>(
|
||||
false, transmission_id, user_id_, remote_user_id, ws_transport_,
|
||||
on_ice_status_change_, user_data_);
|
||||
clock_, false, transmission_id, user_id_, remote_user_id,
|
||||
ws_transport_, on_ice_status_change_, user_data_);
|
||||
|
||||
ice_transport_list_[remote_user_id]->SetLocalCapabilities(
|
||||
hardware_acceleration_, trickle_ice_, reliable_ice_, enable_turn_,
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "audio_decoder.h"
|
||||
#include "audio_encoder.h"
|
||||
#include "clock/system_clock.h"
|
||||
#include "ice_transport.h"
|
||||
#include "video_decoder_factory.h"
|
||||
#include "video_encoder_factory.h"
|
||||
@@ -152,6 +153,7 @@ class PeerConnection {
|
||||
std::vector<int> audio_payload_types_ = {rtp::PAYLOAD_TYPE::OPUS};
|
||||
|
||||
private:
|
||||
std::shared_ptr<SystemClock> clock_ = nullptr;
|
||||
std::shared_ptr<WsClient> ws_transport_ = nullptr;
|
||||
std::function<void(const std::string &)> on_receive_ws_msg_ = nullptr;
|
||||
std::function<void(WsStatus)> on_ws_status_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user