Commit 529bc193 authored by Philip Withnall's avatar Philip Withnall

agent: Correctly namespace Stream and its methods

Remove all references to the old, unnamespaced versions. This should
cause no functional changes.
Reviewed-by: default avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D308
parent ef2b58f6
...@@ -171,10 +171,10 @@ agent_find_component ( ...@@ -171,10 +171,10 @@ agent_find_component (
NiceAgent *agent, NiceAgent *agent,
guint stream_id, guint stream_id,
guint component_id, guint component_id,
Stream **stream, NiceStream **stream,
Component **component); Component **component);
Stream *agent_find_stream (NiceAgent *agent, guint stream_id); NiceStream *agent_find_stream (NiceAgent *agent, guint stream_id);
void agent_gathering_done (NiceAgent *agent); void agent_gathering_done (NiceAgent *agent);
void agent_signal_gathering_done (NiceAgent *agent); void agent_signal_gathering_done (NiceAgent *agent);
...@@ -202,7 +202,7 @@ void agent_signal_new_candidate ( ...@@ -202,7 +202,7 @@ void agent_signal_new_candidate (
void agent_signal_new_remote_candidate (NiceAgent *agent, NiceCandidate *candidate); void agent_signal_new_remote_candidate (NiceAgent *agent, NiceCandidate *candidate);
void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *stream); void agent_signal_initial_binding_request_received (NiceAgent *agent, NiceStream *stream);
guint64 agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandidate *remote); guint64 agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandidate *remote);
......
...@@ -144,7 +144,7 @@ static void pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err, ...@@ -144,7 +144,7 @@ static void pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err,
gpointer user_data); gpointer user_data);
static PseudoTcpWriteResult pseudo_tcp_socket_write_packet (PseudoTcpSocket *sock, static PseudoTcpWriteResult pseudo_tcp_socket_write_packet (PseudoTcpSocket *sock,
const gchar *buffer, guint32 len, gpointer user_data); const gchar *buffer, guint32 len, gpointer user_data);
static void adjust_tcp_clock (NiceAgent *agent, Stream *stream, Component *component); static void adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, Component *component);
static void nice_agent_dispose (GObject *object); static void nice_agent_dispose (GObject *object);
static void nice_agent_get_property (GObject *object, static void nice_agent_get_property (GObject *object,
...@@ -296,13 +296,13 @@ agent_to_turn_socket_compatibility (NiceAgent *agent) ...@@ -296,13 +296,13 @@ agent_to_turn_socket_compatibility (NiceAgent *agent)
NICE_TURN_SOCKET_COMPATIBILITY_RFC5766; NICE_TURN_SOCKET_COMPATIBILITY_RFC5766;
} }
Stream *agent_find_stream (NiceAgent *agent, guint stream_id) NiceStream *agent_find_stream (NiceAgent *agent, guint stream_id)
{ {
GSList *i; GSList *i;
for (i = agent->streams; i; i = i->next) for (i = agent->streams; i; i = i->next)
{ {
Stream *s = i->data; NiceStream *s = i->data;
if (s->id == stream_id) if (s->id == stream_id)
return s; return s;
...@@ -317,10 +317,10 @@ agent_find_component ( ...@@ -317,10 +317,10 @@ agent_find_component (
NiceAgent *agent, NiceAgent *agent,
guint stream_id, guint stream_id,
guint component_id, guint component_id,
Stream **stream, NiceStream **stream,
Component **component) Component **component)
{ {
Stream *s; NiceStream *s;
Component *c; Component *c;
s = agent_find_stream (agent, stream_id); s = agent_find_stream (agent, stream_id);
...@@ -328,7 +328,7 @@ agent_find_component ( ...@@ -328,7 +328,7 @@ agent_find_component (
if (s == NULL) if (s == NULL)
return FALSE; return FALSE;
c = stream_find_component_by_id (s, component_id); c = nice_stream_find_component_by_id (s, component_id);
if (c == NULL) if (c == NULL)
return FALSE; return FALSE;
...@@ -1216,7 +1216,7 @@ nice_agent_reset_all_stun_agents (NiceAgent *agent, gboolean only_software) ...@@ -1216,7 +1216,7 @@ nice_agent_reset_all_stun_agents (NiceAgent *agent, gboolean only_software)
for (stream_item = agent->streams; stream_item; for (stream_item = agent->streams; stream_item;
stream_item = stream_item->next) { stream_item = stream_item->next) {
Stream *stream = stream_item->data; NiceStream *stream = stream_item->data;
for (component_item = stream->components; component_item; for (component_item = stream->components; component_item;
component_item = component_item->next) { component_item = component_item->next) {
...@@ -1365,7 +1365,7 @@ static void ...@@ -1365,7 +1365,7 @@ static void
} }
static void static void
pseudo_tcp_socket_create (NiceAgent *agent, Stream *stream, Component *component) pseudo_tcp_socket_create (NiceAgent *agent, NiceStream *stream, Component *component)
{ {
PseudoTcpCallbacks tcp_callbacks = {component, PseudoTcpCallbacks tcp_callbacks = {component,
pseudo_tcp_socket_opened, pseudo_tcp_socket_opened,
...@@ -1379,7 +1379,7 @@ pseudo_tcp_socket_create (NiceAgent *agent, Stream *stream, Component *component ...@@ -1379,7 +1379,7 @@ pseudo_tcp_socket_create (NiceAgent *agent, Stream *stream, Component *component
agent, component->id); agent, component->id);
} }
static void priv_pseudo_tcp_error (NiceAgent *agent, Stream *stream, static void priv_pseudo_tcp_error (NiceAgent *agent, NiceStream *stream,
Component *component) Component *component)
{ {
if (component->tcp_writable_cancellable) { if (component->tcp_writable_cancellable) {
...@@ -1406,7 +1406,7 @@ pseudo_tcp_socket_opened (PseudoTcpSocket *sock, gpointer user_data) ...@@ -1406,7 +1406,7 @@ pseudo_tcp_socket_opened (PseudoTcpSocket *sock, gpointer user_data)
{ {
Component *component = user_data; Component *component = user_data;
NiceAgent *agent = component->agent; NiceAgent *agent = component->agent;
Stream *stream = component->stream; NiceStream *stream = component->stream;
nice_debug ("Agent %p: s%d:%d pseudo Tcp socket Opened", agent, nice_debug ("Agent %p: s%d:%d pseudo Tcp socket Opened", agent,
stream->id, component->id); stream->id, component->id);
...@@ -1567,7 +1567,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data) ...@@ -1567,7 +1567,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
{ {
Component *component = user_data; Component *component = user_data;
NiceAgent *agent = component->agent; NiceAgent *agent = component->agent;
Stream *stream = component->stream; NiceStream *stream = component->stream;
gboolean has_io_callback; gboolean has_io_callback;
guint stream_id = stream->id; guint stream_id = stream->id;
guint component_id = component->id; guint component_id = component->id;
...@@ -1692,7 +1692,7 @@ pseudo_tcp_socket_writable (PseudoTcpSocket *sock, gpointer user_data) ...@@ -1692,7 +1692,7 @@ pseudo_tcp_socket_writable (PseudoTcpSocket *sock, gpointer user_data)
{ {
Component *component = user_data; Component *component = user_data;
NiceAgent *agent = component->agent; NiceAgent *agent = component->agent;
Stream *stream = component->stream; NiceStream *stream = component->stream;
nice_debug_verbose ("Agent %p: s%d:%d pseudo Tcp socket writable", agent, nice_debug_verbose ("Agent %p: s%d:%d pseudo Tcp socket writable", agent,
stream->id, component->id); stream->id, component->id);
...@@ -1706,7 +1706,7 @@ pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err, ...@@ -1706,7 +1706,7 @@ pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err,
{ {
Component *component = user_data; Component *component = user_data;
NiceAgent *agent = component->agent; NiceAgent *agent = component->agent;
Stream *stream = component->stream; NiceStream *stream = component->stream;
nice_debug ("Agent %p: s%d:%d pseudo Tcp socket closed. " nice_debug ("Agent %p: s%d:%d pseudo Tcp socket closed. "
"Calling priv_pseudo_tcp_error().", agent, stream->id, component->id); "Calling priv_pseudo_tcp_error().", agent, stream->id, component->id);
...@@ -1760,7 +1760,7 @@ static gboolean ...@@ -1760,7 +1760,7 @@ static gboolean
notify_pseudo_tcp_socket_clock (gpointer user_data) notify_pseudo_tcp_socket_clock (gpointer user_data)
{ {
Component *component = user_data; Component *component = user_data;
Stream *stream; NiceStream *stream;
NiceAgent *agent; NiceAgent *agent;
agent_lock(); agent_lock();
...@@ -1784,7 +1784,7 @@ notify_pseudo_tcp_socket_clock (gpointer user_data) ...@@ -1784,7 +1784,7 @@ notify_pseudo_tcp_socket_clock (gpointer user_data)
} }
static void static void
adjust_tcp_clock (NiceAgent *agent, Stream *stream, Component *component) adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, Component *component)
{ {
if (!pseudo_tcp_socket_is_closed (component->tcp)) { if (!pseudo_tcp_socket_is_closed (component->tcp)) {
guint64 timeout = component->last_clock_timeout; guint64 timeout = component->last_clock_timeout;
...@@ -1820,7 +1820,7 @@ _tcp_sock_is_writable (NiceSocket *sock, gpointer user_data) ...@@ -1820,7 +1820,7 @@ _tcp_sock_is_writable (NiceSocket *sock, gpointer user_data)
{ {
Component *component = user_data; Component *component = user_data;
NiceAgent *agent = component->agent; NiceAgent *agent = component->agent;
Stream *stream = component->stream; NiceStream *stream = component->stream;
agent_lock (); agent_lock ();
...@@ -1861,7 +1861,7 @@ void agent_gathering_done (NiceAgent *agent) ...@@ -1861,7 +1861,7 @@ void agent_gathering_done (NiceAgent *agent)
GSList *i, *j, *k, *l, *m; GSList *i, *j, *k, *l, *m;
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *component = j->data; Component *component = j->data;
...@@ -1911,7 +1911,7 @@ void agent_signal_gathering_done (NiceAgent *agent) ...@@ -1911,7 +1911,7 @@ void agent_signal_gathering_done (NiceAgent *agent)
GSList *i; GSList *i;
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
if (stream->gathering) { if (stream->gathering) {
stream->gathering = FALSE; stream->gathering = FALSE;
agent_queue_signal (agent, signals[SIGNAL_CANDIDATE_GATHERING_DONE], agent_queue_signal (agent, signals[SIGNAL_CANDIDATE_GATHERING_DONE],
...@@ -1920,7 +1920,9 @@ void agent_signal_gathering_done (NiceAgent *agent) ...@@ -1920,7 +1920,9 @@ void agent_signal_gathering_done (NiceAgent *agent)
} }
} }
void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *stream) void
agent_signal_initial_binding_request_received (NiceAgent *agent,
NiceStream *stream)
{ {
if (stream->initial_binding_request_received != TRUE) { if (stream->initial_binding_request_received != TRUE) {
stream->initial_binding_request_received = TRUE; stream->initial_binding_request_received = TRUE;
...@@ -1935,7 +1937,7 @@ void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *st ...@@ -1935,7 +1937,7 @@ void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *st
* *
* Must be called with the agent lock held. */ * Must be called with the agent lock held. */
static void static void
process_queued_tcp_packets (NiceAgent *agent, Stream *stream, process_queued_tcp_packets (NiceAgent *agent, NiceStream *stream,
Component *component) Component *component)
{ {
GOutputVector *vec; GOutputVector *vec;
...@@ -1990,7 +1992,7 @@ void agent_signal_new_selected_pair (NiceAgent *agent, guint stream_id, ...@@ -1990,7 +1992,7 @@ void agent_signal_new_selected_pair (NiceAgent *agent, guint stream_id,
guint component_id, NiceCandidate *lcandidate, NiceCandidate *rcandidate) guint component_id, NiceCandidate *lcandidate, NiceCandidate *rcandidate)
{ {
Component *component; Component *component;
Stream *stream; NiceStream *stream;
if (!agent_find_component (agent, stream_id, component_id, if (!agent_find_component (agent, stream_id, component_id,
&stream, &component)) &stream, &component))
...@@ -2104,7 +2106,7 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui ...@@ -2104,7 +2106,7 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
{ {
NiceComponentState old_state; NiceComponentState old_state;
Component *component; Component *component;
Stream *stream; NiceStream *stream;
g_return_if_fail (new_state < NICE_COMPONENT_STATE_LAST); g_return_if_fail (new_state < NICE_COMPONENT_STATE_LAST);
...@@ -2173,7 +2175,7 @@ agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandi ...@@ -2173,7 +2175,7 @@ agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandi
static void static void
priv_add_new_candidate_discovery_stun (NiceAgent *agent, priv_add_new_candidate_discovery_stun (NiceAgent *agent,
NiceSocket *nicesock, NiceAddress server, NiceSocket *nicesock, NiceAddress server,
Stream *stream, guint component_id) NiceStream *stream, guint component_id)
{ {
CandidateDiscovery *cdisco; CandidateDiscovery *cdisco;
...@@ -2186,7 +2188,7 @@ priv_add_new_candidate_discovery_stun (NiceAgent *agent, ...@@ -2186,7 +2188,7 @@ priv_add_new_candidate_discovery_stun (NiceAgent *agent,
cdisco->nicesock = nicesock; cdisco->nicesock = nicesock;
cdisco->server = server; cdisco->server = server;
cdisco->stream = stream; cdisco->stream = stream;
cdisco->component = stream_find_component_by_id (stream, component_id); cdisco->component = nice_stream_find_component_by_id (stream, component_id);
cdisco->agent = agent; cdisco->agent = agent;
stun_agent_init (&cdisco->stun_agent, STUN_ALL_KNOWN_ATTRIBUTES, stun_agent_init (&cdisco->stun_agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_RFC3489, STUN_COMPATIBILITY_RFC3489,
...@@ -2204,10 +2206,10 @@ priv_add_new_candidate_discovery_stun (NiceAgent *agent, ...@@ -2204,10 +2206,10 @@ priv_add_new_candidate_discovery_stun (NiceAgent *agent,
static void static void
priv_add_new_candidate_discovery_turn (NiceAgent *agent, priv_add_new_candidate_discovery_turn (NiceAgent *agent,
NiceSocket *nicesock, TurnServer *turn, NiceSocket *nicesock, TurnServer *turn,
Stream *stream, guint component_id, gboolean turn_tcp) NiceStream *stream, guint component_id, gboolean turn_tcp)
{ {
CandidateDiscovery *cdisco; CandidateDiscovery *cdisco;
Component *component = stream_find_component_by_id (stream, component_id); Component *component = nice_stream_find_component_by_id (stream, component_id);
NiceAddress local_address; NiceAddress local_address;
/* note: no need to check for redundant candidates, as this is /* note: no need to check for redundant candidates, as this is
...@@ -2330,7 +2332,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -2330,7 +2332,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
cdisco->server = turn->server; cdisco->server = turn->server;
cdisco->stream = stream; cdisco->stream = stream;
cdisco->component = stream_find_component_by_id (stream, component_id); cdisco->component = nice_stream_find_component_by_id (stream, component_id);
cdisco->agent = agent; cdisco->agent = agent;
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) { if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
...@@ -2368,7 +2370,7 @@ nice_agent_add_stream ( ...@@ -2368,7 +2370,7 @@ nice_agent_add_stream (
NiceAgent *agent, NiceAgent *agent,
guint n_components) guint n_components)
{ {
Stream *stream; NiceStream *stream;
guint ret = 0; guint ret = 0;
guint i; guint i;
...@@ -2376,7 +2378,7 @@ nice_agent_add_stream ( ...@@ -2376,7 +2378,7 @@ nice_agent_add_stream (
g_return_val_if_fail (n_components >= 1, 0); g_return_val_if_fail (n_components >= 1, 0);
agent_lock(); agent_lock();
stream = stream_new (n_components, agent); stream = nice_stream_new (n_components, agent);
agent->streams = g_slist_append (agent->streams, stream); agent->streams = g_slist_append (agent->streams, stream);
stream->id = agent->next_stream_id++; stream->id = agent->next_stream_id++;
...@@ -2384,7 +2386,7 @@ nice_agent_add_stream ( ...@@ -2384,7 +2386,7 @@ nice_agent_add_stream (
if (agent->reliable) { if (agent->reliable) {
nice_debug ("Agent %p : reliable stream", agent); nice_debug ("Agent %p : reliable stream", agent);
for (i = 0; i < n_components; i++) { for (i = 0; i < n_components; i++) {
Component *component = stream_find_component_by_id (stream, i + 1); Component *component = nice_stream_find_component_by_id (stream, i + 1);
if (component) { if (component) {
pseudo_tcp_socket_create (agent, stream, component); pseudo_tcp_socket_create (agent, stream, component);
} else { } else {
...@@ -2393,7 +2395,7 @@ nice_agent_add_stream ( ...@@ -2393,7 +2395,7 @@ nice_agent_add_stream (
} }
} }
stream_initialize_credentials (stream, agent->rng); nice_stream_initialize_credentials (stream, agent->rng);
ret = stream->id; ret = stream->id;
...@@ -2411,7 +2413,7 @@ nice_agent_set_relay_info(NiceAgent *agent, ...@@ -2411,7 +2413,7 @@ nice_agent_set_relay_info(NiceAgent *agent,
{ {
Component *component = NULL; Component *component = NULL;
Stream *stream = NULL; NiceStream *stream = NULL;
gboolean ret = TRUE; gboolean ret = TRUE;
TurnServer *turn; TurnServer *turn;
...@@ -2562,7 +2564,7 @@ static void _upnp_mapped_external_port (GUPnPSimpleIgd *self, gchar *proto, ...@@ -2562,7 +2564,7 @@ static void _upnp_mapped_external_port (GUPnPSimpleIgd *self, gchar *proto,
nice_address_set_port (&externaddr, external_port); nice_address_set_port (&externaddr, external_port);
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *component = j->data; Component *component = j->data;
for (k = component->local_candidates; k; k = k->next) { for (k = component->local_candidates; k; k = k->next) {
...@@ -2628,7 +2630,7 @@ nice_agent_gather_candidates ( ...@@ -2628,7 +2630,7 @@ nice_agent_gather_candidates (
{ {
guint cid; guint cid;
GSList *i; GSList *i;
Stream *stream; NiceStream *stream;
GSList *local_addresses = NULL; GSList *local_addresses = NULL;
gboolean ret = TRUE; gboolean ret = TRUE;
...@@ -2713,7 +2715,7 @@ nice_agent_gather_candidates ( ...@@ -2713,7 +2715,7 @@ nice_agent_gather_candidates (
#endif #endif
for (cid = 1; cid <= stream->n_components; cid++) { for (cid = 1; cid <= stream->n_components; cid++) {
Component *component = stream_find_component_by_id (stream, cid); Component *component = nice_stream_find_component_by_id (stream, cid);
enum { enum {
ADD_HOST_MIN = 0, ADD_HOST_MIN = 0,
ADD_HOST_UDP = ADD_HOST_MIN, ADD_HOST_UDP = ADD_HOST_MIN,
...@@ -2849,7 +2851,7 @@ nice_agent_gather_candidates ( ...@@ -2849,7 +2851,7 @@ nice_agent_gather_candidates (
/* Only signal the new candidates after we're sure that the gathering was /* Only signal the new candidates after we're sure that the gathering was
* succesfful. But before sending gathering-done */ * succesfful. But before sending gathering-done */
for (cid = 1; cid <= stream->n_components; cid++) { for (cid = 1; cid <= stream->n_components; cid++) {
Component *component = stream_find_component_by_id (stream, cid); Component *component = nice_stream_find_component_by_id (stream, cid);
for (i = component->local_candidates; i; i = i->next) { for (i = component->local_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data; NiceCandidate *candidate = i->data;
agent_signal_new_candidate (agent, candidate); agent_signal_new_candidate (agent, candidate);
...@@ -2878,7 +2880,7 @@ nice_agent_gather_candidates ( ...@@ -2878,7 +2880,7 @@ nice_agent_gather_candidates (
if (ret == FALSE) { if (ret == FALSE) {
priv_stop_upnp (agent); priv_stop_upnp (agent);
for (cid = 1; cid <= stream->n_components; cid++) { for (cid = 1; cid <= stream->n_components; cid++) {
Component *component = stream_find_component_by_id (stream, cid); Component *component = nice_stream_find_component_by_id (stream, cid);
component_free_socket_sources (component); component_free_socket_sources (component);
...@@ -2953,7 +2955,7 @@ nice_agent_remove_stream ( ...@@ -2953,7 +2955,7 @@ nice_agent_remove_stream (
/* note that streams/candidates can be in use by other threads */ /* note that streams/candidates can be in use by other threads */
Stream *stream; NiceStream *stream;
g_return_if_fail (NICE_IS_AGENT (agent)); g_return_if_fail (NICE_IS_AGENT (agent));
g_return_if_fail (stream_id >= 1); g_return_if_fail (stream_id >= 1);
...@@ -2973,7 +2975,7 @@ nice_agent_remove_stream ( ...@@ -2973,7 +2975,7 @@ nice_agent_remove_stream (
/* Remove the stream and signal its removal. */ /* Remove the stream and signal its removal. */
agent->streams = g_slist_remove (agent->streams, stream); agent->streams = g_slist_remove (agent->streams, stream);
stream_close (stream); nice_stream_close (stream);
if (!agent->streams) if (!agent->streams)
priv_remove_keepalive_timer (agent); priv_remove_keepalive_timer (agent);
...@@ -2986,7 +2988,7 @@ nice_agent_remove_stream ( ...@@ -2986,7 +2988,7 @@ nice_agent_remove_stream (
/* Actually free the stream. This should be done with the lock released, as /* Actually free the stream. This should be done with the lock released, as
* it could end up disposing of a NiceIOStream, which tries to take the * it could end up disposing of a NiceIOStream, which tries to take the
* agent lock itself. */ * agent lock itself. */
stream_free (stream); g_object_unref (stream);
return; return;
} }
...@@ -2995,7 +2997,7 @@ NICEAPI_EXPORT void ...@@ -2995,7 +2997,7 @@ NICEAPI_EXPORT void
nice_agent_set_port_range (NiceAgent *agent, guint stream_id, guint component_id, nice_agent_set_port_range (NiceAgent *agent, guint stream_id, guint component_id,
guint min_port, guint max_port) guint min_port, guint max_port)
{ {
Stream *stream; NiceStream *stream;
Component *component; Component *component;
g_return_if_fail (NICE_IS_AGENT (agent)); g_return_if_fail (NICE_IS_AGENT (agent));
...@@ -3150,7 +3152,7 @@ nice_agent_set_remote_credentials ( ...@@ -3150,7 +3152,7 @@ nice_agent_set_remote_credentials (
guint stream_id, guint stream_id,
const gchar *ufrag, const gchar *pwd) const gchar *ufrag, const gchar *pwd)
{ {
Stream *stream; NiceStream *stream;
gboolean ret = FALSE; gboolean ret = FALSE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
...@@ -3181,7 +3183,7 @@ nice_agent_set_local_credentials ( ...@@ -3181,7 +3183,7 @@ nice_agent_set_local_credentials (
const gchar *ufrag, const gchar *ufrag,
const gchar *pwd) const gchar *pwd)
{ {
Stream *stream; NiceStream *stream;
gboolean ret = FALSE; gboolean ret = FALSE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
...@@ -3212,7 +3214,7 @@ nice_agent_get_local_credentials ( ...@@ -3212,7 +3214,7 @@ nice_agent_get_local_credentials (
guint stream_id, guint stream_id,
gchar **ufrag, gchar **pwd) gchar **ufrag, gchar **pwd)
{ {
Stream *stream; NiceStream *stream;
gboolean ret = TRUE; gboolean ret = TRUE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
...@@ -3240,7 +3242,7 @@ nice_agent_get_local_credentials ( ...@@ -3240,7 +3242,7 @@ nice_agent_get_local_credentials (
} }
static int static int
_set_remote_candidates_locked (NiceAgent *agent, Stream *stream, _set_remote_candidates_locked (NiceAgent *agent, NiceStream *stream,
Component *component, const GSList *candidates) Component *component, const GSList *candidates)
{ {
const GSList *i; const GSList *i;
...@@ -3283,7 +3285,7 @@ NICEAPI_EXPORT int ...@@ -3283,7 +3285,7 @@ NICEAPI_EXPORT int
nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint component_id, const GSList *candidates) nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint component_id, const GSList *candidates)
{ {
int added = 0; int added = 0;
Stream *stream; NiceStream *stream;
Component *component; Component *component;
g_return_val_if_fail (NICE_IS_AGENT (agent), 0); g_return_val_if_fail (NICE_IS_AGENT (agent), 0);
...@@ -3343,7 +3345,7 @@ typedef enum { ...@@ -3343,7 +3345,7 @@ typedef enum {
static RecvStatus static RecvStatus
agent_recv_message_unlocked ( agent_recv_message_unlocked (
NiceAgent *agent, NiceAgent *agent,
Stream *stream, NiceStream *stream,
Component *component, Component *component,
NiceSocket *nicesock, NiceSocket *nicesock,
NiceInputMessage *message) NiceInputMessage *message)
...@@ -4000,7 +4002,7 @@ nice_agent_recv_messages_blocking_or_nonblocking (NiceAgent *agent, ...@@ -4000,7 +4002,7 @@ nice_agent_recv_messages_blocking_or_nonblocking (NiceAgent *agent,
GCancellable *cancellable, GError **error) GCancellable *cancellable, GError **error)
{ {
GMainContext *context; GMainContext *context;
Stream *stream; NiceStream *stream;
Component *component; Component *component;
gint n_valid_messages = -1; gint n_valid_messages = -1;
GSource *cancellable_source = NULL; GSource *cancellable_source = NULL;
...@@ -4325,7 +4327,7 @@ nice_agent_send_messages_nonblocking_internal ( ...@@ -4325,7 +4327,7 @@ nice_agent_send_messages_nonblocking_internal (
gboolean allow_partial, gboolean allow_partial,
GError **error) GError **error)
{ {
Stream *stream; NiceStream *stream;
Component *component; Component *component;
gint n_sent = -1; /* is in bytes if allow_partial is TRUE, gint n_sent = -1; /* is in bytes if allow_partial is TRUE,
otherwise in messages */ otherwise in messages */
...@@ -4634,11 +4636,11 @@ nice_agent_restart ( ...@@ -4634,11 +4636,11 @@ nice_agent_restart (
priv_generate_tie_breaker (agent); priv_generate_tie_breaker (agent);
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
/* step: reset local credentials for the stream and /* step: reset local credentials for the stream and
* clean up the list of remote candidates */ * clean up the list of remote candidates */
stream_restart (agent, stream); nice_stream_restart (stream, agent);
} }
agent_unlock_and_emit (agent); agent_unlock_and_emit (agent);
...@@ -4651,7 +4653,7 @@ nice_agent_restart_stream ( ...@@ -4651,7 +4653,7 @@ nice_agent_restart_stream (
guint stream_id) guint stream_id)
{ {
gboolean res = FALSE; gboolean res = FALSE;
Stream *stream; NiceStream *stream;
agent_lock(); agent_lock();
...@@ -4663,7 +4665,7 @@ nice_agent_restart_stream ( ...@@ -4663,7 +4665,7 @@ nice_agent_restart_stream (
/* step: reset local credentials for the stream and /* step: reset local credentials for the stream and
* clean up the list of remote candidates */ * clean up the list of remote candidates */
stream_restart (agent, stream); nice_stream_restart (stream, agent);
res = TRUE; res = TRUE;
done: done:
...@@ -4702,10 +4704,10 @@ nice_agent_dispose (GObject *object) ...@@ -4702,10 +4704,10 @@ nice_agent_dispose (GObject *object)
for (i = agent->streams; i; i = i->next) for (i = agent->streams; i; i = i->next)
{ {
Stream *s = i->data; NiceStream *s = i->data;
stream_close (s); nice_stream_close (s);
stream_free (s); g_object_unref (s);
} }
g_slist_free (agent->streams); g_slist_free (agent->streams);
...@@ -4755,7 +4757,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data) ...@@ -4755,7 +4757,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
SocketSource *socket_source = user_data; SocketSource *socket_source = user_data;
Component *component; Component *component;
NiceAgent *agent; NiceAgent *agent;
Stream *stream; NiceStream *stream;
gboolean has_io_callback; gboolean has_io_callback;
gboolean remove_source = FALSE; gboolean remove_source = FALSE;
...@@ -4976,7 +4978,7 @@ nice_agent_attach_recv ( ...@@ -4976,7 +4978,7 @@ nice_agent_attach_recv (
gpointer data) gpointer data)
{ {
Component *component = NULL; Component *component = NULL;
Stream *stream = NULL; NiceStream *stream = NULL;
gboolean ret = FALSE; gboolean ret = FALSE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
...@@ -5028,7 +5030,7 @@ nice_agent_set_selected_pair ( ...@@ -5028,7 +5030,7 @@ nice_agent_set_selected_pair (
const gchar *rfoundation) const gchar *rfoundation)
{ {
Component *component; Component *component;
Stream *stream; NiceStream *stream;
CandidatePair pair; CandidatePair pair;
gboolean ret = FALSE; gboolean ret = FALSE;
...@@ -5090,7 +5092,7 @@ nice_agent_get_selected_pair (NiceAgent *agent, guint stream_id, ...@@ -5090,7 +5092,7 @@ nice_agent_get_selected_pair (NiceAgent *agent, guint stream_id,
guint component_id, NiceCandidate **local, NiceCandidate **remote) guint component_id, NiceCandidate **local, NiceCandidate **remote)
{ {
Component *component; Component *component;
Stream *stream; NiceStream *stream;
gboolean ret = FALSE; gboolean ret = FALSE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
...@@ -5123,7 +5125,7 @@ nice_agent_get_selected_socket (NiceAgent *agent, guint stream_id, ...@@ -5123,7 +5125,7 @@ nice_agent_get_selected_socket (NiceAgent *agent, guint stream_id,
guint component_id) guint component_id)
{ {
Component *component; Component *component;
Stream *stream; NiceStream *stream;
NiceSocket *nice_socket; NiceSocket *nice_socket;
GSocket *g_socket = NULL; GSocket *g_socket = NULL;
...@@ -5203,7 +5205,7 @@ nice_agent_set_selected_remote_candidate ( ...@@ -5203,7 +5205,7 @@ nice_agent_set_selected_remote_candidate (
NiceCandidate *candidate) NiceCandidate *candidate)
{ {
Component *component; Component *component;
Stream *stream; NiceStream *stream;
NiceCandidate *lcandidate = NULL; NiceCandidate *lcandidate = NULL;
gboolean ret = FALSE; gboolean ret = FALSE;
NiceCandidate *local = NULL, *remote = NULL; NiceCandidate *local = NULL, *remote = NULL;
...@@ -5297,7 +5299,7 @@ nice_agent_set_stream_tos (NiceAgent *agent, ...@@ -5297,7 +5299,7 @@ nice_agent_set_stream_tos (NiceAgent *agent,
guint stream_id, gint tos) guint stream_id, gint tos)
{ {
GSList *i, *j; GSList *i, *j;
Stream *stream; NiceStream *stream;
g_return_if_fail (NICE_IS_AGENT (agent)); g_return_if_fail (NICE_IS_AGENT (agent));
g_return_if_fail (stream_id >= 1); g_return_if_fail (stream_id >= 1);
...@@ -5344,7 +5346,7 @@ NICEAPI_EXPORT gboolean ...@@ -5344,7 +5346,7 @@ NICEAPI_EXPORT gboolean
nice_agent_set_stream_name (NiceAgent *agent, guint stream_id, nice_agent_set_stream_name (NiceAgent *agent, guint stream_id,
const gchar *name) const gchar *name)
{ {
Stream *stream_to_name = NULL; NiceStream *stream_to_name = NULL;
GSList *i; GSList *i;
gboolean ret = FALSE; gboolean ret = FALSE;
...@@ -5366,7 +5368,7 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id, ...@@ -5366,7 +5368,7 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id,
agent_lock(); agent_lock();
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
if (stream->id != stream_id && if (stream->id != stream_id &&
g_strcmp0 (stream->name, name) == 0) g_strcmp0 (stream->name, name) == 0)
...@@ -5392,7 +5394,7 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id, ...@@ -5392,7 +5394,7 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id,
NICEAPI_EXPORT const gchar * NICEAPI_EXPORT const gchar *
nice_agent_get_stream_name (NiceAgent *agent, guint stream_id) nice_agent_get_stream_name (NiceAgent *agent, guint stream_id)
{ {
Stream *stream; NiceStream *stream;
gchar *name = NULL; gchar *name = NULL;
g_return_val_if_fail (NICE_IS_AGENT (agent), NULL); g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
...@@ -5413,7 +5415,7 @@ nice_agent_get_stream_name (NiceAgent *agent, guint stream_id) ...@@ -5413,7 +5415,7 @@ nice_agent_get_stream_name (NiceAgent *agent, guint stream_id)
static NiceCandidate * static NiceCandidate *
_get_default_local_candidate_locked (NiceAgent *agent, _get_default_local_candidate_locked (NiceAgent *agent,
Stream *stream, Component *component) NiceStream *stream, Component *component)
{ {
GSList *i; GSList *i;
NiceCandidate *default_candidate = NULL; NiceCandidate *default_candidate = NULL;
...@@ -5460,7 +5462,7 @@ NICEAPI_EXPORT NiceCandidate * ...@@ -5460,7 +5462,7 @@ NICEAPI_EXPORT NiceCandidate *
nice_agent_get_default_local_candidate (NiceAgent *agent, nice_agent_get_default_local_candidate (NiceAgent *agent,
guint stream_id, guint component_id) guint stream_id, guint component_id)
{ {
Stream *stream = NULL; NiceStream *stream = NULL;
Component *component = NULL; Component *component = NULL;
NiceCandidate *default_candidate = NULL; NiceCandidate *default_candidate = NULL;
...@@ -5560,7 +5562,7 @@ _generate_candidate_sdp (NiceAgent *agent, ...@@ -5560,7 +5562,7 @@ _generate_candidate_sdp (NiceAgent *agent,
} }
static void static void
_generate_stream_sdp (NiceAgent *agent, Stream *stream, _generate_stream_sdp (NiceAgent *agent, NiceStream *stream,
GString *sdp, gboolean include_non_ice) GString *sdp, gboolean include_non_ice)
{ {
GSList *i, *j; GSList *i, *j;
...@@ -5627,7 +5629,7 @@ nice_agent_generate_local_sdp (NiceAgent *agent) ...@@ -5627,7 +5629,7 @@ nice_agent_generate_local_sdp (NiceAgent *agent)
agent_lock(); agent_lock();
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
_generate_stream_sdp (agent, stream, sdp, TRUE); _generate_stream_sdp (agent, stream, sdp, TRUE);
} }
...@@ -5643,7 +5645,7 @@ nice_agent_generate_local_stream_sdp (NiceAgent *agent, guint stream_id, ...@@ -5643,7 +5645,7 @@ nice_agent_generate_local_stream_sdp (NiceAgent *agent, guint stream_id,
{ {
GString *sdp = NULL; GString *sdp = NULL;
gchar *ret = NULL; gchar *ret = NULL;
Stream *stream; NiceStream *stream;
g_return_val_if_fail (NICE_IS_AGENT (agent), NULL); g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
g_return_val_if_fail (stream_id >= 1, NULL); g_return_val_if_fail (stream_id >= 1, NULL);
...@@ -5686,7 +5688,7 @@ nice_agent_generate_local_candidate_sdp (NiceAgent *agent, ...@@ -5686,7 +5688,7 @@ nice_agent_generate_local_candidate_sdp (NiceAgent *agent,
NICEAPI_EXPORT gint NICEAPI_EXPORT gint
nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp) nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp)
{ {
Stream *current_stream = NULL; NiceStream *current_stream = NULL;
gchar **sdp_lines = NULL; gchar **sdp_lines = NULL;
GSList *l, *stream_item = NULL; GSList *l, *stream_item = NULL;
gint i; gint i;
...@@ -5698,7 +5700,7 @@ nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp) ...@@ -5698,7 +5700,7 @@ nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp)
agent_lock(); agent_lock();
for (l = agent->streams; l; l = l->next) { for (l = agent->streams; l; l = l->next) {
Stream *stream = l->data; NiceStream *stream = l->data;
if (stream->name == NULL) { if (stream->name == NULL) {
ret = -1; ret = -1;
...@@ -5778,7 +5780,7 @@ NICEAPI_EXPORT GSList * ...@@ -5778,7 +5780,7 @@ NICEAPI_EXPORT GSList *
nice_agent_parse_remote_stream_sdp (NiceAgent *agent, guint stream_id, nice_agent_parse_remote_stream_sdp (NiceAgent *agent, guint stream_id,
const gchar *sdp, gchar **ufrag, gchar **pwd) const gchar *sdp, gchar **ufrag, gchar **pwd)
{ {
Stream *stream = NULL; NiceStream *stream = NULL;
gchar **sdp_lines = NULL; gchar **sdp_lines = NULL;
GSList *candidates = NULL; GSList *candidates = NULL;
gint i; gint i;
......
...@@ -140,7 +140,7 @@ socket_source_free (SocketSource *source) ...@@ -140,7 +140,7 @@ socket_source_free (SocketSource *source)
} }
Component * Component *
component_new (guint id, NiceAgent *agent, Stream *stream) component_new (guint id, NiceAgent *agent, NiceStream *stream)
{ {
return g_object_new (NICE_TYPE_COMPONENT, return g_object_new (NICE_TYPE_COMPONENT,
"id", id, "id", id,
......
...@@ -201,8 +201,8 @@ struct _Component ...@@ -201,8 +201,8 @@ struct _Component
NiceAgent *agent; /* unowned, immutable: can be accessed without holding the NiceAgent *agent; /* unowned, immutable: can be accessed without holding the
* agent lock */ * agent lock */
Stream *stream; /* unowned, immutable: can be accessed without holding the NiceStream *stream; /* unowned, immutable: can be accessed without holding
* agent lock */ * the agent lock */
StunAgent stun_agent; /* This stun agent is used to validate all stun requests */ StunAgent stun_agent; /* This stun agent is used to validate all stun requests */
...@@ -235,7 +235,7 @@ GType nice_component_get_type (void); ...@@ -235,7 +235,7 @@ GType nice_component_get_type (void);
G_DEPRECATED G_DEPRECATED
Component * Component *
component_new (guint component_id, NiceAgent *agent, Stream *stream); component_new (guint component_id, NiceAgent *agent, NiceStream *stream);
G_DEPRECATED G_DEPRECATED
void void
......
...@@ -61,15 +61,15 @@ ...@@ -61,15 +61,15 @@
#include "stun/usages/bind.h" #include "stun/usages/bind.h"
#include "stun/usages/turn.h" #include "stun/usages/turn.h"
static void priv_update_check_list_failed_components (NiceAgent *agent, Stream *stream); static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStream *stream);
static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *stream, Component *component); static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream *stream, Component *component);
static guint priv_prune_pending_checks (Stream *stream, guint component_id); static guint priv_prune_pending_checks (NiceStream *stream, guint component_id);
static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream, Component *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate); static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *stream, Component *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate);
static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Component *component, NiceCandidate *remotecand); static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, Component *component, NiceCandidate *remotecand);
static size_t priv_create_username (NiceAgent *agent, Stream *stream, static size_t priv_create_username (NiceAgent *agent, NiceStream *stream,
guint component_id, NiceCandidate *remote, NiceCandidate *local, guint component_id, NiceCandidate *remote, NiceCandidate *local,
uint8_t *dest, guint dest_len, gboolean inbound); uint8_t *dest, guint dest_len, gboolean inbound);
static size_t priv_get_password (NiceAgent *agent, Stream *stream, static size_t priv_get_password (NiceAgent *agent, NiceStream *stream,
NiceCandidate *remote, uint8_t **password); NiceCandidate *remote, uint8_t **password);
static void conn_check_free_item (gpointer data); static void conn_check_free_item (gpointer data);
static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state); static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state);
...@@ -142,7 +142,7 @@ static gboolean priv_conn_check_unfreeze_next (NiceAgent *agent) ...@@ -142,7 +142,7 @@ static gboolean priv_conn_check_unfreeze_next (NiceAgent *agent)
*/ */
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
guint64 max_frozen_priority = 0; guint64 max_frozen_priority = 0;
...@@ -185,7 +185,7 @@ static gboolean priv_conn_check_unfreeze_next (NiceAgent *agent) ...@@ -185,7 +185,7 @@ static gboolean priv_conn_check_unfreeze_next (NiceAgent *agent)
* *
* @return TRUE on success, and FALSE if no frozen candidates were found. * @return TRUE on success, and FALSE if no frozen candidates were found.
*/ */
static void priv_conn_check_unfreeze_related (NiceAgent *agent, Stream *stream, CandidateCheckPair *ok_check) static void priv_conn_check_unfreeze_related (NiceAgent *agent, NiceStream *stream, CandidateCheckPair *ok_check)
{ {
GSList *i, *j; GSList *i, *j;
guint unfrozen = 0; guint unfrozen = 0;
...@@ -212,10 +212,10 @@ static void priv_conn_check_unfreeze_related (NiceAgent *agent, Stream *stream, ...@@ -212,10 +212,10 @@ static void priv_conn_check_unfreeze_related (NiceAgent *agent, Stream *stream,
/* step: perform the step (2) of 'Updating Pair States' */ /* step: perform the step (2) of 'Updating Pair States' */
stream = agent_find_stream (agent, ok_check->stream_id); stream = agent_find_stream (agent, ok_check->stream_id);
if (stream_all_components_ready (stream)) { if (nice_stream_all_components_ready (stream)) {
/* step: unfreeze checks from other streams */ /* step: unfreeze checks from other streams */
for (i = agent->streams; i ; i = i->next) { for (i = agent->streams; i ; i = i->next) {
Stream *s = i->data; NiceStream *s = i->data;
for (j = stream->conncheck_list; j ; j = j->next) { for (j = stream->conncheck_list; j ; j = j->next) {
CandidateCheckPair *p = j->data; CandidateCheckPair *p = j->data;
...@@ -242,12 +242,12 @@ static void priv_conn_check_unfreeze_related (NiceAgent *agent, Stream *stream, ...@@ -242,12 +242,12 @@ static void priv_conn_check_unfreeze_related (NiceAgent *agent, Stream *stream,
} }
static void static void
candidate_check_pair_fail (Stream *stream, NiceAgent *agent, CandidateCheckPair *p) candidate_check_pair_fail (NiceStream *stream, NiceAgent *agent, CandidateCheckPair *p)
{ {
StunTransactionId id; StunTransactionId id;
Component *component; Component *component;
component = stream_find_component_by_id (stream, p->component_id); component = nice_stream_find_component_by_id (stream, p->component_id);
p->state = NICE_CHECK_FAILED; p->state = NICE_CHECK_FAILED;
nice_debug ("Agent %p : pair %p state FAILED", agent, p); nice_debug ("Agent %p : pair %p state FAILED", agent, p);
...@@ -269,7 +269,7 @@ candidate_check_pair_fail (Stream *stream, NiceAgent *agent, CandidateCheckPair ...@@ -269,7 +269,7 @@ candidate_check_pair_fail (Stream *stream, NiceAgent *agent, CandidateCheckPair
* *
* @return will return FALSE when no more pending timers. * @return will return FALSE when no more pending timers.
*/ */
static gboolean priv_conn_check_tick_stream (Stream *stream, NiceAgent *agent, GTimeVal *now) static gboolean priv_conn_check_tick_stream (NiceStream *stream, NiceAgent *agent, GTimeVal *now)
{ {
gboolean keep_timer_going = FALSE; gboolean keep_timer_going = FALSE;
guint s_inprogress = 0, s_succeeded = 0, s_discovered = 0, guint s_inprogress = 0, s_succeeded = 0, s_discovered = 0,
...@@ -417,7 +417,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent) ...@@ -417,7 +417,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent)
/* step: find the highest priority waiting check and send it */ /* step: find the highest priority waiting check and send it */
for (i = agent->streams; i ; i = i->next) { for (i = agent->streams; i ; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
pair = priv_conn_check_find_next_waiting (stream->conncheck_list); pair = priv_conn_check_find_next_waiting (stream->conncheck_list);
if (pair) if (pair)
...@@ -432,7 +432,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent) ...@@ -432,7 +432,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent)
} }
for (j = agent->streams; j; j = j->next) { for (j = agent->streams; j; j = j->next) {
Stream *stream = j->data; NiceStream *stream = j->data;
gboolean res = gboolean res =
priv_conn_check_tick_stream (stream, agent, &now); priv_conn_check_tick_stream (stream, agent, &now);
if (res) if (res)
...@@ -443,7 +443,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent) ...@@ -443,7 +443,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent)
if (keep_timer_going != TRUE) { if (keep_timer_going != TRUE) {
nice_debug ("Agent %p : %s: stopping conncheck timer", agent, G_STRFUNC); nice_debug ("Agent %p : %s: stopping conncheck timer", agent, G_STRFUNC);
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
priv_update_check_list_failed_components (agent, stream); priv_update_check_list_failed_components (agent, stream);
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *component = j->data; Component *component = j->data;
...@@ -618,7 +618,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent) ...@@ -618,7 +618,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
* (ref ICE sect 10 "Keepalives" ID-19) */ * (ref ICE sect 10 "Keepalives" ID-19) */
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *component = j->data; Component *component = j->data;
if (component->selected_pair.local != NULL) { if (component->selected_pair.local != NULL) {
...@@ -710,7 +710,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent) ...@@ -710,7 +710,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
/* case 2: connectivity establishment ongoing /* case 2: connectivity establishment ongoing
* (ref ICE sect 4.1.1.4 "Keeping Candidates Alive" ID-19) */ * (ref ICE sect 4.1.1.4 "Keeping Candidates Alive" ID-19) */
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *component = j->data; Component *component = j->data;
if (component->state < NICE_COMPONENT_STATE_READY && if (component->state < NICE_COMPONENT_STATE_READY &&
...@@ -996,7 +996,7 @@ gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair * ...@@ -996,7 +996,7 @@ gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *
* @param component pointer to component object to which 'pair'has been added * @param component pointer to component object to which 'pair'has been added
* @param pair newly added connectivity check * @param pair newly added connectivity check
*/ */
static void priv_preprocess_conn_check_pending_data (NiceAgent *agent, Stream *stream, Component *component, CandidateCheckPair *pair) static void priv_preprocess_conn_check_pending_data (NiceAgent *agent, NiceStream *stream, Component *component, CandidateCheckPair *pair)
{ {
GSList *i; GSList *i;
for (i = component->incoming_checks; i; i = i->next) { for (i = component->incoming_checks; i; i = i->next) {
...@@ -1045,10 +1045,10 @@ void conn_check_remote_candidates_set(NiceAgent *agent) ...@@ -1045,10 +1045,10 @@ void conn_check_remote_candidates_set(NiceAgent *agent)
GSList *i, *j, *k, *l, *m, *n; GSList *i, *j, *k, *l, *m, *n;
for (i = agent->streams; i ; i = i->next) { for (i = agent->streams; i ; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->conncheck_list; j ; j = j->next) { for (j = stream->conncheck_list; j ; j = j->next) {
CandidateCheckPair *pair = j->data; CandidateCheckPair *pair = j->data;
Component *component = stream_find_component_by_id (stream, pair->component_id); Component *component = nice_stream_find_component_by_id (stream, pair->component_id);
gboolean match = FALSE; gboolean match = FALSE;
/* performn delayed processing of spec steps section 7.2.1.4, /* performn delayed processing of spec steps section 7.2.1.4,
...@@ -1240,7 +1240,7 @@ static gboolean priv_update_selected_pair (NiceAgent *agent, Component *componen ...@@ -1240,7 +1240,7 @@ static gboolean priv_update_selected_pair (NiceAgent *agent, Component *componen
* *
* Sends a component state changesignal via 'agent'. * Sends a component state changesignal via 'agent'.
*/ */
static void priv_update_check_list_failed_components (NiceAgent *agent, Stream *stream) static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStream *stream)
{ {
GSList *i; GSList *i;
/* note: emitting a signal might cause the client /* note: emitting a signal might cause the client
...@@ -1300,7 +1300,7 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, Stream * ...@@ -1300,7 +1300,7 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, Stream *
* *
* Sends a component state changesignal via 'agent'. * Sends a component state changesignal via 'agent'.
*/ */
static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *stream, Component *component) static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream *stream, Component *component)
{ {
GSList *i; GSList *i;
guint succeeded = 0, nominated = 0; guint succeeded = 0, nominated = 0;
...@@ -1347,7 +1347,7 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *st ...@@ -1347,7 +1347,7 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *st
* described by 'component' and 'remotecand' is nominated * described by 'component' and 'remotecand' is nominated
* for use. * for use.
*/ */
static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Component *component, NiceCandidate *remotecand) static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, Component *component, NiceCandidate *remotecand)
{ {
GSList *i; GSList *i;
...@@ -1376,7 +1376,7 @@ static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Componen ...@@ -1376,7 +1376,7 @@ static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Componen
*/ */
static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state, gboolean use_candidate) static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state, gboolean use_candidate)
{ {
Stream *stream; NiceStream *stream;
CandidateCheckPair *pair; CandidateCheckPair *pair;
g_assert (local != NULL); g_assert (local != NULL);
...@@ -1584,7 +1584,7 @@ void conn_check_free (NiceAgent *agent) ...@@ -1584,7 +1584,7 @@ void conn_check_free (NiceAgent *agent)
{ {
GSList *i; GSList *i;
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
if (stream->conncheck_list) { if (stream->conncheck_list) {
nice_debug ("Agent %p, freeing conncheck_list of stream %p", agent, nice_debug ("Agent %p, freeing conncheck_list of stream %p", agent,
...@@ -1603,7 +1603,7 @@ void conn_check_free (NiceAgent *agent) ...@@ -1603,7 +1603,7 @@ void conn_check_free (NiceAgent *agent)
* *
* @return TRUE on success, FALSE on a fatal error * @return TRUE on success, FALSE on a fatal error
*/ */
void conn_check_prune_stream (NiceAgent *agent, Stream *stream) void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream)
{ {
GSList *i; GSList *i;
gboolean keep_going = FALSE; gboolean keep_going = FALSE;
...@@ -1616,7 +1616,7 @@ void conn_check_prune_stream (NiceAgent *agent, Stream *stream) ...@@ -1616,7 +1616,7 @@ void conn_check_prune_stream (NiceAgent *agent, Stream *stream)
} }
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *s = i->data; NiceStream *s = i->data;
if (s->conncheck_list) { if (s->conncheck_list) {
keep_going = TRUE; keep_going = TRUE;
break; break;
...@@ -1727,7 +1727,7 @@ size_t priv_gen_username (NiceAgent *agent, guint component_id, ...@@ -1727,7 +1727,7 @@ size_t priv_gen_username (NiceAgent *agent, guint component_id,
* NULL) is ever written to the 'dest'. * NULL) is ever written to the 'dest'.
*/ */
static static
size_t priv_create_username (NiceAgent *agent, Stream *stream, size_t priv_create_username (NiceAgent *agent, NiceStream *stream,
guint component_id, NiceCandidate *remote, NiceCandidate *local, guint component_id, NiceCandidate *remote, NiceCandidate *local,
uint8_t *dest, guint dest_len, gboolean inbound) uint8_t *dest, guint dest_len, gboolean inbound)
{ {
...@@ -1770,7 +1770,7 @@ size_t priv_create_username (NiceAgent *agent, Stream *stream, ...@@ -1770,7 +1770,7 @@ size_t priv_create_username (NiceAgent *agent, Stream *stream,
* check. * check.
*/ */
static static
size_t priv_get_password (NiceAgent *agent, Stream *stream, size_t priv_get_password (NiceAgent *agent, NiceStream *stream,
NiceCandidate *remote, uint8_t **password) NiceCandidate *remote, uint8_t **password)
{ {
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE)
...@@ -1792,7 +1792,7 @@ size_t priv_get_password (NiceAgent *agent, Stream *stream, ...@@ -1792,7 +1792,7 @@ size_t priv_get_password (NiceAgent *agent, Stream *stream,
/* Implement the computation specific in RFC 5245 section 16 */ /* Implement the computation specific in RFC 5245 section 16 */
static unsigned int priv_compute_conncheck_timer (NiceAgent *agent, static unsigned int priv_compute_conncheck_timer (NiceAgent *agent,
Stream *stream) NiceStream *stream)
{ {
GSList *item; GSList *item;
guint waiting_and_in_progress = 0; guint waiting_and_in_progress = 0;
...@@ -1807,7 +1807,7 @@ static unsigned int priv_compute_conncheck_timer (NiceAgent *agent, ...@@ -1807,7 +1807,7 @@ static unsigned int priv_compute_conncheck_timer (NiceAgent *agent,
} }
/* FIXME: This should also be multiple by "N", which I believe is the /* FIXME: This should also be multiple by "N", which I believe is the
* number of Streams currently in the conncheck state. */ * number of NiceStreams currently in the conncheck state. */
rto = agent->timer_ta * waiting_and_in_progress; rto = agent->timer_ta * waiting_and_in_progress;
/* We assume non-reliable streams are RTP, so we use 100 as the max */ /* We assume non-reliable streams are RTP, so we use 100 as the max */
...@@ -1835,7 +1835,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair) ...@@ -1835,7 +1835,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
guint32 priority; guint32 priority;
uint8_t uname[NICE_STREAM_MAX_UNAME]; uint8_t uname[NICE_STREAM_MAX_UNAME];
Stream *stream; NiceStream *stream;
Component *component; Component *component;
gsize uname_len; gsize uname_len;
uint8_t *password = NULL; uint8_t *password = NULL;
...@@ -1913,7 +1913,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair) ...@@ -1913,7 +1913,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
* check pair, until we discover a new local peer reflexive */ * check pair, until we discover a new local peer reflexive */
if (pair->sockptr->fileno == NULL && if (pair->sockptr->fileno == NULL &&
pair->local->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE) { pair->local->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE) {
Stream *stream2 = NULL; NiceStream *stream2 = NULL;
Component *component2 = NULL; Component *component2 = NULL;
NiceSocket *new_socket; NiceSocket *new_socket;
...@@ -1964,7 +1964,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair) ...@@ -1964,7 +1964,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
* *
* @see priv_update_check_list_state_failed_components() * @see priv_update_check_list_state_failed_components()
*/ */
static guint priv_prune_pending_checks (Stream *stream, guint component_id) static guint priv_prune_pending_checks (NiceStream *stream, guint component_id)
{ {
GSList *i; GSList *i;
guint64 highest_nominated_priority = 0; guint64 highest_nominated_priority = 0;
...@@ -2031,7 +2031,7 @@ static guint priv_prune_pending_checks (Stream *stream, guint component_id) ...@@ -2031,7 +2031,7 @@ static guint priv_prune_pending_checks (Stream *stream, guint component_id)
* @param remote_cand remote candidate from which the inbound check was sent * @param remote_cand remote candidate from which the inbound check was sent
* @param use_candidate whether the original check had USE-CANDIDATE attribute set * @param use_candidate whether the original check had USE-CANDIDATE attribute set
*/ */
static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream, Component *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate) static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *stream, Component *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate)
{ {
GSList *i; GSList *i;
NiceCandidate *local = NULL; NiceCandidate *local = NULL;
...@@ -2137,7 +2137,7 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream, ...@@ -2137,7 +2137,7 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream,
* *
* @pre (rcand == NULL || nice_address_equal(rcand->addr, toaddr) == TRUE) * @pre (rcand == NULL || nice_address_equal(rcand->addr, toaddr) == TRUE)
*/ */
static void priv_reply_to_conn_check (NiceAgent *agent, Stream *stream, Component *component, NiceCandidate *rcand, const NiceAddress *toaddr, NiceSocket *sockptr, size_t rbuf_len, uint8_t *rbuf, gboolean use_candidate) static void priv_reply_to_conn_check (NiceAgent *agent, NiceStream *stream, Component *component, NiceCandidate *rcand, const NiceAddress *toaddr, NiceSocket *sockptr, size_t rbuf_len, uint8_t *rbuf, gboolean use_candidate)
{ {
g_assert (rcand == NULL || nice_address_equal(&rcand->addr, toaddr) == TRUE); g_assert (rcand == NULL || nice_address_equal(&rcand->addr, toaddr) == TRUE);
...@@ -2209,7 +2209,7 @@ static int priv_store_pending_check (NiceAgent *agent, Component *component, ...@@ -2209,7 +2209,7 @@ static int priv_store_pending_check (NiceAgent *agent, Component *component,
static CandidateCheckPair *priv_add_peer_reflexive_pair (NiceAgent *agent, guint stream_id, guint component_id, NiceCandidate *local_cand, CandidateCheckPair *parent_pair) static CandidateCheckPair *priv_add_peer_reflexive_pair (NiceAgent *agent, guint stream_id, guint component_id, NiceCandidate *local_cand, CandidateCheckPair *parent_pair)
{ {
CandidateCheckPair *pair = g_slice_new0 (CandidateCheckPair); CandidateCheckPair *pair = g_slice_new0 (CandidateCheckPair);
Stream *stream = agent_find_stream (agent, stream_id); NiceStream *stream = agent_find_stream (agent, stream_id);
pair->agent = agent; pair->agent = agent;
pair->stream_id = stream_id; pair->stream_id = stream_id;
...@@ -2246,7 +2246,7 @@ static void priv_recalculate_pair_priorities (NiceAgent *agent) ...@@ -2246,7 +2246,7 @@ static void priv_recalculate_pair_priorities (NiceAgent *agent)
GSList *i, *j; GSList *i, *j;
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->conncheck_list; j; j = j->next) { for (j = stream->conncheck_list; j; j = j->next) {
CandidateCheckPair *p = j->data; CandidateCheckPair *p = j->data;
p->priority = agent_candidate_pair_priority (agent, p->local, p->remote); p->priority = agent_candidate_pair_priority (agent, p->local, p->remote);
...@@ -2287,7 +2287,7 @@ static void priv_check_for_role_conflict (NiceAgent *agent, gboolean control) ...@@ -2287,7 +2287,7 @@ static void priv_check_for_role_conflict (NiceAgent *agent, gboolean control)
* *
* @return pointer to a candidate pair, found in conncheck list or newly created * @return pointer to a candidate pair, found in conncheck list or newly created
*/ */
static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *agent, Stream *stream, Component *component, CandidateCheckPair *p, NiceSocket *sockptr, struct sockaddr *mapped_sockaddr, NiceCandidate *local_candidate, NiceCandidate *remote_candidate) static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *agent, NiceStream *stream, Component *component, CandidateCheckPair *p, NiceSocket *sockptr, struct sockaddr *mapped_sockaddr, NiceCandidate *local_candidate, NiceCandidate *remote_candidate)
{ {
CandidateCheckPair *new_pair = NULL; CandidateCheckPair *new_pair = NULL;
NiceAddress mapped; NiceAddress mapped;
...@@ -2353,7 +2353,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent * ...@@ -2353,7 +2353,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
* *
* @return TRUE if a matching transaction is found * @return TRUE if a matching transaction is found
*/ */
static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *stream, Component *component, NiceSocket *sockptr, const NiceAddress *from, NiceCandidate *local_candidate, NiceCandidate *remote_candidate, StunMessage *resp) static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStream *stream, Component *component, NiceSocket *sockptr, const NiceAddress *from, NiceCandidate *local_candidate, NiceCandidate *remote_candidate, StunMessage *resp)
{ {
union { union {
struct sockaddr_storage storage; struct sockaddr_storage storage;
...@@ -2935,7 +2935,7 @@ static gboolean priv_map_reply_to_keepalive_conncheck (NiceAgent *agent, ...@@ -2935,7 +2935,7 @@ static gboolean priv_map_reply_to_keepalive_conncheck (NiceAgent *agent,
typedef struct { typedef struct {
NiceAgent *agent; NiceAgent *agent;
Stream *stream; NiceStream *stream;
Component *component; Component *component;
uint8_t *password; uint8_t *password;
} conncheck_validater_data; } conncheck_validater_data;
...@@ -3032,7 +3032,7 @@ static bool conncheck_stun_validater (StunAgent *agent, ...@@ -3032,7 +3032,7 @@ static bool conncheck_stun_validater (StunAgent *agent,
* *
* @return XXX (what FALSE means exactly?) * @return XXX (what FALSE means exactly?)
*/ */
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream,
Component *component, NiceSocket *nicesock, const NiceAddress *from, Component *component, NiceSocket *nicesock, const NiceAddress *from,
gchar *buf, guint len) gchar *buf, guint len)
{ {
...@@ -3378,7 +3378,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, ...@@ -3378,7 +3378,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
/* Remove all pointers to the given @sock from the connection checking process. /* Remove all pointers to the given @sock from the connection checking process.
* These are entirely NiceCandidates pointed to from various places. */ * These are entirely NiceCandidates pointed to from various places. */
void void
conn_check_prune_socket (NiceAgent *agent, Stream *stream, Component *component, conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, Component *component,
NiceSocket *sock) NiceSocket *sock)
{ {
GSList *l; GSList *l;
......
...@@ -100,13 +100,13 @@ gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, C ...@@ -100,13 +100,13 @@ gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, C
void conn_check_free (NiceAgent *agent); void conn_check_free (NiceAgent *agent);
gboolean conn_check_schedule_next (NiceAgent *agent); gboolean conn_check_schedule_next (NiceAgent *agent);
int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair); int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
void conn_check_prune_stream (NiceAgent *agent, Stream *stream); void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream);
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, Component *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len); gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, Component *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b); gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b);
void conn_check_remote_candidates_set(NiceAgent *agent); void conn_check_remote_candidates_set(NiceAgent *agent);
NiceCandidateTransport conn_check_match_transport (NiceCandidateTransport transport); NiceCandidateTransport conn_check_match_transport (NiceCandidateTransport transport);
void void
conn_check_prune_socket (NiceAgent *agent, Stream *stream, Component *component, conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, Component *component,
NiceSocket *sock); NiceSocket *sock);
#endif /*_NICE_CONNCHECK_H */ #endif /*_NICE_CONNCHECK_H */
...@@ -382,7 +382,7 @@ static void priv_assign_foundation (NiceAgent *agent, NiceCandidate *candidate) ...@@ -382,7 +382,7 @@ static void priv_assign_foundation (NiceAgent *agent, NiceCandidate *candidate)
GSList *i, *j, *k; GSList *i, *j, *k;
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *component = j->data; Component *component = j->data;
for (k = component->local_candidates; k; k = k->next) { for (k = component->local_candidates; k; k = k->next) {
...@@ -430,7 +430,7 @@ static void priv_assign_remote_foundation (NiceAgent *agent, NiceCandidate *cand ...@@ -430,7 +430,7 @@ static void priv_assign_remote_foundation (NiceAgent *agent, NiceCandidate *cand
Component *component = NULL; Component *component = NULL;
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
Stream *stream = i->data; NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) { for (j = stream->components; j; j = j->next) {
Component *c = j->data; Component *c = j->data;
...@@ -524,7 +524,7 @@ HostCandidateResult discovery_add_local_host_candidate ( ...@@ -524,7 +524,7 @@ HostCandidateResult discovery_add_local_host_candidate (
{ {
NiceCandidate *candidate; NiceCandidate *candidate;
Component *component; Component *component;
Stream *stream; NiceStream *stream;
NiceSocket *nicesock = NULL; NiceSocket *nicesock = NULL;
HostCandidateResult res = HOST_CANDIDATE_FAILED; HostCandidateResult res = HOST_CANDIDATE_FAILED;
...@@ -611,7 +611,7 @@ discovery_add_server_reflexive_candidate ( ...@@ -611,7 +611,7 @@ discovery_add_server_reflexive_candidate (
{ {
NiceCandidate *candidate; NiceCandidate *candidate;
Component *component; Component *component;
Stream *stream; NiceStream *stream;
gboolean result = FALSE; gboolean result = FALSE;
if (!agent_find_component (agent, stream_id, component_id, &stream, &component)) if (!agent_find_component (agent, stream_id, component_id, &stream, &component))
...@@ -671,7 +671,7 @@ discovery_discover_tcp_server_reflexive_candidates ( ...@@ -671,7 +671,7 @@ discovery_discover_tcp_server_reflexive_candidates (
NiceSocket *base_socket) NiceSocket *base_socket)
{ {
Component *component; Component *component;
Stream *stream; NiceStream *stream;
NiceAddress base_addr = base_socket->addr; NiceAddress base_addr = base_socket->addr;
GSList *i; GSList *i;
...@@ -719,7 +719,7 @@ discovery_add_relay_candidate ( ...@@ -719,7 +719,7 @@ discovery_add_relay_candidate (
{ {
NiceCandidate *candidate; NiceCandidate *candidate;
Component *component; Component *component;
Stream *stream; NiceStream *stream;
NiceSocket *relay_socket = NULL; NiceSocket *relay_socket = NULL;
if (!agent_find_component (agent, stream_id, component_id, &stream, &component)) if (!agent_find_component (agent, stream_id, component_id, &stream, &component))
...@@ -799,7 +799,7 @@ discovery_add_peer_reflexive_candidate ( ...@@ -799,7 +799,7 @@ discovery_add_peer_reflexive_candidate (
{ {
NiceCandidate *candidate; NiceCandidate *candidate;
Component *component; Component *component;
Stream *stream; NiceStream *stream;
gboolean result; gboolean result;
if (!agent_find_component (agent, stream_id, component_id, &stream, &component)) if (!agent_find_component (agent, stream_id, component_id, &stream, &component))
...@@ -891,7 +891,7 @@ discovery_add_peer_reflexive_candidate ( ...@@ -891,7 +891,7 @@ discovery_add_peer_reflexive_candidate (
*/ */
NiceCandidate *discovery_learn_remote_peer_reflexive_candidate ( NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
NiceAgent *agent, NiceAgent *agent,
Stream *stream, NiceStream *stream,
Component *component, Component *component,
guint32 priority, guint32 priority,
const NiceAddress *remote_address, const NiceAddress *remote_address,
......
...@@ -53,7 +53,7 @@ typedef struct ...@@ -53,7 +53,7 @@ typedef struct
GTimeVal next_tick; /* next tick timestamp */ GTimeVal next_tick; /* next tick timestamp */
gboolean pending; /* is discovery in progress? */ gboolean pending; /* is discovery in progress? */
gboolean done; /* is discovery complete? */ gboolean done; /* is discovery complete? */
Stream *stream; NiceStream *stream;
Component *component; Component *component;
TurnServer *turn; TurnServer *turn;
StunAgent stun_agent; StunAgent stun_agent;
...@@ -70,7 +70,7 @@ typedef struct ...@@ -70,7 +70,7 @@ typedef struct
NiceSocket *nicesock; /* existing socket to use */ NiceSocket *nicesock; /* existing socket to use */
NiceAddress server; /* STUN/TURN server address */ NiceAddress server; /* STUN/TURN server address */
NiceCandidate *candidate; /* candidate to refresh */ NiceCandidate *candidate; /* candidate to refresh */
Stream *stream; NiceStream *stream;
Component *component; Component *component;
StunAgent stun_agent; StunAgent stun_agent;
GSource *timer_source; GSource *timer_source;
...@@ -151,7 +151,7 @@ discovery_add_peer_reflexive_candidate ( ...@@ -151,7 +151,7 @@ discovery_add_peer_reflexive_candidate (
NiceCandidate * NiceCandidate *
discovery_learn_remote_peer_reflexive_candidate ( discovery_learn_remote_peer_reflexive_candidate (
NiceAgent *agent, NiceAgent *agent,
Stream *stream, NiceStream *stream,
Component *component, Component *component,
guint32 priority, guint32 priority,
const NiceAddress *remote_address, const NiceAddress *remote_address,
......
...@@ -333,7 +333,7 @@ nice_input_stream_close (GInputStream *stream, GCancellable *cancellable, ...@@ -333,7 +333,7 @@ nice_input_stream_close (GInputStream *stream, GCancellable *cancellable,
{ {
NiceInputStreamPrivate *priv = NICE_INPUT_STREAM (stream)->priv; NiceInputStreamPrivate *priv = NICE_INPUT_STREAM (stream)->priv;
Component *component = NULL; Component *component = NULL;
Stream *_stream = NULL; NiceStream *_stream = NULL;
NiceAgent *agent; /* owned */ NiceAgent *agent; /* owned */
/* Has the agent disappeared? */ /* Has the agent disappeared? */
...@@ -362,7 +362,7 @@ nice_input_stream_is_readable (GPollableInputStream *stream) ...@@ -362,7 +362,7 @@ nice_input_stream_is_readable (GPollableInputStream *stream)
{ {
NiceInputStreamPrivate *priv = NICE_INPUT_STREAM (stream)->priv; NiceInputStreamPrivate *priv = NICE_INPUT_STREAM (stream)->priv;
Component *component = NULL; Component *component = NULL;
Stream *_stream = NULL; NiceStream *_stream = NULL;
gboolean retval = FALSE; gboolean retval = FALSE;
GSList *i; GSList *i;
NiceAgent *agent; /* owned */ NiceAgent *agent; /* owned */
......
...@@ -477,7 +477,7 @@ nice_output_stream_close (GOutputStream *stream, GCancellable *cancellable, ...@@ -477,7 +477,7 @@ nice_output_stream_close (GOutputStream *stream, GCancellable *cancellable,
{ {
NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv; NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv;
Component *component = NULL; Component *component = NULL;
Stream *_stream = NULL; NiceStream *_stream = NULL;
NiceAgent *agent; /* owned */ NiceAgent *agent; /* owned */
/* Has the agent disappeared? */ /* Has the agent disappeared? */
...@@ -506,7 +506,7 @@ nice_output_stream_is_writable (GPollableOutputStream *stream) ...@@ -506,7 +506,7 @@ nice_output_stream_is_writable (GPollableOutputStream *stream)
{ {
NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv; NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv;
Component *component = NULL; Component *component = NULL;
Stream *_stream = NULL; NiceStream *_stream = NULL;
gboolean retval = FALSE; gboolean retval = FALSE;
NiceAgent *agent; /* owned */ NiceAgent *agent; /* owned */
...@@ -596,7 +596,7 @@ nice_output_stream_create_source (GPollableOutputStream *stream, ...@@ -596,7 +596,7 @@ nice_output_stream_create_source (GPollableOutputStream *stream,
NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv; NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv;
GSource *component_source = NULL; GSource *component_source = NULL;
Component *component = NULL; Component *component = NULL;
Stream *_stream = NULL; NiceStream *_stream = NULL;
NiceAgent *agent; /* owned */ NiceAgent *agent; /* owned */
component_source = g_pollable_source_new (G_OBJECT (stream)); component_source = g_pollable_source_new (G_OBJECT (stream));
......
...@@ -57,8 +57,8 @@ nice_stream_finalize (GObject *obj); ...@@ -57,8 +57,8 @@ nice_stream_finalize (GObject *obj);
* @file stream.c * @file stream.c
* @brief ICE stream functionality * @brief ICE stream functionality
*/ */
Stream * NiceStream *
stream_new (guint n_components, NiceAgent *agent) nice_stream_new (guint n_components, NiceAgent *agent)
{ {
NiceStream *stream = NULL; NiceStream *stream = NULL;
guint n; guint n;
...@@ -79,7 +79,7 @@ stream_new (guint n_components, NiceAgent *agent) ...@@ -79,7 +79,7 @@ stream_new (guint n_components, NiceAgent *agent)
} }
void void
stream_close (Stream *stream) nice_stream_close (NiceStream *stream)
{ {
GSList *i; GSList *i;
...@@ -89,14 +89,8 @@ stream_close (Stream *stream) ...@@ -89,14 +89,8 @@ stream_close (Stream *stream)
} }
} }
void
stream_free (Stream *stream)
{
g_object_unref (stream);
}
Component * Component *
stream_find_component_by_id (const Stream *stream, guint id) nice_stream_find_component_by_id (NiceStream *stream, guint id)
{ {
GSList *i; GSList *i;
...@@ -114,7 +108,7 @@ stream_find_component_by_id (const Stream *stream, guint id) ...@@ -114,7 +108,7 @@ stream_find_component_by_id (const Stream *stream, guint id)
* 'CONNECTED' or 'READY' (connected plus nominated). * 'CONNECTED' or 'READY' (connected plus nominated).
*/ */
gboolean gboolean
stream_all_components_ready (const Stream *stream) nice_stream_all_components_ready (NiceStream *stream)
{ {
GSList *i; GSList *i;
...@@ -133,7 +127,8 @@ stream_all_components_ready (const Stream *stream) ...@@ -133,7 +127,8 @@ stream_all_components_ready (const Stream *stream)
/* /*
* Initialized the local crendentials for the stream. * Initialized the local crendentials for the stream.
*/ */
void stream_initialize_credentials (Stream *stream, NiceRNG *rng) void
nice_stream_initialize_credentials (NiceStream *stream, NiceRNG *rng)
{ {
/* note: generate ufrag/pwd for the stream (see ICE 15.4. /* note: generate ufrag/pwd for the stream (see ICE 15.4.
* '"ice-ufrag" and "ice-pwd" Attributes', ID-19) */ * '"ice-ufrag" and "ice-pwd" Attributes', ID-19) */
...@@ -146,7 +141,7 @@ void stream_initialize_credentials (Stream *stream, NiceRNG *rng) ...@@ -146,7 +141,7 @@ void stream_initialize_credentials (Stream *stream, NiceRNG *rng)
* session. * session.
*/ */
void void
stream_restart (NiceAgent *agent, Stream *stream) nice_stream_restart (NiceStream *stream, NiceAgent *agent)
{ {
GSList *i; GSList *i;
...@@ -155,7 +150,7 @@ stream_restart (NiceAgent *agent, Stream *stream) ...@@ -155,7 +150,7 @@ stream_restart (NiceAgent *agent, Stream *stream)
stream->initial_binding_request_received = FALSE; stream->initial_binding_request_received = FALSE;
stream_initialize_credentials (stream, agent->rng); nice_stream_initialize_credentials (stream, agent->rng);
for (i = stream->components; i; i = i->next) { for (i = stream->components; i; i = i->next) {
Component *component = i->data; Component *component = i->data;
......
...@@ -42,8 +42,7 @@ ...@@ -42,8 +42,7 @@
#include <glib.h> #include <glib.h>
typedef struct _Stream Stream G_GNUC_DEPRECATED_FOR(NiceStream); typedef struct _NiceStream NiceStream;
typedef Stream NiceStream;
#include "component.h" #include "component.h"
#include "random.h" #include "random.h"
...@@ -72,8 +71,7 @@ G_BEGIN_DECLS ...@@ -72,8 +71,7 @@ G_BEGIN_DECLS
#define NICE_STREAM_GET_CLASS(obj) \ #define NICE_STREAM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_STREAM, NiceStreamClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_STREAM, NiceStreamClass))
struct _Stream struct _NiceStream {
{
/*< private >*/ /*< private >*/
GObject parent; GObject parent;
...@@ -98,33 +96,23 @@ typedef struct { ...@@ -98,33 +96,23 @@ typedef struct {
GType nice_stream_get_type (void); GType nice_stream_get_type (void);
G_DEPRECATED NiceStream *
Stream * nice_stream_new (guint n_components, NiceAgent *agent);
stream_new (guint n_components, NiceAgent *agent);
G_DEPRECATED
void void
stream_close (Stream *stream); nice_stream_close (NiceStream *stream);
G_DEPRECATED_FOR(g_object_unref)
void
stream_free (Stream *stream);
G_DEPRECATED
gboolean gboolean
stream_all_components_ready (const Stream *stream); nice_stream_all_components_ready (NiceStream *stream);
G_DEPRECATED
Component * Component *
stream_find_component_by_id (const Stream *stream, guint id); nice_stream_find_component_by_id (NiceStream *stream, guint id);
G_DEPRECATED
void void
stream_initialize_credentials (Stream *stream, NiceRNG *rng); nice_stream_initialize_credentials (NiceStream *stream, NiceRNG *rng);
G_DEPRECATED
void void
stream_restart (NiceAgent *agent, Stream *stream); nice_stream_restart (NiceStream *stream, NiceAgent *agent);
G_END_DECLS G_END_DECLS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment