Delete unused AudioCodingModule methods.
Methods deleted: IsCodecValid (static), QueryEncoder, SendFrequency. Bug: None Change-Id: Id63ea7cdc364583e896d3301d04fa9caae1e4d94 Reviewed-on: https://webrtc-review.googlesource.com/95486 Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24440}
This commit is contained in:
@ -50,15 +50,9 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
|
|||||||
void ModifyEncoder(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)>
|
void ModifyEncoder(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)>
|
||||||
modifier) override;
|
modifier) override;
|
||||||
|
|
||||||
void QueryEncoder(
|
|
||||||
rtc::FunctionView<void(const AudioEncoder*)> query) override;
|
|
||||||
|
|
||||||
// Get current send codec.
|
// Get current send codec.
|
||||||
absl::optional<CodecInst> SendCodec() const override;
|
absl::optional<CodecInst> SendCodec() const override;
|
||||||
|
|
||||||
// Get current send frequency.
|
|
||||||
int SendFrequency() const override;
|
|
||||||
|
|
||||||
// Sets the bitrate to the specified value in bits/sec. In case the codec does
|
// Sets the bitrate to the specified value in bits/sec. In case the codec does
|
||||||
// not support the requested value it will choose an appropriate value
|
// not support the requested value it will choose an appropriate value
|
||||||
// instead.
|
// instead.
|
||||||
@ -592,12 +586,6 @@ void AudioCodingModuleImpl::ModifyEncoder(
|
|||||||
modifier(&encoder_stack_);
|
modifier(&encoder_stack_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioCodingModuleImpl::QueryEncoder(
|
|
||||||
rtc::FunctionView<void(const AudioEncoder*)> query) {
|
|
||||||
rtc::CritScope lock(&acm_crit_sect_);
|
|
||||||
query(encoder_stack_.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get current send codec.
|
// Get current send codec.
|
||||||
absl::optional<CodecInst> AudioCodingModuleImpl::SendCodec() const {
|
absl::optional<CodecInst> AudioCodingModuleImpl::SendCodec() const {
|
||||||
rtc::CritScope lock(&acm_crit_sect_);
|
rtc::CritScope lock(&acm_crit_sect_);
|
||||||
@ -621,18 +609,6 @@ absl::optional<CodecInst> AudioCodingModuleImpl::SendCodec() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current send frequency.
|
|
||||||
int AudioCodingModuleImpl::SendFrequency() const {
|
|
||||||
rtc::CritScope lock(&acm_crit_sect_);
|
|
||||||
|
|
||||||
if (!encoder_stack_) {
|
|
||||||
RTC_LOG(LS_ERROR) << "SendFrequency Failed, no codec is registered";
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return encoder_stack_->SampleRateHz();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioCodingModuleImpl::SetBitRate(int bitrate_bps) {
|
void AudioCodingModuleImpl::SetBitRate(int bitrate_bps) {
|
||||||
rtc::CritScope lock(&acm_crit_sect_);
|
rtc::CritScope lock(&acm_crit_sect_);
|
||||||
if (encoder_stack_) {
|
if (encoder_stack_) {
|
||||||
@ -1284,12 +1260,4 @@ int AudioCodingModule::Codec(const char* payload_name,
|
|||||||
return i ? *i : -1;
|
return i ? *i : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks the validity of the parameters of the given codec
|
|
||||||
bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
|
|
||||||
bool valid = acm2::RentACodec::IsCodecValid(codec);
|
|
||||||
if (!valid)
|
|
||||||
RTC_LOG(LS_ERROR) << "Invalid codec setting";
|
|
||||||
return valid;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -80,10 +80,6 @@ absl::optional<CodecInst> RentACodec::CodecInstByParams(
|
|||||||
return ci;
|
return ci;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RentACodec::IsCodecValid(const CodecInst& codec_inst) {
|
|
||||||
return ACMCodecDB::CodecNumber(codec_inst) >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
absl::optional<bool> RentACodec::IsSupportedNumChannels(CodecId codec_id,
|
absl::optional<bool> RentACodec::IsSupportedNumChannels(CodecId codec_id,
|
||||||
size_t num_channels) {
|
size_t num_channels) {
|
||||||
auto i = CodecIndexFromId(codec_id);
|
auto i = CodecIndexFromId(codec_id);
|
||||||
|
@ -128,7 +128,6 @@ class RentACodec {
|
|||||||
static absl::optional<CodecInst> CodecInstByParams(const char* payload_name,
|
static absl::optional<CodecInst> CodecInstByParams(const char* payload_name,
|
||||||
int sampling_freq_hz,
|
int sampling_freq_hz,
|
||||||
size_t channels);
|
size_t channels);
|
||||||
static bool IsCodecValid(const CodecInst& codec_inst);
|
|
||||||
|
|
||||||
static inline bool IsPayloadTypeValid(int payload_type) {
|
static inline bool IsPayloadTypeValid(int payload_type) {
|
||||||
return payload_type >= 0 && payload_type <= 127;
|
return payload_type >= 0 && payload_type <= 127;
|
||||||
|
@ -150,20 +150,6 @@ class AudioCodingModule {
|
|||||||
int sampling_freq_hz,
|
int sampling_freq_hz,
|
||||||
size_t channels);
|
size_t channels);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// bool IsCodecValid()
|
|
||||||
// Checks the validity of the parameters of the given codec.
|
|
||||||
//
|
|
||||||
// Input:
|
|
||||||
// -codec : the structure which keeps the parameters of the
|
|
||||||
// codec.
|
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// true if the parameters are valid,
|
|
||||||
// false if any parameter is not valid.
|
|
||||||
//
|
|
||||||
static bool IsCodecValid(const CodecInst& codec);
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Sender
|
// Sender
|
||||||
//
|
//
|
||||||
@ -210,11 +196,6 @@ class AudioCodingModule {
|
|||||||
virtual void ModifyEncoder(
|
virtual void ModifyEncoder(
|
||||||
rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier) = 0;
|
rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier) = 0;
|
||||||
|
|
||||||
// |modifier| is called exactly once with one argument: a const pointer to the
|
|
||||||
// current encoder (which is null if there is no current encoder).
|
|
||||||
virtual void QueryEncoder(
|
|
||||||
rtc::FunctionView<void(AudioEncoder const*)> query) = 0;
|
|
||||||
|
|
||||||
// Utility method for simply replacing the existing encoder with a new one.
|
// Utility method for simply replacing the existing encoder with a new one.
|
||||||
void SetEncoder(std::unique_ptr<AudioEncoder> new_encoder) {
|
void SetEncoder(std::unique_ptr<AudioEncoder> new_encoder) {
|
||||||
ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
|
ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
|
||||||
@ -231,16 +212,6 @@ class AudioCodingModule {
|
|||||||
//
|
//
|
||||||
virtual absl::optional<CodecInst> SendCodec() const = 0;
|
virtual absl::optional<CodecInst> SendCodec() const = 0;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// int32_t SendFrequency()
|
|
||||||
// Get the sampling frequency of the current encoder in Hertz.
|
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// positive; sampling frequency [Hz] of the current encoder.
|
|
||||||
// -1 if an error has happened.
|
|
||||||
//
|
|
||||||
virtual int32_t SendFrequency() const = 0;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Sets the bitrate to the specified value in bits/sec. If the value is not
|
// Sets the bitrate to the specified value in bits/sec. If the value is not
|
||||||
// supported by the codec, it will choose another appropriate value.
|
// supported by the codec, it will choose another appropriate value.
|
||||||
|
Reference in New Issue
Block a user