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

Commit f533b509 authored by Sneha Patil's avatar Sneha Patil
Browse files

DownmixProcess: Add tests to validate the downmix process.

Added methods to set and validate parameters.
Added test to verify multichannel to stereo conversion for STRIP type.
Added test to verify multichannel to stereo conversion for FOLD type.

Bug:314953788
Test: atest VtsHalDownmixTargetTest
Change-Id: I31ee4df3eac6ae42e3e3cabebd1622e860581eab
parent f7575096
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ cc_test {
    name: "VtsHalDownmixTargetTest",
    defaults: ["VtsHalAudioTargetTestDefaults"],
    srcs: ["VtsHalDownmixTargetTest.cpp"],
    shared_libs: [
        "libaudioutils",
    ],
}

cc_test {
+28 −0
Original line number Diff line number Diff line
@@ -283,4 +283,32 @@ class EffectHelper {
        }
        return functor(result);
    }

    static void processAndWriteToOutput(std::vector<float>& inputBuffer,
                                        std::vector<float>& outputBuffer,
                                        const std::shared_ptr<IEffect>& mEffect,
                                        IEffect::OpenEffectReturn* mOpenEffectReturn) {
        // Initialize AidlMessagequeues
        auto statusMQ = std::make_unique<EffectHelper::StatusMQ>(mOpenEffectReturn->statusMQ);
        ASSERT_TRUE(statusMQ->isValid());
        auto inputMQ = std::make_unique<EffectHelper::DataMQ>(mOpenEffectReturn->inputDataMQ);
        ASSERT_TRUE(inputMQ->isValid());
        auto outputMQ = std::make_unique<EffectHelper::DataMQ>(mOpenEffectReturn->outputDataMQ);
        ASSERT_TRUE(outputMQ->isValid());

        // Enabling the process
        ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
        ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));

        // Write from buffer to message queues and calling process
        EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, inputBuffer));

        // Read the updated message queues into buffer
        EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 1, outputMQ,
                                                          outputBuffer.size(), outputBuffer));

        // Disable the process
        ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::RESET));
        ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
    }
};
+383 −57

File changed.

Preview size limit exceeded, changes collapsed.