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:
@ -46,19 +46,19 @@ TestPack::TestPack()
|
||||
timestamp_diff_(0),
|
||||
last_in_timestamp_(0),
|
||||
total_bytes_(0),
|
||||
payload_size_(0) {
|
||||
}
|
||||
payload_size_(0) {}
|
||||
|
||||
TestPack::~TestPack() {
|
||||
}
|
||||
TestPack::~TestPack() {}
|
||||
|
||||
void TestPack::RegisterReceiverACM(AudioCodingModule* acm) {
|
||||
receiver_acm_ = acm;
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t TestPack::SendData(FrameType frame_type, uint8_t payload_type,
|
||||
uint32_t timestamp, const uint8_t* payload_data,
|
||||
int32_t TestPack::SendData(FrameType frame_type,
|
||||
uint8_t payload_type,
|
||||
uint32_t timestamp,
|
||||
const uint8_t* payload_data,
|
||||
size_t payload_size,
|
||||
const RTPFragmentationHeader* fragmentation) {
|
||||
WebRtcRTPHeader rtp_info;
|
||||
@ -125,8 +125,8 @@ TestAllCodecs::~TestAllCodecs() {
|
||||
}
|
||||
|
||||
void TestAllCodecs::Perform() {
|
||||
const std::string file_name = webrtc::test::ResourcePath(
|
||||
"audio_coding/testfile32kHz", "pcm");
|
||||
const std::string file_name =
|
||||
webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
|
||||
infile_a_.Open(file_name, 32000, "rb");
|
||||
|
||||
if (test_mode_ == 0) {
|
||||
@ -306,17 +306,17 @@ void TestAllCodecs::Perform() {
|
||||
char codec_opus[] = "OPUS";
|
||||
RegisterSendCodec('A', codec_opus, 48000, 6000, 480, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 20000, 480*2, kVariableSize);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 20000, 480 * 2, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 32000, 480*4, kVariableSize);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 32000, 480 * 4, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 48000, 480, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 64000, 480*4, kVariableSize);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 64000, 480 * 4, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 96000, 480*6, kVariableSize);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 96000, 480 * 6, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 500000, 480*2, kVariableSize);
|
||||
RegisterSendCodec('A', codec_opus, 48000, 500000, 480 * 2, kVariableSize);
|
||||
Run(channel_a_to_b_);
|
||||
outfile_b_.Close();
|
||||
#endif
|
||||
@ -351,9 +351,12 @@ void TestAllCodecs::Perform() {
|
||||
// used when registering, can be an internal header
|
||||
// set to kVariableSize if the codec is a variable
|
||||
// rate codec
|
||||
void TestAllCodecs::RegisterSendCodec(char side, char* codec_name,
|
||||
int32_t sampling_freq_hz, int rate,
|
||||
int packet_size, size_t extra_byte) {
|
||||
void TestAllCodecs::RegisterSendCodec(char side,
|
||||
char* codec_name,
|
||||
int32_t sampling_freq_hz,
|
||||
int rate,
|
||||
int packet_size,
|
||||
size_t extra_byte) {
|
||||
if (test_mode_ != 0) {
|
||||
// Print out codec and settings.
|
||||
printf("codec: %s Freq: %d Rate: %d PackSize: %d\n", codec_name,
|
||||
@ -377,9 +380,11 @@ void TestAllCodecs::RegisterSendCodec(char side, char* codec_name,
|
||||
// packet. If variable rate codec (extra_byte == -1), set to -1.
|
||||
if (extra_byte != kVariableSize) {
|
||||
// Add 0.875 to always round up to a whole byte
|
||||
packet_size_bytes_ = static_cast<size_t>(
|
||||
static_cast<float>(packet_size * rate) /
|
||||
static_cast<float>(sampling_freq_hz * 8) + 0.875) + extra_byte;
|
||||
packet_size_bytes_ =
|
||||
static_cast<size_t>(static_cast<float>(packet_size * rate) /
|
||||
static_cast<float>(sampling_freq_hz * 8) +
|
||||
0.875) +
|
||||
extra_byte;
|
||||
} else {
|
||||
// Packets will have a variable size.
|
||||
packet_size_bytes_ = kVariableSize;
|
||||
@ -396,9 +401,7 @@ void TestAllCodecs::RegisterSendCodec(char side, char* codec_name,
|
||||
my_acm = acm_b_.get();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
default: { break; }
|
||||
}
|
||||
ASSERT_TRUE(my_acm != NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user