Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
profiling_reader.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_audio/profiling_reader.h
10//! @brief Profiling reader.
11
12#ifndef ROC_AUDIO_PROFILING_READER_H_
13#define ROC_AUDIO_PROFILING_READER_H_
14
16#include "roc_audio/profiler.h"
19#include "roc_core/time.h"
20#include "roc_packet/units.h"
21
22namespace roc {
23namespace audio {
24
25//! Profiling reader.
27public:
28 //! Initialization.
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 //! Read audio frame.
38 virtual bool read(Frame& frame);
39
40private:
41 core::nanoseconds_t read_(Frame& frame, bool& ret);
42
43 Profiler profiler_;
44 IFrameReader& reader_;
45};
46
47} // namespace audio
48} // namespace roc
49
50#endif // ROC_AUDIO_PROFILING_READER_H_
Audio frame.
Definition frame.h:25
Frame reader interface.
Profiler The role of the profiler is to report the average processing speed (# of samples processed p...
Definition profiler.h:65
virtual bool read(Frame &frame)
Read audio frame.
ProfilingReader(IFrameReader &reader, core::IArena &arena, const SampleSpec &sample_spec, ProfilerConfig profiler_config)
Initialization.
bool is_valid() const
Check if the profiler was succefully constructed.
Sample specification. Describes sample rate and channels.
Definition sample_spec.h:30
Memory arena interface.
Definition iarena.h:23
Base class for non-copyable objects.
Definition noncopyable.h:23
Frame reader interface.
int64_t nanoseconds_t
Nanoseconds.
Definition time.h:58
Root namespace.
Non-copyable object.
Profiler.
Rate limiter.
Profiler Configuration Parameters. Controls profiling interval and duration of each circular buffer c...
Definition profiler.h:30
Time definitions.
Various units used in packets.