Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
sender_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/sender_endpoint.h
10//! @brief Sender endpoint pipeline.
11
12#ifndef ROC_PIPELINE_SENDER_ENDPOINT_H_
13#define ROC_PIPELINE_SENDER_ENDPOINT_H_
14
15#include "roc_core/iallocator.h"
16#include "roc_core/mutex.h"
18#include "roc_core/optional.h"
19#include "roc_core/scoped_ptr.h"
21#include "roc_packet/iwriter.h"
22#include "roc_pipeline/config.h"
23#include "roc_rtcp/composer.h"
24#include "roc_rtp/composer.h"
25
26namespace roc {
27namespace pipeline {
28
29//! Sender endpoint sub-pipeline.
30//!
31//! Contains:
32//! - a pipeline for processing packets for single network endpoint
34public:
35 //! Initialize.
37
38 //! Check if pipeline was succefully constructed.
39 bool valid() const;
40
41 //! Get protocol.
43
44 //! Get packet composer.
45 //! @remarks
46 //! This composer will creates packets according to endpoint protocol.
48
49 //! Get packet writer.
50 //! @remarks
51 //! This writer will pass packets to the endpoint pipeline.
53
54 //! Check if destination writer was set.
55 //! @remarks
56 //! True if set_destination_writer() was called.
58
59 //! Set destination writer.
60 //! @remarks
61 //! When packets are written to the endpoint pipeline, in the end they
62 //! go to the destination writer.
64
65 //! Set destination address.
66 //! @remarks
67 //! When packets are written to the endpoint pipeline, they are assigned
68 //! the specified destination address.
70
71private:
72 virtual void write(const packet::PacketPtr& packet);
73
74 const address::Protocol proto_;
75
76 packet::IWriter* dst_writer_;
77 address::SocketAddr dst_address_;
78
79 packet::IComposer* composer_;
80
83 core::Optional<rtcp::Composer> rtcp_composer_;
84};
85
86} // namespace pipeline
87} // namespace roc
88
89#endif // ROC_PIPELINE_SENDER_ENDPOINT_H_
Memory allocator interface.
Definition iallocator.h:23
Base class for non-copyable objects.
Definition noncopyable.h:23
Optionally constructed object.
Definition optional.h:25
Unique ownrship pointer.
Definition scoped_ptr.h:32
Packet composer interface.
Definition icomposer.h:22
Packet writer interface.
Definition iwriter.h:21
Sender endpoint sub-pipeline.
address::Protocol proto() const
Get protocol.
bool valid() const
Check if pipeline was succefully constructed.
SenderEndpoint(address::Protocol proto, core::IAllocator &allocator)
Initialize.
packet::IWriter & writer()
Get packet writer.
bool has_destination_writer() const
Check if destination writer was set.
void set_destination_address(const address::SocketAddr &)
Set destination address.
packet::IComposer & composer()
Get packet composer.
void set_destination_writer(packet::IWriter &writer)
Set destination writer.
Memory allocator interface.
Packet composer interface.
Packet writer interface.
Mutex.
Protocol
Protocol ID.
Definition protocol.h:19
Root namespace.
Non-copyable object.
Optionally constructed object.
Pipeline config.
RTCP packet composer.
RTP packet composer.
Unique ownrship pointer.