xref: /aosp_15_r20/hardware/interfaces/audio/aidl/vts/VtsHalDownmixTargetTest.cpp (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #define LOG_TAG "VtsHalDownmixTargetTest"
18 #include <android-base/logging.h>
19 
20 #include <audio_utils/ChannelMix.h>
21 #include "EffectHelper.h"
22 
23 using namespace android;
24 
25 using aidl::android::hardware::audio::common::getChannelCount;
26 using aidl::android::hardware::audio::effect::Descriptor;
27 using aidl::android::hardware::audio::effect::Downmix;
28 using aidl::android::hardware::audio::effect::getEffectTypeUuidDownmix;
29 using aidl::android::hardware::audio::effect::IEffect;
30 using aidl::android::hardware::audio::effect::IFactory;
31 using aidl::android::hardware::audio::effect::Parameter;
32 using android::audio_utils::channels::ChannelMix;
33 using android::hardware::audio::common::testing::detail::TestExecutionTracer;
34 
35 // minimal HAL interface version to run downmix data path test
36 constexpr int32_t kMinDataTestHalVersion = 2;
37 
38 // Testing for enum values
39 static const std::vector<Downmix::Type> kTypeValues = {ndk::enum_range<Downmix::Type>().begin(),
40                                                        ndk::enum_range<Downmix::Type>().end()};
41 
42 // Testing for supported layouts from AudioChannelLayout.h
43 static const std::vector<int32_t> kLayoutValues = {
44         AudioChannelLayout::LAYOUT_STEREO,        AudioChannelLayout::LAYOUT_2POINT1,
45         AudioChannelLayout::LAYOUT_TRI,           AudioChannelLayout::LAYOUT_TRI_BACK,
46         AudioChannelLayout::LAYOUT_3POINT1,       AudioChannelLayout::LAYOUT_2POINT0POINT2,
47         AudioChannelLayout::LAYOUT_2POINT1POINT2, AudioChannelLayout::LAYOUT_3POINT0POINT2,
48         AudioChannelLayout::LAYOUT_3POINT1POINT2, AudioChannelLayout::LAYOUT_QUAD,
49         AudioChannelLayout::LAYOUT_QUAD_SIDE,     AudioChannelLayout::LAYOUT_SURROUND,
50         AudioChannelLayout::LAYOUT_PENTA,         AudioChannelLayout::LAYOUT_5POINT1,
51         AudioChannelLayout::LAYOUT_5POINT1_SIDE,  AudioChannelLayout::LAYOUT_5POINT1POINT2,
52         AudioChannelLayout::LAYOUT_5POINT1POINT4, AudioChannelLayout::LAYOUT_6POINT1,
53         AudioChannelLayout::LAYOUT_7POINT1,       AudioChannelLayout::LAYOUT_7POINT1POINT2,
54         AudioChannelLayout::LAYOUT_7POINT1POINT4, AudioChannelLayout::LAYOUT_9POINT1POINT4,
55         AudioChannelLayout::LAYOUT_9POINT1POINT6, AudioChannelLayout::LAYOUT_13POINT_360RA,
56         AudioChannelLayout::LAYOUT_22POINT2};
57 
58 static const std::vector<int32_t> kChannels = {
59         AudioChannelLayout::CHANNEL_FRONT_LEFT,
60         AudioChannelLayout::CHANNEL_FRONT_RIGHT,
61         AudioChannelLayout::CHANNEL_FRONT_CENTER,
62         AudioChannelLayout::CHANNEL_LOW_FREQUENCY,
63         AudioChannelLayout::CHANNEL_BACK_LEFT,
64         AudioChannelLayout::CHANNEL_BACK_RIGHT,
65         AudioChannelLayout::CHANNEL_BACK_CENTER,
66         AudioChannelLayout::CHANNEL_SIDE_LEFT,
67         AudioChannelLayout::CHANNEL_SIDE_RIGHT,
68         AudioChannelLayout::CHANNEL_FRONT_LEFT_OF_CENTER,
69         AudioChannelLayout::CHANNEL_FRONT_RIGHT_OF_CENTER,
70         AudioChannelLayout::CHANNEL_TOP_CENTER,
71         AudioChannelLayout::CHANNEL_TOP_FRONT_LEFT,
72         AudioChannelLayout::CHANNEL_TOP_FRONT_CENTER,
73         AudioChannelLayout::CHANNEL_TOP_FRONT_RIGHT,
74         AudioChannelLayout::CHANNEL_TOP_BACK_LEFT,
75         AudioChannelLayout::CHANNEL_TOP_BACK_CENTER,
76         AudioChannelLayout::CHANNEL_TOP_BACK_RIGHT,
77         AudioChannelLayout::CHANNEL_TOP_SIDE_LEFT,
78         AudioChannelLayout::CHANNEL_TOP_SIDE_RIGHT,
79         AudioChannelLayout::CHANNEL_BOTTOM_FRONT_LEFT,
80         AudioChannelLayout::CHANNEL_BOTTOM_FRONT_CENTER,
81         AudioChannelLayout::CHANNEL_BOTTOM_FRONT_RIGHT,
82         AudioChannelLayout::CHANNEL_LOW_FREQUENCY_2,
83         AudioChannelLayout::CHANNEL_FRONT_WIDE_LEFT,
84         AudioChannelLayout::CHANNEL_FRONT_WIDE_RIGHT,
85 };
86 
87 class DownmixEffectHelper : public EffectHelper {
88   public:
SetUpDownmix(int32_t inputBufferLayout=AudioChannelLayout::LAYOUT_STEREO)89     void SetUpDownmix(int32_t inputBufferLayout = AudioChannelLayout::LAYOUT_STEREO) {
90         ASSERT_NE(nullptr, mFactory);
91         ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
92 
93         AudioChannelLayout inputChannelLayout =
94                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(inputBufferLayout);
95 
96         Parameter::Specific specific = getDefaultParamSpecific();
97         Parameter::Common common = EffectHelper::createParamCommon(
98                 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
99                 kFrameCount /* iFrameCount */, kFrameCount /* oFrameCount */, inputChannelLayout,
100                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
101                         AudioChannelLayout::LAYOUT_STEREO));
102         ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
103         ASSERT_NE(nullptr, mEffect);
104     }
105 
TearDownDownmix()106     void TearDownDownmix() {
107         ASSERT_NO_FATAL_FAILURE(close(mEffect));
108         ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
109         mOpenEffectReturn = IEffect::OpenEffectReturn{};
110     }
111 
createDownmixParam(Downmix::Type type)112     Parameter createDownmixParam(Downmix::Type type) {
113         return Parameter::make<Parameter::specific>(
114                 Parameter::Specific::make<Parameter::Specific::downmix>(
115                         Downmix::make<Downmix::type>(type)));
116     }
setParameters(Downmix::Type type)117     void setParameters(Downmix::Type type) {
118         // set parameter
119         auto param = createDownmixParam(type);
120         EXPECT_STATUS(EX_NONE, mEffect->setParameter(param)) << param.toString();
121     }
122 
validateParameters(Downmix::Type type)123     void validateParameters(Downmix::Type type) {
124         auto leId = Downmix::Id::make<Downmix::Id::commonTag>(Downmix::Tag(Downmix::type));
125         auto id = Parameter::Id::make<Parameter::Id::downmixTag>(leId);
126         // get parameter
127         Parameter getParam;
128         EXPECT_STATUS(EX_NONE, mEffect->getParameter(id, &getParam));
129         auto expectedParam = createDownmixParam(type);
130         EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
131                                            << "\ngetParam:" << getParam.toString();
132     }
133 
getDefaultParamSpecific()134     Parameter::Specific getDefaultParamSpecific() {
135         Downmix dm = Downmix::make<Downmix::type>(Downmix::Type::STRIP);
136         Parameter::Specific specific = Parameter::Specific::make<Parameter::Specific::downmix>(dm);
137         return specific;
138     }
139 
setDataTestParams(int32_t layoutType)140     void setDataTestParams(int32_t layoutType) {
141         // Get the number of channels used
142         mInputChannelCount = getChannelCount(
143                 AudioChannelLayout::make<AudioChannelLayout::layoutMask>(layoutType));
144         mInputBufferSize = kFrameCount * mInputChannelCount;
145         mInputBuffer.resize(mInputBufferSize);
146 
147         // In case of downmix, output is always configured to stereo layout.
148         mOutputBufferSize = kFrameCount * kOutputChannelCount;
149         mOutputBuffer.resize(mOutputBufferSize);
150     }
151 
isLayoutValid(int32_t inputLayout)152     bool isLayoutValid(int32_t inputLayout) {
153         if (inputLayout & kMaxChannelMask) {
154             return false;
155         }
156         return true;
157     }
158 
159     static const long kFrameCount = 256;
160     static constexpr float kMaxDownmixSample = 1;
161     static constexpr int kOutputChannelCount = 2;
162     // Mask for layouts greater than MAX_INPUT_CHANNELS_SUPPORTED
163     static constexpr int32_t kMaxChannelMask =
164             ~((1 << ChannelMix<AUDIO_CHANNEL_OUT_STEREO>::MAX_INPUT_CHANNELS_SUPPORTED) - 1);
165     std::shared_ptr<IFactory> mFactory;
166     Descriptor mDescriptor;
167     std::shared_ptr<IEffect> mEffect;
168     IEffect::OpenEffectReturn mOpenEffectReturn;
169 
170     std::vector<float> mInputBuffer;
171     std::vector<float> mOutputBuffer;
172     size_t mInputChannelCount;
173     size_t mOutputBufferSize;
174     size_t mInputBufferSize;
175 };
176 
177 /**
178  * Here we focus on specific parameter checking, general IEffect interfaces testing performed in
179  * VtsAudioEffectTargetTest.
180  */
181 enum ParamName { PARAM_INSTANCE_NAME, PARAM_TYPE };
182 
183 using DownmixParamTestParam =
184         std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, Downmix::Type>;
185 
186 class DownmixParamTest : public ::testing::TestWithParam<DownmixParamTestParam>,
187                          public DownmixEffectHelper {
188   public:
DownmixParamTest()189     DownmixParamTest() : mParamType(std::get<PARAM_TYPE>(GetParam())) {
190         std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
191     }
192 
SetUp()193     void SetUp() override { SetUpDownmix(); }
194 
TearDown()195     void TearDown() override { TearDownDownmix(); }
196 
197     const Downmix::Type mParamType;
198 };
199 
TEST_P(DownmixParamTest,SetAndGetType)200 TEST_P(DownmixParamTest, SetAndGetType) {
201     ASSERT_NO_FATAL_FAILURE(setParameters(mParamType));
202     ASSERT_NO_FATAL_FAILURE(validateParameters(mParamType));
203 }
204 
205 enum FoldParamName { FOLD_INSTANCE_NAME, FOLD_INPUT_LAYOUT, FOLD_TEST_CHANNEL };
206 
207 using DownmixDataTestParamFold =
208         std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t>;
209 
210 class DownmixFoldDataTest : public ::testing::TestWithParam<DownmixDataTestParamFold>,
211                             public DownmixEffectHelper {
212   public:
DownmixFoldDataTest()213     DownmixFoldDataTest() : mInputChannelLayout(std::get<FOLD_INPUT_LAYOUT>(GetParam())) {
214         std::tie(mFactory, mDescriptor) = std::get<FOLD_INSTANCE_NAME>(GetParam());
215     }
216 
SetUp()217     void SetUp() override {
218         SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
219         SetUpDownmix(mInputChannelLayout);
220         if (int32_t version;
221             mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
222             GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
223         }
224         if (!isLayoutValid(mInputChannelLayout)) {
225             GTEST_SKIP() << "Layout not supported \n";
226         }
227         setDataTestParams(mInputChannelLayout);
228     }
229 
TearDown()230     void TearDown() override {
231         SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
232         TearDownDownmix();
233     }
234 
checkAtLeft(int32_t position)235     void checkAtLeft(int32_t position) {
236         for (size_t i = 0, j = position; i < mOutputBufferSize;
237              i += kOutputChannelCount, j += mInputChannelCount) {
238             // Validate Left channel has audio
239             if (mInputBuffer[j] != 0) {
240                 ASSERT_NE(mOutputBuffer[i], 0);
241             } else {
242                 // No change in output when input is 0
243                 ASSERT_EQ(mOutputBuffer[i], mInputBuffer[j]);
244             }
245             // Validate Right channel has no audio
246             ASSERT_EQ(mOutputBuffer[i + 1], 0);
247         }
248     }
249 
checkAtRight(int32_t position)250     void checkAtRight(int32_t position) {
251         for (size_t i = 0, j = position; i < mOutputBufferSize;
252              i += kOutputChannelCount, j += mInputChannelCount) {
253             // Validate Left channel has no audio
254             ASSERT_EQ(mOutputBuffer[i], 0) << " at " << i;
255             // Validate Right channel has audio
256             if (mInputBuffer[j] != 0) {
257                 ASSERT_NE(mOutputBuffer[i + 1], 0) << " at " << i;
258             } else {
259                 // No change in output when input is 0
260                 ASSERT_EQ(mOutputBuffer[i + 1], mInputBuffer[j]) << " at " << i;
261             }
262         }
263     }
264 
checkAtCenter(size_t position)265     void checkAtCenter(size_t position) {
266         for (size_t i = 0, j = position; i < mOutputBufferSize;
267              i += kOutputChannelCount, j += mInputChannelCount) {
268             // Validate both channels have audio
269             if (mInputBuffer[j] != 0) {
270                 ASSERT_NE(mOutputBuffer[i], 0);
271                 ASSERT_NE(mOutputBuffer[i + 1], 0);
272 
273             } else {
274                 // No change in output when input is 0
275                 ASSERT_EQ(mOutputBuffer[i], mInputBuffer[j]);
276                 ASSERT_EQ(mOutputBuffer[i + 1], mInputBuffer[j]);
277             }
278         }
279     }
280 
validateOutput(int32_t channel,size_t position)281     void validateOutput(int32_t channel, size_t position) {
282         switch (channel) {
283             case AudioChannelLayout::CHANNEL_FRONT_LEFT:
284             case AudioChannelLayout::CHANNEL_BACK_LEFT:
285             case AudioChannelLayout::CHANNEL_SIDE_LEFT:
286             case AudioChannelLayout::CHANNEL_TOP_FRONT_LEFT:
287             case AudioChannelLayout::CHANNEL_BOTTOM_FRONT_LEFT:
288             case AudioChannelLayout::CHANNEL_TOP_BACK_LEFT:
289             case AudioChannelLayout::CHANNEL_FRONT_WIDE_LEFT:
290             case AudioChannelLayout::CHANNEL_TOP_SIDE_LEFT:
291                 checkAtLeft(position);
292                 break;
293 
294             case AudioChannelLayout::CHANNEL_FRONT_RIGHT:
295             case AudioChannelLayout::CHANNEL_BACK_RIGHT:
296             case AudioChannelLayout::CHANNEL_SIDE_RIGHT:
297             case AudioChannelLayout::CHANNEL_TOP_FRONT_RIGHT:
298             case AudioChannelLayout::CHANNEL_BOTTOM_FRONT_RIGHT:
299             case AudioChannelLayout::CHANNEL_TOP_BACK_RIGHT:
300             case AudioChannelLayout::CHANNEL_FRONT_WIDE_RIGHT:
301             case AudioChannelLayout::CHANNEL_TOP_SIDE_RIGHT:
302             case AudioChannelLayout::CHANNEL_LOW_FREQUENCY_2:
303                 checkAtRight(position);
304                 break;
305 
306             case AudioChannelLayout::CHANNEL_FRONT_CENTER:
307             case AudioChannelLayout::CHANNEL_BACK_CENTER:
308             case AudioChannelLayout::CHANNEL_TOP_FRONT_CENTER:
309             case AudioChannelLayout::CHANNEL_BOTTOM_FRONT_CENTER:
310             case AudioChannelLayout::CHANNEL_FRONT_LEFT_OF_CENTER:
311             case AudioChannelLayout::CHANNEL_FRONT_RIGHT_OF_CENTER:
312             case AudioChannelLayout::CHANNEL_TOP_CENTER:
313             case AudioChannelLayout::CHANNEL_TOP_BACK_CENTER:
314                 checkAtCenter(position);
315                 break;
316 
317             case AudioChannelLayout::CHANNEL_LOW_FREQUENCY:
318                 // If CHANNEL_LOW_FREQUENCY_2 is supported
319                 if (mInputChannelLayout & AudioChannelLayout::CHANNEL_LOW_FREQUENCY_2) {
320                     // Validate that only Left channel has audio
321                     checkAtLeft(position);
322                 } else {
323                     // Validate that both channels have audio
324                     checkAtCenter(position);
325                 }
326                 break;
327         }
328     }
329 
getInputChannelLayouts()330     std::set<int32_t> getInputChannelLayouts() {
331         std::set<int32_t> supportedChannels;
332         for (int32_t channel : kChannels) {
333             if ((mInputChannelLayout & channel) == channel) {
334                 supportedChannels.insert(channel);
335             }
336         }
337         return supportedChannels;
338     }
339 
340     int32_t mInputChannelLayout;
341 };
342 
TEST_P(DownmixFoldDataTest,DownmixProcessData)343 TEST_P(DownmixFoldDataTest, DownmixProcessData) {
344     // Set FOLD type parameter
345     ASSERT_NO_FATAL_FAILURE(setParameters(Downmix::Type::FOLD));
346 
347     // Get all the channels from input layout
348     std::set<int32_t> supportedChannels = getInputChannelLayouts();
349 
350     for (int32_t channel : supportedChannels) {
351         size_t position = std::distance(supportedChannels.begin(), supportedChannels.find(channel));
352         generateInputBuffer(mInputBuffer, position, false /*isStripe*/,
353                             mInputChannelCount /*channelCount*/, kMaxDownmixSample);
354         ASSERT_NO_FATAL_FAILURE(
355                 processAndWriteToOutput(mInputBuffer, mOutputBuffer, mEffect, &mOpenEffectReturn));
356         validateOutput(channel, position);
357         std::fill(mInputBuffer.begin(), mInputBuffer.end(), 0);
358     }
359 }
360 
361 enum StripParamName { STRIP_INSTANCE_NAME, STRIP_INPUT_LAYOUT };
362 
363 using DownmixStripDataTestParam =
364         std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t>;
365 
366 class DownmixStripDataTest : public ::testing::TestWithParam<DownmixStripDataTestParam>,
367                              public DownmixEffectHelper {
368   public:
DownmixStripDataTest()369     DownmixStripDataTest() : mInputChannelLayout(std::get<STRIP_INPUT_LAYOUT>(GetParam())) {
370         std::tie(mFactory, mDescriptor) = std::get<STRIP_INSTANCE_NAME>(GetParam());
371     }
372 
SetUp()373     void SetUp() override {
374         SetUpDownmix(mInputChannelLayout);
375         if (int32_t version;
376             mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
377             GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
378         }
379         if (!isLayoutValid(mInputChannelLayout)) {
380             GTEST_SKIP() << "Layout not supported \n";
381         }
382         setDataTestParams(mInputChannelLayout);
383     }
384 
TearDown()385     void TearDown() override { TearDownDownmix(); }
386 
validateOutput()387     void validateOutput() {
388         ASSERT_EQ(mInputBufferSize, mInputBuffer.size());
389         ASSERT_GE(mInputBufferSize, mOutputBufferSize);
390         for (size_t i = 0, j = 0; i < mInputBufferSize && j < mOutputBufferSize;
391              i += mInputChannelCount, j += kOutputChannelCount) {
392             ASSERT_EQ(mOutputBuffer[j], mInputBuffer[i]);
393             ASSERT_EQ(mOutputBuffer[j + 1], mInputBuffer[i + 1]);
394         }
395     }
396 
397     int32_t mInputChannelLayout;
398 };
399 
TEST_P(DownmixStripDataTest,DownmixProcessData)400 TEST_P(DownmixStripDataTest, DownmixProcessData) {
401     // Set STRIP type parameter
402     ASSERT_NO_FATAL_FAILURE(setParameters(Downmix::Type::STRIP));
403 
404     // Generate input buffer, call process and compare outputs
405     generateInputBuffer(mInputBuffer, 0 /*position*/, true /*isStripe*/,
406                         mInputChannelCount /*channelCount*/, kMaxDownmixSample);
407     ASSERT_NO_FATAL_FAILURE(
408             processAndWriteToOutput(mInputBuffer, mOutputBuffer, mEffect, &mOpenEffectReturn));
409     validateOutput();
410 }
411 
412 INSTANTIATE_TEST_SUITE_P(
413         DownmixTest, DownmixParamTest,
414         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
415                                    IFactory::descriptor, getEffectTypeUuidDownmix())),
416                            testing::ValuesIn(kTypeValues)),
__anondb014f0b0102(const testing::TestParamInfo<DownmixParamTest::ParamType>& info) 417         [](const testing::TestParamInfo<DownmixParamTest::ParamType>& info) {
418             auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
419             std::string type = std::to_string(static_cast<int>(std::get<PARAM_TYPE>(info.param)));
420             std::string name = getPrefix(descriptor) + "_type_" + type;
421             std::replace_if(
422                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
423             return name;
424         });
425 
426 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DownmixParamTest);
427 
428 INSTANTIATE_TEST_SUITE_P(
429         DownmixTest, DownmixFoldDataTest,
430         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
431                                    IFactory::descriptor, getEffectTypeUuidDownmix())),
432                            testing::ValuesIn(kLayoutValues)),
__anondb014f0b0302(const testing::TestParamInfo<DownmixFoldDataTest::ParamType>& info) 433         [](const testing::TestParamInfo<DownmixFoldDataTest::ParamType>& info) {
434             auto descriptor = std::get<FOLD_INSTANCE_NAME>(info.param).second;
435             std::string layout = std::to_string(std::get<FOLD_INPUT_LAYOUT>(info.param));
436             std::string name = getPrefix(descriptor) + "_fold_layout_" + layout;
437             std::replace_if(
438                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
439             return name;
440         });
441 
442 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DownmixFoldDataTest);
443 
444 INSTANTIATE_TEST_SUITE_P(
445         DownmixTest, DownmixStripDataTest,
446         ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
447                                    IFactory::descriptor, getEffectTypeUuidDownmix())),
448                            testing::ValuesIn(kLayoutValues)),
__anondb014f0b0502(const testing::TestParamInfo<DownmixStripDataTest::ParamType>& info) 449         [](const testing::TestParamInfo<DownmixStripDataTest::ParamType>& info) {
450             auto descriptor = std::get<STRIP_INSTANCE_NAME>(info.param).second;
451             std::string layout =
452                     std::to_string(static_cast<int>(std::get<STRIP_INPUT_LAYOUT>(info.param)));
453             std::string name = getPrefix(descriptor) + "_strip_layout_" + layout;
454             std::replace_if(
455                     name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
456             return name;
457         });
458 
459 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DownmixStripDataTest);
460 
main(int argc,char ** argv)461 int main(int argc, char** argv) {
462     ::testing::InitGoogleTest(&argc, argv);
463     ::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
464     ABinderProcess_setThreadPoolMaxThreadCount(1);
465     ABinderProcess_startThreadPool();
466     return RUN_ALL_TESTS();
467 }
468