Remove webrtc::ProtoString.
Bug: None Change-Id: If99a977532eda41eada25f57ff0ff6fe17085986 Reviewed-on: https://webrtc-review.googlesource.com/c/122581 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Minyue Li <minyue@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26726}
This commit is contained in:

committed by
Commit Bot

parent
eaf6a8cbc8
commit
e45c688e67
@ -767,6 +767,7 @@ rtc_static_library("webrtc_opus") {
|
||||
"../../api/audio_codecs/opus:audio_encoder_opus_config",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_numerics",
|
||||
"../../rtc_base:safe_minmax",
|
||||
@ -777,7 +778,6 @@ rtc_static_library("webrtc_opus") {
|
||||
]
|
||||
public_deps = [
|
||||
":webrtc_opus_c",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
]
|
||||
|
||||
defines = audio_codec_defines
|
||||
@ -1341,7 +1341,6 @@ if (rtc_include_tests) {
|
||||
":neteq_test_tools",
|
||||
"../..:webrtc_common",
|
||||
"../../api/audio_codecs/opus:audio_encoder_opus",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial",
|
||||
@ -1433,7 +1432,6 @@ if (rtc_include_tests) {
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs/opus:audio_encoder_opus",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base/system:arch",
|
||||
"../../test:test_main",
|
||||
"//testing/gtest",
|
||||
@ -2040,7 +2038,6 @@ if (rtc_include_tests) {
|
||||
"../../logging:rtc_event_log_api",
|
||||
"../../modules/rtp_rtcp:rtp_rtcp_format",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_base_tests_utils",
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "modules/audio_coding/audio_network_adaptor/controller_manager.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "modules/audio_coding/audio_network_adaptor/bitrate_controller.h"
|
||||
@ -213,7 +214,7 @@ ControllerManagerImpl::Config::Config(int min_reordering_time_ms,
|
||||
ControllerManagerImpl::Config::~Config() = default;
|
||||
|
||||
std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
@ -229,7 +230,7 @@ std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
}
|
||||
|
||||
std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
|
@ -13,11 +13,11 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "modules/audio_coding/audio_network_adaptor/controller.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -47,7 +47,7 @@ class ControllerManagerImpl final : public ControllerManager {
|
||||
};
|
||||
|
||||
static std::unique_ptr<ControllerManager> Create(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
@ -58,7 +58,7 @@ class ControllerManagerImpl final : public ControllerManager {
|
||||
bool initial_dtx_enabled);
|
||||
|
||||
static std::unique_ptr<ControllerManager> Create(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
|
@ -8,6 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "modules/audio_coding/audio_network_adaptor/controller_manager.h"
|
||||
@ -15,7 +16,6 @@
|
||||
#include "modules/audio_coding/audio_network_adaptor/mock/mock_debug_dump_writer.h"
|
||||
#include "rtc_base/fake_clock.h"
|
||||
#include "rtc_base/ignore_wundef.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
#if WEBRTC_ENABLE_PROTOBUF
|
||||
@ -266,7 +266,7 @@ constexpr int kInitialFrameLengthMs = 60;
|
||||
constexpr int kMinBitrateBps = 6000;
|
||||
|
||||
ControllerManagerStates CreateControllerManager(
|
||||
const ProtoString& config_string) {
|
||||
const std::string& config_string) {
|
||||
ControllerManagerStates states;
|
||||
constexpr size_t kNumEncoderChannels = 2;
|
||||
const std::vector<int> encoder_frame_lengths_ms = {20, 60};
|
||||
@ -319,8 +319,8 @@ void CheckControllersOrder(const std::vector<Controller*>& controllers,
|
||||
}
|
||||
|
||||
MATCHER_P(ControllerManagerEqual, value, "") {
|
||||
ProtoString value_string;
|
||||
ProtoString arg_string;
|
||||
std::string value_string;
|
||||
std::string arg_string;
|
||||
EXPECT_TRUE(arg.SerializeToString(&arg_string));
|
||||
EXPECT_TRUE(value.SerializeToString(&value_string));
|
||||
return arg_string == value_string;
|
||||
@ -339,7 +339,7 @@ TEST(ControllerManagerTest, DebugDumpLoggedWhenCreateFromConfigString) {
|
||||
AddFrameLengthControllerConfig(&config);
|
||||
AddBitrateControllerConfig(&config);
|
||||
|
||||
ProtoString config_string;
|
||||
std::string config_string;
|
||||
config.SerializeToString(&config_string);
|
||||
|
||||
constexpr size_t kNumEncoderChannels = 2;
|
||||
@ -373,7 +373,7 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckDefaultOrder) {
|
||||
AddFrameLengthControllerConfig(&config);
|
||||
AddBitrateControllerConfig(&config);
|
||||
|
||||
ProtoString config_string;
|
||||
std::string config_string;
|
||||
config.SerializeToString(&config_string);
|
||||
|
||||
auto states = CreateControllerManager(config_string);
|
||||
@ -395,7 +395,7 @@ TEST(ControllerManagerTest, CreateCharPointFreeConfigAndCheckDefaultOrder) {
|
||||
AddDtxControllerConfig(&config);
|
||||
AddBitrateControllerConfig(&config);
|
||||
|
||||
ProtoString config_string;
|
||||
std::string config_string;
|
||||
config.SerializeToString(&config_string);
|
||||
|
||||
auto states = CreateControllerManager(config_string);
|
||||
@ -426,7 +426,7 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) {
|
||||
|
||||
AddBitrateControllerConfig(&config);
|
||||
|
||||
ProtoString config_string;
|
||||
std::string config_string;
|
||||
config.SerializeToString(&config_string);
|
||||
|
||||
auto states = CreateControllerManager(config_string);
|
||||
|
@ -10,11 +10,12 @@
|
||||
|
||||
#include "modules/audio_coding/audio_network_adaptor/debug_dump_writer.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/ignore_wundef.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
#include "rtc_base/system/file_wrapper.h"
|
||||
|
||||
#if WEBRTC_ENABLE_PROTOBUF
|
||||
@ -38,7 +39,7 @@ using audio_network_adaptor::debug_dump::EncoderRuntimeConfig;
|
||||
|
||||
void DumpEventToFile(const Event& event, FileWrapper* dump_file) {
|
||||
RTC_CHECK(dump_file->is_open());
|
||||
ProtoString dump_data;
|
||||
std::string dump_data;
|
||||
event.SerializeToString(&dump_data);
|
||||
int32_t size = rtc::checked_cast<int32_t>(event.ByteSizeLong());
|
||||
dump_file->Write(&size, sizeof(size));
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
@ -25,7 +26,6 @@
|
||||
#include "rtc_base/numerics/exp_filter.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/numerics/safe_minmax.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
#include "rtc_base/string_to_number.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
@ -443,7 +443,7 @@ AudioEncoderOpusImpl::AudioEncoderOpusImpl(const AudioEncoderOpusConfig& config,
|
||||
: AudioEncoderOpusImpl(
|
||||
config,
|
||||
payload_type,
|
||||
[this](const ProtoString& config_string, RtcEventLog* event_log) {
|
||||
[this](const std::string& config_string, RtcEventLog* event_log) {
|
||||
return DefaultAudioNetworkAdaptorCreator(config_string, event_log);
|
||||
},
|
||||
// We choose 5sec as initial time constant due to empirical data.
|
||||
@ -870,7 +870,7 @@ void AudioEncoderOpusImpl::ApplyAudioNetworkAdaptor() {
|
||||
|
||||
std::unique_ptr<AudioNetworkAdaptor>
|
||||
AudioEncoderOpusImpl::DefaultAudioNetworkAdaptorCreator(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
RtcEventLog* event_log) const {
|
||||
AudioNetworkAdaptorImpl::Config config;
|
||||
config.event_log = event_log;
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
||||
#include "modules/audio_coding/codecs/opus/opus_interface.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -171,7 +170,7 @@ class AudioEncoderOpusImpl final : public AudioEncoder {
|
||||
|
||||
void ApplyAudioNetworkAdaptor();
|
||||
std::unique_ptr<AudioNetworkAdaptor> DefaultAudioNetworkAdaptorCreator(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
RtcEventLog* event_log) const;
|
||||
|
||||
void MaybeUpdateUplinkBandwidth();
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "rtc_base/ignore_wundef.h"
|
||||
#include "rtc_base/message_digest.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
#include "rtc_base/string_encode.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
@ -208,7 +207,7 @@ void ResultSink::AddResult(const NetEqNetworkStatistics& stats_raw) {
|
||||
neteq_unittest::NetEqNetworkStatistics stats;
|
||||
Convert(stats_raw, &stats);
|
||||
|
||||
ProtoString stats_string;
|
||||
std::string stats_string;
|
||||
ASSERT_TRUE(stats.SerializeToString(&stats_string));
|
||||
AddMessage(output_fp_, digest_.get(), stats_string);
|
||||
#else
|
||||
@ -221,7 +220,7 @@ void ResultSink::AddResult(const RtcpStatistics& stats_raw) {
|
||||
neteq_unittest::RtcpStatistics stats;
|
||||
Convert(stats_raw, &stats);
|
||||
|
||||
ProtoString stats_string;
|
||||
std::string stats_string;
|
||||
ASSERT_TRUE(stats.SerializeToString(&stats_string));
|
||||
AddMessage(output_fp_, digest_.get(), stats_string);
|
||||
#else
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "modules/audio_processing/aec_dump/write_to_file_task.h"
|
||||
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
#include <string>
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -39,7 +39,7 @@ void WriteToFileTask::UpdateBytesLeft(size_t event_byte_size) {
|
||||
}
|
||||
|
||||
bool WriteToFileTask::Run() {
|
||||
ProtoString event_string;
|
||||
std::string event_string;
|
||||
event_.SerializeToString(&event_string);
|
||||
|
||||
const size_t event_byte_size = event_.ByteSizeLong();
|
||||
|
@ -13,12 +13,6 @@
|
||||
#ifndef RTC_BASE_PROTOBUF_UTILS_H_
|
||||
#define RTC_BASE_PROTOBUF_UTILS_H_
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
using ProtoString = std::string;
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#if WEBRTC_ENABLE_PROTOBUF
|
||||
|
||||
#include "third_party/protobuf/src/google/protobuf/message_lite.h"
|
||||
|
@ -9,8 +9,9 @@
|
||||
*/
|
||||
#include "rtc_tools/network_tester/packet_logger.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -31,7 +32,7 @@ void PacketLogger::LogPacket(const NetworkTesterPacket& packet) {
|
||||
// | Size of the next | proto | Size of the next | ... | proto |
|
||||
// | proto message | message | proto message | | message |
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
ProtoString packet_data;
|
||||
std::string packet_data;
|
||||
packet.SerializeToString(&packet_data);
|
||||
RTC_DCHECK_LE(packet_data.length(), 255);
|
||||
RTC_DCHECK_GE(packet_data.length(), 0);
|
||||
|
Reference in New Issue
Block a user