~aleteoryx/muditaos

ref: b00548440b4d37ee2806f0760a949b23b7e14aa8 muditaos/module-audio/Audio/test/TestEndpoint.cpp -rw-r--r-- 1.3 KiB
b0054844 — Lefucjusz [BH-2020] Fix double-free in DecoderMP3 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// 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() -> 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() -> std::vector<AudioFormat>
{
    return formats;
}

auto TestSource::getTraits() const -> ::audio::Endpoint::Traits
{
    return testTraits;
}