Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
backend_dispatcher.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_sndio/backend_dispatcher.h
10//! @brief Backend dispatcher.
11
12#ifndef ROC_SNDIO_BACKEND_DISPATCHER_H_
13#define ROC_SNDIO_BACKEND_DISPATCHER_H_
14
15#include "roc_address/io_uri.h"
17#include "roc_core/iallocator.h"
19#include "roc_core/singleton.h"
21#include "roc_sndio/driver.h"
22#include "roc_sndio/ibackend.h"
23#include "roc_sndio/isink.h"
24#include "roc_sndio/isource.h"
26
27namespace roc {
28namespace sndio {
29
30//! Backend dispatcher.
32public:
33 //! Initialize.
35
36 //! Create and open default sink.
37 ISink* open_default_sink(const Config& config, core::IAllocator& allocator);
38
39 //! Create and open default source.
41
42 //! Create and open a sink.
44 const char* force_format,
45 const Config& config,
46 core::IAllocator& allocator);
47
48 //! Create and open a source.
50 const char* force_format,
51 const Config& config,
52 core::IAllocator& allocator);
53
54 //! Get all supported URI schemes.
56
57 //! Get all supported file formats.
59
60private:
61 ITerminal* open_default_terminal_(TerminalType terminal_type,
62 const Config& config,
63 core::IAllocator& allocator);
64
65 ITerminal* open_terminal_(TerminalType terminal_type,
66 DriverType driver_type,
67 const char* driver_name,
68 const char* path,
69 const Config& config,
70 core::IAllocator& allocator);
71};
72
73} // namespace sndio
74} // namespace roc
75
76#endif // ROC_SNDIO_BACKEND_DISPATCHER_H_
Audio file or device URI.
Definition io_uri.h:24
Memory allocator interface.
Definition iallocator.h:23
Base class for non-copyable objects.
Definition noncopyable.h:23
Dynamic list of strings.
Definition string_list.h:24
bool get_supported_schemes(core::StringList &)
Get all supported URI schemes.
bool get_supported_formats(core::StringList &)
Get all supported file formats.
ISink * open_default_sink(const Config &config, core::IAllocator &allocator)
Create and open default sink.
ISink * open_sink(const address::IoUri &uri, const char *force_format, const Config &config, core::IAllocator &allocator)
Create and open a sink.
ISource * open_source(const address::IoUri &uri, const char *force_format, const Config &config, core::IAllocator &allocator)
Create and open a source.
ISource * open_default_source(const Config &config, core::IAllocator &allocator)
Create and open default source.
Sink interface.
Definition isink.h:22
Source interface.
Definition isource.h:23
Base interface for sinks and sources.
Definition iterminal.h:23
Driver types.
Memory allocator interface.
Backend interface.
Audio file or device URI.
Sink interface.
Source interface.
TerminalType
Terminal type.
DriverType
Driver type.
Definition driver.h:27
Root namespace.
Non-copyable object.
Sample specifications.
Singleton.
Dynamic list of strings.
Sink and source config.
Definition config.h:23
Terminal type.