Move kFeedbackMessageType from Remb to Psfb

The FMT 15 is not specific only to REMB or loss notification messages.
Rather, it is the Application Layer FB (AFB) of Psfb (Payload Specific
Feedback Messages).
See https://tools.ietf.org/html/rfc4585#section-6.3

TBR=terelius@webrtc.org

Bug: webrtc:10336
Change-Id: I8cd27ef9ee044bf7b7e7c1bd1a53c1dae2d95006
Reviewed-on: https://webrtc-review.googlesource.com/c/123886
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26827}
This commit is contained in:
Elad Alon
2019-02-23 22:16:52 +01:00
committed by Commit Bot
parent 56973e627e
commit 74f0a51f97
9 changed files with 11 additions and 11 deletions

View File

@ -855,7 +855,7 @@ void StoreRtcpBlocks(
pli_list->push_back(std::move(parsed_block)); pli_list->push_back(std::move(parsed_block));
} }
} else if (header.type() == rtcp::Remb::kPacketType && } else if (header.type() == rtcp::Remb::kPacketType &&
header.fmt() == rtcp::Remb::kFeedbackMessageType) { header.fmt() == rtcp::Psfb::kAfbMessageType) {
bool type_found = false; bool type_found = false;
if (!type_found) { if (!type_found) {
LoggedRtcpPacketRemb parsed_block; LoggedRtcpPacketRemb parsed_block;

View File

@ -17,7 +17,6 @@
namespace webrtc { namespace webrtc {
namespace rtcp { namespace rtcp {
constexpr uint8_t LossNotification::kFeedbackMessageType;
// Loss Notification // Loss Notification
// ----------------- // -----------------
@ -58,7 +57,7 @@ bool LossNotification::Create(uint8_t* packet,
const size_t index_end = *index + BlockLength(); const size_t index_end = *index + BlockLength();
// Note: |index| updated by the function below. // Note: |index| updated by the function below.
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet, CreateHeader(Psfb::kAfbMessageType, kPacketType, HeaderLength(), packet,
index); index);
CreateCommonFeedback(packet + *index); CreateCommonFeedback(packet + *index);
@ -85,7 +84,7 @@ bool LossNotification::Create(uint8_t* packet,
bool LossNotification::Parse(const CommonHeader& packet) { bool LossNotification::Parse(const CommonHeader& packet) {
RTC_DCHECK_EQ(packet.type(), kPacketType); RTC_DCHECK_EQ(packet.type(), kPacketType);
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType); RTC_DCHECK_EQ(packet.fmt(), Psfb::kAfbMessageType);
if (packet.payload_size_bytes() < if (packet.payload_size_bytes() <
kCommonFeedbackLength + kLossNotificationPayloadLength) { kCommonFeedbackLength + kLossNotificationPayloadLength) {

View File

@ -20,8 +20,6 @@ namespace rtcp {
class LossNotification : public Psfb { class LossNotification : public Psfb {
public: public:
static constexpr uint8_t kFeedbackMessageType = 15;
LossNotification(); LossNotification();
LossNotification(const LossNotification& other); LossNotification(const LossNotification& other);
~LossNotification() override; ~LossNotification() override;

View File

@ -15,6 +15,7 @@
namespace webrtc { namespace webrtc {
namespace rtcp { namespace rtcp {
constexpr uint8_t Psfb::kPacketType; constexpr uint8_t Psfb::kPacketType;
constexpr uint8_t Psfb::kAfbMessageType;
constexpr size_t Psfb::kCommonFeedbackLength; constexpr size_t Psfb::kCommonFeedbackLength;
// RFC 4585: Feedback format. // RFC 4585: Feedback format.
// //

View File

@ -25,6 +25,7 @@ namespace rtcp {
class Psfb : public RtcpPacket { class Psfb : public RtcpPacket {
public: public:
static constexpr uint8_t kPacketType = 206; static constexpr uint8_t kPacketType = 206;
static constexpr uint8_t kAfbMessageType = 15;
Psfb() : sender_ssrc_(0), media_ssrc_(0) {} Psfb() : sender_ssrc_(0), media_ssrc_(0) {}
~Psfb() override {} ~Psfb() override {}

View File

@ -20,6 +20,7 @@
namespace webrtc { namespace webrtc {
namespace rtcp { namespace rtcp {
// TODO(bugs.webrtc.org/10353): Remove once dependencies are updated.
constexpr uint8_t Remb::kFeedbackMessageType; constexpr uint8_t Remb::kFeedbackMessageType;
// Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb).
// //
@ -48,7 +49,7 @@ Remb::~Remb() = default;
bool Remb::Parse(const CommonHeader& packet) { bool Remb::Parse(const CommonHeader& packet) {
RTC_DCHECK(packet.type() == kPacketType); RTC_DCHECK(packet.type() == kPacketType);
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType); RTC_DCHECK_EQ(packet.fmt(), Psfb::kAfbMessageType);
if (packet.payload_size_bytes() < 16) { if (packet.payload_size_bytes() < 16) {
RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes() RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
@ -112,7 +113,7 @@ bool Remb::Create(uint8_t* packet,
return false; return false;
} }
size_t index_end = *index + BlockLength(); size_t index_end = *index + BlockLength();
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet, CreateHeader(Psfb::kAfbMessageType, kPacketType, HeaderLength(), packet,
index); index);
RTC_DCHECK_EQ(0, Psfb::media_ssrc()); RTC_DCHECK_EQ(0, Psfb::media_ssrc());
CreateCommonFeedback(packet + *index); CreateCommonFeedback(packet + *index);

View File

@ -22,7 +22,7 @@ class CommonHeader;
// Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb).
class Remb : public Psfb { class Remb : public Psfb {
public: public:
static constexpr uint8_t kFeedbackMessageType = 15; static constexpr uint8_t kFeedbackMessageType = Psfb::kAfbMessageType;
static constexpr size_t kMaxNumberOfSsrcs = 0xff; static constexpr size_t kMaxNumberOfSsrcs = 0xff;
Remb(); Remb();

View File

@ -379,7 +379,7 @@ bool RTCPReceiver::ParseCompoundPacket(const uint8_t* packet_begin,
case rtcp::Fir::kFeedbackMessageType: case rtcp::Fir::kFeedbackMessageType:
HandleFir(rtcp_block, packet_information); HandleFir(rtcp_block, packet_information);
break; break;
case rtcp::Remb::kFeedbackMessageType: case rtcp::Psfb::kAfbMessageType:
HandlePsfbApp(rtcp_block, packet_information); HandlePsfbApp(rtcp_block, packet_information);
break; break;
default: default:

View File

@ -55,7 +55,7 @@ bool RtcpPacketParser::Parse(const void* data, size_t length) {
case rtcp::Pli::kFeedbackMessageType: case rtcp::Pli::kFeedbackMessageType:
pli_.Parse(header, &sender_ssrc_); pli_.Parse(header, &sender_ssrc_);
break; break;
case rtcp::Remb::kFeedbackMessageType: case rtcp::Psfb::kAfbMessageType:
remb_.Parse(header, &sender_ssrc_); remb_.Parse(header, &sender_ssrc_);
break; break;
default: default: