-
-
Save droogie/84a9c788c185d418be4b54b589785037 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
LOCAL_PATH:= $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_SRC_FILES := omx-store.cpp | |
LOCAL_SHARED_LIBRARIES := libutils liblog [email protected] [email protected] libcutils \ | |
[email protected] \ | |
[email protected] \ | |
libhidlbase libbase | |
LOCAL_CFLAGS += -Wno-multichar -Werror -Wall | |
LOCAL_MODULE:= omx-store | |
include $(BUILD_EXECUTABLE) |
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