Remove the audio codec factory methods that don't take AudioCodecPairId

Bug: webrtc:9062
Change-Id: I929097f45986335633ccf01462348c9d24202424
Reviewed-on: https://webrtc-review.googlesource.com/74441
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23487}
This commit is contained in:
Karl Wiberg
2018-06-01 11:24:55 +02:00
committed by Commit Bot
parent c4b7f037b7
commit f1c470e9fb
7 changed files with 4 additions and 145 deletions

View File

@ -22,22 +22,6 @@ namespace webrtc {
namespace audio_decoder_factory_template_impl {
template <typename T, typename ConfigT>
class MakeAudioDecoderTakesTwoArgs {
private:
template <typename U>
static auto Test(int) -> decltype(
U::MakeAudioDecoder(std::declval<ConfigT>(),
std::declval<rtc::Optional<AudioCodecPairId>>()),
std::true_type());
template <typename U>
static std::false_type Test(...);
public:
static constexpr bool value = decltype(Test<T>(0))::value;
};
template <typename... Ts>
struct Helper;
@ -73,26 +57,9 @@ struct Helper<T, Ts...> {
const SdpAudioFormat& format,
rtc::Optional<AudioCodecPairId> codec_pair_id) {
auto opt_config = T::SdpToConfig(format);
return opt_config ? CallMakeAudioDecoder(*opt_config, codec_pair_id)
return opt_config ? T::MakeAudioDecoder(*opt_config, codec_pair_id)
: Helper<Ts...>::MakeAudioDecoder(format, codec_pair_id);
}
template <
typename ConfigT,
typename std::enable_if<
!MakeAudioDecoderTakesTwoArgs<T, ConfigT>::value>::type* = nullptr>
static decltype(T::MakeAudioDecoder(std::declval<ConfigT>()))
CallMakeAudioDecoder(const ConfigT& config,
rtc::Optional<AudioCodecPairId> codec_pair_id) {
return T::MakeAudioDecoder(config);
}
template <typename ConfigT>
static decltype(
T::MakeAudioDecoder(std::declval<ConfigT>(),
std::declval<rtc::Optional<AudioCodecPairId>>()))
CallMakeAudioDecoder(const ConfigT& config,
rtc::Optional<AudioCodecPairId> codec_pair_id) {
return T::MakeAudioDecoder(config, codec_pair_id);
}
};
template <typename... Ts>
@ -133,8 +100,6 @@ class AudioDecoderFactoryT : public AudioDecoderFactory {
//
// // Creates an AudioDecoder for the specified format. Used to implement
// // AudioDecoderFactory::MakeAudioDecoder().
// std::unique_ptr<AudioDecoder> MakeAudioDecoder(const ConfigType& config);
// OR
// std::unique_ptr<AudioDecoder> MakeAudioDecoder(
// const ConfigType& config,
// rtc::Optional<AudioCodecPairId> codec_pair_id);