Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 237e3d7f authored by Lajos Molnar's avatar Lajos Molnar
Browse files

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
parent 3836d558
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -785,8 +785,8 @@ const std::vector<std::tuple<std::string, std::string, std::string>>& getTestPar
        for (IOmx::ComponentInfo info : componentInfos) {
        for (IOmx::ComponentInfo info : componentInfos) {
            for (std::string role : info.mRoles) {
            for (std::string role : info.mRoles) {
                if (filter.empty()) {
                if (filter.empty()) {
                    if (kWhiteListRoles.find(role.c_str()) == kWhiteListRoles.end()) {
                    if (kKnownRoles.find(role.c_str()) == kKnownRoles.end()) {
                        // This is for component test and the role is not in the white list.
                        // This is for component test and the role is not supported.
                        continue;
                        continue;
                    }
                    }
                } else if (role.find(filter) == std::string::npos) {
                } else if (role.find(filter) == std::string::npos) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -78,8 +78,8 @@ enum bufferOwner {
    unknown,
    unknown,
};
};


// White list audio/video roles to be tested.
// List known and thus tested audio/video roles.
static std::set<std::string> kWhiteListRoles{
static std::set<std::string> kKnownRoles{
        "audio_encoder.aac",      "audio_encoder.amrnb", "audio_encoder.amrwb",
        "audio_encoder.aac",      "audio_encoder.amrnb", "audio_encoder.amrwb",
        "audio_encoder.flac",     "audio_decoder.aac",   "audio_decoder.amrnb",
        "audio_encoder.flac",     "audio_decoder.aac",   "audio_decoder.amrnb",
        "audio_decoder.amrwb",    "audio_decoder.flac",  "audio_decoder.g711alaw",
        "audio_decoder.amrwb",    "audio_decoder.flac",  "audio_decoder.g711alaw",
+9 −9
Original line number Original line Diff line number Diff line
@@ -289,11 +289,11 @@ struct CodecProducerListener : public IProducerListener {
};
};


// Mock IOmxBufferSource class. GraphicBufferSource.cpp in libstagefright/omx/
// 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
// functions are actually being called or not
struct DummyBufferSource : public IOmxBufferSource {
struct MockBufferSource : public IOmxBufferSource {
   public:
   public:
    DummyBufferSource(sp<IOmxNode> node) {
    MockBufferSource(sp<IOmxNode> node) {
        callback = 0;
        callback = 0;
        executing = false;
        executing = false;
        omxNode = node;
        omxNode = node;
@@ -311,7 +311,7 @@ struct DummyBufferSource : public IOmxBufferSource {
    android::Vector<BufferInfo> iBuffer, oBuffer;
    android::Vector<BufferInfo> iBuffer, oBuffer;
};
};


Return<void> DummyBufferSource::onOmxExecuting() {
Return<void> MockBufferSource::onOmxExecuting() {
    executing = true;
    executing = true;
    callback |= 0x1;
    callback |= 0x1;
    size_t index;
    size_t index;
@@ -332,25 +332,25 @@ Return<void> DummyBufferSource::onOmxExecuting() {
    return Void();
    return Void();
};
};


Return<void> DummyBufferSource::onOmxIdle() {
Return<void> MockBufferSource::onOmxIdle() {
    callback |= 0x2;
    callback |= 0x2;
    executing = false;
    executing = false;
    return Void();
    return Void();
};
};


Return<void> DummyBufferSource::onOmxLoaded() {
Return<void> MockBufferSource::onOmxLoaded() {
    callback |= 0x4;
    callback |= 0x4;
    return Void();
    return Void();
};
};


Return<void> DummyBufferSource::onInputBufferAdded(uint32_t buffer) {
Return<void> MockBufferSource::onInputBufferAdded(uint32_t buffer) {
    (void)buffer;
    (void)buffer;
    EXPECT_EQ(executing, false);
    EXPECT_EQ(executing, false);
    callback |= 0x8;
    callback |= 0x8;
    return Void();
    return Void();
};
};


Return<void> DummyBufferSource::onInputBufferEmptied(
Return<void> MockBufferSource::onInputBufferEmptied(
    uint32_t buffer, const ::android::hardware::hidl_handle& fence) {
    uint32_t buffer, const ::android::hardware::hidl_handle& fence) {
    (void)fence;
    (void)fence;
    callback |= 0x10;
    callback |= 0x10;
@@ -1143,7 +1143,7 @@ TEST_P(VideoEncHidlTest, BufferSourceCallBacks) {
    setupRAWPort(omxNode, kPortIndexInput, nFrameWidth, nFrameHeight, 0,
    setupRAWPort(omxNode, kPortIndexInput, nFrameWidth, nFrameHeight, 0,
                 xFramerate, eColorFormat);
                 xFramerate, eColorFormat);


    sp<DummyBufferSource> buffersource = new DummyBufferSource(omxNode);
    sp<MockBufferSource> buffersource = new MockBufferSource(omxNode);
    ASSERT_NE(buffersource, nullptr);
    ASSERT_NE(buffersource, nullptr);
    status = omxNode->setInputSurface(buffersource);
    status = omxNode->setInputSurface(buffersource);
    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);