Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
populator.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 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_rtp/populator.h
10 //! @brief RTP populator.
11 
12 #ifndef ROC_RTP_POPULATOR_H_
13 #define ROC_RTP_POPULATOR_H_
14 
16 #include "roc_audio/sample_spec.h"
17 #include "roc_core/noncopyable.h"
18 #include "roc_packet/ireader.h"
19 
20 namespace roc {
21 namespace rtp {
22 
23 //! RTP populator.
24 class Populator : public packet::IReader, public core::NonCopyable<> {
25 public:
26  //! Initialize.
28  audio::IFrameDecoder& decoder,
29  const audio::SampleSpec& sample_spec);
30 
31  //! Read next packet.
33 
34 private:
35  packet::IReader& reader_;
36  audio::IFrameDecoder& decoder_;
37  const audio::SampleSpec sample_spec_;
38 };
39 
40 } // namespace rtp
41 } // namespace roc
42 
43 #endif // ROC_RTP_POPULATOR_H_
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Definition: attributes.h:31
Audio frame decoder interface.
Sample specification. Describes sample rate and channels.
Definition: sample_spec.h:26
Base class for non-copyable objects.
Definition: noncopyable.h:23
Packet reader interface.
Definition: ireader.h:23
RTP populator.
Definition: populator.h:24
Populator(packet::IReader &reader, audio::IFrameDecoder &decoder, const audio::SampleSpec &sample_spec)
Initialize.
virtual ROC_ATTR_NODISCARD status::StatusCode read(packet::PacketPtr &)
Read next packet.
Audio frame decoder interface.
Packet reader interface.
Root namespace.
Non-copyable object.
Sample specifications.
StatusCode
Status code.
Definition: status_code.h:19