Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
c4bfe347
Commit
c4bfe347
authored
Apr 08, 2014
by
Youness Alaoui
Committed by
Olivier Crête
May 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use nice_candidate_ice_priority instead of _full variant when possible
parent
60cf169b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
28 deletions
+21
-28
agent/discovery.c
agent/discovery.c
+21
-28
No files found.
agent/discovery.c
View file @
c4bfe347
...
...
@@ -545,6 +545,10 @@ discovery_add_server_reflexive_candidate (
return
NULL
;
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
);
candidate
->
transport
=
transport
;
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
candidate
->
priority
=
nice_candidate_jingle_priority
(
candidate
);
...
...
@@ -552,15 +556,9 @@ discovery_add_server_reflexive_candidate (
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007
)
{
candidate
->
priority
=
nice_candidate_msn_priority
(
candidate
);
}
else
{
candidate
->
priority
=
nice_candidate_ice_priority_full
(
NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE
,
0
,
component_id
);
candidate
->
priority
=
nice_candidate_ice_priority
(
candidate
);
}
candidate
->
transport
=
transport
;
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
/* step: link to the base candidate+socket */
candidate
->
sockptr
=
base_socket
;
candidate
->
base_addr
=
base_socket
->
addr
;
...
...
@@ -606,6 +604,11 @@ discovery_add_relay_candidate (
return
NULL
;
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_RELAYED
);
candidate
->
transport
=
transport
;
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
candidate
->
turn
=
turn_server_ref
(
turn
);
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
candidate
->
priority
=
nice_candidate_jingle_priority
(
candidate
);
...
...
@@ -613,14 +616,8 @@ discovery_add_relay_candidate (
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007
)
{
candidate
->
priority
=
nice_candidate_msn_priority
(
candidate
);
}
else
{
candidate
->
priority
=
nice_candidate_ice_priority_full
(
NICE_CANDIDATE_TYPE_PREF_RELAYED
,
0
,
component_id
);
candidate
->
priority
=
nice_candidate_ice_priority
(
candidate
);
}
candidate
->
transport
=
transport
;
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
candidate
->
turn
=
turn_server_ref
(
turn
);
/* step: link to the base candidate+socket */
relay_socket
=
nice_turn_socket_new
(
agent
->
main_context
,
address
,
...
...
@@ -683,6 +680,11 @@ discovery_add_peer_reflexive_candidate (
return
NULL
;
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_PEER_REFLEXIVE
);
candidate
->
transport
=
local
->
transport
;
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
candidate
->
base_addr
=
base_socket
->
addr
;
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
candidate
->
priority
=
nice_candidate_jingle_priority
(
candidate
);
...
...
@@ -690,15 +692,8 @@ discovery_add_peer_reflexive_candidate (
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007
)
{
candidate
->
priority
=
nice_candidate_msn_priority
(
candidate
);
}
else
{
candidate
->
priority
=
nice_candidate_ice_priority_full
(
NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE
,
0
,
component_id
);
candidate
->
priority
=
nice_candidate_ice_priority
(
candidate
);
}
candidate
->
transport
=
local
->
transport
;
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
candidate
->
base_addr
=
base_socket
->
addr
;
priv_assign_foundation
(
agent
,
candidate
);
...
...
@@ -776,6 +771,9 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
candidate
->
addr
=
*
remote_address
;
candidate
->
base_addr
=
*
remote_address
;
candidate
->
transport
=
remote
->
transport
;
candidate
->
stream_id
=
stream
->
id
;
candidate
->
component_id
=
component
->
id
;
/* if the check didn't contain the PRIORITY attribute, then the priority will
* be 0, which is invalid... */
...
...
@@ -787,13 +785,8 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
agent
->
compatibility
==
NICE_COMPATIBILITY_OC2007
)
{
candidate
->
priority
=
nice_candidate_msn_priority
(
candidate
);
}
else
{
candidate
->
priority
=
nice_candidate_ice_priority_full
(
NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE
,
0
,
component
->
id
);
candidate
->
priority
=
nice_candidate_ice_priority
(
candidate
);
}
candidate
->
transport
=
remote
->
transport
;
candidate
->
stream_id
=
stream
->
id
;
candidate
->
component_id
=
component
->
id
;
priv_assign_remote_foundation
(
agent
,
candidate
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment