in rtp_rtcp module:
fixed build/namespaces lint errors fixed readability/namespace lint errors BUG=webrtc:5277 R=mflodman,stefan@webrtc.org Review URL: https://codereview.webrtc.org/1506823002 Cr-Commit-Position: refs/heads/master@{#10978}
This commit is contained in:
parent
a1f567ae90
commit
6a6f0893dd
@ -51,17 +51,14 @@ namespace webrtc {
|
||||
// platform that doesn't use two's complement, implement conversion to/from
|
||||
// wire format.
|
||||
|
||||
namespace {
|
||||
inline void AssertTwosComplement() {
|
||||
// Assume the if any one signed integer type is two's complement, then all
|
||||
// other will be too.
|
||||
static_assert(
|
||||
(-1 & 0x03) == 0x03,
|
||||
"Only two's complement representation of signed integers supported.");
|
||||
}
|
||||
// Assume the if any one signed integer type is two's complement, then all
|
||||
// other will be too.
|
||||
static_assert(
|
||||
(-1 & 0x03) == 0x03,
|
||||
"Only two's complement representation of signed integers supported.");
|
||||
|
||||
// Plain const char* won't work for static_assert, use #define instead.
|
||||
#define kSizeErrorMsg "Byte size must be less than or equal to data type size."
|
||||
}
|
||||
|
||||
// Utility class for getting the unsigned equivalent of a signed type.
|
||||
template <typename T>
|
||||
|
||||
@ -27,7 +27,8 @@
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace {
|
||||
namespace webrtc {
|
||||
namespace fec_private_tables {
|
||||
|
||||
const uint8_t kMaskBursty1_1[2] = {
|
||||
0x80, 0x00
|
||||
@ -756,5 +757,6 @@ const uint8_t** kPacketMaskBurstyTbl[12] = {
|
||||
kPacketMaskBursty12
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace fec_private_tables
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_PRIVATE_TABLES_BURSTY_H_
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace {
|
||||
namespace webrtc {
|
||||
namespace fec_private_tables {
|
||||
|
||||
const uint8_t kMaskRandom10_1[2] = {
|
||||
0xff, 0xc0
|
||||
@ -24518,5 +24519,6 @@ const uint8_t** kPacketMaskRandomTbl[48] = {
|
||||
kPacketMaskRandom48
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace fec_private_tables
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_PRIVATE_TABLES_RANDOM_H_
|
||||
|
||||
@ -54,6 +54,6 @@ class FrameGenerator {
|
||||
uint16_t seq_num_;
|
||||
uint32_t timestamp_;
|
||||
};
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_TEST_HELPER_H_
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/fec_private_tables_random.h"
|
||||
|
||||
namespace {
|
||||
using webrtc::fec_private_tables::kPacketMaskBurstyTbl;
|
||||
using webrtc::fec_private_tables::kPacketMaskRandomTbl;
|
||||
|
||||
// Allow for different modes of protection for packets in UEP case.
|
||||
enum ProtectionMode {
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "webrtc/transport.h"
|
||||
|
||||
using namespace webrtc;
|
||||
namespace webrtc {
|
||||
|
||||
const int kVideoNackListSize = 30;
|
||||
const uint32_t kTestSsrc = 3456;
|
||||
@ -338,3 +338,5 @@ TEST_F(RtpRtcpRtxNackTest, RtxNack) {
|
||||
EXPECT_EQ(kTestNumberOfRtxPackets, transport_.count_rtx_ssrc_);
|
||||
EXPECT_TRUE(ExpectedPacketsReceived());
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -21,10 +21,9 @@
|
||||
#include "webrtc/test/null_transport.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
using namespace webrtc;
|
||||
|
||||
class TestTransport : public Transport {
|
||||
public:
|
||||
TestTransport(RTCPReceiver* rtcp_receiver) : rtcp_receiver_(rtcp_receiver) {}
|
||||
@ -130,3 +129,4 @@ TEST_F(RtcpFormatRembTest, TestCompund) {
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -23,8 +23,13 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
|
||||
|
||||
namespace webrtc {
|
||||
using namespace RTCPUtility;
|
||||
using namespace RTCPHelp;
|
||||
using RTCPHelp::RTCPPacketInformation;
|
||||
using RTCPHelp::RTCPReceiveInformation;
|
||||
using RTCPHelp::RTCPReportBlockInformation;
|
||||
using RTCPUtility::kBtVoipMetric;
|
||||
using RTCPUtility::RTCPCnameInformation;
|
||||
using RTCPUtility::RTCPPacketReportBlockItem;
|
||||
using RTCPUtility::RTCPPacketTypes;
|
||||
|
||||
// The number of RTCP time intervals needed to trigger a timeout.
|
||||
const int kRrTimeoutIntervals = 3;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
||||
|
||||
namespace webrtc {
|
||||
using namespace RTCPHelp;
|
||||
namespace RTCPHelp {
|
||||
|
||||
RTCPPacketInformation::RTCPPacketInformation()
|
||||
: rtcpPacketTypeFlags(0),
|
||||
@ -190,4 +190,5 @@ void RTCPReceiveInformation::VerifyAndAllocateBoundingSet(
|
||||
const uint32_t minimumSize) {
|
||||
TmmbnBoundingSet.VerifyAndAllocateSet(minimumSize);
|
||||
}
|
||||
} // namespace RTCPHelp
|
||||
} // namespace webrtc
|
||||
|
||||
@ -41,8 +41,8 @@ void NackStats::ReportRequest(uint16_t sequence_number) {
|
||||
|
||||
uint32_t MidNtp(uint32_t ntp_sec, uint32_t ntp_frac) {
|
||||
return (ntp_sec << 16) + (ntp_frac >> 16);
|
||||
} // end RTCPUtility
|
||||
}
|
||||
} // namespace RTCPUtility
|
||||
|
||||
// RTCPParserV2 : currently read only
|
||||
RTCPUtility::RTCPParserV2::RTCPParserV2(const uint8_t* rtcpData,
|
||||
|
||||
@ -487,6 +487,6 @@ class RTCPPacketIterator {
|
||||
|
||||
RtcpCommonHeader _header;
|
||||
};
|
||||
} // RTCPUtility
|
||||
} // namespace RTCPUtility
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_
|
||||
|
||||
@ -112,7 +112,7 @@ class RtpHeaderExtensionMap {
|
||||
int32_t Register(const RTPExtensionType type, const uint8_t id, bool active);
|
||||
std::map<uint8_t, HeaderExtension*> extensionMap_;
|
||||
};
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_
|
||||
|
||||
|
||||
@ -265,4 +265,4 @@ size_t Vp8PartitionAggregator::CalcNumberOfFragments(
|
||||
return num_fragments;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -132,6 +132,6 @@ class Vp8PartitionAggregator {
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(Vp8PartitionAggregator);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_VP8_PARTITION_AGGREGATOR_H_
|
||||
|
||||
@ -209,4 +209,4 @@ TEST(Vp8PartitionAggregator, TestCalcNumberOfFragments) {
|
||||
1600, kMTU, 1, 900, 1000));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -24,7 +24,10 @@
|
||||
#include "webrtc/system_wrappers/include/event_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/tick_util.h"
|
||||
|
||||
using namespace webrtc;
|
||||
using webrtc::CriticalSectionScoped;
|
||||
using webrtc::CriticalSectionWrapper;
|
||||
using webrtc::EventWrapper;
|
||||
using webrtc::TickTime;
|
||||
|
||||
#ifdef MATLAB
|
||||
MatlabEngine eng;
|
||||
|
||||
@ -21,9 +21,6 @@ class TestLoadGenerator;
|
||||
namespace webrtc {
|
||||
class CriticalSectionWrapper;
|
||||
class EventWrapper;
|
||||
}
|
||||
|
||||
using namespace webrtc;
|
||||
|
||||
#define MAX_BITRATE_KBPS 50000
|
||||
|
||||
@ -149,5 +146,5 @@ private:
|
||||
int64_t _lastTime;
|
||||
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTSENDERRECEIVER_H_
|
||||
|
||||
@ -15,9 +15,8 @@
|
||||
|
||||
#include "webrtc/test/null_transport.h"
|
||||
|
||||
using namespace webrtc;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
void LoopBackTransport::SetSendModule(RtpRtcp* rtp_rtcp_module,
|
||||
RTPPayloadRegistry* payload_registry,
|
||||
RtpReceiver* receiver,
|
||||
@ -77,7 +76,6 @@ int32_t TestRtpReceiver::OnReceivedPayloadData(
|
||||
payload_size_ = payload_size;
|
||||
return 0;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
class RtpRtcpAPITest : public ::testing::Test {
|
||||
protected:
|
||||
@ -188,3 +186,5 @@ TEST_F(RtpRtcpAPITest, RtxReceiver) {
|
||||
rtx_header.payloadType = 0;
|
||||
EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h"
|
||||
|
||||
using namespace webrtc;
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
#define test_rate 64000u
|
||||
|
||||
class VerifyingAudioReceiver : public NullRtpData {
|
||||
@ -349,3 +349,6 @@ TEST_F(RtpRtcpAudioTest, DTMF) {
|
||||
module1->Process();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -20,7 +20,8 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_audio.h"
|
||||
#include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h"
|
||||
|
||||
using namespace webrtc;
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
const uint64_t kTestPictureId = 12345678;
|
||||
const uint8_t kSliPictureId = 156;
|
||||
@ -266,3 +267,6 @@ TEST_F(RtpRtcpRtcpTest, RemoteRTCPStatRemote) {
|
||||
EXPECT_EQ(test_sequence_number, report_blocks[0].extendedHighSeqNum);
|
||||
EXPECT_EQ(0u, report_blocks[0].fractionLost);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#ifndef WEBRTC_MODULES_RTP_RTCP_TEST_TESTFEC_AVERAGE_RESIDUAL_LOSS_XOR_CODES_H_
|
||||
#define WEBRTC_MODULES_RTP_RTCP_TEST_TESTFEC_AVERAGE_RESIDUAL_LOSS_XOR_CODES_H_
|
||||
|
||||
namespace {
|
||||
namespace webrtc {
|
||||
|
||||
// Maximum number of media packets allowed in this test. The burst mask types
|
||||
// are currently defined up to (kMaxMediaPacketsTest, kMaxMediaPacketsTest).
|
||||
@ -187,5 +187,5 @@ const float kMaxResidualLossBurstyMask[kNumberCodes] = {
|
||||
0.009657f
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_RTP_RTCP_TEST_TESTFEC_AVERAGE_RESIDUAL_LOSS_XOR_CODES_H_
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
#include <list>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/fec_private_tables_bursty.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h"
|
||||
|
||||
@ -32,7 +31,11 @@
|
||||
//#define VERBOSE_OUTPUT
|
||||
|
||||
namespace webrtc {
|
||||
namespace fec_private_tables {
|
||||
extern const uint8_t** kPacketMaskBurstyTbl[12];
|
||||
}
|
||||
namespace test {
|
||||
using fec_private_tables::kPacketMaskBurstyTbl;
|
||||
|
||||
void ReceivePackets(
|
||||
ForwardErrorCorrection::ReceivedPacketList* toDecodeList,
|
||||
@ -94,10 +97,6 @@ TEST(FecTest, FecTest) {
|
||||
const FecMaskType kMaskTypes[] = { kFecMaskRandom, kFecMaskBursty };
|
||||
const int kNumFecMaskTypes = sizeof(kMaskTypes) / sizeof(*kMaskTypes);
|
||||
|
||||
// TODO(pbos): Fix this. Hack to prevent a warning
|
||||
// ('-Wunneeded-internal-declaration') from clang.
|
||||
(void) kPacketMaskBurstyTbl;
|
||||
|
||||
// Maximum number of media packets allowed for the mask type.
|
||||
const uint16_t kMaxMediaPackets[] = {kMaxNumberMediaPackets,
|
||||
sizeof(kPacketMaskBurstyTbl) / sizeof(*kPacketMaskBurstyTbl)};
|
||||
|
||||
@ -59,13 +59,6 @@ enum { kMaxNumberMediaPackets = 48 };
|
||||
// Maximum number of media packets allowed for each mask type.
|
||||
const uint16_t kMaxMediaPackets[] = {kMaxNumberMediaPackets, 12};
|
||||
|
||||
// Maximum number of media packets allowed in this test. The burst mask types
|
||||
// are currently defined up to (k=12,m=12).
|
||||
const int kMaxMediaPacketsTest = 12;
|
||||
|
||||
// Maximum number of FEC codes considered in this test.
|
||||
const int kNumberCodes = kMaxMediaPacketsTest * (kMaxMediaPacketsTest + 1) / 2;
|
||||
|
||||
// Maximum gap size for characterizing the consecutiveness of the loss.
|
||||
const int kMaxGapSize = 2 * kMaxMediaPacketsTest;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user