Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mediastreamer2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
mediastreamer2
Commits
be65952f
Commit
be65952f
authored
Jul 26, 2012
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function to get ICE nominated valid remote candidate.
parent
f428f3f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
ice.h
include/mediastreamer2/ice.h
+12
-0
ice.c
src/ice.c
+26
-0
No files found.
include/mediastreamer2/ice.h
View file @
be65952f
...
...
@@ -417,6 +417,18 @@ MS2_PUBLIC bool_t ice_check_list_default_local_candidate(const IceCheckList *cl,
*/
MS2_PUBLIC
bool_t
ice_check_list_nominated_valid_local_candidate
(
const
IceCheckList
*
cl
,
const
char
**
rtp_addr
,
int
*
rtp_port
,
const
char
**
rtcp_addr
,
int
*
rtcp_port
);
/**
* Get the nominated valid remote candidate for an ICE check list.
*
* @param cl A pointer to a check list
* @param rtp_addr A pointer to store the RTP address
* @param rtp_port A pointer to store the RTP port
* @param rtcp_addr A pointer to store the RTCP address
* @param rtcp_port A pointer to store the RTCP port
* @return TRUE if the information have been successfully retrieved, FALSE otherwise
*/
MS2_PUBLIC
bool_t
ice_check_list_nominated_valid_remote_candidate
(
const
IceCheckList
*
cl
,
const
char
**
rtp_addr
,
int
*
rtp_port
,
const
char
**
rtcp_addr
,
int
*
rtcp_port
);
/**
* Get the candidate type as a string.
*
...
...
src/ice.c
View file @
be65952f
...
...
@@ -429,6 +429,32 @@ bool_t ice_check_list_nominated_valid_local_candidate(const IceCheckList *cl, co
return
TRUE
;
}
bool_t
ice_check_list_nominated_valid_remote_candidate
(
const
IceCheckList
*
cl
,
const
char
**
rtp_addr
,
int
*
rtp_port
,
const
char
**
rtcp_addr
,
int
*
rtcp_port
)
{
IceCandidate
*
candidate
=
NULL
;
IceValidCandidatePair
*
valid_pair
=
NULL
;
uint16_t
componentID
;
MSList
*
rtp_elem
;
MSList
*
rtcp_elem
;
componentID
=
1
;
rtp_elem
=
ms_list_find_custom
(
cl
->
valid_list
,
(
MSCompareFunc
)
ice_find_nominated_valid_pair_from_componentID
,
&
componentID
);
if
(
rtp_elem
==
NULL
)
return
FALSE
;
componentID
=
2
;
rtcp_elem
=
ms_list_find_custom
(
cl
->
valid_list
,
(
MSCompareFunc
)
ice_find_nominated_valid_pair_from_componentID
,
&
componentID
);
valid_pair
=
(
IceValidCandidatePair
*
)
rtp_elem
->
data
;
candidate
=
valid_pair
->
valid
->
remote
;
if
(
rtp_addr
!=
NULL
)
*
rtp_addr
=
candidate
->
taddr
.
ip
;
if
(
rtp_port
!=
NULL
)
*
rtp_port
=
candidate
->
taddr
.
port
;
if
(
rtcp_elem
==
NULL
)
return
FALSE
;
valid_pair
=
(
IceValidCandidatePair
*
)
rtcp_elem
->
data
;
candidate
=
valid_pair
->
valid
->
remote
;
if
(
rtcp_addr
!=
NULL
)
*
rtcp_addr
=
candidate
->
taddr
.
ip
;
if
(
rtcp_port
!=
NULL
)
*
rtcp_port
=
candidate
->
taddr
.
port
;
return
TRUE
;
}
static
void
ice_check_list_queue_triggered_check
(
IceCheckList
*
cl
,
IceCandidatePair
*
pair
)
{
MSList
*
elem
=
ms_list_find
(
cl
->
triggered_checks_queue
,
pair
);
...
...
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