Files
MuditaOS/module-audio/Audio/test/TestEndpoint.cpp
T
Marcin Smoczyński a3e512a89b [EGD-6674] Change negotiation of audio block size
Replace faulty implementation which produced ambiguous results with one
which is suited for both phone calls and music playback requirements,
including A2DP and HSP Bluetooth profiles.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-05-05 21:36:00 +02:00

65 lines
1.3 KiB
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "TestEndpoint.hpp"
#include <Audio/AudioFormat.hpp>
using audio::AudioFormat;
using audio::test::TestSink;
using audio::test::TestSource;
TestSink::TestSink(std::vector<AudioFormat> supportedFormats) : formats(std::move(supportedFormats))
{}
auto TestSink::getSupportedFormats() -> const std::vector<AudioFormat> &
{
return formats;
}
void TestSink::onDataSend()
{}
void TestSink::enableOutput()
{}
void TestSink::disableOutput()
{}
auto TestSink::getTraits() const -> ::audio::Endpoint::Traits
{
return testTraits;
}
TestSource::TestSource(std::vector<AudioFormat> supportedFormats, AudioFormat sourceFormat)
: formats(std::move(supportedFormats)), sourceFormat(std::move(sourceFormat))
{}
TestSource::TestSource(AudioFormat audioFormat)
: formats(std::vector<AudioFormat>{audioFormat}), sourceFormat(std::move(audioFormat))
{}
auto TestSource::getSourceFormat() -> AudioFormat
{
return sourceFormat;
}
void TestSource::onDataReceive()
{}
void TestSource::enableInput()
{}
void TestSource::disableInput()
{}
auto TestSource::getSupportedFormats() -> const std::vector<AudioFormat> &
{
return formats;
}
auto TestSource::getTraits() const -> ::audio::Endpoint::Traits
{
return testTraits;
}