Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
receiver_endpoint.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 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_pipeline/receiver_endpoint.h
10//! @brief Receiver endpoint pipeline.
11
12#ifndef ROC_PIPELINE_RECEIVER_ENDPOINT_H_
13#define ROC_PIPELINE_RECEIVER_ENDPOINT_H_
14
17#include "roc_core/iallocator.h"
18#include "roc_core/mpsc_queue.h"
19#include "roc_core/optional.h"
21#include "roc_core/scoped_ptr.h"
22#include "roc_packet/iparser.h"
23#include "roc_packet/iwriter.h"
24#include "roc_pipeline/config.h"
27#include "roc_rtcp/parser.h"
28#include "roc_rtp/format_map.h"
29#include "roc_rtp/parser.h"
30
31namespace roc {
32namespace pipeline {
33
34//! Receiver endpoint sub-pipeline.
35//!
36//! Contains:
37//! - a pipeline for processing packets from single network endpoint
38//! - a reference to session group to which packets are routed
40 : public core::RefCounted<ReceiverEndpoint, core::StandardAllocation>,
41 public core::ListNode,
42 private packet::IWriter {
44
45public:
46 //! Initialize.
48 ReceiverState& receiver_state,
49 ReceiverSessionGroup& session_group,
50 const rtp::FormatMap& format_map,
52
53 //! Check if the port pipeline was succefully constructed.
54 bool valid() const;
55
56 //! Get protocol.
58
59 //! Get endpoint writer.
60 //! @remarks
61 //! Packets passed to this writer will be pulled by endpoint pipeline.
62 //! This writer is thread-safe and lock-free.
63 //! The writer is passed to netio thread.
65
66 //! Pull packets writter to endpoint writer.
68
69private:
70 virtual void write(const packet::PacketPtr& packet);
71
72 const address::Protocol proto_;
73
74 ReceiverState& receiver_state_;
75 ReceiverSessionGroup& session_group_;
76
77 packet::IParser* parser_;
78
82
84};
85
86} // namespace pipeline
87} // namespace roc
88
89#endif // ROC_PIPELINE_RECEIVER_ENDPOINT_H_
Memory allocator interface.
Definition: iallocator.h:23
Base class for list element.
Definition: list_node.h:26
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
Definition: mpsc_queue.h:40
Optionally constructed object.
Definition: optional.h:25
Base class for reference counted object.
Definition: ref_counted.h:39
Unique ownrship pointer.
Definition: scoped_ptr.h:32
IAllocator & allocator() const
Get allocator.
Packet parser interface.
Definition: iparser.h:22
Packet writer interface.
Definition: iwriter.h:21
Receiver endpoint sub-pipeline.
bool valid() const
Check if the port pipeline was succefully constructed.
packet::IWriter & writer()
Get endpoint writer.
void pull_packets()
Pull packets writter to endpoint writer.
address::Protocol proto() const
Get protocol.
ReceiverEndpoint(address::Protocol proto, ReceiverState &receiver_state, ReceiverSessionGroup &session_group, const rtp::FormatMap &format_map, core::IAllocator &allocator)
Initialize.
Receiver pipeline state. Thread-safe.
RTP payload format map.
Definition: format_map.h:22
RTP payload format map.
Memory allocator interface.
Interface ID.
Packet parser interface.
Packet writer interface.
Multi-producer single-consumer queue.
Protocol
Protocol ID.
Definition: protocol.h:19
Root namespace.
Optionally constructed object.
Protocol ID.
Receiver session group.
Receiver pipeline state.
Base class for reference counted object.
Pipeline config.
RTCP packet parser.
RTP packet parser.
Unique ownrship pointer.