Class definition of the SAPListener.
More...
#include <sap_listener.h>
|
static SapListener & | GetInstance () |
| A Singleton get method.
|
|
|
SdpTypeEnum | GetType (const std::string_view &line) const |
| Get the SDP attribute type doe a single SDP line of text.
|
|
std::map< std::string, std::string, std::less<> > | ParseAttributes1 (const std::string_view &line) const |
| Parse any attributes.
|
|
std::map< std::string, std::string, std::less<> > | ParseAttributes (const std::string_view &line) const |
| Parse any attributes.
|
|
std::map< std::string, std::string, std::less<> > | ParseAttributesEqual (const std::string &line) const |
| Parse attributes with equals.
|
|
bool | SapStore (std::array< uint8_t, mediax::rtp::kMaxUdpData > *udpdata, uint32_t size) |
| Store or update the SAP data.
|
|
|
std::map< std::string, SapCallback, std::less<> > | callbacks_ |
| The list of SAP/SDP announcement callbacks.
|
|
std::map< std::string, SdpMessage, std::less<> > | announcements_ |
| The list of SAP/SDP announcements.
|
|
std::array< uint8_t, mediax::rtp::kMaxUdpData > | udpdata_ |
| The buffer for the UDP data.
|
|
std::thread | thread_ |
| The thread for the SAP/SDP announcements.
|
|
int | sockfd_ |
| The socket for the SAP/SDP announcements.
|
|
struct sockaddr_in | multicast_addr_ |
| The multicast address for the SAP/SDP announcements.
|
|
void * | data_ |
| Callback data.
|
|
|
static std::unique_ptr< SapListener > | singleton_ |
| The pointer to the SAPListener singleton.
|
|
static bool | running_ = false |
| The SAP/SDP announcements thread running flag.
|
|
Class definition of the SAPListener.
◆ GetSapAnnouncement()
bool mediax::sap::SapListener::GetSapAnnouncement |
( |
std::string_view |
session_name, |
|
|
SdpMessage ** |
sdp_message |
|
) |
| |
Get the Sap Announcement object.
- Parameters
-
session_name | The session name we want |
sdp_message | The pointer to the SDP message data |
- Returns
- true If found, i.e. SAP message recieved
-
false If not yet seen, not in list
◆ GetSapAnnouncements()
const std::map< std::string, SdpMessage, std::less<> > & mediax::sap::SapListener::GetSapAnnouncements |
( |
| ) |
const |
Get a list of SAP/SDP streams seen on the network.
- Returns
- The vectored list of SAP/SDP streams seen on the network
◆ GetStreamInformation()
Get the stream information for a given session name.
- Parameters
-
session_name | The SAP/SDP session name |
stream_information | The stream information being updated |
- Returns
- bool, true if the stream information was updated
◆ GetType()
SdpTypeEnum mediax::sap::SapListener::GetType |
( |
const std::string_view & |
line | ) |
const |
|
private |
Get the SDP attribute type doe a single SDP line of text.
- Returns
- SdpTypeEnum attribute enum
◆ ParseAttributes()
std::map< std::string, std::string, std::less<> > mediax::sap::SapListener::ParseAttributes |
( |
const std::string_view & |
line | ) |
const |
|
private |
Parse any attributes.
- Parameters
-
- Returns
- std::map<std::string, std::string, std::less<>>
◆ ParseAttributes1()
std::map< std::string, std::string, std::less<> > mediax::sap::SapListener::ParseAttributes1 |
( |
const std::string_view & |
line | ) |
const |
|
private |
Parse any attributes.
- Parameters
-
- Returns
- std::map<std::string, std::string>
◆ ParseAttributesEqual()
std::map< std::string, std::string, std::less<> > mediax::sap::SapListener::ParseAttributesEqual |
( |
const std::string & |
line | ) |
const |
|
private |
Parse attributes with equals.
- Parameters
-
- Returns
- std::map<std::string, std::string>
◆ RegisterSapListener()
void mediax::sap::SapListener::RegisterSapListener |
( |
std::string_view |
session_name, |
|
|
const ::mediax::sap::SapCallback & |
callback, |
|
|
void * |
data |
|
) |
| |
Register a callback for our session_name.
- Parameters
-
session_name | Advertised session name |
callback | The callback to notify when SAP/SDP message received |
data | The data to pass to the callback |
◆ SapListenerThread()
void mediax::sap::SapListener::SapListenerThread |
( |
SapListener * |
sap | ) |
|
|
staticprivate |
Function to broadcast SAP announcements for a list of streams.
Only needs to be called once to start the broadcast thread
- Parameters
-
◆ SapStore()
Store or update the SAP data.
- Returns
- true
-
false
Remove the first two characters now we know the type
The documentation for this class was generated from the following files: