Files
MuditaOS/module-audio/Audio/StreamFactory.hpp
T
Marcin Smoczyński 9cf397d192 [EGD-6497] Add audio transcoding framework
Add a mechanism to apply a data transform on the stream's input. An
example mono to stereo transform is provided.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-04-23 07:29:18 +02:00

33 lines
924 B
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "Endpoint.hpp"
#include "Stream.hpp"
#include <memory>
#include <vector>
namespace audio
{
class StreamFactory
{
public:
explicit StreamFactory(Endpoint::Capabilities factoryCaps,
unsigned int bufferingSize = Stream::defaultBufferingSize);
auto makeStream(Source &source, Sink &sink) -> std::unique_ptr<Stream>;
private:
auto negotiateCaps(std::vector<std::reference_wrapper<const Endpoint>> v) -> Endpoint::Capabilities;
auto getAllocator(bool usesDMA) -> Stream::Allocator &;
Endpoint::Capabilities caps;
StandardStreamAllocator stdAlloc;
NonCacheableStreamAllocator nonCacheableAlloc;
unsigned int bufferingSize;
};
} // namespace audio