Reformat the WebRTC code base

Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
Yves Gerey
2018-06-19 15:03:05 +02:00
parent b602123a5a
commit 665174fdbb
1569 changed files with 30495 additions and 30309 deletions

View File

@ -25,7 +25,7 @@ namespace webrtc {
namespace {
const uint32_t kTestRate = 64000u;
const uint8_t kTestPayload[] = { 't', 'e', 's', 't' };
const uint8_t kTestPayload[] = {'t', 'e', 's', 't'};
const uint8_t kPcmuPayloadType = 96;
const uint8_t kDtmfPayloadType = 97;

View File

@ -28,11 +28,8 @@ namespace {
class RtcpCallback : public RtcpIntraFrameObserver {
public:
void SetModule(RtpRtcp* module) {
_rtpRtcpModule = module;
}
virtual void OnRTCPPacketTimeout(const int32_t id) {
}
void SetModule(RtpRtcp* module) { _rtpRtcpModule = module; }
virtual void OnRTCPPacketTimeout(const int32_t id) {}
virtual void OnLipSyncUpdate(const int32_t id,
const int32_t audioVideoOffset) {}
void OnReceivedIntraFrameRequest(uint32_t ssrc) override {}

View File

@ -27,7 +27,6 @@
namespace {
const unsigned char kPayloadType = 100;
};
namespace webrtc {
@ -75,13 +74,13 @@ class RtpRtcpVideoTest : public ::testing::Test {
payload_data_length_ = sizeof(video_frame_);
for (size_t n = 0; n < payload_data_length_; n++) {
video_frame_[n] = n%10;
video_frame_[n] = n % 10;
}
}
size_t BuildRTPheader(uint8_t* dataBuffer,
uint32_t timestamp,
uint32_t sequence_number) {
uint32_t timestamp,
uint32_t sequence_number) {
dataBuffer[0] = static_cast<uint8_t>(0x80); // version 2
dataBuffer[1] = static_cast<uint8_t>(kPayloadType);
ByteWriter<uint16_t>::WriteBigEndian(dataBuffer + 2, sequence_number);
@ -105,8 +104,7 @@ class RtpRtcpVideoTest : public ::testing::Test {
// Correct seq num, timestamp and payload type.
size_t header_length = BuildRTPheader(buffer, timestamp, sequence_number);
buffer[0] |= 0x20; // Set padding bit.
int32_t* data =
reinterpret_cast<int32_t*>(&(buffer[header_length]));
int32_t* data = reinterpret_cast<int32_t*>(&(buffer[header_length]));
// Fill data buffer with random data.
for (size_t j = 0; j < (padding_bytes_in_packet >> 2); j++) {
@ -134,7 +132,7 @@ class RtpRtcpVideoTest : public ::testing::Test {
uint32_t test_ssrc_;
uint32_t test_timestamp_;
uint16_t test_sequence_number_;
uint8_t video_frame_[65000];
uint8_t video_frame_[65000];
size_t payload_data_length_;
SimulatedClock fake_clock;
RateLimiter retransmission_rate_limiter_;
@ -158,8 +156,8 @@ TEST_F(RtpRtcpVideoTest, PaddingOnlyFrames) {
EXPECT_EQ(0, rtp_payload_registry_.RegisterReceivePayload(codec));
for (int frame_idx = 0; frame_idx < 10; ++frame_idx) {
for (int packet_idx = 0; packet_idx < 5; ++packet_idx) {
size_t packet_size = PaddingPacket(padding_packet, timestamp, seq_num,
kPadSize);
size_t packet_size =
PaddingPacket(padding_packet, timestamp, seq_num, kPadSize);
++seq_num;
RTPHeader header;
std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());