Skip to content
Snippets Groups Projects
Commit 738aedb0 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

add support for QoS

Change-Id: Ic75d07dd85a09af8255e24d5993920d8bf1ed005
parent 0b50a03f
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,19 @@ struct TurnServerInfo
std::string realm; // credentials realm (optional, empty if not used)
};
/** Maps PJSIP QOS types */
enum class QosType
{
BEST_EFFORT, /**< Best effort traffic (default value).
Any QoS function calls with specifying
this value are effectively no-op */
BACKGROUND, /**< Background traffic. */
VIDEO, /**< Video traffic. */
VOICE, /**< Voice traffic. */
CONTROL, /**< Control traffic. */
SIGNALLING /**< Signalling traffic. */
};
struct IceTransportOptions
{
std::shared_ptr<IceTransportFactory> factory {};
......@@ -83,6 +96,8 @@ struct IceTransportOptions
IpAddr accountLocalAddr {};
IpAddr accountPublicAddr {};
std::shared_ptr<upnp::UPnPContext> upnpContext {};
/** Per component QoS Type. */
std::vector<QosType> qosType {};
};
}
......@@ -423,6 +423,15 @@ IceTransport::Impl::initIceInstance(const IceTransportOptions& options)
config_.stun.conn_type = PJ_STUN_TP_UDP;
config_.turn.conn_type = PJ_TURN_TP_UDP;
}
if (options.qosType.size() == 1) {
config_.stun.cfg.qos_type = (pj_qos_type)options.qosType[0];
config_.turn.cfg.qos_type = (pj_qos_type)options.qosType[0];
}
if (options.qosType.size() == compCount_) {
for (unsigned i = 0; i < compCount_; ++i) {
config_.comp[i].qos_type = (pj_qos_type)(options.qosType[i]);
}
}
pool_.reset(
pj_pool_create(factory->getPoolFactory(), "IceTransport.pool", 512, 512, NULL));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment