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

#include <ravenna_receiver.hpp>

Inheritance diagram for rav::RavennaReceiver:
rav::RavennaRtspClient::Subscriber

Classes

struct  Configuration
 Defines the configuration for the receiver. More...
class  Subscriber
 Baseclass for other classes which want to receive changes to the stream. More...

Public Member Functions

 RavennaReceiver (RavennaRtspClient &rtsp_client, rtp::AudioReceiver &rtp_audio_receiver, Id id, NetworkInterfaceConfig network_interface_config)
 ~RavennaReceiver () override
 RavennaReceiver (const RavennaReceiver &)=delete
RavennaReceiver & operator= (const RavennaReceiver &)=delete
 RavennaReceiver (RavennaReceiver &&) noexcept=delete
RavennaReceiver & operator= (RavennaReceiver &&) noexcept=delete
Id get_id () const
const boost::uuids::uuid & get_uuid () const
tl::expected< void, std::string > set_configuration (Configuration config)
 Updates the configuration of the receiver.
const Configuration & get_configuration () const
bool subscribe (Subscriber *subscriber)
 Adds a subscriber to the receiver.
bool unsubscribe (const Subscriber *subscriber)
 Removes a subscriber from the receiver.
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.
std::optional< sdp::SessionDescription > get_sdp () const
std::optional< std::string > get_sdp_text () const
void set_network_interface_config (NetworkInterfaceConfig network_interface_config)
 Sets the network interface config for the receiver.
boost::json::object to_boost_json () const
tl::expected< void, std::string > restore_from_json (const boost::json::value &json)
 Restores the receiver from a JSON representation.
const nmos::ReceiverAudio & get_nmos_receiver () const
void do_maintenance ()
 Call regularly from the maintenance thread.
void on_announced (const RavennaRtspClient::AnnouncedEvent &event) override
 Called when a session is announced.
Public Member Functions inherited from rav::RavennaRtspClient::Subscriber
 Subscriber ()=default
virtual ~Subscriber ()=default
 Subscriber (const Subscriber &)=delete
Subscriber & operator= (const Subscriber &)=delete
 Subscriber (Subscriber &&) noexcept=delete
Subscriber & operator= (Subscriber &&) noexcept=delete

Static Public Attributes

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 37 of file ravenna_receiver.hpp.

Constructor & Destructor Documentation

◆ RavennaReceiver() [1/3]

rav::RavennaReceiver::RavennaReceiver ( RavennaRtspClient & rtsp_client,
rtp::AudioReceiver & rtp_audio_receiver,
Id id,
NetworkInterfaceConfig network_interface_config )
explicit

◆ ~RavennaReceiver()

rav::RavennaReceiver::~RavennaReceiver ( )
override

◆ RavennaReceiver() [2/3]

rav::RavennaReceiver::RavennaReceiver ( const RavennaReceiver & )
delete

◆ RavennaReceiver() [3/3]

rav::RavennaReceiver::RavennaReceiver ( RavennaReceiver && )
deletenoexcept

Member Function Documentation

◆ do_maintenance()

void rav::RavennaReceiver::do_maintenance ( )

Call regularly from the maintenance thread.

◆ get_configuration()

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

◆ get_id()

Id rav::RavennaReceiver::get_id ( ) const
nodiscard
Returns
The unique ID of this stream receiver. The id is unique across the process.

◆ get_nmos_receiver()

const nmos::ReceiverAudio & rav::RavennaReceiver::get_nmos_receiver ( ) const
nodiscard
Returns
The NMOS receiver of this receiver.

◆ get_sdp()

std::optional< sdp::SessionDescription > rav::RavennaReceiver::get_sdp ( ) const
nodiscard
Returns
The SDP for the session.

◆ get_sdp_text()

std::optional< std::string > rav::RavennaReceiver::get_sdp_text ( ) const
nodiscard
Returns
The SDP text for the session. This is the original SDP text as receiver from the server potentially including things which haven't been parsed into the session_description.

◆ get_uuid()

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

◆ on_announced()

void rav::RavennaReceiver::on_announced ( const RavennaRtspClient::AnnouncedEvent & event)
overridevirtual

Called when a session is announced.

Parameters
eventThe announced event.

Reimplemented from rav::RavennaRtspClient::Subscriber.

◆ operator=() [1/2]

RavennaReceiver & rav::RavennaReceiver::operator= ( const RavennaReceiver & )
delete

◆ operator=() [2/2]

RavennaReceiver & rav::RavennaReceiver::operator= ( RavennaReceiver && )
deletenoexcept

◆ restore_from_json()

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

Restores the receiver from a JSON representation.

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

◆ set_configuration()

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

Updates the configuration of the receiver.

Only takes into account the fields in the configuration that are set. This allows to update only a subset of the configuration.

Parameters
configThe configuration changes to apply.

◆ set_network_interface_config()

void rav::RavennaReceiver::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::RavennaReceiver::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::RavennaReceiver::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::RavennaReceiver::subscribe ( Subscriber * subscriber)
nodiscard

Adds a subscriber to the receiver.

Parameters
subscriberThe subscriber to add.
Returns
true if the subscriber was added, or false if it was already in the list.

◆ to_boost_json()

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

◆ unsubscribe()

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

Removes a subscriber from the receiver.

Parameters
subscriberThe subscriber to remove.
Returns
true if the subscriber was removed, or false if it wasn't found.

Member Data Documentation

◆ k_supported_encodings

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

List of supported audio encodings for the sender.

Definition at line 40 of file ravenna_receiver.hpp.


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