Revert of Loosening the coupling between WebRTC and //third_party/protobuf (patchset #16 id:300001 of https://codereview.webrtc.org/2747863003/ )
Reason for revert:
I will try to reland next week because it is causing some problems.
Original issue's description:
> To accommodate some downstream WebRTC users we need to loosen
> the coupling between our code and the //third_party/protobuf.
>
> This includes using typedefs to define strings instead of
> assuming std::string.
>
> After this refactoring it will be possible to link with other
> protobuf implementations than the current one.
>
> We moved the PRESUBMIT check to another CL [1]. The goal of this
> presubmit is to avoid the direct usage of google::protobuf outside
> of the webrtc/base/protobuf_utils.h header file.
>
> [1] - https://codereview.webrtc.org/2753823003/
>
> BUG=webrtc:7340
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2747863003
> Cr-Commit-Position: refs/heads/master@{#17466}
> Committed: 16ab93b952
TBR=kjellander@webrtc.org,henrik.lundin@webrtc.org,kwiberg@webrtc.org,michaelt@webrtc.org,peah@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7340
Review-Url: https://codereview.webrtc.org/2786363002
Cr-Commit-Position: refs/heads/master@{#17483}
This commit is contained in:
@ -74,7 +74,6 @@ rtc_static_library("rent_a_codec") {
|
||||
deps = [
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../..:webrtc_common",
|
||||
"../../base:protobuf_utils",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../system_wrappers",
|
||||
":audio_coding_module_typedefs",
|
||||
@ -83,7 +82,6 @@ rtc_static_library("rent_a_codec") {
|
||||
":isac_fix_c",
|
||||
":neteq_decoder_enum",
|
||||
] + audio_codec_deps
|
||||
|
||||
defines = audio_codec_defines
|
||||
}
|
||||
|
||||
@ -830,7 +828,6 @@ rtc_static_library("webrtc_opus") {
|
||||
":audio_network_adaptor",
|
||||
"../..:webrtc_common",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../base:protobuf_utils",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../base:rtc_numerics",
|
||||
"../../common_audio",
|
||||
@ -924,7 +921,6 @@ rtc_static_library("audio_network_adaptor") {
|
||||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../base:protobuf_utils",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../common_audio",
|
||||
"../../logging:rtc_event_log_api",
|
||||
@ -1192,12 +1188,10 @@ if (rtc_include_tests) {
|
||||
":neteq_unittest_tools",
|
||||
":webrtc_opus",
|
||||
"../..:webrtc_common",
|
||||
"../../base:protobuf_utils",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../system_wrappers:system_wrappers",
|
||||
"../../test:test_support",
|
||||
]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
@ -1332,7 +1326,6 @@ if (rtc_include_tests) {
|
||||
":neteq",
|
||||
":neteq_unittest_tools",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../base:protobuf_utils",
|
||||
"../../common_audio",
|
||||
"../../test:test_main",
|
||||
"//testing/gtest",
|
||||
@ -2089,7 +2082,6 @@ if (rtc_include_tests) {
|
||||
"../..:webrtc_common",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../../base:protobuf_utils",
|
||||
"../../base:rtc_base",
|
||||
"../../base:rtc_base_approved",
|
||||
"../../base:rtc_base_tests_utils",
|
||||
|
||||
@ -195,7 +195,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,
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/protobuf_utils.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -50,7 +49,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,
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#include <utility>
|
||||
|
||||
#include "webrtc/base/ignore_wundef.h"
|
||||
#include "webrtc/base/protobuf_utils.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_controller.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
@ -274,7 +273,7 @@ constexpr int kInitialFrameLengthMs = 60;
|
||||
constexpr int kMinBitrateBps = 6000;
|
||||
|
||||
ControllerManagerStates CreateControllerManager(
|
||||
const ProtoString& config_string) {
|
||||
const std::string& config_string) {
|
||||
ControllerManagerStates states;
|
||||
states.simulated_clock.reset(new SimulatedClock(kClockInitialTime));
|
||||
constexpr size_t kNumEncoderChannels = 2;
|
||||
@ -346,7 +345,7 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckDefaultOrder) {
|
||||
AddFrameLengthControllerConfig(&config);
|
||||
AddBitrateControllerConfig(&config);
|
||||
|
||||
ProtoString config_string;
|
||||
std::string config_string;
|
||||
config.SerializeToString(&config_string);
|
||||
|
||||
auto states = CreateControllerManager(config_string);
|
||||
@ -377,7 +376,7 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) {
|
||||
|
||||
AddBitrateControllerConfig(&config);
|
||||
|
||||
ProtoString config_string;
|
||||
std::string config_string;
|
||||
config.SerializeToString(&config_string);
|
||||
|
||||
auto states = CreateControllerManager(config_string);
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/ignore_wundef.h"
|
||||
#include "webrtc/base/protobuf_utils.h"
|
||||
|
||||
#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
|
||||
RTC_PUSH_IGNORING_WUNDEF()
|
||||
@ -35,7 +34,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 = event.ByteSize();
|
||||
dump_file->Write(&size, sizeof(size));
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP_WRITER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h"
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/numerics/exp_filter.h"
|
||||
#include "webrtc/base/protobuf_utils.h"
|
||||
#include "webrtc/base/safe_conversions.h"
|
||||
#include "webrtc/base/timeutils.h"
|
||||
#include "webrtc/common_types.h"
|
||||
@ -193,7 +192,7 @@ AudioEncoderOpus::AudioEncoderOpus(
|
||||
audio_network_adaptor_creator_(
|
||||
audio_network_adaptor_creator
|
||||
? std::move(audio_network_adaptor_creator)
|
||||
: [this](const ProtoString& config_string,
|
||||
: [this](const std::string& config_string,
|
||||
RtcEventLog* event_log,
|
||||
const Clock* clock) {
|
||||
return DefaultAudioNetworkAdaptorCreator(config_string,
|
||||
@ -549,7 +548,7 @@ void AudioEncoderOpus::ApplyAudioNetworkAdaptor() {
|
||||
|
||||
std::unique_ptr<AudioNetworkAdaptor>
|
||||
AudioEncoderOpus::DefaultAudioNetworkAdaptorCreator(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
RtcEventLog* event_log,
|
||||
const Clock* clock) const {
|
||||
AudioNetworkAdaptorImpl::Config config;
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
#include "webrtc/base/protobuf_utils.h"
|
||||
#include "webrtc/common_audio/smoothing_filter.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h"
|
||||
@ -157,7 +156,7 @@ class AudioEncoderOpus final : public AudioEncoder {
|
||||
|
||||
void ApplyAudioNetworkAdaptor();
|
||||
std::unique_ptr<AudioNetworkAdaptor> DefaultAudioNetworkAdaptorCreator(
|
||||
const ProtoString& config_string,
|
||||
const std::string& config_string,
|
||||
RtcEventLog* event_log,
|
||||
const Clock* clock) const;
|
||||
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
#include "webrtc/base/ignore_wundef.h"
|
||||
#include "webrtc/base/sha1digest.h"
|
||||
#include "webrtc/base/stringencode.h"
|
||||
#include "webrtc/base/protobuf_utils.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h"
|
||||
@ -195,7 +194,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
|
||||
@ -208,7 +207,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
|
||||
|
||||
Reference in New Issue
Block a user