Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
738aedb0
Commit
738aedb0
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
add support for QoS
Change-Id: Ic75d07dd85a09af8255e24d5993920d8bf1ed005
parent
0b50a03f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ice_options.h
+15
-0
15 additions, 0 deletions
include/ice_options.h
src/ice_transport.cpp
+9
-0
9 additions, 0 deletions
src/ice_transport.cpp
with
24 additions
and
0 deletions
include/ice_options.h
+
15
−
0
View file @
738aedb0
...
...
@@ -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
{};
};
}
This diff is collapsed.
Click to expand it.
src/ice_transport.cpp
+
9
−
0
View file @
738aedb0
...
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment