Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
ibackend.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/ibackend.h
10//! @brief Backend interface.
11
12#ifndef ROC_SNDIO_IBACKEND_H_
13#define ROC_SNDIO_IBACKEND_H_
14
15#include "roc_core/array.h"
16#include "roc_core/iarena.h"
17#include "roc_sndio/config.h"
19#include "roc_sndio/driver.h"
20#include "roc_sndio/idevice.h"
21
22namespace roc {
23namespace sndio {
24
25//! Maximum number of backends.
26static const size_t MaxBackends = 8;
27
28//! Backend interface.
29class IBackend {
30public:
31 virtual ~IBackend();
32
33 //! Append supported drivers to the list.
35
36 //! Create and open a sink or source.
37 virtual IDevice* open_device(DeviceType device_type,
38 DriverType driver_type,
39 const char* driver,
40 const char* path,
41 const Config& config,
42 core::IArena& arena) = 0;
43 //! Returns name of backend.
44 virtual const char* name() const = 0;
45};
46
47} // namespace sndio
48} // namespace roc
49
50#endif // ROC_SNDIO_IBACKEND_H_
Dynamic array.
Memory arena interface.
Definition iarena.h:23
Shared ownership intrusive pointer.
Definition shared_ptr.h:32
Backend interface.
Definition ibackend.h:29
virtual const char * name() const =0
Returns name of backend.
virtual IDevice * open_device(DeviceType device_type, DriverType driver_type, const char *driver, const char *path, const Config &config, core::IArena &arena)=0
Create and open a sink or source.
virtual void discover_drivers(core::Array< DriverInfo, MaxDrivers > &driver_list)=0
Append supported drivers to the list.
Base interface for sinks and sources.
Definition idevice.h:28
Device type.
Driver types.
Memory arena interface.
Device interface.
DeviceType
Device type.
Definition device_type.h:19
DriverType
Driver type.
Definition driver.h:27
Root namespace.
Sink and source config.
Sink and source config.
Definition config.h:29