mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-26 00:18:31 -04:00
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>
33 lines
924 B
C++
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
|