Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
converter.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Roc 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_pipeline/converter.h
10
//! @brief Converter pipeline.
11
12
#ifndef ROC_PIPELINE_CONVERTER_H_
13
#define ROC_PIPELINE_CONVERTER_H_
14
15
#include "
roc_audio/null_writer.h
"
16
#include "
roc_audio/poison_writer.h
"
17
#include "
roc_audio/profiling_writer.h
"
18
#include "
roc_audio/resampler_profile.h
"
19
#include "
roc_audio/resampler_writer.h
"
20
#include "
roc_core/buffer_pool.h
"
21
#include "
roc_core/unique_ptr.h
"
22
#include "
roc_pipeline/config.h
"
23
#include "
roc_sndio/isink.h
"
24
25
namespace
roc
{
26
namespace
pipeline {
27
28
//! Converter pipeline.
29
class
Converter
:
public
sndio::ISink
,
public
core::NonCopyable
<> {
30
public
:
31
//! Initialize.
32
Converter
(
const
ConverterConfig
& config,
33
audio::IWriter
* output_writer,
34
core::BufferPool<audio::sample_t>
& pool,
35
core::IAllocator
& allocator);
36
37
//! Check if the pipeline was successfully constructed.
38
bool
valid
();
39
40
//! Get sink sample rate.
41
virtual
size_t
sample_rate
()
const
;
42
43
//! Check if the sink has own clock.
44
virtual
bool
has_clock
()
const
;
45
46
//! Write audio frame.
47
virtual
void
write
(
audio::Frame
& frame);
48
49
private
:
50
audio::NullWriter
null_writer_;
51
52
core::UniquePtr<audio::PoisonWriter>
resampler_poisoner_;
53
core::UniquePtr<audio::ResamplerWriter>
resampler_;
54
55
core::UniquePtr<audio::ProfilingWriter>
profiler_;
56
57
core::UniquePtr<audio::PoisonWriter>
pipeline_poisoner_;
58
59
audio::IWriter
* audio_writer_;
60
61
ConverterConfig
config_;
62
};
63
64
}
// namespace pipeline
65
}
// namespace roc
66
67
#endif
// ROC_PIPELINE_CONVERTER_H_
buffer_pool.h
Buffer pool.
roc::audio::Frame
Audio frame.
Definition:
frame.h:22
roc::audio::IWriter
Audio writer interface.
Definition:
iwriter.h:21
roc::audio::NullWriter
Null writer.
Definition:
null_writer.h:22
roc::core::BufferPool
Buffer pool.
Definition:
buffer_pool.h:23
roc::core::IAllocator
Memory allocator interface.
Definition:
iallocator.h:23
roc::core::NonCopyable
Base class for non-copyable objects.
Definition:
noncopyable.h:23
roc::core::UniquePtr
Unique ownrship pointer.
Definition:
unique_ptr.h:27
roc::pipeline::Converter
Converter pipeline.
Definition:
converter.h:29
roc::pipeline::Converter::write
virtual void write(audio::Frame &frame)
Write audio frame.
roc::pipeline::Converter::has_clock
virtual bool has_clock() const
Check if the sink has own clock.
roc::pipeline::Converter::sample_rate
virtual size_t sample_rate() const
Get sink sample rate.
roc::pipeline::Converter::Converter
Converter(const ConverterConfig &config, audio::IWriter *output_writer, core::BufferPool< audio::sample_t > &pool, core::IAllocator &allocator)
Initialize.
roc::pipeline::Converter::valid
bool valid()
Check if the pipeline was successfully constructed.
roc::sndio::ISink
Sink interface.
Definition:
isink.h:21
isink.h
Sink interface.
roc
Root namespace.
null_writer.h
Null writer.
poison_writer.h
Poison writer.
profiling_writer.h
Profiling writer.
resampler_profile.h
Resampler profile.
resampler_writer.h
Resampler.
config.h
Pipeline config.
roc::pipeline::ConverterConfig
Converter parameters.
Definition:
config.h:205
unique_ptr.h
Unique ownrship pointer.
roc_pipeline
converter.h
Generated by
1.9.5