Created
January 12, 2020 12:30
-
-
Save phhusson/d04962cd61d799cf089dd4beecb9f2ab to your computer and use it in GitHub Desktop.
List OMX codecs through treble HAL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <unistd.h> | |
#include <android/hardware/media/omx/1.0/IOmxStore.h> | |
using ::android::hardware::media::omx::V1_0::IOmxStore; | |
using ::android::sp; | |
int main(int argc, char **argv) { | |
auto svc = IOmxStore::getService(); | |
{ | |
auto res = svc->getNodePrefix([](const auto& prefix) { | |
std::cout << "Got prefix " << prefix << std::endl; | |
}); | |
if(!res.isOk()) exit(1); | |
} | |
auto res = svc->listRoles([](const auto& roles) { | |
for(auto role : roles) { | |
std::cout << "Role " << role.role << std::endl; | |
std::cout << "\tType: " << role.type << std::endl; | |
std::cout << "\tNodes:" << std::endl; | |
for(auto node : role.nodes) { | |
std::cout << "\t\t" << node.name << std::endl; | |
std::cout << "\t\t\t" << node.owner << std::endl; | |
for(auto attribute: node.attributes) { | |
std::cout << "\t\t\t" << attribute.key << "=" << attribute.value << std::endl; | |
} | |
} | |
} | |
} ); | |
if(!res.isOk()) exit(2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment