mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Merge "OMX VTS: Added a test to mandate transition to C2 codecs" am: d9aa226a60
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1973542 Change-Id: Ic1840ca9a58f24e1763c67031cc12052703d1680
This commit is contained in:
@@ -20,7 +20,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <android-base/logging.h>
|
#include <android-base/logging.h>
|
||||||
|
#include <android-base/properties.h>
|
||||||
#include <android-base/strings.h>
|
#include <android-base/strings.h>
|
||||||
|
#include <android/api-level.h>
|
||||||
|
|
||||||
#include <android/hardware/media/omx/1.0/IOmx.h>
|
#include <android/hardware/media/omx/1.0/IOmx.h>
|
||||||
#include <android/hardware/media/omx/1.0/IOmxNode.h>
|
#include <android/hardware/media/omx/1.0/IOmxNode.h>
|
||||||
@@ -371,6 +373,31 @@ TEST_P(StoreHidlTest, ListRoles) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int getFirstApiLevel() {
|
||||||
|
return android::base::GetIntProperty("ro.product.first_api_level", __ANDROID_API_T__);
|
||||||
|
}
|
||||||
|
|
||||||
|
// list components and roles.
|
||||||
|
TEST_P(StoreHidlTest, OmxCodecAllowedTest) {
|
||||||
|
hidl_vec<IOmx::ComponentInfo> componentInfos = getComponentInfoList(omx);
|
||||||
|
for (IOmx::ComponentInfo info : componentInfos) {
|
||||||
|
for (std::string role : info.mRoles) {
|
||||||
|
if (role.find("video_decoder") != std::string::npos ||
|
||||||
|
role.find("video_encoder") != std::string::npos) {
|
||||||
|
ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__)
|
||||||
|
<< " Component: " << info.mName.c_str() << " Role: " << role.c_str()
|
||||||
|
<< " not allowed for devices launching with Android S and above";
|
||||||
|
}
|
||||||
|
if (role.find("audio_decoder") != std::string::npos ||
|
||||||
|
role.find("audio_encoder") != std::string::npos) {
|
||||||
|
ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__)
|
||||||
|
<< " Component: " << info.mName.c_str() << " Role: " << role.c_str()
|
||||||
|
<< " not allowed for devices launching with Android T and above";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// list components and roles.
|
// list components and roles.
|
||||||
TEST_P(StoreHidlTest, ListNodes) {
|
TEST_P(StoreHidlTest, ListNodes) {
|
||||||
description("enumerate component and roles");
|
description("enumerate component and roles");
|
||||||
|
|||||||
Reference in New Issue
Block a user