CCodec: handle vendor parameters
Bug: 142705928
Test: atest ccodec_unit_test:CCodecConfigTest
Change-Id: Ib3fe12d8e6f6785567c9f0ebd74e8ffce6a84322
diff --git a/media/codec2/sfplugin/ReflectedParamUpdater.cpp b/media/codec2/sfplugin/ReflectedParamUpdater.cpp
index 55b0ec9..f39051b 100644
--- a/media/codec2/sfplugin/ReflectedParamUpdater.cpp
+++ b/media/codec2/sfplugin/ReflectedParamUpdater.cpp
@@ -125,18 +125,6 @@
}
addParamDesc(desc, *structDesc, reflector, true /* markVendor */);
}
-
- // TEMP: also add vendor parameters as non-vendor
- for (const std::shared_ptr<C2ParamDescriptor> &desc : paramDescs) {
- if (!desc->index().isVendor()) {
- continue;
- }
- std::unique_ptr<C2StructDescriptor> structDesc = reflector->describe(
- desc->index().coreIndex());
- if (structDesc) {
- addParamDesc(desc, *structDesc, reflector, false /* markVendor */);
- }
- }
}
void ReflectedParamUpdater::addParamStructDesc(
@@ -286,6 +274,20 @@
}
}
+void ReflectedParamUpdater::getKeysForParamIndex(
+ const C2Param::Index &index,
+ std::vector<std::string> *keys /* nonnull */) const {
+ CHECK(keys != nullptr);
+ keys->clear();
+ for (const std::pair<const std::string, FieldDesc> &kv : mMap) {
+ const std::string &name = kv.first;
+ const FieldDesc &desc = kv.second;
+ if (desc.paramDesc->index() == index) {
+ keys->push_back(name);
+ }
+ }
+}
+
void ReflectedParamUpdater::updateParamsFromMessage(
const Dict ¶ms,
std::vector<std::unique_ptr<C2Param>> *vec /* nonnull */) const {