mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-19 20:44:44 -04:00
Add basic playback capability using Bluetooth A2DP profile. Only stereo/44100/16bit files are supported at the moment Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
32 lines
914 B
C++
32 lines
914 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 <memory>
|
|
#include <vector>
|
|
|
|
namespace audio
|
|
{
|
|
|
|
class StreamFactory
|
|
{
|
|
public:
|
|
explicit StreamFactory(Endpoint::Capabilities factoryCaps,
|
|
unsigned int bufferingSize = Stream::defaultBufferingSize);
|
|
auto makeStream(const Source &source, const 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
|