Codec2: remove some unused code
MyReflector code is copied into MyComponentInstance.
C2TypedFieldSupportedValues was meant as a helper class that should not be
part of C2Param.h. It will be reworked to reuse C2FieldSupportedValues to
avoid having to copy to-from the Codec2 struct.
Bug: 64121714
Test: build
Change-Id: Ibb6fb87f69470b721fe7bd1871c4f2400411b6b9
diff --git a/media/libstagefright/codec2/include/C2Param.h b/media/libstagefright/codec2/include/C2Param.h
index 0fb9881a..753c665 100644
--- a/media/libstagefright/codec2/include/C2Param.h
+++ b/media/libstagefright/codec2/include/C2Param.h
@@ -1100,48 +1100,6 @@
};
/**
- * A useable supported values for a field.
- *
- * This can be either a range or a set of values. The range can be linear or geometric with a
- * clear minimum and maximum value, and can have an optional step size or geometric ratio. Values
- * can optionally represent flags.
- *
- * \note Do not use flags to represent bitfields. Use individual values or separate fields instead.
- */
-template<typename T>
-struct C2TypedFieldSupportedValues {
-//public:
- enum Type {
- RANGE, ///< a numeric range that can be continuous or discrete
- VALUES, ///< a list of values
- FLAGS ///< a list of flags that can be OR-ed
- };
-
- Type type;
-
- struct {
- T min;
- T max;
- T step;
- T nom;
- T denom;
- } range;
- std::vector<T> values;
-
- C2TypedFieldSupportedValues(T min, T max, T step = T(std::is_floating_point<T>::value ? 0 : 1))
- : type(RANGE),
- range{min, max, step, (T)1, (T)1} { }
-
- C2TypedFieldSupportedValues(T min, T max, T nom, T den) :
- type(RANGE),
- range{min, max, (T)0, nom, den} { }
-
- C2TypedFieldSupportedValues(bool flags, std::initializer_list<T> list) :
- type(flags ? FLAGS : VALUES),
- values(list) {}
-};
-
-/**
* Generic supported values for a field.
*
* This can be either a range or a set of values. The range can be linear or geometric with a
diff --git a/media/libstagefright/codec2/tests/C2Param_test.cpp b/media/libstagefright/codec2/tests/C2Param_test.cpp
index 9a2ead6..83f67d5 100644
--- a/media/libstagefright/codec2/tests/C2Param_test.cpp
+++ b/media/libstagefright/codec2/tests/C2Param_test.cpp
@@ -2197,36 +2197,6 @@
typedef C2PortParam<C2Tuning, C2VideoConfigStruct> C2VideoConfigPortTuning;
-class MyReflector : public C2ParamReflector {
-private:
- std::unique_ptr<C2VideoConfigPortTuning::input> inputVideoConfigTuning;
- std::unique_ptr<C2VideoConfigPortTuning::output> outputVideoConfigTuning;
-
-public:
- void describeSupportedValues() {
- C2TypedFieldSupportedValues<int32_t> supportedWidths(16, 1920, 8);
- C2FieldSupportedValues supportedWidths2(16, 1920, 8);
-
-
- std::list<C2FieldSupportedValues> supported;
- //supported.emplace_push(inputVideoConfigTuning->mNumber, range(16, 1920, 8));
- //supported.emplace_push(inputVideoConfigTuning->mHeight, range(16, 1088, 8));
- //supported.emplace_push(inputVideoConfigTuning->mMetadataType, all_enums);
- //supported.emplace_push(inputVideoConfigTuning->mSupportedFormats, { 0, 1, 5, 7 });
- }
-
- virtual std::unique_ptr<android::C2StructDescriptor> describe(C2Param::BaseIndex paramType) {
- switch (paramType.baseIndex()) {
- case C2VideoConfigPortTuning::baseIndex:
- return std::unique_ptr<C2StructDescriptor>(new C2StructDescriptor{
- paramType.baseIndex(),
- C2VideoConfigPortTuning::fieldList,
- });
- }
- return nullptr;
- }
-};
-
class MyComponentInstance : public C2ComponentInterface {
public:
virtual C2String getName() const {