context: Add new create_session method with correct order of IP addresses. Deprecate old one.
This commit is contained in:
parent
b3f2c6f2ba
commit
80dd00d536
|
@ -33,6 +33,18 @@ namespace uvgrtp {
|
||||||
*/
|
*/
|
||||||
~context();
|
~context();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Create a new RTP session between two IP addresses
|
||||||
|
*
|
||||||
|
* \param addresses Pair of a local and a remote IP address
|
||||||
|
*
|
||||||
|
* \return RTP session object
|
||||||
|
*
|
||||||
|
* \retval uvgrtp::session On success
|
||||||
|
* \retval nullptr If memory allocation failed
|
||||||
|
*/
|
||||||
|
uvgrtp::session* create_session(std::pair<std::string, std::string> addresses);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Create a new RTP session
|
* \brief Create a new RTP session
|
||||||
*
|
*
|
||||||
|
@ -45,23 +57,10 @@ namespace uvgrtp {
|
||||||
*/
|
*/
|
||||||
uvgrtp::session *create_session(std::string address);
|
uvgrtp::session *create_session(std::string address);
|
||||||
|
|
||||||
/**
|
/// \cond DO_NOT_DOCUMENT
|
||||||
* \brief Create a new RTP session
|
// Obsolete method, replaced by create_session(std::pair<std::string, std::string> addresses);
|
||||||
*
|
|
||||||
* \details If UDP holepunching should be utilized, in addition to remote IP
|
|
||||||
* address, the caller must also provide local IP address where uvgRTP
|
|
||||||
* should bind itself to. If you are using uvgRTP for unidirectional streaming,
|
|
||||||
* please take a look at @ref RCE_HOLEPUNCH_KEEPALIVE
|
|
||||||
*
|
|
||||||
* \param remote_addr IP address of the remote participant
|
|
||||||
* \param local_addr IP address of a local interface
|
|
||||||
*
|
|
||||||
* \return RTP session object
|
|
||||||
*
|
|
||||||
* \retval uvgrtp::session On success
|
|
||||||
* \retval nullptr If memory allocation failed
|
|
||||||
*/
|
|
||||||
uvgrtp::session *create_session(std::string remote_addr, std::string local_addr);
|
uvgrtp::session *create_session(std::string remote_addr, std::string local_addr);
|
||||||
|
/// \endcond
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Destroy RTP session and all of its media streams
|
* \brief Destroy RTP session and all of its media streams
|
||||||
|
|
|
@ -55,6 +55,11 @@ uvgrtp::context::~context()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uvgrtp::session* uvgrtp::context::create_session(std::pair<std::string, std::string> addresses)
|
||||||
|
{
|
||||||
|
return create_session(addresses.second, addresses.first);
|
||||||
|
}
|
||||||
|
|
||||||
uvgrtp::session *uvgrtp::context::create_session(std::string address)
|
uvgrtp::session *uvgrtp::context::create_session(std::string address)
|
||||||
{
|
{
|
||||||
if (address == "")
|
if (address == "")
|
||||||
|
|
Loading…
Reference in New Issue