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

Maintains connections to one or more RAVENNA RTSP servers, upon request. More...

#include <ravenna_rtsp_client.hpp>

Inheritance diagram for rav::RavennaRtspClient:
rav::RavennaBrowser::Subscriber

Classes

struct  AnnouncedEvent
class  Subscriber

Public Member Functions

 RavennaRtspClient (boost::asio::io_context &io_context, RavennaBrowser &browser)
 ~RavennaRtspClient () override
bool subscribe_to_session (Subscriber *subscriber_to_add, const std::string &session_name)
 Subscribes to a session.
bool unsubscribe_from_all_sessions (const Subscriber *subscriber_to_remove)
 Unsubscribes from all sessions.
std::optional< sdp::SessionDescription > get_sdp_for_session (const std::string &session_name) const
 Tries to find the SDP for the given session.
std::optional< std::string > get_sdp_text_for_session (const std::string &session_name) const
 Tries to find the SDP text for the given session.
boost::asio::io_context & get_io_context () const
void ravenna_session_discovered (const dnssd::ServiceDescription &desc) override
 Called when a session is discovered.
Public Member Functions inherited from rav::RavennaBrowser::Subscriber
virtual ~Subscriber ()=default
virtual void ravenna_node_discovered (const dnssd::ServiceDescription &desc)
 Called when a node is discovered.
virtual void ravenna_node_removed (const dnssd::ServiceDescription &desc)
 Called when a node is removed.
virtual void ravenna_session_removed (const dnssd::ServiceDescription &desc)
 Called when a session is removed.

Detailed Description

Maintains connections to one or more RAVENNA RTSP servers, upon request.

Definition at line 37 of file ravenna_rtsp_client.hpp.

Constructor & Destructor Documentation

◆ RavennaRtspClient()

rav::RavennaRtspClient::RavennaRtspClient ( boost::asio::io_context & io_context,
RavennaBrowser & browser )
explicit

◆ ~RavennaRtspClient()

rav::RavennaRtspClient::~RavennaRtspClient ( )
override

Member Function Documentation

◆ get_io_context()

boost::asio::io_context & rav::RavennaRtspClient::get_io_context ( ) const
nodiscard
Returns
The io_context used by this client.

◆ get_sdp_for_session()

std::optional< sdp::SessionDescription > rav::RavennaRtspClient::get_sdp_for_session ( const std::string & session_name) const
nodiscard

Tries to find the SDP for the given session.

Parameters
session_nameThe name of the session to get the SDP for.
Returns
The SDP for the session, if it exists, otherwise an empty optional.

◆ get_sdp_text_for_session()

std::optional< std::string > rav::RavennaRtspClient::get_sdp_text_for_session ( const std::string & session_name) const
nodiscard

Tries to find the SDP text for the given session.

The difference between this and get_sdp_for_session is that the return value will contain the original SDP text, including things which might not be parsed into the session_description.

Parameters
session_nameThe name of the session to get the SDP text for.
Returns
The SDP text for the session, if it exists, otherwise an empty optional.

◆ ravenna_session_discovered()

void rav::RavennaRtspClient::ravenna_session_discovered ( const dnssd::ServiceDescription & desc)
overridevirtual

Called when a session is discovered.

Parameters
descThe service description of the discovered session.

Reimplemented from rav::RavennaBrowser::Subscriber.

◆ subscribe_to_session()

bool rav::RavennaRtspClient::subscribe_to_session ( Subscriber * subscriber_to_add,
const std::string & session_name )
nodiscard

Subscribes to a session.

Parameters
subscriber_to_addThe subscriber to add.
session_nameThe name of the session to subscribe to.
Returns
true if the subscriber was added, or false if it was already in the list.

◆ unsubscribe_from_all_sessions()

bool rav::RavennaRtspClient::unsubscribe_from_all_sessions ( const Subscriber * subscriber_to_remove)
nodiscard

Unsubscribes from all sessions.

Parameters
subscriber_to_removeThe subscriber to remove.
Returns
true if the subscriber was removed from at least one session, or false if it wasn't.

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