mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 5/inf
Add field trials to audio api. It is added as a pointer with nullptr as default. It is not (yet) used anywhere. Usage of field trials comes in subsequent patches. Bug: webrtc:10335 Change-Id: Icbe22d95c356a6fefde34590f11ea63f005ab09e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255521 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36213}
This commit is contained in:
parent
160b37b70f
commit
6e2b9e2210
47 changed files with 152 additions and 50 deletions
|
@ -32,6 +32,7 @@ rtc_library("audio_codecs_api") {
|
|||
"..:array_view",
|
||||
"..:bitrate_allocation",
|
||||
"..:scoped_refptr",
|
||||
"../../api:webrtc_key_value_config",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:sanitizer",
|
||||
|
|
|
@ -21,6 +21,7 @@ rtc_library("audio_encoder_L16") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:pcm16b",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
|
@ -41,6 +42,7 @@ rtc_library("audio_decoder_L16") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:pcm16b",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
|
|
@ -37,7 +37,8 @@ void AudioDecoderL16::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderL16::MakeAudioDecoder(
|
||||
const Config& config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -39,7 +40,8 @@ struct RTC_EXPORT AudioDecoderL16 {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
const Config& config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -59,7 +59,8 @@ AudioCodecInfo AudioEncoderL16::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderL16::MakeAudioEncoder(
|
||||
const AudioEncoderL16::Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
AudioEncoderPcm16B::Config c;
|
||||
c.sample_rate_hz = config.sample_rate_hz;
|
||||
c.num_channels = config.num_channels;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -44,7 +45,8 @@ struct RTC_EXPORT AudioEncoderL16 {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "api/audio_codecs/audio_decoder_factory.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -32,7 +33,8 @@ struct Helper<> {
|
|||
static bool IsSupportedDecoder(const SdpAudioFormat& format) { return false; }
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
const SdpAudioFormat& format,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
@ -55,16 +57,22 @@ struct Helper<T, Ts...> {
|
|||
}
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
const SdpAudioFormat& format,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
auto opt_config = T::SdpToConfig(format);
|
||||
return opt_config ? T::MakeAudioDecoder(*opt_config, codec_pair_id)
|
||||
: Helper<Ts...>::MakeAudioDecoder(format, codec_pair_id);
|
||||
: Helper<Ts...>::MakeAudioDecoder(format, codec_pair_id,
|
||||
field_trials);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename... Ts>
|
||||
class AudioDecoderFactoryT : public AudioDecoderFactory {
|
||||
public:
|
||||
explicit AudioDecoderFactoryT(const WebRtcKeyValueConfig* field_trials) {
|
||||
field_trials_ = field_trials;
|
||||
}
|
||||
|
||||
std::vector<AudioCodecSpec> GetSupportedDecoders() override {
|
||||
std::vector<AudioCodecSpec> specs;
|
||||
Helper<Ts...>::AppendSupportedDecoders(&specs);
|
||||
|
@ -78,8 +86,11 @@ class AudioDecoderFactoryT : public AudioDecoderFactory {
|
|||
std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
const SdpAudioFormat& format,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) override {
|
||||
return Helper<Ts...>::MakeAudioDecoder(format, codec_pair_id);
|
||||
return Helper<Ts...>::MakeAudioDecoder(format, codec_pair_id,
|
||||
field_trials_);
|
||||
}
|
||||
|
||||
const WebRtcKeyValueConfig* field_trials_;
|
||||
};
|
||||
|
||||
} // namespace audio_decoder_factory_template_impl
|
||||
|
@ -115,7 +126,8 @@ class AudioDecoderFactoryT : public AudioDecoderFactory {
|
|||
// TODO(kwiberg): Point at CreateBuiltinAudioDecoderFactory() for an example of
|
||||
// how it is used.
|
||||
template <typename... Ts>
|
||||
rtc::scoped_refptr<AudioDecoderFactory> CreateAudioDecoderFactory() {
|
||||
rtc::scoped_refptr<AudioDecoderFactory> CreateAudioDecoderFactory(
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr) {
|
||||
// There's no technical reason we couldn't allow zero template parameters,
|
||||
// but such a factory couldn't create any decoders, and callers can do this
|
||||
// by mistake by simply forgetting the <> altogether. So we forbid it in
|
||||
|
@ -124,7 +136,8 @@ rtc::scoped_refptr<AudioDecoderFactory> CreateAudioDecoderFactory() {
|
|||
"Caller must give at least one template parameter");
|
||||
|
||||
return rtc::make_ref_counted<
|
||||
audio_decoder_factory_template_impl::AudioDecoderFactoryT<Ts...>>();
|
||||
audio_decoder_factory_template_impl::AudioDecoderFactoryT<Ts...>>(
|
||||
field_trials);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "api/audio_codecs/audio_encoder_factory.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -36,7 +37,8 @@ struct Helper<> {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
int payload_type,
|
||||
const SdpAudioFormat& format,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
@ -63,13 +65,14 @@ struct Helper<T, Ts...> {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
int payload_type,
|
||||
const SdpAudioFormat& format,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
auto opt_config = T::SdpToConfig(format);
|
||||
if (opt_config) {
|
||||
return T::MakeAudioEncoder(*opt_config, payload_type, codec_pair_id);
|
||||
} else {
|
||||
return Helper<Ts...>::MakeAudioEncoder(payload_type, format,
|
||||
codec_pair_id);
|
||||
codec_pair_id, field_trials);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -77,6 +80,10 @@ struct Helper<T, Ts...> {
|
|||
template <typename... Ts>
|
||||
class AudioEncoderFactoryT : public AudioEncoderFactory {
|
||||
public:
|
||||
explicit AudioEncoderFactoryT(const WebRtcKeyValueConfig* field_trials) {
|
||||
field_trials_ = field_trials;
|
||||
}
|
||||
|
||||
std::vector<AudioCodecSpec> GetSupportedEncoders() override {
|
||||
std::vector<AudioCodecSpec> specs;
|
||||
Helper<Ts...>::AppendSupportedEncoders(&specs);
|
||||
|
@ -92,8 +99,11 @@ class AudioEncoderFactoryT : public AudioEncoderFactory {
|
|||
int payload_type,
|
||||
const SdpAudioFormat& format,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) override {
|
||||
return Helper<Ts...>::MakeAudioEncoder(payload_type, format, codec_pair_id);
|
||||
return Helper<Ts...>::MakeAudioEncoder(payload_type, format, codec_pair_id,
|
||||
field_trials_);
|
||||
}
|
||||
|
||||
const WebRtcKeyValueConfig* field_trials_;
|
||||
};
|
||||
|
||||
} // namespace audio_encoder_factory_template_impl
|
||||
|
@ -134,7 +144,8 @@ class AudioEncoderFactoryT : public AudioEncoderFactory {
|
|||
// TODO(kwiberg): Point at CreateBuiltinAudioEncoderFactory() for an example of
|
||||
// how it is used.
|
||||
template <typename... Ts>
|
||||
rtc::scoped_refptr<AudioEncoderFactory> CreateAudioEncoderFactory() {
|
||||
rtc::scoped_refptr<AudioEncoderFactory> CreateAudioEncoderFactory(
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr) {
|
||||
// There's no technical reason we couldn't allow zero template parameters,
|
||||
// but such a factory couldn't create any encoders, and callers can do this
|
||||
// by mistake by simply forgetting the <> altogether. So we forbid it in
|
||||
|
@ -143,7 +154,8 @@ rtc::scoped_refptr<AudioEncoderFactory> CreateAudioEncoderFactory() {
|
|||
"Caller must give at least one template parameter");
|
||||
|
||||
return rtc::make_ref_counted<
|
||||
audio_encoder_factory_template_impl::AudioEncoderFactoryT<Ts...>>();
|
||||
audio_encoder_factory_template_impl::AudioEncoderFactoryT<Ts...>>(
|
||||
field_trials);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -47,8 +47,10 @@ struct NotAdvertised {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt) {
|
||||
return T::MakeAudioEncoder(config, payload_type, codec_pair_id);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr) {
|
||||
return T::MakeAudioEncoder(config, payload_type, codec_pair_id,
|
||||
field_trials);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ rtc_library("audio_encoder_g711") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:g711",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
|
@ -41,6 +42,7 @@ rtc_library("audio_decoder_g711") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:g711",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
|
|
@ -47,7 +47,8 @@ void AudioDecoderG711::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderG711::MakeAudioDecoder(
|
||||
const Config& config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -39,7 +40,8 @@ struct RTC_EXPORT AudioDecoderG711 {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
const Config& config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -64,7 +64,8 @@ AudioCodecInfo AudioEncoderG711::QueryAudioEncoder(const Config& config) {
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderG711::MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -44,7 +45,8 @@ struct RTC_EXPORT AudioEncoderG711 {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -27,6 +27,7 @@ rtc_library("audio_encoder_g722") {
|
|||
deps = [
|
||||
":audio_encoder_g722_config",
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:g722",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
|
@ -47,6 +48,7 @@ rtc_library("audio_decoder_g722") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:g722",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
|
|
@ -36,7 +36,8 @@ void AudioDecoderG722::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderG722::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -33,7 +34,8 @@ struct RTC_EXPORT AudioDecoderG722 {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -62,7 +62,8 @@ AudioCodecInfo AudioEncoderG722::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderG722::MakeAudioEncoder(
|
||||
const AudioEncoderG722Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/audio_codecs/g722/audio_encoder_g722_config.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -34,7 +35,8 @@ struct RTC_EXPORT AudioEncoderG722 {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const AudioEncoderG722Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -27,6 +27,7 @@ rtc_library("audio_encoder_ilbc") {
|
|||
deps = [
|
||||
":audio_encoder_ilbc_config",
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:ilbc",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:safe_minmax",
|
||||
|
@ -46,6 +47,7 @@ rtc_library("audio_decoder_ilbc") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:ilbc",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
]
|
||||
|
|
|
@ -34,7 +34,8 @@ void AudioDecoderIlbc::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderIlbc::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
return std::make_unique<AudioDecoderIlbcImpl>();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -29,7 +30,8 @@ struct AudioDecoderIlbc {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -76,7 +76,8 @@ AudioCodecInfo AudioEncoderIlbc::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderIlbc::MakeAudioEncoder(
|
||||
const AudioEncoderIlbcConfig& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/audio_codecs/ilbc/audio_encoder_ilbc_config.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -33,7 +34,8 @@ struct AudioEncoderIlbc {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const AudioEncoderIlbcConfig& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -65,6 +65,7 @@ rtc_library("audio_encoder_isac_fix") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:isac_fix",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
@ -84,6 +85,7 @@ rtc_library("audio_decoder_isac_fix") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:isac_fix",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
@ -103,6 +105,7 @@ rtc_library("audio_encoder_isac_float") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:isac",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
@ -122,6 +125,7 @@ rtc_library("audio_decoder_isac_float") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:isac",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
|
|
@ -33,7 +33,8 @@ void AudioDecoderIsacFix::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderIsacFix::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
AudioDecoderIsacFixImpl::Config c;
|
||||
c.sample_rate_hz = 16000;
|
||||
return std::make_unique<AudioDecoderIsacFixImpl>(c);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -30,7 +31,8 @@ struct RTC_EXPORT AudioDecoderIsacFix {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -42,7 +42,8 @@ void AudioDecoderIsacFloat::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderIsacFloat::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
AudioDecoderIsacFloatImpl::Config c;
|
||||
c.sample_rate_hz = config.sample_rate_hz;
|
||||
if (!config.IsOk()) {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -35,7 +36,8 @@ struct RTC_EXPORT AudioDecoderIsacFloat {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -56,7 +56,8 @@ AudioCodecInfo AudioEncoderIsacFix::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderIsacFix::MakeAudioEncoder(
|
||||
AudioEncoderIsacFix::Config config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
AudioEncoderIsacFixImpl::Config c;
|
||||
c.frame_size_ms = config.frame_size_ms;
|
||||
c.bit_rate = config.bit_rate;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -44,7 +45,8 @@ struct RTC_EXPORT AudioEncoderIsacFix {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
Config config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -68,7 +68,8 @@ AudioCodecInfo AudioEncoderIsacFloat::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderIsacFloat::MakeAudioEncoder(
|
||||
const AudioEncoderIsacFloat::Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
AudioEncoderIsacFloatImpl::Config c;
|
||||
c.payload_type = payload_type;
|
||||
c.sample_rate_hz = config.sample_rate_hz;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -58,7 +59,8 @@ struct RTC_EXPORT AudioEncoderIsacFloat {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -46,6 +46,7 @@ rtc_library("audio_encoder_opus") {
|
|||
deps = [
|
||||
":audio_encoder_opus_config",
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:webrtc_opus",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
@ -65,6 +66,7 @@ rtc_library("audio_decoder_opus") {
|
|||
]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:webrtc_opus",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
@ -82,6 +84,7 @@ rtc_library("audio_encoder_multiopus") {
|
|||
sources = [ "audio_encoder_multi_channel_opus.cc" ]
|
||||
deps = [
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:webrtc_multiopus",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
@ -100,6 +103,7 @@ rtc_library("audio_decoder_multiopus") {
|
|||
deps = [
|
||||
":audio_decoder_opus_config",
|
||||
"..:audio_codecs_api",
|
||||
"../../../api:webrtc_key_value_config",
|
||||
"../../../modules/audio_coding:webrtc_multiopus",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:rtc_export",
|
||||
|
|
|
@ -64,7 +64,8 @@ void AudioDecoderMultiChannelOpus::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderMultiChannelOpus::MakeAudioDecoder(
|
||||
AudioDecoderMultiChannelOpusConfig config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
return AudioDecoderMultiChannelOpusImpl::MakeAudioDecoder(config);
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/audio_codecs/opus/audio_decoder_multi_channel_opus_config.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -32,7 +33,8 @@ struct RTC_EXPORT AudioDecoderMultiChannelOpus {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
AudioDecoderMultiChannelOpusConfig config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -73,7 +73,8 @@ void AudioDecoderOpus::AppendSupportedDecoders(
|
|||
|
||||
std::unique_ptr<AudioDecoder> AudioDecoderOpus::MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -34,7 +35,8 @@ struct RTC_EXPORT AudioDecoderOpus {
|
|||
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
||||
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
||||
Config config,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -66,7 +66,8 @@ AudioCodecInfo AudioEncoderMultiChannelOpus::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderMultiChannelOpus::MakeAudioEncoder(
|
||||
const AudioEncoderMultiChannelOpusConfig& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
return AudioEncoderMultiChannelOpusImpl::MakeAudioEncoder(config,
|
||||
payload_type);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -33,7 +34,8 @@ struct RTC_EXPORT AudioEncoderMultiChannelOpus {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -32,7 +32,8 @@ AudioCodecInfo AudioEncoderOpus::QueryAudioEncoder(
|
|||
std::unique_ptr<AudioEncoder> AudioEncoderOpus::MakeAudioEncoder(
|
||||
const AudioEncoderOpusConfig& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/,
|
||||
const WebRtcKeyValueConfig* field_trials) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/audio_codecs/opus/audio_encoder_opus_config.h"
|
||||
#include "api/webrtc_key_value_config.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -34,7 +35,8 @@ struct RTC_EXPORT AudioEncoderOpus {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const AudioEncoderOpusConfig& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -37,8 +37,10 @@ struct NotAdvertised {
|
|||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
const Config& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt) {
|
||||
return T::MakeAudioEncoder(config, payload_type, codec_pair_id);
|
||||
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt,
|
||||
const WebRtcKeyValueConfig* field_trials = nullptr) {
|
||||
return T::MakeAudioEncoder(config, payload_type, codec_pair_id,
|
||||
field_trials);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ if (rtc_include_tests) {
|
|||
"..:audio_codecs_api",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../test:audio_codec_mocks",
|
||||
"../../../test:scoped_key_value_config",
|
||||
"../../../test:test_support",
|
||||
"../L16:audio_decoder_L16",
|
||||
"../L16:audio_encoder_L16",
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_audio_decoder.h"
|
||||
#include "test/scoped_key_value_config.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -77,9 +78,11 @@ struct AudioDecoderFakeApi {
|
|||
} // namespace
|
||||
|
||||
TEST(AudioDecoderFactoryTemplateTest, NoDecoderTypes) {
|
||||
test::ScopedKeyValueConfig field_trials;
|
||||
rtc::scoped_refptr<AudioDecoderFactory> factory(
|
||||
rtc::make_ref_counted<
|
||||
audio_decoder_factory_template_impl::AudioDecoderFactoryT<>>());
|
||||
audio_decoder_factory_template_impl::AudioDecoderFactoryT<>>(
|
||||
&field_trials));
|
||||
EXPECT_THAT(factory->GetSupportedDecoders(), ::testing::IsEmpty());
|
||||
EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1}));
|
||||
EXPECT_EQ(nullptr,
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_audio_encoder.h"
|
||||
#include "test/scoped_key_value_config.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -77,9 +78,11 @@ struct AudioEncoderFakeApi {
|
|||
} // namespace
|
||||
|
||||
TEST(AudioEncoderFactoryTemplateTest, NoEncoderTypes) {
|
||||
test::ScopedKeyValueConfig field_trials;
|
||||
rtc::scoped_refptr<AudioEncoderFactory> factory(
|
||||
rtc::make_ref_counted<
|
||||
audio_encoder_factory_template_impl::AudioEncoderFactoryT<>>());
|
||||
audio_encoder_factory_template_impl::AudioEncoderFactoryT<>>(
|
||||
&field_trials));
|
||||
EXPECT_THAT(factory->GetSupportedEncoders(), ::testing::IsEmpty());
|
||||
EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"foo", 8000, 1}));
|
||||
EXPECT_EQ(nullptr,
|
||||
|
|
|
@ -1396,6 +1396,7 @@ if (rtc_include_tests) {
|
|||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base/synchronization:mutex",
|
||||
"../../test:fileutils",
|
||||
"../../test:scoped_key_value_config",
|
||||
"../../test:test_support",
|
||||
]
|
||||
absl_deps = [
|
||||
|
|
Loading…
Reference in a new issue