Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
pcm_mapper_reader.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 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_audio/pcm_mapper_reader.h
10
//! @brief Pcm mapper reader.
11
12
#ifndef ROC_AUDIO_PCM_MAPPER_READER_H_
13
#define ROC_AUDIO_PCM_MAPPER_READER_H_
14
15
#include "
roc_audio/frame_factory.h
"
16
#include "
roc_audio/iframe_reader.h
"
17
#include "
roc_audio/pcm_mapper.h
"
18
#include "
roc_audio/sample_spec.h
"
19
#include "
roc_core/noncopyable.h
"
20
#include "
roc_core/slice.h
"
21
#include "
roc_core/stddefs.h
"
22
#include "
roc_core/time.h
"
23
24
namespace
roc
{
25
namespace
audio
{
26
27
//! Pcm mapper reader.
28
//! Reads frames from nested reader and maps them to another pcm mask.
29
class
PcmMapperReader
:
public
IFrameReader
,
public
core::NonCopyable
<> {
30
public
:
31
//! Initialize.
32
PcmMapperReader
(
IFrameReader
& reader,
33
FrameFactory
& frame_factory,
34
const
SampleSpec
& in_spec,
35
const
SampleSpec
& out_spec);
36
37
//! Check if the object was succefully constructed.
38
bool
is_valid
()
const
;
39
40
//! Read audio frame.
41
virtual
bool
read
(
Frame
& frame);
42
43
private
:
44
PcmMapper
mapper_;
45
46
IFrameReader
& in_reader_;
47
core::Slice<uint8_t>
in_buf_;
48
49
const
SampleSpec
in_spec_;
50
const
SampleSpec
out_spec_;
51
52
const
size_t
num_ch_;
53
54
bool
valid_;
55
};
56
57
}
// namespace audio
58
}
// namespace roc
59
60
#endif
// ROC_AUDIO_PCM_MAPPER_READER_H_
roc::audio::FrameFactory
Frame factory.
Definition
frame_factory.h:38
roc::audio::Frame
Audio frame.
Definition
frame.h:25
roc::audio::IFrameReader
Frame reader interface.
Definition
iframe_reader.h:22
roc::audio::PcmMapperReader::is_valid
bool is_valid() const
Check if the object was succefully constructed.
roc::audio::PcmMapperReader::read
virtual bool read(Frame &frame)
Read audio frame.
roc::audio::PcmMapperReader::PcmMapperReader
PcmMapperReader(IFrameReader &reader, FrameFactory &frame_factory, const SampleSpec &in_spec, const SampleSpec &out_spec)
Initialize.
roc::audio::PcmMapper
PCM format mapper. Convert between PCM formats.
Definition
pcm_mapper.h:24
roc::audio::SampleSpec
Sample specification. Describes sample rate and channels.
Definition
sample_spec.h:30
roc::core::NonCopyable
Base class for non-copyable objects.
Definition
noncopyable.h:23
roc::core::Slice
Slice.
Definition
slice.h:55
frame_factory.h
Frame factory.
iframe_reader.h
Frame reader interface.
roc::audio
Audio frames and audio processing.
roc
Root namespace.
noncopyable.h
Non-copyable object.
pcm_mapper.h
PCM format mapper.
sample_spec.h
Sample specifications.
slice.h
Slice.
stddefs.h
Commonly used types and functions.
time.h
Time definitions.
roc_audio
pcm_mapper_reader.h
Generated by
1.17.0