Loading media/codec2/sfplugin/CCodec.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -375,7 +375,11 @@ public: // consumer usage is queried earlier. if (status.str().empty()) { ALOGD("ISConfig not changed"); } else { ALOGD("ISConfig%s", status.str().c_str()); } return err; } Loading media/codec2/sfplugin/CCodecConfig.cpp +24 −2 Original line number Diff line number Diff line Loading @@ -235,7 +235,10 @@ struct StandardParams { const std::vector<ConfigMapper> &getConfigMappersForSdkKey(std::string key) const { auto it = mConfigMappers.find(key); if (it == mConfigMappers.end()) { if (mComplained.count(key) == 0) { ALOGD("no c2 equivalents for %s", key.c_str()); mComplained.insert(key); } return NO_MAPPERS; } ALOGV("found %zu eqs for %s", it->second.size(), key.c_str()); Loading Loading @@ -304,6 +307,7 @@ struct StandardParams { private: std::map<SdkKey, std::vector<ConfigMapper>> mConfigMappers; mutable std::set<std::string> mComplained; }; const std::vector<ConfigMapper> StandardParams::NO_MAPPERS; Loading Loading @@ -1028,7 +1032,25 @@ bool CCodecConfig::updateFormats(Domain domain) { } ReflectedParamUpdater::Dict reflected = mParamUpdater->getParams(paramPointers); ALOGD("c2 config is %s", reflected.debugString().c_str()); std::string config = reflected.debugString(); std::set<std::string> configLines; std::string diff; for (size_t start = 0; start != std::string::npos; ) { size_t end = config.find('\n', start); size_t count = (end == std::string::npos) ? std::string::npos : end - start + 1; std::string line = config.substr(start, count); configLines.insert(line); if (mLastConfig.count(line) == 0) { diff.append(line); } start = (end == std::string::npos) ? std::string::npos : end + 1; } if (!diff.empty()) { ALOGD("c2 config diff is %s", diff.c_str()); } mLastConfig.swap(configLines); bool changed = false; if (domain & mInputDomain) { Loading media/codec2/sfplugin/CCodecConfig.h +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ struct CCodecConfig { /// For now support a validation function. std::map<C2Param::Index, LocalParamValidator> mLocalParams; std::set<std::string> mLastConfig; CCodecConfig(); /// initializes the members required to manage the format: descriptors, reflector, Loading Loading
media/codec2/sfplugin/CCodec.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -375,7 +375,11 @@ public: // consumer usage is queried earlier. if (status.str().empty()) { ALOGD("ISConfig not changed"); } else { ALOGD("ISConfig%s", status.str().c_str()); } return err; } Loading
media/codec2/sfplugin/CCodecConfig.cpp +24 −2 Original line number Diff line number Diff line Loading @@ -235,7 +235,10 @@ struct StandardParams { const std::vector<ConfigMapper> &getConfigMappersForSdkKey(std::string key) const { auto it = mConfigMappers.find(key); if (it == mConfigMappers.end()) { if (mComplained.count(key) == 0) { ALOGD("no c2 equivalents for %s", key.c_str()); mComplained.insert(key); } return NO_MAPPERS; } ALOGV("found %zu eqs for %s", it->second.size(), key.c_str()); Loading Loading @@ -304,6 +307,7 @@ struct StandardParams { private: std::map<SdkKey, std::vector<ConfigMapper>> mConfigMappers; mutable std::set<std::string> mComplained; }; const std::vector<ConfigMapper> StandardParams::NO_MAPPERS; Loading Loading @@ -1028,7 +1032,25 @@ bool CCodecConfig::updateFormats(Domain domain) { } ReflectedParamUpdater::Dict reflected = mParamUpdater->getParams(paramPointers); ALOGD("c2 config is %s", reflected.debugString().c_str()); std::string config = reflected.debugString(); std::set<std::string> configLines; std::string diff; for (size_t start = 0; start != std::string::npos; ) { size_t end = config.find('\n', start); size_t count = (end == std::string::npos) ? std::string::npos : end - start + 1; std::string line = config.substr(start, count); configLines.insert(line); if (mLastConfig.count(line) == 0) { diff.append(line); } start = (end == std::string::npos) ? std::string::npos : end + 1; } if (!diff.empty()) { ALOGD("c2 config diff is %s", diff.c_str()); } mLastConfig.swap(configLines); bool changed = false; if (domain & mInputDomain) { Loading
media/codec2/sfplugin/CCodecConfig.h +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ struct CCodecConfig { /// For now support a validation function. std::map<C2Param::Index, LocalParamValidator> mLocalParams; std::set<std::string> mLastConfig; CCodecConfig(); /// initializes the members required to manage the format: descriptors, reflector, Loading