Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
profiling_writer.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 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/profiling_writer.h
10
//! @brief Profiling writer.
11
12
#ifndef ROC_AUDIO_PROFILING_WRITER_H_
13
#define ROC_AUDIO_PROFILING_WRITER_H_
14
15
#include "
roc_audio/iframe_writer.h
"
16
#include "
roc_audio/profiler.h
"
17
#include "
roc_core/noncopyable.h
"
18
#include "
roc_core/rate_limiter.h
"
19
#include "
roc_core/time.h
"
20
#include "
roc_packet/units.h
"
21
22
namespace
roc
{
23
namespace
audio
{
24
25
//! Profiling writer.
26
class
ProfilingWriter
:
public
IFrameWriter
,
public
core::NonCopyable
<> {
27
public
:
28
//! Initialization.
29
ProfilingWriter
(
IFrameWriter
& writer,
30
core::IArena
& arena,
31
const
SampleSpec
& sample_spec,
32
ProfilerConfig
profiler_config);
33
34
//! Check if the profiler was succefully constructed.
35
bool
is_valid
()
const
;
36
37
//! Write audio frame.
38
virtual
void
write
(
Frame
& frame);
39
40
private
:
41
core::nanoseconds_t
write_(
Frame
& frame);
42
43
Profiler
profiler_;
44
IFrameWriter
& writer_;
45
};
46
47
}
// namespace audio
48
}
// namespace roc
49
50
#endif
// ROC_AUDIO_PROFILING_WRITER_H_
roc::audio::Frame
Audio frame.
Definition
frame.h:25
roc::audio::IFrameWriter
Frame writer interface.
Definition
iframe_writer.h:22
roc::audio::Profiler
Profiler The role of the profiler is to report the average processing speed (# of samples processed p...
Definition
profiler.h:65
roc::audio::ProfilingWriter::is_valid
bool is_valid() const
Check if the profiler was succefully constructed.
roc::audio::ProfilingWriter::ProfilingWriter
ProfilingWriter(IFrameWriter &writer, core::IArena &arena, const SampleSpec &sample_spec, ProfilerConfig profiler_config)
Initialization.
roc::audio::ProfilingWriter::write
virtual void write(Frame &frame)
Write audio frame.
roc::audio::SampleSpec
Sample specification. Describes sample rate and channels.
Definition
sample_spec.h:30
roc::core::IArena
Memory arena interface.
Definition
iarena.h:23
roc::core::NonCopyable
Base class for non-copyable objects.
Definition
noncopyable.h:23
iframe_writer.h
Frame writer interface.
roc::audio
Audio frames and audio processing.
roc::core::nanoseconds_t
int64_t nanoseconds_t
Nanoseconds.
Definition
time.h:58
roc
Root namespace.
noncopyable.h
Non-copyable object.
profiler.h
Profiler.
rate_limiter.h
Rate limiter.
roc::audio::ProfilerConfig
Profiler Configuration Parameters. Controls profiling interval and duration of each circular buffer c...
Definition
profiler.h:30
time.h
Time definitions.
units.h
Various units used in packets.
roc_audio
profiling_writer.h
Generated by
1.17.0