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
9eb56677
Commit
9eb56677
authored
Jul 02, 2008
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method in agent to force the selection of a remote candidate
parent
c8f978aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
agent/agent.c
agent/agent.c
+59
-0
agent/agent.h
agent/agent.h
+8
-0
No files found.
agent/agent.c
View file @
9eb56677
...
...
@@ -1973,3 +1973,62 @@ guint agent_timeout_add_with_context (NiceAgent *agent, guint interval,
return
id
;
}
/**
* nice_agent_set_selected_remote_candidate:
* @agent: a #NiceAgent
* @stream_id: the stream id
* @component_id: the component id
* @candidate: the #NiceCandidate to force
*
* Sets the selected remote candidate for media transmission
* for given stream component. Calling this function will
* disable all further ICE processing (connection check,
* state machine updates, etc). Note that keepalives will
* continue to be sent.
*
* Returns: %TRUE on success, %FALSE on failure
*/
NICEAPI_EXPORT
gboolean
nice_agent_set_selected_remote_candidate
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
NiceCandidate
*
candidate
)
{
Component
*
component
;
Stream
*
stream
;
NiceCandidate
*
lcandidate
=
NULL
;
gboolean
ret
=
FALSE
;
g_static_rec_mutex_lock
(
&
agent
->
mutex
);
/* step: check if the component exists*/
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
{
goto
done
;
}
/* step: stop connectivity checks (note: for the whole stream) */
conn_check_prune_stream
(
agent
,
stream
);
/* step: set the selected pair */
lcandidate
=
component_set_selected_remote_candidate
(
agent
,
component
,
candidate
);
if
(
!
lcandidate
)
goto
done
;
/* step: change component state */
agent_signal_component_state_change
(
agent
,
stream_id
,
component_id
,
NICE_COMPONENT_STATE_READY
);
agent_signal_new_selected_pair
(
agent
,
stream_id
,
component_id
,
lcandidate
->
foundation
,
candidate
->
foundation
);
ret
=
TRUE
;
done:
g_static_rec_mutex_unlock
(
&
agent
->
mutex
);
return
ret
;
}
agent/agent.h
View file @
9eb56677
...
...
@@ -238,6 +238,14 @@ nice_agent_set_selected_pair (
const
gchar
*
lfoundation
,
const
gchar
*
rfoundation
);
gboolean
nice_agent_set_selected_remote_candidate
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
NiceCandidate
*
candidate
);
G_END_DECLS
#endif
/* _AGENT_H */
...
...
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