RAVENNAKIT
Loading...
Searching...
No Matches
rav::RavennaSender Class Reference

#include <ravenna_sender.hpp>

Inheritance diagram for rav::RavennaSender:
rav::rtsp::Server::PathHandler rav::ptp::Instance::Subscriber

Classes

struct  Destination
 The destination of where a stream of packets should go. More...
struct  Configuration
class  Subscriber

Public Member Functions

 RavennaSender (rtp::AudioSender &rtp_audio_sender, dnssd::Advertiser *advertiser, rtsp::Server &rtsp_server, ptp::Instance &ptp_instance, Id id, uint32_t session_id, NetworkInterfaceConfig network_interface_config)
 ~RavennaSender () override
 RavennaSender (const RavennaSender &other)=delete
RavennaSender & operator= (const RavennaSender &other)=delete
 RavennaSender (RavennaSender &&other) noexcept=delete
RavennaSender & operator= (RavennaSender &&other) noexcept=delete
Id get_id () const
const boost::uuids::uuid & get_uuid () const
uint32_t get_session_id () const
tl::expected< void, std::string > set_configuration (Configuration config)
 Updates the configuration of the sender.
const Configuration & get_configuration () const
bool subscribe (Subscriber *subscriber)
 Subscribes to the sender.
bool unsubscribe (const Subscriber *subscriber)
 Unsubscribes from the sender.
void set_nmos_node (nmos::Node *nmos_node)
 Sets the NMOS node for the receiver.
void set_nmos_device_id (const boost::uuids::uuid &device_id)
 Sets the NMOS device ID for the receiver.
float get_signaled_ptime () const
uint32_t get_framecount () const
void set_network_interface_config (NetworkInterfaceConfig network_interface_config)
 Sets the network interface config for the receiver.
void set_advertiser (dnssd::Advertiser *advertiser)
 Sets given advertiser, updating the advertisement where necessary.
tl::expected< sdp::SessionDescription, std::string > generate_sdp () const
 Generates and returns the SDP as string.
boost::json::object to_boost_json () const
tl::expected< void, std::string > restore_from_json (const boost::json::value &json)
 Restores the sender from a JSON representation.
const nmos::SourceAudio & get_nmos_source () const
const nmos::FlowAudioRaw & get_nmos_flow () const
const nmos::Sender & get_nmos_sender () const
void on_request (rtsp::Connection::RequestEvent event) const override
 Called when a request is received.
void ptp_parent_changed (const ptp::ParentDs &parent) override
 Called when the parent of the PTP instance changes.
Public Member Functions inherited from rav::rtsp::Server::PathHandler
virtual ~PathHandler ()=default
virtual void on_response (Connection::ResponseEvent event)
 Called when a response is received.
Public Member Functions inherited from rav::ptp::Instance::Subscriber
virtual ~Subscriber ()=default
virtual void ptp_port_changed_state (const Port &port)
 Called when the state of a port changes.
virtual void ptp_port_removed (const uint16_t port_number)
 Called when a port was removed.
virtual void ptp_configuration_updated (const Configuration &config)
 Called when the configuration was updated.
virtual void ptp_stats_updated (const Stats &ptp_stats)
 Called at a regular interval when the PTP stats are updated.
const LocalClock & get_local_clock ()

Static Public Attributes

static constexpr uint32_t k_buffer_num_packets = 30
 The number of packet buffers available for sending.
static constexpr uint32_t k_max_num_frames = 4096
 The max number of frames to feed into the sender (using send_audio_data_realtime).
static constexpr auto k_supported_encodings = {AudioEncoding::pcm_s16, AudioEncoding::pcm_s24}
 List of supported audio encodings for the sender.

Detailed Description

Definition at line 42 of file ravenna_sender.hpp.

Constructor & Destructor Documentation

◆ RavennaSender() [1/3]

rav::RavennaSender::RavennaSender ( rtp::AudioSender & rtp_audio_sender,
dnssd::Advertiser * advertiser,
rtsp::Server & rtsp_server,
ptp::Instance & ptp_instance,
Id id,
uint32_t session_id,
NetworkInterfaceConfig network_interface_config )

◆ ~RavennaSender()

rav::RavennaSender::~RavennaSender ( )
override

◆ RavennaSender() [2/3]

rav::RavennaSender::RavennaSender ( const RavennaSender & other)
delete

◆ RavennaSender() [3/3]

rav::RavennaSender::RavennaSender ( RavennaSender && other)
deletenoexcept

Member Function Documentation

◆ generate_sdp()

tl::expected< sdp::SessionDescription, std::string > rav::RavennaSender::generate_sdp ( ) const
nodiscard

Generates and returns the SDP as string.

Returns
A result containing either an error or the SDP text.

◆ get_configuration()

const Configuration & rav::RavennaSender::get_configuration ( ) const
nodiscard
Returns
The current configuration of the sender.

◆ get_framecount()

uint32_t rav::RavennaSender::get_framecount ( ) const
nodiscard
Returns
The packet size in number of frames.

◆ get_id()

Id rav::RavennaSender::get_id ( ) const
nodiscard
Returns
The sender ID.

◆ get_nmos_flow()

const nmos::FlowAudioRaw & rav::RavennaSender::get_nmos_flow ( ) const
nodiscard
Returns
The NMOS flow of this sender.

◆ get_nmos_sender()

const nmos::Sender & rav::RavennaSender::get_nmos_sender ( ) const
nodiscard
Returns
The NMOS sender of this sender.

◆ get_nmos_source()

const nmos::SourceAudio & rav::RavennaSender::get_nmos_source ( ) const
nodiscard
Returns
The NMOS source of this sender.

◆ get_session_id()

uint32_t rav::RavennaSender::get_session_id ( ) const
nodiscard
Returns
The session ID of the sender.

◆ get_signaled_ptime()

float rav::RavennaSender::get_signaled_ptime ( ) const
nodiscard
Returns
The packet time in milliseconds as signaled using SDP. If the packet time is 1ms and the sample rate is 44.1kHz, then the signaled packet time is 1.09.

◆ get_uuid()

const boost::uuids::uuid & rav::RavennaSender::get_uuid ( ) const
nodiscard
Returns
The unique UUID of the sender.

◆ on_request()

void rav::RavennaSender::on_request ( rtsp::Connection::RequestEvent event) const
overridevirtual

Called when a request is received.

Parameters
eventThe event containing the request.

Reimplemented from rav::rtsp::Server::PathHandler.

◆ operator=() [1/2]

RavennaSender & rav::RavennaSender::operator= ( const RavennaSender & other)
delete

◆ operator=() [2/2]

RavennaSender & rav::RavennaSender::operator= ( RavennaSender && other)
deletenoexcept

◆ ptp_parent_changed()

void rav::RavennaSender::ptp_parent_changed ( const ptp::ParentDs & parent)
overridevirtual

Called when the parent of the PTP instance changes.

Parameters
parentThe new parent data set.

Reimplemented from rav::ptp::Instance::Subscriber.

◆ restore_from_json()

tl::expected< void, std::string > rav::RavennaSender::restore_from_json ( const boost::json::value & json)
nodiscard

Restores the sender from a JSON representation.

Parameters
jsonThe JSON representation of the sender.
Returns
A result indicating whether the restoration was successful or not.

◆ set_advertiser()

void rav::RavennaSender::set_advertiser ( dnssd::Advertiser * advertiser)

Sets given advertiser, updating the advertisement where necessary.

Parameters
advertiserThe new advertiser. Can be nullptr to stop the advirtisement.

◆ set_configuration()

tl::expected< void, std::string > rav::RavennaSender::set_configuration ( Configuration config)
nodiscard

Updates the configuration of the sender.

Parameters
configThe configuration to update.

◆ set_network_interface_config()

void rav::RavennaSender::set_network_interface_config ( NetworkInterfaceConfig network_interface_config)

Sets the network interface config for the receiver.

Parameters
network_interface_configThe configuration of the network interface to use.

◆ set_nmos_device_id()

void rav::RavennaSender::set_nmos_device_id ( const boost::uuids::uuid & device_id)

Sets the NMOS device ID for the receiver.

Parameters
device_idThe device ID to set.

◆ set_nmos_node()

void rav::RavennaSender::set_nmos_node ( nmos::Node * nmos_node)

Sets the NMOS node for the receiver.

Parameters
nmos_nodeThe NMOS node to set. May be nullptr if NMOS is not used.

◆ subscribe()

bool rav::RavennaSender::subscribe ( Subscriber * subscriber)
nodiscard

Subscribes to the sender.

Parameters
subscriberThe subscriber to subscribe.
Returns
True if the subscriber was successfully subscribed, false otherwise.

◆ to_boost_json()

boost::json::object rav::RavennaSender::to_boost_json ( ) const
Returns
A JSON representation of the sender.

◆ unsubscribe()

bool rav::RavennaSender::unsubscribe ( const Subscriber * subscriber)
nodiscard

Unsubscribes from the sender.

Parameters
subscriberThe subscriber to unsubscribe.
Returns

Member Data Documentation

◆ k_buffer_num_packets

uint32_t rav::RavennaSender::k_buffer_num_packets = 30
staticconstexpr

The number of packet buffers available for sending.

This value means that n packets worth of data can be queued for sending.

Definition at line 46 of file ravenna_sender.hpp.

◆ k_max_num_frames

uint32_t rav::RavennaSender::k_max_num_frames = 4096
staticconstexpr

The max number of frames to feed into the sender (using send_audio_data_realtime).

This will usually correspond to an audio device buffer size.

Definition at line 50 of file ravenna_sender.hpp.

◆ k_supported_encodings

auto rav::RavennaSender::k_supported_encodings = {AudioEncoding::pcm_s16, AudioEncoding::pcm_s24}
staticconstexpr

List of supported audio encodings for the sender.

Definition at line 53 of file ravenna_sender.hpp.


The documentation for this class was generated from the following file: