Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
ac437f66
Commit
ac437f66
authored
Jul 18, 2012
by
Ghislain MARY
Browse files
Add ICE session state.
parent
0ebf88d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
include/mediastreamer2/ice.h
include/mediastreamer2/ice.h
+11
-0
src/ice.c
src/ice.c
+3
-0
No files found.
include/mediastreamer2/ice.h
View file @
ac437f66
...
...
@@ -81,6 +81,16 @@ typedef enum {
ICL_Failed
}
IceCheckListState
;
/**
* ICE session state.
*/
typedef
enum
{
IS_Stopped
,
IS_Running
,
IS_Completed
,
IS_Failed
}
IceSessionState
;
/**
* Structure representing an ICE session.
*/
...
...
@@ -92,6 +102,7 @@ typedef struct _IceSession {
char
*
remote_ufrag
;
/**< Remote username fragment for the session (provided via SDP by the peer) */
char
*
remote_pwd
;
/**< Remote password for the session (provided via SDP by the peer) */
IceRole
role
;
/**< Role played by the agent for this session */
IceSessionState
state
;
/**< State of the session */
uint64_t
tie_breaker
;
/**< Random number used to resolve role conflicts (see paragraph 5.2 of the RFC 5245) */
uint32_t
ta
;
/**< Duration of timer for sending connectivity checks in ms */
uint8_t
max_connectivity_checks
;
/**< Configuration parameter to limit the number of connectivity checks performed by the agent (default is 100) */
...
...
src/ice.c
View file @
ac437f66
...
...
@@ -143,6 +143,7 @@ static const char * const candidate_pair_state_values[] = {
static
void
ice_session_init
(
IceSession
*
session
)
{
session
->
streams
=
NULL
;
session
->
state
=
IS_Stopped
;
session
->
role
=
IR_Controlling
;
session
->
tie_breaker
=
(((
uint64_t
)
random
())
<<
32
)
|
(((
uint64_t
)
random
())
&
0xffffffff
);
session
->
ta
=
ICE_DEFAULT_TA_DURATION
;
...
...
@@ -1639,6 +1640,7 @@ static void ice_check_list_pair_candidates(IceCheckList *cl, IceSession *session
void
ice_session_pair_candidates
(
IceSession
*
session
)
{
ms_list_for_each2
(
session
->
streams
,
(
void
(
*
)(
void
*
,
void
*
))
ice_check_list_pair_candidates
,
session
);
session
->
state
=
IS_Running
;
}
...
...
@@ -1791,6 +1793,7 @@ void ice_check_list_process(IceCheckList *cl, RtpSession *rtp_session)
bool_t
retransmissions_pending
=
FALSE
;
if
(
cl
->
session
==
NULL
)
return
;
if
((
cl
->
session
->
state
==
IS_Stopped
)
||
(
cl
->
session
->
state
==
IS_Failed
))
return
;
curtime
=
cl
->
session
->
ticker
->
time
;
switch
(
cl
->
state
)
{
...
...
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