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}
diff --git a/api/audio_codecs/BUILD.gn b/api/audio_codecs/BUILD.gn
index ee943a1..3206a74 100644
--- a/api/audio_codecs/BUILD.gn
+++ b/api/audio_codecs/BUILD.gn
@@ -19,12 +19,10 @@
"audio_codec_pair_id.h",
"audio_decoder.cc",
"audio_decoder.h",
- "audio_decoder_factory.cc",
"audio_decoder_factory.h",
"audio_decoder_factory_template.h",
"audio_encoder.cc",
"audio_encoder.h",
- "audio_encoder_factory.cc",
"audio_encoder_factory.h",
"audio_encoder_factory_template.h",
"audio_format.cc",
diff --git a/api/audio_codecs/audio_decoder_factory.cc b/api/audio_codecs/audio_decoder_factory.cc
deleted file mode 100644
index 08dbe78..0000000
--- a/api/audio_codecs/audio_decoder_factory.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "api/audio_codecs/audio_decoder_factory.h"
-
-namespace webrtc {
-
-std::unique_ptr<AudioDecoder> AudioDecoderFactory::MakeAudioDecoder(
- const SdpAudioFormat& format,
- rtc::Optional<AudioCodecPairId> codec_pair_id) {
- return MakeAudioDecoder(format);
-}
-
-std::unique_ptr<AudioDecoder> AudioDecoderFactory::MakeAudioDecoder(
- const SdpAudioFormat& format) {
- return MakeAudioDecoder(format, rtc::nullopt);
-}
-
-} // namespace webrtc
diff --git a/api/audio_codecs/audio_decoder_factory.h b/api/audio_codecs/audio_decoder_factory.h
index 9954f31..fb1c965 100644
--- a/api/audio_codecs/audio_decoder_factory.h
+++ b/api/audio_codecs/audio_decoder_factory.h
@@ -41,11 +41,7 @@
// work.
virtual std::unique_ptr<AudioDecoder> MakeAudioDecoder(
const SdpAudioFormat& format,
- rtc::Optional<AudioCodecPairId> codec_pair_id);
-
- // Deprecated version of the above.
- virtual std::unique_ptr<AudioDecoder> MakeAudioDecoder(
- const SdpAudioFormat& format);
+ rtc::Optional<AudioCodecPairId> codec_pair_id) = 0;
};
} // namespace webrtc
diff --git a/api/audio_codecs/audio_decoder_factory_template.h b/api/audio_codecs/audio_decoder_factory_template.h
index 20a56d3..4adac21 100644
--- a/api/audio_codecs/audio_decoder_factory_template.h
+++ b/api/audio_codecs/audio_decoder_factory_template.h
@@ -22,22 +22,6 @@
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 @@
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 @@
//
// // 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);
diff --git a/api/audio_codecs/audio_encoder_factory.cc b/api/audio_codecs/audio_encoder_factory.cc
deleted file mode 100644
index b5c7110..0000000
--- a/api/audio_codecs/audio_encoder_factory.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "api/audio_codecs/audio_encoder_factory.h"
-
-namespace webrtc {
-
-std::unique_ptr<AudioEncoder> AudioEncoderFactory::MakeAudioEncoder(
- int payload_type,
- const SdpAudioFormat& format,
- rtc::Optional<AudioCodecPairId> codec_pair_id) {
- return MakeAudioEncoder(payload_type, format);
-}
-
-std::unique_ptr<AudioEncoder> AudioEncoderFactory::MakeAudioEncoder(
- int payload_type,
- const SdpAudioFormat& format) {
- return MakeAudioEncoder(payload_type, format, rtc::nullopt);
-}
-
-} // namespace webrtc
diff --git a/api/audio_codecs/audio_encoder_factory.h b/api/audio_codecs/audio_encoder_factory.h
index 02bdfd9..7825953 100644
--- a/api/audio_codecs/audio_encoder_factory.h
+++ b/api/audio_codecs/audio_encoder_factory.h
@@ -50,12 +50,7 @@
virtual std::unique_ptr<AudioEncoder> MakeAudioEncoder(
int payload_type,
const SdpAudioFormat& format,
- rtc::Optional<AudioCodecPairId> codec_pair_id);
-
- // Deprecated version of the above.
- virtual std::unique_ptr<AudioEncoder> MakeAudioEncoder(
- int payload_type,
- const SdpAudioFormat& format);
+ rtc::Optional<AudioCodecPairId> codec_pair_id) = 0;
};
} // namespace webrtc
diff --git a/api/audio_codecs/audio_encoder_factory_template.h b/api/audio_codecs/audio_encoder_factory_template.h
index 6d4d9d6..f76677d 100644
--- a/api/audio_codecs/audio_encoder_factory_template.h
+++ b/api/audio_codecs/audio_encoder_factory_template.h
@@ -22,23 +22,6 @@
namespace audio_encoder_factory_template_impl {
-template <typename T, typename ConfigT>
-class MakeAudioEncoderTakesThreeArgs {
- private:
- template <typename U>
- static auto Test(int) -> decltype(
- U::MakeAudioEncoder(std::declval<ConfigT>(),
- std::declval<int>(),
- 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;
@@ -83,33 +66,12 @@
rtc::Optional<AudioCodecPairId> codec_pair_id) {
auto opt_config = T::SdpToConfig(format);
if (opt_config) {
- return CallMakeAudioEncoder(*opt_config, payload_type, codec_pair_id);
+ return T::MakeAudioEncoder(*opt_config, payload_type, codec_pair_id);
} else {
return Helper<Ts...>::MakeAudioEncoder(payload_type, format,
codec_pair_id);
}
}
- template <
- typename ConfigT,
- typename std::enable_if<
- !MakeAudioEncoderTakesThreeArgs<T, ConfigT>::value>::type* = nullptr>
- static decltype(T::MakeAudioEncoder(std::declval<ConfigT>(),
- std::declval<int>()))
- CallMakeAudioEncoder(const ConfigT& config,
- int payload_type,
- rtc::Optional<AudioCodecPairId> codec_pair_id) {
- return T::MakeAudioEncoder(config, payload_type);
- }
- template <typename ConfigT>
- static decltype(
- T::MakeAudioEncoder(std::declval<ConfigT>(),
- std::declval<int>(),
- std::declval<rtc::Optional<AudioCodecPairId>>()))
- CallMakeAudioEncoder(const ConfigT& config,
- int payload_type,
- rtc::Optional<AudioCodecPairId> codec_pair_id) {
- return T::MakeAudioEncoder(config, payload_type, codec_pair_id);
- }
};
template <typename... Ts>
@@ -156,9 +118,6 @@
//
// // Creates an AudioEncoder for the specified format. Used to implement
// // AudioEncoderFactory::MakeAudioEncoder().
-// std::unique_ptr<AudioEncoder> MakeAudioEncoder(const ConfigType& config,
-// int payload_type);
-// OR
// std::unique_ptr<AudioDecoder> MakeAudioEncoder(
// const ConfigType& config,
// int payload_type,