Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet.cc

Issue 1590883002: [rtp_rtcp] rtcp::Remb moved into own file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_packet.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet.cc
index eef29783714ac73cd672e57e9e133aa65820b85a..533564d277d2d30a4b2e3f8950b00b54e6feb698 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet.cc
@@ -29,10 +29,8 @@ using webrtc::RTCPUtility::PT_SR;
using webrtc::RTCPUtility::PT_XR;
using webrtc::RTCPUtility::RTCPPacketAPP;
-using webrtc::RTCPUtility::RTCPPacketPSFBAPP;
using webrtc::RTCPUtility::RTCPPacketPSFBFIR;
using webrtc::RTCPUtility::RTCPPacketPSFBFIRItem;
-using webrtc::RTCPUtility::RTCPPacketPSFBREMBItem;
using webrtc::RTCPUtility::RTCPPacketPSFBRPSI;
using webrtc::RTCPUtility::RTCPPacketReportBlockItem;
using webrtc::RTCPUtility::RTCPPacketRTPFBNACK;
@@ -63,24 +61,6 @@ void AssignUWord32(uint8_t* buffer, size_t* offset, uint32_t value) {
*offset += 4;
}
-void ComputeMantissaAnd6bitBase2Exponent(uint32_t input_base10,
- uint8_t bits_mantissa,
- uint32_t* mantissa,
- uint8_t* exp) {
- // input_base10 = mantissa * 2^exp
- assert(bits_mantissa <= 32);
- uint32_t mantissa_max = (1 << bits_mantissa) - 1;
- uint8_t exponent = 0;
- for (uint32_t i = 0; i < 64; ++i) {
- if (input_base10 <= (mantissa_max << i)) {
- exponent = i;
- break;
- }
- }
- *exp = exponent;
- *mantissa = (input_base10 >> exponent);
-}
-
// Sender report (SR) (RFC 3550).
// 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
@@ -230,48 +210,6 @@ void CreateFir(const RTCPPacketPSFBFIR& fir,
AssignUWord24(buffer, pos, 0);
}
-// Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb).
-//
-// 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=15 | PT=206 | length |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | SSRC of packet sender |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | SSRC of media source |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | Unique identifier 'R' 'E' 'M' 'B' |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | Num SSRC | BR Exp | BR Mantissa |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | SSRC feedback |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | ... |
-
-void CreateRemb(const RTCPPacketPSFBAPP& remb,
- const RTCPPacketPSFBREMBItem& remb_item,
- uint8_t* buffer,
- size_t* pos) {
- uint32_t mantissa = 0;
- uint8_t exp = 0;
- ComputeMantissaAnd6bitBase2Exponent(remb_item.BitRate, 18, &mantissa, &exp);
-
- AssignUWord32(buffer, pos, remb.SenderSSRC);
- AssignUWord32(buffer, pos, kUnusedMediaSourceSsrc0);
- AssignUWord8(buffer, pos, 'R');
- AssignUWord8(buffer, pos, 'E');
- AssignUWord8(buffer, pos, 'M');
- AssignUWord8(buffer, pos, 'B');
- AssignUWord8(buffer, pos, remb_item.NumberOfSSRCs);
- AssignUWord8(buffer, pos, (exp << 2) + ((mantissa >> 16) & 0x03));
- AssignUWord8(buffer, pos, mantissa >> 8);
- AssignUWord8(buffer, pos, mantissa);
- for (uint8_t i = 0; i < remb_item.NumberOfSSRCs; ++i) {
- AssignUWord32(buffer, pos, remb_item.SSRCs[i]);
- }
-}
-
// From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR).
//
// Format for XR packets:
@@ -513,28 +451,6 @@ bool Fir::Create(uint8_t* packet,
return true;
}
-bool Remb::Create(uint8_t* packet,
- size_t* index,
- size_t max_length,
- RtcpPacket::PacketReadyCallback* callback) const {
- while (*index + BlockLength() > max_length) {
- if (!OnBufferFull(packet, index, callback))
- return false;
- }
- const uint8_t kFmt = 15;
- CreateHeader(kFmt, PT_PSFB, HeaderLength(), packet, index);
- CreateRemb(remb_, remb_item_, packet, index);
- return true;
-}
-
-void Remb::AppliesTo(uint32_t ssrc) {
- if (remb_item_.NumberOfSSRCs >= kMaxNumberOfSsrcs) {
- LOG(LS_WARNING) << "Max number of REMB feedback SSRCs reached.";
- return;
- }
- remb_item_.SSRCs[remb_item_.NumberOfSSRCs++] = ssrc;
-}
-
bool Xr::Create(uint8_t* packet,
size_t* index,
size_t max_length,
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698