aboutsummaryrefslogtreecommitdiff
path: root/webrtc/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/common.h')
-rw-r--r--webrtc/common.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/webrtc/common.h b/webrtc/common.h
index dda045ee6c..d705d4b8ed 100644
--- a/webrtc/common.h
+++ b/webrtc/common.h
@@ -17,6 +17,23 @@
namespace webrtc {
+// Only add new values to the end of the enumeration and never remove (only
+// deprecate) to maintain binary compatibility.
+enum class ConfigOptionID {
+ kMyExperimentForTest,
+ kAlgo1CostFunctionForTest,
+ kTemporalLayersFactory,
+ kNetEqCapacityConfig,
+ kNetEqFastAccelerate,
+ kVoicePacing,
+ kExtendedFilter,
+ kDelayAgnostic,
+ kExperimentalAgc,
+ kExperimentalNs,
+ kBeamforming,
+ kIntelligibility
+};
+
// Class Config is designed to ease passing a set of options across webrtc code.
// Options are identified by typename in order to avoid incorrect casts.
//
@@ -61,8 +78,6 @@ class Config {
}
private:
- typedef void* OptionIdentifier;
-
struct BaseOption {
virtual ~BaseOption() {}
};
@@ -76,11 +91,9 @@ class Config {
T* value;
};
- // Own implementation of rtti-subset to avoid depending on rtti and its costs.
template<typename T>
- static OptionIdentifier identifier() {
- static char id_placeholder;
- return &id_placeholder;
+ static ConfigOptionID identifier() {
+ return T::identifier;
}
// Used to instantiate a default constructed object that doesn't needs to be
@@ -92,7 +105,7 @@ class Config {
return def;
}
- typedef std::map<OptionIdentifier, BaseOption*> OptionMap;
+ typedef std::map<ConfigOptionID, BaseOption*> OptionMap;
OptionMap options_;
// RTC_DISALLOW_COPY_AND_ASSIGN