From 3836d5584a8f4cf698e7d4cf2642fa2abd26d36d Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 29 Jul 2020 13:35:36 -0700 Subject: [PATCH 1/2] omx: rename master to store Update language to comply with Android's inclusive language guidance See https://source.android.com/setup/contribute/respectful-code for reference BUG=161896447 Change-Id: I9b1f8ed9da444024cd2fa2f3a62b6874dcd96cf7 --- media/omx/1.0/vts/functional/README.md | 8 ++++---- .../vts/functional/{master => store}/Android.bp | 4 ++-- .../VtsHalMediaOmxV1_0TargetStoreTest.cpp} | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) rename media/omx/1.0/vts/functional/{master => store}/Android.bp (87%) rename media/omx/1.0/vts/functional/{master/VtsHalMediaOmxV1_0TargetMasterTest.cpp => store/VtsHalMediaOmxV1_0TargetStoreTest.cpp} (98%) diff --git a/media/omx/1.0/vts/functional/README.md b/media/omx/1.0/vts/functional/README.md index c5a686747f..67f4aa5112 100644 --- a/media/omx/1.0/vts/functional/README.md +++ b/media/omx/1.0/vts/functional/README.md @@ -1,12 +1,12 @@ ## Omx Hal @ 1.0 tests ## --- ## Overview : -The scope of the tests presented here is not restricted solely to testing omx hal @ 1.0 API but also test to omx core functionality and to an extent omx components as well. The current directory contains the following folders: audio, common, component, master and video. Besides common all other folders contain test fixtures for testing AV decoder, encoder components. Common constitutes files that are used across by these test applications. +The scope of the tests presented here is not restricted solely to testing omx hal @ 1.0 API but also test to omx core functionality and to an extent omx components as well. The current directory contains the following folders: audio, common, component, store and video. Besides common all other folders contain test fixtures for testing AV decoder, encoder components. Common constitutes files that are used across by these test applications. -#### master : -Functionality of master is to enumerate all the omx components (and the roles it supports) available in android media framework. +#### store : +Functionality of store is to enumerate all the omx components (and the roles it supports) available in android media framework. -usage: atest VtsHalMediaOmxV1\_0TargetMasterTest +usage: atest VtsHalMediaOmxV1\_0TargetStoreTest #### component : This folder includes test fixtures that tests aspects common to all omx compatible components. For instance, port enabling/disabling, enumerating port formats, state transitions, flush, ..., stay common to all components irrespective of the service they offer. Test fixtures here are directed towards testing these (omx core). Every standard OMX compatible component is expected to pass these tests. diff --git a/media/omx/1.0/vts/functional/master/Android.bp b/media/omx/1.0/vts/functional/store/Android.bp similarity index 87% rename from media/omx/1.0/vts/functional/master/Android.bp rename to media/omx/1.0/vts/functional/store/Android.bp index 5953eb5681..28d12ffa5d 100644 --- a/media/omx/1.0/vts/functional/master/Android.bp +++ b/media/omx/1.0/vts/functional/store/Android.bp @@ -15,9 +15,9 @@ // cc_test { - name: "VtsHalMediaOmxV1_0TargetMasterTest", + name: "VtsHalMediaOmxV1_0TargetStoreTest", defaults: ["VtsHalMediaOmxV1_0Defaults"], - srcs: ["VtsHalMediaOmxV1_0TargetMasterTest.cpp"], + srcs: ["VtsHalMediaOmxV1_0TargetStoreTest.cpp"], test_suites: [ "general-tests", "vts", diff --git a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp similarity index 98% rename from media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp rename to media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp index 4e253134c4..0ad06344e5 100644 --- a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp +++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "media_omx_hidl_master_test" +#define LOG_TAG "media_omx_hidl_store_test" #ifdef __LP64__ #define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS #endif @@ -55,7 +55,7 @@ using ::android::hidl::memory::V1_0::IMemory; #include #include -class MasterHidlTest : public ::testing::TestWithParam { +class StoreHidlTest : public ::testing::TestWithParam { public: virtual void SetUp() override { omxStore = IOmxStore::getService(GetParam()); @@ -127,7 +127,7 @@ void validateAttributes( } // Make sure IOmx and IOmxStore have the same set of instances. -TEST(MasterHidlTest, instanceMatchValidation) { +TEST(StoreHidlTest, instanceMatchValidation) { auto omxInstances = android::hardware::getAllHalInstanceNames(IOmx::descriptor); auto omxStoreInstances = android::hardware::getAllHalInstanceNames(IOmxStore::descriptor); ASSERT_EQ(omxInstances.size(), omxInstances.size()); @@ -138,7 +138,7 @@ TEST(MasterHidlTest, instanceMatchValidation) { } // list service attributes and verify expected formats -TEST_P(MasterHidlTest, ListServiceAttr) { +TEST_P(StoreHidlTest, ListServiceAttr) { description("list service attributes"); android::hardware::media::omx::V1_0::Status status; hidl_vec attributes; @@ -184,7 +184,7 @@ TEST_P(MasterHidlTest, ListServiceAttr) { } // get node prefix -TEST_P(MasterHidlTest, getNodePrefix) { +TEST_P(StoreHidlTest, getNodePrefix) { description("get node prefix"); hidl_string prefix; omxStore->getNodePrefix( @@ -193,7 +193,7 @@ TEST_P(MasterHidlTest, getNodePrefix) { } // list roles and validate all RoleInfo objects -TEST_P(MasterHidlTest, ListRoles) { +TEST_P(StoreHidlTest, ListRoles) { description("list roles"); hidl_vec roleList; omxStore->listRoles([&roleList](hidl_vec const& _nl) { @@ -370,7 +370,7 @@ TEST_P(MasterHidlTest, ListRoles) { } // list components and roles. -TEST_P(MasterHidlTest, ListNodes) { +TEST_P(StoreHidlTest, ListNodes) { description("enumerate component and roles"); android::hardware::media::omx::V1_0::Status status; hidl_vec nodeList; @@ -419,6 +419,6 @@ TEST_P(MasterHidlTest, ListNodes) { } INSTANTIATE_TEST_CASE_P( - PerInstance, MasterHidlTest, + PerInstance, StoreHidlTest, testing::ValuesIn(android::hardware::getAllHalInstanceNames(IOmxStore::descriptor)), android::hardware::PrintInstanceNameToString); From 237e3d7ffc5cd41a439ab878295ad38023c7dc90 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 29 Jul 2020 13:35:36 -0700 Subject: [PATCH 2/2] omx vts: update language to comply with Android's inclusive language guidance See https://source.android.com/setup/contribute/respectful-code for reference BUG=161896447 Change-Id: I0ced401233497bbbfce90e9b84147bb08399e421 --- .../common/media_hidl_test_common.cpp | 4 ++-- .../functional/common/media_hidl_test_common.h | 4 ++-- .../VtsHalMediaOmxV1_0TargetVideoEncTest.cpp | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp index d9d11571c4..a507eeadb3 100644 --- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp +++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp @@ -785,8 +785,8 @@ const std::vector>& getTestPar for (IOmx::ComponentInfo info : componentInfos) { for (std::string role : info.mRoles) { if (filter.empty()) { - if (kWhiteListRoles.find(role.c_str()) == kWhiteListRoles.end()) { - // This is for component test and the role is not in the white list. + if (kKnownRoles.find(role.c_str()) == kKnownRoles.end()) { + // This is for component test and the role is not supported. continue; } } else if (role.find(filter) == std::string::npos) { diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h index bb03dd0341..02c42c195d 100644 --- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h +++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h @@ -78,8 +78,8 @@ enum bufferOwner { unknown, }; -// White list audio/video roles to be tested. -static std::set kWhiteListRoles{ +// List known and thus tested audio/video roles. +static std::set kKnownRoles{ "audio_encoder.aac", "audio_encoder.amrnb", "audio_encoder.amrwb", "audio_encoder.flac", "audio_decoder.aac", "audio_decoder.amrnb", "audio_decoder.amrwb", "audio_decoder.flac", "audio_decoder.g711alaw", diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp index 397bee6464..5105d53f92 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp @@ -289,11 +289,11 @@ struct CodecProducerListener : public IProducerListener { }; // Mock IOmxBufferSource class. GraphicBufferSource.cpp in libstagefright/omx/ -// implements this class. Below is dummy class introduced to test if callback +// implements this class. Below class is introduced to test if callback // functions are actually being called or not -struct DummyBufferSource : public IOmxBufferSource { +struct MockBufferSource : public IOmxBufferSource { public: - DummyBufferSource(sp node) { + MockBufferSource(sp node) { callback = 0; executing = false; omxNode = node; @@ -311,7 +311,7 @@ struct DummyBufferSource : public IOmxBufferSource { android::Vector iBuffer, oBuffer; }; -Return DummyBufferSource::onOmxExecuting() { +Return MockBufferSource::onOmxExecuting() { executing = true; callback |= 0x1; size_t index; @@ -332,25 +332,25 @@ Return DummyBufferSource::onOmxExecuting() { return Void(); }; -Return DummyBufferSource::onOmxIdle() { +Return MockBufferSource::onOmxIdle() { callback |= 0x2; executing = false; return Void(); }; -Return DummyBufferSource::onOmxLoaded() { +Return MockBufferSource::onOmxLoaded() { callback |= 0x4; return Void(); }; -Return DummyBufferSource::onInputBufferAdded(uint32_t buffer) { +Return MockBufferSource::onInputBufferAdded(uint32_t buffer) { (void)buffer; EXPECT_EQ(executing, false); callback |= 0x8; return Void(); }; -Return DummyBufferSource::onInputBufferEmptied( +Return MockBufferSource::onInputBufferEmptied( uint32_t buffer, const ::android::hardware::hidl_handle& fence) { (void)fence; callback |= 0x10; @@ -1143,7 +1143,7 @@ TEST_P(VideoEncHidlTest, BufferSourceCallBacks) { setupRAWPort(omxNode, kPortIndexInput, nFrameWidth, nFrameHeight, 0, xFramerate, eColorFormat); - sp buffersource = new DummyBufferSource(omxNode); + sp buffersource = new MockBufferSource(omxNode); ASSERT_NE(buffersource, nullptr); status = omxNode->setInputSurface(buffersource); ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);