Adopt absl::string_view in modules/audio_coding/
Bug: webrtc:13579 Change-Id: Ifec66fb6ba9724d18539de7245a358c2d13c7939 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268547 Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Ali Tofigh <alito@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37573}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
761072f68e
commit
714e3cbb48
@ -15,6 +15,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/bitrate_controller.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/channel_controller.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/debug_dump_writer.h"
|
||||
@ -219,7 +220,7 @@ ControllerManagerImpl::Config::Config(int min_reordering_time_ms,
|
||||
ControllerManagerImpl::Config::~Config() = default;
|
||||
|
||||
std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
const std::string& config_string,
|
||||
absl::string_view config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
@ -235,7 +236,7 @@ std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
}
|
||||
|
||||
std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
const std::string& config_string,
|
||||
absl::string_view config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
@ -247,7 +248,8 @@ std::unique_ptr<ControllerManager> ControllerManagerImpl::Create(
|
||||
DebugDumpWriter* debug_dump_writer) {
|
||||
#if WEBRTC_ENABLE_PROTOBUF
|
||||
audio_network_adaptor::config::ControllerManager controller_manager_config;
|
||||
RTC_CHECK(controller_manager_config.ParseFromString(config_string));
|
||||
RTC_CHECK(
|
||||
controller_manager_config.ParseFromString(std::string(config_string)));
|
||||
if (debug_dump_writer)
|
||||
debug_dump_writer->DumpControllerManagerConfig(controller_manager_config,
|
||||
rtc::TimeMillis());
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/controller.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -46,7 +47,7 @@ class ControllerManagerImpl final : public ControllerManager {
|
||||
};
|
||||
|
||||
static std::unique_ptr<ControllerManager> Create(
|
||||
const std::string& config_string,
|
||||
absl::string_view config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
@ -57,7 +58,7 @@ class ControllerManagerImpl final : public ControllerManager {
|
||||
bool initial_dtx_enabled);
|
||||
|
||||
static std::unique_ptr<ControllerManager> Create(
|
||||
const std::string& config_string,
|
||||
absl::string_view config_string,
|
||||
size_t num_encoder_channels,
|
||||
rtc::ArrayView<const int> encoder_frame_lengths_ms,
|
||||
int min_encoder_bitrate_bps,
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/mock/mock_controller.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/mock/mock_debug_dump_writer.h"
|
||||
#include "rtc_base/fake_clock.h"
|
||||
@ -276,7 +277,7 @@ constexpr int kInitialFrameLengthMs = 60;
|
||||
constexpr int kMinBitrateBps = 6000;
|
||||
|
||||
ControllerManagerStates CreateControllerManager(
|
||||
const std::string& config_string) {
|
||||
absl::string_view config_string) {
|
||||
ControllerManagerStates states;
|
||||
constexpr size_t kNumEncoderChannels = 2;
|
||||
const std::vector<int> encoder_frame_lengths_ms = {20, 60};
|
||||
|
||||
Reference in New Issue
Block a user