[feat] enable congestion controller

This commit is contained in:
dijunkun
2025-02-07 17:42:05 +08:00
parent 316a0220a8
commit 8d7068aa32
32 changed files with 184 additions and 46 deletions

View File

@@ -25,7 +25,8 @@ IceTransport::IceTransport(
remote_user_id_(remote_user_id),
ice_ws_transport_(ice_ws_transmission),
on_ice_status_change_(on_ice_status_change),
user_data_(user_data) {}
user_data_(user_data),
clock_(webrtc::Clock::GetRealTimeClockShared()) {}
IceTransport::~IceTransport() {
user_data_ = nullptr;
@@ -119,8 +120,8 @@ void IceTransport::InitializeChannels(
rtp::PAYLOAD_TYPE video_codec_payload_type) {
video_codec_payload_type_ = video_codec_payload_type;
video_channel_send_ =
std::make_unique<VideoChannelSend>(ice_agent_, ice_io_statistics_);
video_channel_send_ = std::make_unique<VideoChannelSend>(clock_, ice_agent_,
ice_io_statistics_);
audio_channel_send_ =
std::make_unique<AudioChannelSend>(ice_agent_, ice_io_statistics_);
data_channel_send_ =
@@ -132,7 +133,7 @@ void IceTransport::InitializeChannels(
std::weak_ptr<IceTransport> weak_self = shared_from_this();
video_channel_receive_ = std::make_unique<VideoChannelReceive>(
ice_agent_, ice_io_statistics_,
clock_, ice_agent_, ice_io_statistics_,
[this, weak_self](VideoFrame &video_frame) {
if (auto self = weak_self.lock()) {
OnReceiveCompleteFrame(video_frame);

View File

@@ -14,6 +14,7 @@
// #include "congestion_control.h"
#include "audio_channel_receive.h"
#include "audio_channel_send.h"
#include "clock.h"
#include "data_channel_receive.h"
#include "data_channel_send.h"
#include "ice_agent.h"
@@ -219,6 +220,7 @@ class IceTransport : public std::enable_shared_from_this<IceTransport> {
on_receive_net_status_report_ = nullptr;
private:
std::shared_ptr<webrtc::Clock> clock_;
std::unique_ptr<VideoChannelSend> video_channel_send_ = nullptr;
std::unique_ptr<VideoChannelReceive> video_channel_receive_ = nullptr;
std::unique_ptr<AudioChannelSend> audio_channel_send_ = nullptr;