mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[feat] update congestion control feedback
This commit is contained in:
29
src/rtcp/rtp_feedback/rtp_feedback.cpp
Normal file
29
src/rtcp/rtp_feedback/rtp_feedback.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "rtp_feedback.h"
|
||||
|
||||
#include "byte_io.h"
|
||||
|
||||
// RFC 4585, Section 6.1: Feedback format.
|
||||
//
|
||||
// Common packet format:
|
||||
//
|
||||
// 0 1 2 3
|
||||
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// |V=2|P| FMT | PT | length |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// 0 | SSRC of packet sender |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// 4 | SSRC of media source |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
// : Feedback Control Information (FCI) :
|
||||
// : :
|
||||
|
||||
void RtpFeedback::ParseCommonFeedback(const uint8_t* payload) {
|
||||
SetSenderSsrc(ByteReader<uint32_t>::ReadBigEndian(&payload[0]));
|
||||
SetMediaSsrc(ByteReader<uint32_t>::ReadBigEndian(&payload[4]));
|
||||
}
|
||||
|
||||
void RtpFeedback::CreateCommonFeedback(uint8_t* payload) const {
|
||||
ByteWriter<uint32_t>::WriteBigEndian(&payload[0], sender_ssrc());
|
||||
ByteWriter<uint32_t>::WriteBigEndian(&payload[4], media_ssrc());
|
||||
}
|
||||
Reference in New Issue
Block a user