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:
@ -10,20 +10,20 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <iostream>
|
||||
#include <limits.h> // For ULONG_MAX returned by strtoul.
|
||||
#include <memory>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // For strtoul.
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "modules/audio_coding/neteq/include/neteq.h"
|
||||
#include "modules/audio_coding/neteq/tools/fake_decode_from_file.h"
|
||||
#include "modules/audio_coding/neteq/tools/input_audio_file.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_delay_analyzer.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_stats_getter.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_packet_source_input.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_replacement_input.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_stats_getter.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_test.h"
|
||||
#include "modules/audio_coding/neteq/tools/output_audio_file.h"
|
||||
#include "modules/audio_coding/neteq/tools/output_wav_file.h"
|
||||
@ -71,7 +71,7 @@ bool ValidatePayloadType(int value) {
|
||||
|
||||
bool ValidateSsrcValue(const std::string& str) {
|
||||
uint32_t dummy_ssrc;
|
||||
if (ParseSsrc(str, &dummy_ssrc)) // Value is ok.
|
||||
if (ParseSsrc(str, &dummy_ssrc)) // Value is ok.
|
||||
return true;
|
||||
printf("Invalid SSRC: %s\n", str.c_str());
|
||||
return false;
|
||||
@ -106,10 +106,15 @@ DEFINE_int(cn_nb, 13, "RTP payload type for comfort noise (8 kHz)");
|
||||
DEFINE_int(cn_wb, 98, "RTP payload type for comfort noise (16 kHz)");
|
||||
DEFINE_int(cn_swb32, 99, "RTP payload type for comfort noise (32 kHz)");
|
||||
DEFINE_int(cn_swb48, 100, "RTP payload type for comfort noise (48 kHz)");
|
||||
DEFINE_bool(codec_map, false, "Prints the mapping between RTP payload type and "
|
||||
"codec");
|
||||
DEFINE_string(replacement_audio_file, "",
|
||||
"A PCM file that will be used to populate ""dummy"" RTP packets");
|
||||
DEFINE_bool(codec_map,
|
||||
false,
|
||||
"Prints the mapping between RTP payload type and "
|
||||
"codec");
|
||||
DEFINE_string(replacement_audio_file,
|
||||
"",
|
||||
"A PCM file that will be used to populate "
|
||||
"dummy"
|
||||
" RTP packets");
|
||||
DEFINE_string(ssrc,
|
||||
"",
|
||||
"Only use packets with this SSRC (decimal or hex, the latter "
|
||||
@ -240,8 +245,8 @@ class SsrcSwitchDetector : public NetEqPostInsertPacket {
|
||||
NetEq* neteq) override {
|
||||
if (last_ssrc_ && packet.header.ssrc != *last_ssrc_) {
|
||||
std::cout << "Changing streams from 0x" << std::hex << *last_ssrc_
|
||||
<< " to 0x" << std::hex << packet.header.ssrc
|
||||
<< std::dec << " (payload type "
|
||||
<< " to 0x" << std::hex << packet.header.ssrc << std::dec
|
||||
<< " (payload type "
|
||||
<< static_cast<int>(packet.header.payloadType) << ")"
|
||||
<< std::endl;
|
||||
}
|
||||
@ -258,10 +263,13 @@ class SsrcSwitchDetector : public NetEqPostInsertPacket {
|
||||
|
||||
int RunTest(int argc, char* argv[]) {
|
||||
std::string program_name = argv[0];
|
||||
std::string usage = "Tool for decoding an RTP dump file using NetEq.\n"
|
||||
"Run " + program_name + " --help for usage.\n"
|
||||
"Example usage:\n" + program_name +
|
||||
" input.rtp output.{pcm, wav}\n";
|
||||
std::string usage =
|
||||
"Tool for decoding an RTP dump file using NetEq.\n"
|
||||
"Run " +
|
||||
program_name +
|
||||
" --help for usage.\n"
|
||||
"Example usage:\n" +
|
||||
program_name + " input.rtp output.{pcm, wav}\n";
|
||||
if (rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true)) {
|
||||
return 1;
|
||||
}
|
||||
@ -406,10 +414,8 @@ int RunTest(int argc, char* argv[]) {
|
||||
{FLAG_g722, std::make_pair(NetEqDecoder::kDecoderG722, "g722")},
|
||||
{FLAG_avt, std::make_pair(NetEqDecoder::kDecoderAVT, "avt")},
|
||||
{FLAG_avt_16, std::make_pair(NetEqDecoder::kDecoderAVT16kHz, "avt-16")},
|
||||
{FLAG_avt_32,
|
||||
std::make_pair(NetEqDecoder::kDecoderAVT32kHz, "avt-32")},
|
||||
{FLAG_avt_48,
|
||||
std::make_pair(NetEqDecoder::kDecoderAVT48kHz, "avt-48")},
|
||||
{FLAG_avt_32, std::make_pair(NetEqDecoder::kDecoderAVT32kHz, "avt-32")},
|
||||
{FLAG_avt_48, std::make_pair(NetEqDecoder::kDecoderAVT48kHz, "avt-48")},
|
||||
{FLAG_red, std::make_pair(NetEqDecoder::kDecoderRED, "red")},
|
||||
{FLAG_cn_nb, std::make_pair(NetEqDecoder::kDecoderCNGnb, "cng-nb")},
|
||||
{FLAG_cn_wb, std::make_pair(NetEqDecoder::kDecoderCNGwb, "cng-wb")},
|
||||
@ -440,9 +446,8 @@ int RunTest(int argc, char* argv[]) {
|
||||
|
||||
std::set<uint8_t> cn_types = std_set_int32_to_uint8(
|
||||
{FLAG_cn_nb, FLAG_cn_wb, FLAG_cn_swb32, FLAG_cn_swb48});
|
||||
std::set<uint8_t> forbidden_types =
|
||||
std_set_int32_to_uint8({FLAG_g722, FLAG_red, FLAG_avt,
|
||||
FLAG_avt_16, FLAG_avt_32, FLAG_avt_48});
|
||||
std::set<uint8_t> forbidden_types = std_set_int32_to_uint8(
|
||||
{FLAG_g722, FLAG_red, FLAG_avt, FLAG_avt_16, FLAG_avt_32, FLAG_avt_48});
|
||||
input.reset(new NetEqReplacementInput(std::move(input), replacement_pt,
|
||||
cn_types, forbidden_types));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user