Remove simple stringstream usages.
This CL replaces std::o?stringstream with rtc::StringBuilder where that's possible to do without changing any of the surrounding code. It also updates includes and build files as appropriate. The CL was generated by running 'git grep -l -P std::o?stringstream | xargs perl -pi -e "s/std::o?stringstream/rtc::StringBuilder/g"'. Then I've manually updated the #includes and BUILD files, run 'git cl format' and unstaged any file that would need more complex fixes. Bug: webrtc:8982 Change-Id: Ibc32153f4a3fd177e260b6ad05ce393972549357 Reviewed-on: https://webrtc-review.googlesource.com/98460 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24605}
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <memory>
|
||||
#include <sstream> // no-presubmit-check TODO(webrtc:8982)
|
||||
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -133,7 +133,7 @@ void Receiver::Setup(AudioCodingModule *acm, RTPStream *rtpStream,
|
||||
|
||||
int playSampFreq;
|
||||
std::string file_name;
|
||||
std::stringstream file_stream;
|
||||
rtc::StringBuilder file_stream;
|
||||
file_stream << webrtc::test::OutputPath() << out_file_name
|
||||
<< static_cast<int>(codeId) << ".pcm";
|
||||
file_name = file_stream.str();
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -34,7 +35,7 @@ void ReceiverWithPacketLoss::Setup(AudioCodingModule* acm,
|
||||
loss_rate_ = loss_rate;
|
||||
burst_length_ = burst_length;
|
||||
burst_lost_counter_ = burst_length_; // To prevent first packet gets lost.
|
||||
std::stringstream ss;
|
||||
rtc::StringBuilder ss;
|
||||
ss << out_file_name << "_" << loss_rate_ << "_" << burst_length_ << "_";
|
||||
Receiver::Setup(acm, rtpStream, ss.str(), channels);
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/stringencode.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -476,7 +477,7 @@ void TestAllCodecs::Run(TestPack* channel) {
|
||||
|
||||
void TestAllCodecs::OpenOutFile(int test_number) {
|
||||
std::string filename = webrtc::test::OutputPath();
|
||||
std::ostringstream test_number_str;
|
||||
rtc::StringBuilder test_number_str;
|
||||
test_number_str << test_number;
|
||||
filename += "testallcodecs_out_";
|
||||
filename += test_number_str.str();
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -327,7 +328,7 @@ void TestRedFec::Run() {
|
||||
|
||||
void TestRedFec::OpenOutFile(int16_t test_number) {
|
||||
std::string file_name;
|
||||
std::stringstream file_stream;
|
||||
rtc::StringBuilder file_stream;
|
||||
file_stream << webrtc::test::OutputPath();
|
||||
file_stream << "TestRedFec_outFile_";
|
||||
file_stream << test_number << ".pcm";
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -832,7 +833,7 @@ void TestStereo::Run(TestPackStereo* channel,
|
||||
|
||||
void TestStereo::OpenOutFile(int16_t test_number) {
|
||||
std::string file_name;
|
||||
std::stringstream file_stream;
|
||||
rtc::StringBuilder file_stream;
|
||||
file_stream << webrtc::test::OutputPath() << "teststereo_out_" << test_number
|
||||
<< ".pcm";
|
||||
file_name = file_stream.str();
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "modules/audio_coding/test/PCMFile.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -204,7 +205,7 @@ void TestWebRtcVadDtx::Test(bool new_outfile) {
|
||||
if (new_outfile) {
|
||||
output_file_num_++;
|
||||
}
|
||||
std::stringstream out_filename;
|
||||
rtc::StringBuilder out_filename;
|
||||
out_filename << webrtc::test::OutputPath() << "testWebRtcVadDtx_outFile_"
|
||||
<< output_file_num_ << ".pcm";
|
||||
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"), 32000, 1,
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "modules/audio_coding/test/PCMFile.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/flags.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "system_wrappers/include/event_wrapper.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
@ -171,7 +172,7 @@ class DelayTest {
|
||||
}
|
||||
|
||||
void OpenOutFile(const char* output_id) {
|
||||
std::stringstream file_stream;
|
||||
rtc::StringBuilder file_stream;
|
||||
file_stream << "delay_test_" << FLAG_codec << "_" << FLAG_sample_rate_hz
|
||||
<< "Hz"
|
||||
<< "_" << FLAG_delay << "ms.pcm";
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "system_wrappers/include/event_wrapper.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -221,8 +222,8 @@ void ISACTest::EncodeDecode(int testNr,
|
||||
_inFileB.Open(file_name_swb_, 32000, "rb", true);
|
||||
|
||||
std::string file_name_out;
|
||||
std::stringstream file_stream_a;
|
||||
std::stringstream file_stream_b;
|
||||
rtc::StringBuilder file_stream_a;
|
||||
rtc::StringBuilder file_stream_b;
|
||||
file_stream_a << webrtc::test::OutputPath();
|
||||
file_stream_b << webrtc::test::OutputPath();
|
||||
file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
|
||||
@ -288,8 +289,8 @@ void ISACTest::SwitchingSamplingRate(int testNr, int maxSampRateChange) {
|
||||
_inFileB.Open(file_name_swb_, 32000, "rb");
|
||||
|
||||
std::string file_name_out;
|
||||
std::stringstream file_stream_a;
|
||||
std::stringstream file_stream_b;
|
||||
rtc::StringBuilder file_stream_a;
|
||||
rtc::StringBuilder file_stream_b;
|
||||
file_stream_a << webrtc::test::OutputPath();
|
||||
file_stream_b << webrtc::test::OutputPath();
|
||||
file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
|
||||
|
||||
Reference in New Issue
Block a user