Skip to content

Commit

Permalink
(halium) Update CCodec 2.0 filtering
Browse files Browse the repository at this point in the history
To force hardware-accelerated qti but keep all software encoders intact
we have to be more precise when filtering out codecs.
  • Loading branch information
fredldotme committed Oct 15, 2020
1 parent edc41c5 commit eac98e8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions hardware/google/av/0002-Client-Filter-out-non-qti-codecs.patch
@@ -1,4 +1,4 @@
From 40f1680694124e807f43c375d0849c9d4a82671b Mon Sep 17 00:00:00 2001
From 10e0f9321bde831b5f8854edb457f3df5037c303 Mon Sep 17 00:00:00 2001
From: Alfred Neumayer <dev.beidl@gmail.com>
Date: Wed, 14 Oct 2020 00:57:01 +0200
Subject: [PATCH] Client: Filter out non-qti codecs
Expand All @@ -10,25 +10,32 @@ Filter out any codecs that would be considered software decoders

Change-Id: I5f401bb50eef7f96a836de6390f84d9307de501f
---
codec2/hidl/client/client.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
codec2/hidl/client/client.cpp | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/codec2/hidl/client/client.cpp b/codec2/hidl/client/client.cpp
index ff67681..5e5ce88 100644
index ff67681..2509ac6 100644
--- a/codec2/hidl/client/client.cpp
+++ b/codec2/hidl/client/client.cpp
@@ -548,16 +548,26 @@ const std::vector<C2Component::Traits>& Codec2Client::listComponents() const {
@@ -548,16 +548,33 @@ const std::vector<C2Component::Traits>& Codec2Client::listComponents() const {
}
Return<void> transStatus = base()->listComponents(
[this](const hidl_vec<IComponentStore::ComponentTraits>& t) {
+ int removeCounter = 0;
mTraitsList.resize(t.size());
mAliasesBuffer.resize(t.size());
for (size_t i = 0; i < t.size(); ++i) {
+ if (((std::string)t[i].name).find("c2.qti.") != 0) {
+ std::string componentName = (std::string)(t[i].name);
+ ALOGI("listComponents: %s", componentName.c_str());
+ if ((componentName.find(".encoder") == std::string::npos) &&
+ ((componentName.find("c2.android.") == 0) ||
+ (componentName.find("OMX.google.") == 0) ||
+ (componentName.find("OMX.qcom.") == 0))) {
+ ++removeCounter;
+ continue;
+ }
+
+ ALOGI("Accepting component '%s'", componentName.c_str());
+
c2_status_t status = objcpy(
- &mTraitsList[i], &mAliasesBuffer[i], t[i]);
Expand Down

0 comments on commit eac98e8

Please sign in to comment.