Cleanup static constants in modules/rtp_rtcp/
Change static const to static constexpr where applicable In .cc files ensure static constants are in unnamed namespace Remove obsolete declaration for class level constexpr values Bug: None Change-Id: I23759974b5042c8c9d9ec2816ee7df283a8872d4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364483 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Emil Lundmark <lndmrk@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43171}
This commit is contained in:
parent
ca3ac5fe64
commit
d9b04adbdb
@ -16,11 +16,14 @@
|
|||||||
|
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
namespace {
|
||||||
|
|
||||||
// After this many packets are added, adding additional packets will cause the
|
// After this many packets are added, adding additional packets will cause the
|
||||||
// oldest packets to be pruned from the buffer.
|
// oldest packets to be pruned from the buffer.
|
||||||
static const int kBufferSize = 100;
|
constexpr int kBufferSize = 100;
|
||||||
|
|
||||||
namespace webrtc {
|
} // namespace
|
||||||
|
|
||||||
PacketLossStats::PacketLossStats()
|
PacketLossStats::PacketLossStats()
|
||||||
: single_loss_historic_count_(0),
|
: single_loss_historic_count_(0),
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr size_t RtcpPacket::kHeaderLength;
|
|
||||||
|
|
||||||
rtc::Buffer RtcpPacket::Build() const {
|
rtc::Buffer RtcpPacket::Build() const {
|
||||||
rtc::Buffer packet(BlockLength());
|
rtc::Buffer packet(BlockLength());
|
||||||
|
|||||||
@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t App::kPacketType;
|
|
||||||
constexpr size_t App::kMaxDataSize;
|
|
||||||
// Application-Defined packet (APP) (RFC 3550).
|
// Application-Defined packet (APP) (RFC 3550).
|
||||||
//
|
//
|
||||||
// 0 1 2 3
|
// 0 1 2 3
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Bye::kPacketType;
|
|
||||||
// Bye packet (BYE) (RFC 3550).
|
// Bye packet (BYE) (RFC 3550).
|
||||||
//
|
//
|
||||||
// 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
|
// 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
|
||||||
|
|||||||
@ -46,7 +46,8 @@ class Bye : public RtcpPacket {
|
|||||||
PacketReadyCallback callback) const override;
|
PacketReadyCallback callback) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int kMaxNumberOfCsrcs = 0x1f - 1; // First item is sender SSRC.
|
static constexpr int kMaxNumberOfCsrcs =
|
||||||
|
0x1f - 1; // First item is sender SSRC.
|
||||||
|
|
||||||
std::vector<uint32_t> csrcs_;
|
std::vector<uint32_t> csrcs_;
|
||||||
std::string reason_;
|
std::string reason_;
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr size_t CommonHeader::kHeaderSizeBytes;
|
|
||||||
// 0 1 1 2 3
|
// 0 1 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
|
// 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
|
||||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
|||||||
@ -42,7 +42,7 @@ inline bool operator!=(const ReceiveTimeInfo& lhs, const ReceiveTimeInfo& rhs) {
|
|||||||
// DLRR Report Block: Delay since the Last Receiver Report (RFC 3611).
|
// DLRR Report Block: Delay since the Last Receiver Report (RFC 3611).
|
||||||
class Dlrr {
|
class Dlrr {
|
||||||
public:
|
public:
|
||||||
static const uint8_t kBlockType = 5;
|
static constexpr uint8_t kBlockType = 5;
|
||||||
|
|
||||||
Dlrr();
|
Dlrr();
|
||||||
Dlrr(const Dlrr& other);
|
Dlrr(const Dlrr& other);
|
||||||
@ -70,8 +70,8 @@ class Dlrr {
|
|||||||
const std::vector<ReceiveTimeInfo>& sub_blocks() const { return sub_blocks_; }
|
const std::vector<ReceiveTimeInfo>& sub_blocks() const { return sub_blocks_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const size_t kBlockHeaderLength = 4;
|
static constexpr size_t kBlockHeaderLength = 4;
|
||||||
static const size_t kSubBlockLength = 12;
|
static constexpr size_t kSubBlockLength = 12;
|
||||||
|
|
||||||
std::vector<ReceiveTimeInfo> sub_blocks_;
|
std::vector<ReceiveTimeInfo> sub_blocks_;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t ExtendedReports::kPacketType;
|
|
||||||
constexpr size_t ExtendedReports::kMaxNumberOfDlrrItems;
|
|
||||||
// From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR).
|
// From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR).
|
||||||
//
|
//
|
||||||
// Format for XR packets:
|
// Format for XR packets:
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Fir::kFeedbackMessageType;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
//
|
//
|
||||||
|
|||||||
@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Nack::kFeedbackMessageType;
|
|
||||||
constexpr size_t Nack::kNackItemLength;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
//
|
//
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Pli::kFeedbackMessageType;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
//
|
//
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
|
|||||||
@ -14,9 +14,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Psfb::kPacketType;
|
|
||||||
constexpr uint8_t Psfb::kAfbMessageType;
|
|
||||||
constexpr size_t Psfb::kCommonFeedbackLength;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
//
|
//
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t RapidResyncRequest::kFeedbackMessageType;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
// Rapid Resynchronisation Request (draft-perkins-avt-rapid-rtp-sync-03).
|
// Rapid Resynchronisation Request (draft-perkins-avt-rapid-rtp-sync-03).
|
||||||
//
|
//
|
||||||
|
|||||||
@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t ReceiverReport::kPacketType;
|
|
||||||
constexpr size_t ReceiverReport::kMaxNumberOfReportBlocks;
|
|
||||||
// RTCP receiver report (RFC 3550).
|
// RTCP receiver report (RFC 3550).
|
||||||
//
|
//
|
||||||
// 0 1 2 3
|
// 0 1 2 3
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class ReceiverReport : public RtcpPacket {
|
|||||||
PacketReadyCallback callback) const override;
|
PacketReadyCallback callback) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const size_t kRrBaseLength = 4;
|
static constexpr size_t kRrBaseLength = 4;
|
||||||
|
|
||||||
std::vector<ReportBlock> report_blocks_;
|
std::vector<ReportBlock> report_blocks_;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -22,7 +22,7 @@ namespace rtcp {
|
|||||||
// RFC 3550 section 6.4.1.
|
// RFC 3550 section 6.4.1.
|
||||||
class ReportBlock {
|
class ReportBlock {
|
||||||
public:
|
public:
|
||||||
static const size_t kLength = 24;
|
static constexpr size_t kLength = 24;
|
||||||
|
|
||||||
ReportBlock();
|
ReportBlock();
|
||||||
~ReportBlock() {}
|
~ReportBlock() {}
|
||||||
|
|||||||
@ -22,9 +22,9 @@ namespace rtcp {
|
|||||||
|
|
||||||
class Rrtr {
|
class Rrtr {
|
||||||
public:
|
public:
|
||||||
static const uint8_t kBlockType = 4;
|
static constexpr uint8_t kBlockType = 4;
|
||||||
static const uint16_t kBlockLength = 2;
|
static constexpr uint16_t kBlockLength = 2;
|
||||||
static const size_t kLength = 4 * (kBlockLength + 1); // 12
|
static constexpr size_t kLength = 4 * (kBlockLength + 1); // 12
|
||||||
|
|
||||||
Rrtr() {}
|
Rrtr() {}
|
||||||
Rrtr(const Rrtr&) = default;
|
Rrtr(const Rrtr&) = default;
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Rtpfb::kPacketType;
|
|
||||||
// RFC 4585, Section 6.1: Feedback format.
|
// RFC 4585, Section 6.1: Feedback format.
|
||||||
//
|
//
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
|
|||||||
@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Sdes::kPacketType;
|
|
||||||
constexpr size_t Sdes::kMaxNumberOfChunks;
|
|
||||||
// Source Description (SDES) (RFC 3550).
|
// Source Description (SDES) (RFC 3550).
|
||||||
//
|
//
|
||||||
// 0 1 2 3
|
// 0 1 2 3
|
||||||
|
|||||||
@ -19,9 +19,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t SenderReport::kPacketType;
|
|
||||||
constexpr size_t SenderReport::kMaxNumberOfReportBlocks;
|
|
||||||
constexpr size_t SenderReport::kSenderBaseLength;
|
|
||||||
// Sender report (SR) (RFC 3550).
|
// Sender report (SR) (RFC 3550).
|
||||||
// 0 1 2 3
|
// 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
|
// 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
|
||||||
|
|||||||
@ -16,9 +16,11 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
|
namespace {
|
||||||
|
|
||||||
constexpr size_t kTargetBitrateHeaderSizeBytes = 4;
|
constexpr size_t kTargetBitrateHeaderSizeBytes = 4;
|
||||||
constexpr uint8_t TargetBitrate::kBlockType;
|
|
||||||
const size_t TargetBitrate::kBitrateItemSizeBytes = 4;
|
} // namespace
|
||||||
|
|
||||||
TargetBitrate::BitrateItem::BitrateItem()
|
TargetBitrate::BitrateItem::BitrateItem()
|
||||||
: spatial_layer(0), temporal_layer(0), target_bitrate_kbps(0) {}
|
: spatial_layer(0), temporal_layer(0), target_bitrate_kbps(0) {}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class TargetBitrate {
|
|||||||
// TODO(sprang): This block type is just a place holder. We need to get an
|
// TODO(sprang): This block type is just a place holder. We need to get an
|
||||||
// id assigned by IANA.
|
// id assigned by IANA.
|
||||||
static constexpr uint8_t kBlockType = 42;
|
static constexpr uint8_t kBlockType = 42;
|
||||||
static const size_t kBitrateItemSizeBytes;
|
static constexpr size_t kBitrateItemSizeBytes = 4;
|
||||||
|
|
||||||
struct BitrateItem {
|
struct BitrateItem {
|
||||||
BitrateItem();
|
BitrateItem();
|
||||||
|
|||||||
@ -21,7 +21,7 @@ namespace rtcp {
|
|||||||
// Used both by TMMBR and TMMBN rtcp packets.
|
// Used both by TMMBR and TMMBN rtcp packets.
|
||||||
class TmmbItem {
|
class TmmbItem {
|
||||||
public:
|
public:
|
||||||
static const size_t kLength = 8;
|
static constexpr size_t kLength = 8;
|
||||||
|
|
||||||
TmmbItem() : ssrc_(0), bitrate_bps_(0), packet_overhead_(0) {}
|
TmmbItem() : ssrc_(0), bitrate_bps_(0), packet_overhead_(0) {}
|
||||||
TmmbItem(uint32_t ssrc, uint64_t bitrate_bps, uint16_t overhead);
|
TmmbItem(uint32_t ssrc, uint64_t bitrate_bps, uint16_t overhead);
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Tmmbn::kFeedbackMessageType;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
//
|
//
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace rtcp {
|
namespace rtcp {
|
||||||
constexpr uint8_t Tmmbr::kFeedbackMessageType;
|
|
||||||
// RFC 4585: Feedback format.
|
// RFC 4585: Feedback format.
|
||||||
// Common packet format:
|
// Common packet format:
|
||||||
//
|
//
|
||||||
|
|||||||
@ -73,13 +73,6 @@ constexpr TimeDelta kTimeWrapPeriod = kBaseTimeTick * (1 << 24);
|
|||||||
// | recv delta | recv delta | zero padding |
|
// | recv delta | recv delta | zero padding |
|
||||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
} // namespace
|
} // namespace
|
||||||
constexpr uint8_t TransportFeedback::kFeedbackMessageType;
|
|
||||||
constexpr size_t TransportFeedback::kMaxReportedPackets;
|
|
||||||
|
|
||||||
constexpr size_t TransportFeedback::LastChunk::kMaxRunLengthCapacity;
|
|
||||||
constexpr size_t TransportFeedback::LastChunk::kMaxOneBitCapacity;
|
|
||||||
constexpr size_t TransportFeedback::LastChunk::kMaxTwoBitCapacity;
|
|
||||||
constexpr size_t TransportFeedback::LastChunk::kMaxVectorCapacity;
|
|
||||||
|
|
||||||
TransportFeedback::LastChunk::LastChunk() {
|
TransportFeedback::LastChunk::LastChunk() {
|
||||||
Clear();
|
Clear();
|
||||||
|
|||||||
@ -107,8 +107,6 @@ bool ResetTimestampIfExpired(const Timestamp now,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
constexpr size_t RTCPReceiver::RegisteredSsrcs::kMediaSsrcIndex;
|
|
||||||
|
|
||||||
RTCPReceiver::RegisteredSsrcs::RegisteredSsrcs(
|
RTCPReceiver::RegisteredSsrcs::RegisteredSsrcs(
|
||||||
bool disable_sequence_checker,
|
bool disable_sequence_checker,
|
||||||
const RtpRtcpInterface::Configuration& config)
|
const RtpRtcpInterface::Configuration& config)
|
||||||
|
|||||||
@ -49,6 +49,9 @@
|
|||||||
#include "test/mock_transport.h"
|
#include "test/mock_transport.h"
|
||||||
#include "test/rtcp_packet_parser.h"
|
#include "test/rtcp_packet_parser.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
namespace {
|
||||||
|
|
||||||
using ::testing::_;
|
using ::testing::_;
|
||||||
using ::testing::ElementsAre;
|
using ::testing::ElementsAre;
|
||||||
using ::testing::Eq;
|
using ::testing::Eq;
|
||||||
@ -56,8 +59,6 @@ using ::testing::Invoke;
|
|||||||
using ::testing::Property;
|
using ::testing::Property;
|
||||||
using ::testing::SizeIs;
|
using ::testing::SizeIs;
|
||||||
|
|
||||||
namespace webrtc {
|
|
||||||
|
|
||||||
class RtcpPacketTypeCounterObserverImpl : public RtcpPacketTypeCounterObserver {
|
class RtcpPacketTypeCounterObserverImpl : public RtcpPacketTypeCounterObserver {
|
||||||
public:
|
public:
|
||||||
RtcpPacketTypeCounterObserverImpl() : ssrc_(0) {}
|
RtcpPacketTypeCounterObserverImpl() : ssrc_(0) {}
|
||||||
@ -87,12 +88,10 @@ class TestTransport : public Transport {
|
|||||||
test::RtcpPacketParser parser_;
|
test::RtcpPacketParser parser_;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace {
|
constexpr uint32_t kSenderSsrc = 0x11111111;
|
||||||
static const uint32_t kSenderSsrc = 0x11111111;
|
constexpr uint32_t kRemoteSsrc = 0x22222222;
|
||||||
static const uint32_t kRemoteSsrc = 0x22222222;
|
constexpr uint32_t kStartRtpTimestamp = 0x34567;
|
||||||
static const uint32_t kStartRtpTimestamp = 0x34567;
|
constexpr uint32_t kRtpTimestamp = 0x45678;
|
||||||
static const uint32_t kRtpTimestamp = 0x45678;
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
class RtcpSenderTest : public ::testing::Test {
|
class RtcpSenderTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
@ -856,4 +855,5 @@ TEST_F(RtcpSenderTest, SendsCombinedRtcpPacket) {
|
|||||||
EXPECT_EQ(parser()->app()->sender_ssrc(), kSenderSsrc);
|
EXPECT_EQ(parser()->app()->sender_ssrc(), kSenderSsrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -22,9 +22,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
constexpr RTPExtensionType RtpDependencyDescriptorExtension::kId;
|
|
||||||
constexpr std::bitset<32> RtpDependencyDescriptorExtension::kAllChainsAreActive;
|
|
||||||
|
|
||||||
bool RtpDependencyDescriptorExtension::Parse(
|
bool RtpDependencyDescriptorExtension::Parse(
|
||||||
rtc::ArrayView<const uint8_t> data,
|
rtc::ArrayView<const uint8_t> data,
|
||||||
const FrameDependencyStructure* structure,
|
const FrameDependencyStructure* structure,
|
||||||
|
|||||||
@ -173,7 +173,7 @@ bool RtpFecTest<ForwardErrorCorrectionType>::IsRecoveryComplete() {
|
|||||||
|
|
||||||
class FlexfecForwardErrorCorrection : public ForwardErrorCorrection {
|
class FlexfecForwardErrorCorrection : public ForwardErrorCorrection {
|
||||||
public:
|
public:
|
||||||
static const uint32_t kFecSsrc = kFlexfecSsrc;
|
static constexpr uint32_t kFecSsrc = kFlexfecSsrc;
|
||||||
|
|
||||||
FlexfecForwardErrorCorrection()
|
FlexfecForwardErrorCorrection()
|
||||||
: ForwardErrorCorrection(
|
: ForwardErrorCorrection(
|
||||||
@ -192,7 +192,7 @@ class FlexfecForwardErrorCorrection : public ForwardErrorCorrection {
|
|||||||
|
|
||||||
class UlpfecForwardErrorCorrection : public ForwardErrorCorrection {
|
class UlpfecForwardErrorCorrection : public ForwardErrorCorrection {
|
||||||
public:
|
public:
|
||||||
static const uint32_t kFecSsrc = kMediaSsrc;
|
static constexpr uint32_t kFecSsrc = kMediaSsrc;
|
||||||
|
|
||||||
UlpfecForwardErrorCorrection()
|
UlpfecForwardErrorCorrection()
|
||||||
: ForwardErrorCorrection(
|
: ForwardErrorCorrection(
|
||||||
|
|||||||
@ -34,9 +34,9 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
static const size_t kNalHeaderSize = 1;
|
constexpr size_t kNalHeaderSize = 1;
|
||||||
static const size_t kFuAHeaderSize = 2;
|
constexpr size_t kFuAHeaderSize = 2;
|
||||||
static const size_t kLengthFieldSize = 2;
|
constexpr size_t kLengthFieldSize = 2;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
@ -47,8 +47,8 @@ enum Nalu {
|
|||||||
kFuA = 28
|
kFuA = 28
|
||||||
};
|
};
|
||||||
|
|
||||||
static const size_t kNalHeaderSize = 1;
|
constexpr size_t kNalHeaderSize = 1;
|
||||||
static const size_t kFuAHeaderSize = 2;
|
constexpr size_t kFuAHeaderSize = 2;
|
||||||
|
|
||||||
// Creates Buffer that looks like nal unit of given size.
|
// Creates Buffer that looks like nal unit of given size.
|
||||||
rtc::Buffer GenerateNalUnit(size_t size) {
|
rtc::Buffer GenerateNalUnit(size_t size) {
|
||||||
|
|||||||
@ -19,9 +19,12 @@
|
|||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
namespace {
|
||||||
|
|
||||||
static const size_t kGenericHeaderLength = 1;
|
constexpr size_t kGenericHeaderLength = 1;
|
||||||
static const size_t kExtendedHeaderLength = 2;
|
constexpr size_t kExtendedHeaderLength = 2;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
RtpPacketizerGeneric::RtpPacketizerGeneric(
|
RtpPacketizerGeneric::RtpPacketizerGeneric(
|
||||||
rtc::ArrayView<const uint8_t> payload,
|
rtc::ArrayView<const uint8_t> payload,
|
||||||
|
|||||||
@ -23,11 +23,11 @@ class RtpPacketToSend;
|
|||||||
struct RTPVideoHeader;
|
struct RTPVideoHeader;
|
||||||
|
|
||||||
namespace RtpFormatVideoGeneric {
|
namespace RtpFormatVideoGeneric {
|
||||||
static const uint8_t kKeyFrameBit = 0x01;
|
inline constexpr uint8_t kKeyFrameBit = 0x01;
|
||||||
static const uint8_t kFirstPacketBit = 0x02;
|
inline constexpr uint8_t kFirstPacketBit = 0x02;
|
||||||
// If this bit is set, there will be an extended header contained in this
|
// If this bit is set, there will be an extended header contained in this
|
||||||
// packet. This was added later so old clients will not send this.
|
// packet. This was added later so old clients will not send this.
|
||||||
static const uint8_t kExtendedHeaderBit = 0x04;
|
inline constexpr uint8_t kExtendedHeaderBit = 0x04;
|
||||||
} // namespace RtpFormatVideoGeneric
|
} // namespace RtpFormatVideoGeneric
|
||||||
|
|
||||||
class RtpPacketizerGeneric : public RtpPacketizer {
|
class RtpPacketizerGeneric : public RtpPacketizer {
|
||||||
|
|||||||
@ -16,10 +16,6 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
constexpr int RtpGenericFrameDescriptor::kMaxNumFrameDependencies;
|
|
||||||
constexpr int RtpGenericFrameDescriptor::kMaxTemporalLayers;
|
|
||||||
constexpr int RtpGenericFrameDescriptor::kMaxSpatialLayers;
|
|
||||||
|
|
||||||
RtpGenericFrameDescriptor::RtpGenericFrameDescriptor() = default;
|
RtpGenericFrameDescriptor::RtpGenericFrameDescriptor() = default;
|
||||||
RtpGenericFrameDescriptor::RtpGenericFrameDescriptor(
|
RtpGenericFrameDescriptor::RtpGenericFrameDescriptor(
|
||||||
const RtpGenericFrameDescriptor&) = default;
|
const RtpGenericFrameDescriptor&) = default;
|
||||||
|
|||||||
@ -56,7 +56,6 @@ constexpr uint8_t kFlageXtendedOffset = 0x02;
|
|||||||
// +---------------+
|
// +---------------+
|
||||||
// | ... |
|
// | ... |
|
||||||
// +-+-+-+-+-+-+-+-+
|
// +-+-+-+-+-+-+-+-+
|
||||||
constexpr RTPExtensionType RtpGenericFrameDescriptorExtension00::kId;
|
|
||||||
|
|
||||||
bool RtpGenericFrameDescriptorExtension00::Parse(
|
bool RtpGenericFrameDescriptorExtension00::Parse(
|
||||||
rtc::ArrayView<const uint8_t> data,
|
rtc::ArrayView<const uint8_t> data,
|
||||||
|
|||||||
@ -70,9 +70,6 @@ static_assert(arraysize(kExtensions) ==
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
constexpr RTPExtensionType RtpHeaderExtensionMap::kInvalidType;
|
|
||||||
constexpr int RtpHeaderExtensionMap::kInvalidId;
|
|
||||||
|
|
||||||
RtpHeaderExtensionMap::RtpHeaderExtensionMap() : RtpHeaderExtensionMap(false) {}
|
RtpHeaderExtensionMap::RtpHeaderExtensionMap() : RtpHeaderExtensionMap(false) {}
|
||||||
|
|
||||||
RtpHeaderExtensionMap::RtpHeaderExtensionMap(bool extmap_allow_mixed)
|
RtpHeaderExtensionMap::RtpHeaderExtensionMap(bool extmap_allow_mixed)
|
||||||
|
|||||||
@ -160,7 +160,7 @@ TEST_P(RtpPacketHistoryTest, GetRtpPacket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(RtpPacketHistoryTest, MinResendTime) {
|
TEST_P(RtpPacketHistoryTest, MinResendTime) {
|
||||||
static const TimeDelta kMinRetransmitInterval = TimeDelta::Millis(100);
|
static constexpr TimeDelta kMinRetransmitInterval = TimeDelta::Millis(100);
|
||||||
|
|
||||||
hist_.SetStorePacketsStatus(StorageMode::kStoreAndCull, 10);
|
hist_.SetStorePacketsStatus(StorageMode::kStoreAndCull, 10);
|
||||||
hist_.SetRtt(kMinRetransmitInterval);
|
hist_.SetRtt(kMinRetransmitInterval);
|
||||||
|
|||||||
@ -20,9 +20,6 @@
|
|||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
constexpr RTPExtensionType RtpVideoLayersAllocationExtension::kId;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr int kMaxNumRtpStreams = 4;
|
constexpr int kMaxNumRtpStreams = 4;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user