Loading audio/6.0/IStream.hal +1 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,7 @@ interface IStream { * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * NOT_INITIALIZED in case of memory allocation error * INVALID_ARGUMENTS if the requested buffer size is too large * INVALID_ARGUMENTS if the requested buffer size is invalid * INVALID_STATE if called out of sequence * @return info a MmapBufferInfo struct containing information on the MMMAP buffer created. */ Loading audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,8 @@ const std::vector<DeviceConfigParameter>& getOutputDeviceConfigParameters() { special = true; } if ((flags & AUDIO_OUTPUT_FLAG_DIRECT) && !(flags & AUDIO_OUTPUT_FLAG_HW_AV_SYNC)) { !(flags & (AUDIO_OUTPUT_FLAG_HW_AV_SYNC | AUDIO_OUTPUT_FLAG_MMAP_NOIRQ))) { result.emplace_back(device, config, AudioOutputFlag(AUDIO_OUTPUT_FLAG_DIRECT)); special = true; Loading audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +9 −11 Original line number Diff line number Diff line Loading @@ -1203,19 +1203,17 @@ TEST_IO_STREAM(closeTwice, "Make sure a stream can not be closed twice", waitForStreamDestruction()) // clang-format on static void testCreateTooBigMmapBuffer(IStream* stream) { static void testMmapBufferOfInvalidSize(IStream* stream) { for (int32_t value : {-1, 0, std::numeric_limits<int32_t>::max()}) { MmapBufferInfo info; Result res; // Assume that int max is a value too big to be allocated // This is true currently with a 32bit media server, but might not when it // will run in 64 bit auto minSizeFrames = std::numeric_limits<int32_t>::max(); ASSERT_OK(stream->createMmapBuffer(minSizeFrames, returnIn(res, info))); ASSERT_RESULT(invalidArgsOrNotSupported, res); EXPECT_OK(stream->createMmapBuffer(value, returnIn(res, info))); EXPECT_RESULT(invalidArgsOrNotSupported, res) << "value=" << value; } } TEST_IO_STREAM(CreateTooBigMmapBuffer, "Create mmap buffer too big should fail", testCreateTooBigMmapBuffer(stream.get())) TEST_IO_STREAM(CreateTooBigMmapBuffer, "Create mmap buffer of invalid size must fail", testMmapBufferOfInvalidSize(stream.get())) static void testGetMmapPositionOfNonMmapedStream(IStream* stream) { Result res; Loading Loading
audio/6.0/IStream.hal +1 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,7 @@ interface IStream { * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * NOT_INITIALIZED in case of memory allocation error * INVALID_ARGUMENTS if the requested buffer size is too large * INVALID_ARGUMENTS if the requested buffer size is invalid * INVALID_STATE if called out of sequence * @return info a MmapBufferInfo struct containing information on the MMMAP buffer created. */ Loading
audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,8 @@ const std::vector<DeviceConfigParameter>& getOutputDeviceConfigParameters() { special = true; } if ((flags & AUDIO_OUTPUT_FLAG_DIRECT) && !(flags & AUDIO_OUTPUT_FLAG_HW_AV_SYNC)) { !(flags & (AUDIO_OUTPUT_FLAG_HW_AV_SYNC | AUDIO_OUTPUT_FLAG_MMAP_NOIRQ))) { result.emplace_back(device, config, AudioOutputFlag(AUDIO_OUTPUT_FLAG_DIRECT)); special = true; Loading
audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h +9 −11 Original line number Diff line number Diff line Loading @@ -1203,19 +1203,17 @@ TEST_IO_STREAM(closeTwice, "Make sure a stream can not be closed twice", waitForStreamDestruction()) // clang-format on static void testCreateTooBigMmapBuffer(IStream* stream) { static void testMmapBufferOfInvalidSize(IStream* stream) { for (int32_t value : {-1, 0, std::numeric_limits<int32_t>::max()}) { MmapBufferInfo info; Result res; // Assume that int max is a value too big to be allocated // This is true currently with a 32bit media server, but might not when it // will run in 64 bit auto minSizeFrames = std::numeric_limits<int32_t>::max(); ASSERT_OK(stream->createMmapBuffer(minSizeFrames, returnIn(res, info))); ASSERT_RESULT(invalidArgsOrNotSupported, res); EXPECT_OK(stream->createMmapBuffer(value, returnIn(res, info))); EXPECT_RESULT(invalidArgsOrNotSupported, res) << "value=" << value; } } TEST_IO_STREAM(CreateTooBigMmapBuffer, "Create mmap buffer too big should fail", testCreateTooBigMmapBuffer(stream.get())) TEST_IO_STREAM(CreateTooBigMmapBuffer, "Create mmap buffer of invalid size must fail", testMmapBufferOfInvalidSize(stream.get())) static void testGetMmapPositionOfNonMmapedStream(IStream* stream) { Result res; Loading