mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[feat] introduce fraction lost into congestion control module
This commit is contained in:
72
src/channel/meida_channel/video_channel_send.h
Normal file
72
src/channel/meida_channel/video_channel_send.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2025-01-03
|
||||
* Copyright (c) 2025 by DI JUNKUN, All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _VIDEO_CHANNEL_SEND_H_
|
||||
#define _VIDEO_CHANNEL_SEND_H_
|
||||
|
||||
#include "api/transport/network_types.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "clock/system_clock.h"
|
||||
#include "congestion_control.h"
|
||||
#include "congestion_control_feedback.h"
|
||||
#include "ice_agent.h"
|
||||
#include "rtp_packetizer.h"
|
||||
#include "rtp_video_sender.h"
|
||||
#include "transport_feedback_adapter.h"
|
||||
#include "video_frame_wrapper.h"
|
||||
|
||||
class VideoChannelSend {
|
||||
public:
|
||||
VideoChannelSend();
|
||||
VideoChannelSend(std::shared_ptr<SystemClock> clock,
|
||||
std::shared_ptr<IceAgent> ice_agent,
|
||||
std::shared_ptr<IOStatistics> ice_io_statistics,
|
||||
std::function<void(const webrtc::RtpPacketToSend& packet)>
|
||||
on_sent_packet_func_);
|
||||
~VideoChannelSend();
|
||||
|
||||
public:
|
||||
void Initialize(rtp::PAYLOAD_TYPE payload_type);
|
||||
void Destroy();
|
||||
|
||||
uint32_t GetSsrc() {
|
||||
if (rtp_video_sender_) {
|
||||
return rtp_video_sender_->GetSsrc();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SendVideo(std::shared_ptr<VideoFrameWrapper> encoded_frame);
|
||||
|
||||
void OnCongestionControlFeedback(
|
||||
Timestamp recv_ts,
|
||||
const webrtc::rtcp::CongestionControlFeedback& feedback);
|
||||
|
||||
void OnReceiverReport(const ReceiverReport& receiver_report) {
|
||||
if (rtp_video_sender_) {
|
||||
rtp_video_sender_->OnReceiverReport(receiver_report);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void PostUpdates(webrtc::NetworkControlUpdate update);
|
||||
void UpdateControlState();
|
||||
void UpdateCongestedState();
|
||||
|
||||
private:
|
||||
std::shared_ptr<IceAgent> ice_agent_ = nullptr;
|
||||
std::shared_ptr<IOStatistics> ice_io_statistics_ = nullptr;
|
||||
std::unique_ptr<RtpPacketizer> rtp_packetizer_ = nullptr;
|
||||
std::unique_ptr<RtpVideoSender> rtp_video_sender_ = nullptr;
|
||||
|
||||
std::function<void(const webrtc::RtpPacketToSend& packet)>
|
||||
on_sent_packet_func_ = nullptr;
|
||||
|
||||
private:
|
||||
std::shared_ptr<SystemClock> clock_;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user