summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2020-08-12 15:56:31 -0700
committerBruno Martins <bgcngm@gmail.com>2021-03-07 15:30:33 +0000
commit18f63b92c792f3be810e9d3deb429134ce4adf42 (patch)
treee4f5f5c690a73484f0231c30df697c93a430230a
parentc03f236b13f36328dcc0ef32e7ffead1debf6aab (diff)
omx: calculate nodePrefix only for components listed in IOmx
Also make common prefix matching case insensitive. Bug: 162578527 Change-Id: Iaf66967fd519e0c3eabb8f0c320b8c7e7fd03497 (cherry picked from commit 42f653bd87672f3427bdb522f46c55502e6d20d1)
-rw-r--r--media/libstagefright/omx/1.0/OmxStore.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/media/libstagefright/omx/1.0/OmxStore.cpp b/media/libstagefright/omx/1.0/OmxStore.cpp
index 67f478ead0..b5c116656f 100644
--- a/media/libstagefright/omx/1.0/OmxStore.cpp
+++ b/media/libstagefright/omx/1.0/OmxStore.cpp
@@ -54,6 +54,24 @@ OmxStore::OmxStore(
});
}
+ if (!nodes.empty()) {
+ auto anyNode = nodes.cbegin();
+ std::string::const_iterator first = anyNode->cbegin();
+ std::string::const_iterator last = anyNode->cend();
+ for (const std::string &name : nodes) {
+ std::string::const_iterator it1 = first;
+ for (std::string::const_iterator it2 = name.cbegin();
+ it1 != last && it2 != name.cend() && tolower(*it1) == tolower(*it2);
+ ++it1, ++it2) {
+ }
+ last = it1;
+ }
+ mPrefix = std::string(first, last);
+ LOG(INFO) << "omx common prefix: '" << mPrefix.c_str() << "'";
+ } else {
+ LOG(INFO) << "omx common prefix: no nodes";
+ }
+
MediaCodecsXmlParser parser;
parser.parseXmlFilesInSearchDirs(xmlNames, searchDirs);
if (profilingResultsXmlPath != nullptr) {
@@ -112,8 +130,6 @@ OmxStore::OmxStore(
mRoleList[i] = std::move(role);
++i;
}
-
- mPrefix = parser.getCommonPrefix();
}
OmxStore::~OmxStore() {