[feat] use VideoFrameWrapper to store frame info

This commit is contained in:
dijunkun
2025-02-21 16:13:31 +08:00
parent f797cc3f91
commit a39d0f6652
15 changed files with 150 additions and 55 deletions

View File

@@ -57,10 +57,12 @@ void VideoChannelSend::Destroy() {
}
}
int VideoChannelSend::SendVideo(char* data, size_t size) {
int VideoChannelSend::SendVideo(
std::shared_ptr<VideoFrameWrapper> encoded_frame) {
if (rtp_video_sender_ && rtp_packetizer_) {
std::vector<std::shared_ptr<RtpPacket>> rtp_packets =
rtp_packetizer_->Build((uint8_t*)data, (uint32_t)size, true);
rtp_packetizer_->Build((uint8_t*)encoded_frame->Buffer(),
(uint32_t)encoded_frame->Size(), true);
rtp_video_sender_->Enqueue(rtp_packets);
}

View File

@@ -16,6 +16,7 @@
#include "rtp_packetizer.h"
#include "rtp_video_sender.h"
#include "transport_feedback_adapter.h"
#include "video_frame_wrapper.h"
class VideoChannelSend {
public:
@@ -31,7 +32,7 @@ class VideoChannelSend {
void Initialize(rtp::PAYLOAD_TYPE payload_type);
void Destroy();
int SendVideo(char* data, size_t size);
int SendVideo(std::shared_ptr<VideoFrameWrapper> encoded_frame);
void OnCongestionControlFeedback(
Timestamp recv_ts,