summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-09-30 14:57:10 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-10-01 17:49:32 +0100
commit008739a5a60e591629e38da9b8b7065dbc2c746f (patch)
tree39a8017fefa342a7d7f756d4755f780869bb3890
parent529bc193d56522b10a4de83409396b3316863934 (diff)
downloadlibnice-008739a5a60e591629e38da9b8b7065dbc2c746f.tar.gz
agent: Correctly namespace Component and its methods
Remove all references to the old, unnamespaced versions. This should cause no functional changes. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D309
-rw-r--r--agent/agent-priv.h2
-rw-r--r--agent/agent.c157
-rw-r--r--agent/component.c117
-rw-r--r--agent/component.h72
-rw-r--r--agent/conncheck.c70
-rw-r--r--agent/conncheck.h10
-rw-r--r--agent/discovery.c26
-rw-r--r--agent/discovery.h6
-rw-r--r--agent/inputstream.c6
-rw-r--r--agent/outputstream.c6
-rw-r--r--agent/stream.c20
-rw-r--r--agent/stream.h4
12 files changed, 235 insertions, 261 deletions
diff --git a/agent/agent-priv.h b/agent/agent-priv.h
index d3cafe7..fe0a521 100644
--- a/agent/agent-priv.h
+++ b/agent/agent-priv.h
@@ -172,7 +172,7 @@ agent_find_component (
guint stream_id,
guint component_id,
NiceStream **stream,
- Component **component);
+ NiceComponent **component);
NiceStream *agent_find_stream (NiceAgent *agent, guint stream_id);
diff --git a/agent/agent.c b/agent/agent.c
index 130e814..279e7cd 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -144,7 +144,7 @@ static void pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err,
gpointer user_data);
static PseudoTcpWriteResult pseudo_tcp_socket_write_packet (PseudoTcpSocket *sock,
const gchar *buffer, guint32 len, gpointer user_data);
-static void adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, Component *component);
+static void adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, NiceComponent *component);
static void nice_agent_dispose (GObject *object);
static void nice_agent_get_property (GObject *object,
@@ -318,10 +318,10 @@ agent_find_component (
guint stream_id,
guint component_id,
NiceStream **stream,
- Component **component)
+ NiceComponent **component)
{
NiceStream *s;
- Component *c;
+ NiceComponent *c;
s = agent_find_stream (agent, stream_id);
@@ -1220,7 +1220,7 @@ nice_agent_reset_all_stun_agents (NiceAgent *agent, gboolean only_software)
for (component_item = stream->components; component_item;
component_item = component_item->next) {
- Component *component = component_item->data;
+ NiceComponent *component = component_item->data;
if (only_software)
stun_agent_set_software (&component->stun_agent,
@@ -1356,7 +1356,7 @@ nice_agent_set_property (
static void
- agent_signal_socket_writable (NiceAgent *agent, Component *component)
+ agent_signal_socket_writable (NiceAgent *agent, NiceComponent *component)
{
g_cancellable_cancel (component->tcp_writable_cancellable);
@@ -1365,7 +1365,7 @@ static void
}
static void
-pseudo_tcp_socket_create (NiceAgent *agent, NiceStream *stream, Component *component)
+pseudo_tcp_socket_create (NiceAgent *agent, NiceStream *stream, NiceComponent *component)
{
PseudoTcpCallbacks tcp_callbacks = {component,
pseudo_tcp_socket_opened,
@@ -1380,7 +1380,7 @@ pseudo_tcp_socket_create (NiceAgent *agent, NiceStream *stream, Component *compo
}
static void priv_pseudo_tcp_error (NiceAgent *agent, NiceStream *stream,
- Component *component)
+ NiceComponent *component)
{
if (component->tcp_writable_cancellable) {
g_cancellable_cancel (component->tcp_writable_cancellable);
@@ -1390,7 +1390,7 @@ static void priv_pseudo_tcp_error (NiceAgent *agent, NiceStream *stream,
if (component->tcp) {
agent_signal_component_state_change (agent, stream->id,
component->id, NICE_COMPONENT_STATE_FAILED);
- component_detach_all_sockets (component);
+ nice_component_detach_all_sockets (component);
pseudo_tcp_socket_close (component->tcp, TRUE);
}
@@ -1404,7 +1404,7 @@ static void priv_pseudo_tcp_error (NiceAgent *agent, NiceStream *stream,
static void
pseudo_tcp_socket_opened (PseudoTcpSocket *sock, gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
NiceAgent *agent = component->agent;
NiceStream *stream = component->stream;
@@ -1565,7 +1565,7 @@ done:
static void
pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
NiceAgent *agent = component->agent;
NiceStream *stream = component->stream;
gboolean has_io_callback;
@@ -1579,11 +1579,11 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
component->tcp_readable = TRUE;
- has_io_callback = component_has_io_callback (component);
+ has_io_callback = nice_component_has_io_callback (component);
/* Only dequeue pseudo-TCP data if we can reliably inform the client. The
* agent lock is held here, so has_io_callback can only change during
- * component_emit_io_callback(), after which it’s re-queried. This ensures
+ * nice_component_emit_io_callback(), after which it’s re-queried. This ensures
* no data loss of packets already received and dequeued. */
if (has_io_callback) {
do {
@@ -1626,7 +1626,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
break;
}
- component_emit_io_callback (component, buf, len);
+ nice_component_emit_io_callback (component, buf, len);
if (!agent_find_component (agent, stream_id, component_id,
&stream, &component)) {
@@ -1638,7 +1638,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
goto out;
}
- has_io_callback = component_has_io_callback (component);
+ has_io_callback = nice_component_has_io_callback (component);
} while (has_io_callback);
} else if (component->recv_messages != NULL) {
gint n_valid_messages;
@@ -1690,7 +1690,7 @@ out:
static void
pseudo_tcp_socket_writable (PseudoTcpSocket *sock, gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
NiceAgent *agent = component->agent;
NiceStream *stream = component->stream;
@@ -1704,7 +1704,7 @@ static void
pseudo_tcp_socket_closed (PseudoTcpSocket *sock, guint32 err,
gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
NiceAgent *agent = component->agent;
NiceStream *stream = component->stream;
@@ -1718,7 +1718,7 @@ static PseudoTcpWriteResult
pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
const gchar *buffer, guint32 len, gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
if (component->selected_pair.local != NULL) {
NiceSocket *sock;
@@ -1759,7 +1759,7 @@ pseudo_tcp_socket_write_packet (PseudoTcpSocket *psocket,
static gboolean
notify_pseudo_tcp_socket_clock (gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
NiceStream *stream;
NiceAgent *agent;
@@ -1784,7 +1784,7 @@ notify_pseudo_tcp_socket_clock (gpointer user_data)
}
static void
-adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, Component *component)
+adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, NiceComponent *component)
{
if (!pseudo_tcp_socket_is_closed (component->tcp)) {
guint64 timeout = component->last_clock_timeout;
@@ -1818,7 +1818,7 @@ adjust_tcp_clock (NiceAgent *agent, NiceStream *stream, Component *component)
void
_tcp_sock_is_writable (NiceSocket *sock, gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
NiceAgent *agent = component->agent;
NiceStream *stream = component->stream;
@@ -1863,7 +1863,7 @@ void agent_gathering_done (NiceAgent *agent)
for (i = agent->streams; i; i = i->next) {
NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) {
- Component *component = j->data;
+ NiceComponent *component = j->data;
for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *local_candidate = k->data;
@@ -1938,7 +1938,7 @@ agent_signal_initial_binding_request_received (NiceAgent *agent,
* Must be called with the agent lock held. */
static void
process_queued_tcp_packets (NiceAgent *agent, NiceStream *stream,
- Component *component)
+ NiceComponent *component)
{
GOutputVector *vec;
guint stream_id = stream->id;
@@ -1991,7 +1991,7 @@ process_queued_tcp_packets (NiceAgent *agent, NiceStream *stream,
void agent_signal_new_selected_pair (NiceAgent *agent, guint stream_id,
guint component_id, NiceCandidate *lcandidate, NiceCandidate *rcandidate)
{
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
if (!agent_find_component (agent, stream_id, component_id,
@@ -2105,7 +2105,7 @@ nice_component_state_to_string (NiceComponentState state)
void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, guint component_id, NiceComponentState new_state)
{
NiceComponentState old_state;
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
g_return_if_fail (new_state < NICE_COMPONENT_STATE_LAST);
@@ -2209,7 +2209,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
NiceStream *stream, guint component_id, gboolean turn_tcp)
{
CandidateDiscovery *cdisco;
- Component *component = nice_stream_find_component_by_id (stream, component_id);
+ NiceComponent *component = nice_stream_find_component_by_id (stream, component_id);
NiceAddress local_address;
/* note: no need to check for redundant candidates, as this is
@@ -2231,7 +2231,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
new_socket = nice_udp_bsd_socket_new (&addr);
if (new_socket) {
_priv_set_socket_tos (agent, new_socket, stream->tos);
- component_attach_socket (component, new_socket);
+ nice_component_attach_socket (component, new_socket);
nicesock = new_socket;
}
}
@@ -2325,7 +2325,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
cdisco->nicesock = nice_udp_turn_over_tcp_socket_new (nicesock,
agent_to_turn_socket_compatibility (agent));
- component_attach_socket (component, cdisco->nicesock);
+ nice_component_attach_socket (component, cdisco->nicesock);
}
cdisco->turn = turn_server_ref (turn);
@@ -2386,7 +2386,7 @@ nice_agent_add_stream (
if (agent->reliable) {
nice_debug ("Agent %p : reliable stream", agent);
for (i = 0; i < n_components; i++) {
- Component *component = nice_stream_find_component_by_id (stream, i + 1);
+ NiceComponent *component = nice_stream_find_component_by_id (stream, i + 1);
if (component) {
pseudo_tcp_socket_create (agent, stream, component);
} else {
@@ -2412,7 +2412,7 @@ nice_agent_set_relay_info(NiceAgent *agent,
NiceRelayType type)
{
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *stream = NULL;
gboolean ret = TRUE;
TurnServer *turn;
@@ -2566,7 +2566,7 @@ static void _upnp_mapped_external_port (GUPnPSimpleIgd *self, gchar *proto,
for (i = agent->streams; i; i = i->next) {
NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) {
- Component *component = j->data;
+ NiceComponent *component = j->data;
for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *local_candidate = k->data;
@@ -2715,7 +2715,7 @@ nice_agent_gather_candidates (
#endif
for (cid = 1; cid <= stream->n_components; cid++) {
- Component *component = nice_stream_find_component_by_id (stream, cid);
+ NiceComponent *component = nice_stream_find_component_by_id (stream, cid);
enum {
ADD_HOST_MIN = 0,
ADD_HOST_UDP = ADD_HOST_MIN,
@@ -2851,7 +2851,7 @@ nice_agent_gather_candidates (
/* Only signal the new candidates after we're sure that the gathering was
* succesfful. But before sending gathering-done */
for (cid = 1; cid <= stream->n_components; cid++) {
- Component *component = nice_stream_find_component_by_id (stream, cid);
+ NiceComponent *component = nice_stream_find_component_by_id (stream, cid);
for (i = component->local_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
agent_signal_new_candidate (agent, candidate);
@@ -2880,9 +2880,9 @@ nice_agent_gather_candidates (
if (ret == FALSE) {
priv_stop_upnp (agent);
for (cid = 1; cid <= stream->n_components; cid++) {
- Component *component = nice_stream_find_component_by_id (stream, cid);
+ NiceComponent *component = nice_stream_find_component_by_id (stream, cid);
- component_free_socket_sources (component);
+ nice_component_free_socket_sources (component);
for (i = component->local_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
@@ -2998,7 +2998,7 @@ nice_agent_set_port_range (NiceAgent *agent, guint stream_id, guint component_id
guint min_port, guint max_port)
{
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
g_return_if_fail (NICE_IS_AGENT (agent));
g_return_if_fail (stream_id >= 1);
@@ -3050,14 +3050,14 @@ static gboolean priv_add_remote_candidate (
const gchar *password,
const gchar *foundation)
{
- Component *component;
+ NiceComponent *component;
NiceCandidate *candidate;
if (!agent_find_component (agent, stream_id, component_id, NULL, &component))
return FALSE;
/* step: check whether the candidate already exists */
- candidate = component_find_remote_candidate(component, addr, transport);
+ candidate = nice_component_find_remote_candidate (component, addr, transport);
if (candidate && candidate->type == type) {
if (nice_debug_is_enabled ()) {
gchar tmpbuf[INET6_ADDRSTRLEN];
@@ -3243,7 +3243,7 @@ nice_agent_get_local_credentials (
static int
_set_remote_candidates_locked (NiceAgent *agent, NiceStream *stream,
- Component *component, const GSList *candidates)
+ NiceComponent *component, const GSList *candidates)
{
const GSList *i;
int added = 0;
@@ -3286,7 +3286,7 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
{
int added = 0;
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
g_return_val_if_fail (NICE_IS_AGENT (agent), 0);
g_return_val_if_fail (stream_id >= 1, 0);
@@ -3346,7 +3346,7 @@ static RecvStatus
agent_recv_message_unlocked (
NiceAgent *agent,
NiceStream *stream,
- Component *component,
+ NiceComponent *component,
NiceSocket *nicesock,
NiceInputMessage *message)
{
@@ -3427,7 +3427,7 @@ agent_recv_message_unlocked (
new_socket = nice_tcp_passive_socket_accept (nicesock);
if (new_socket) {
_priv_set_socket_tos (agent, new_socket, stream->tos);
- component_attach_socket (component, new_socket);
+ nice_component_attach_socket (component, new_socket);
}
retval = 0;
} else {
@@ -3928,7 +3928,7 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
*
* Must be called with the io_mutex held. */
static gint
-pending_io_messages_recv_messages (Component *component, gboolean reliable,
+pending_io_messages_recv_messages (NiceComponent *component, gboolean reliable,
NiceInputMessage *messages, guint n_messages, NiceInputMessageIter *iter)
{
gsize len;
@@ -4003,7 +4003,7 @@ nice_agent_recv_messages_blocking_or_nonblocking (NiceAgent *agent,
{
GMainContext *context;
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
gint n_valid_messages = -1;
GSource *cancellable_source = NULL;
gboolean received_enough = FALSE, error_reported = FALSE;
@@ -4066,8 +4066,8 @@ nice_agent_recv_messages_blocking_or_nonblocking (NiceAgent *agent,
component->recv_messages == NULL);
/* Set the component’s receive buffer. */
- context = component_dup_io_context (component);
- component_set_io_callback (component, NULL, NULL, messages, n_messages,
+ context = nice_component_dup_io_context (component);
+ nice_component_set_io_callback (component, NULL, NULL, messages, n_messages,
&child_error);
/* Add the cancellable as a source. */
@@ -4175,7 +4175,7 @@ nice_agent_recv_messages_blocking_or_nonblocking (NiceAgent *agent,
nice_input_message_iter_get_n_valid_messages (
&component->recv_messages_iter); /* grab before resetting the iter */
- component_set_io_callback (component, NULL, NULL, NULL, 0, NULL);
+ nice_component_set_io_callback (component, NULL, NULL, NULL, 0, NULL);
recv_error:
/* Tidy up. Below this point, @component may be %NULL. */
@@ -4328,7 +4328,7 @@ nice_agent_send_messages_nonblocking_internal (
GError **error)
{
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
gint n_sent = -1; /* is in bytes if allow_partial is TRUE,
otherwise in messages */
GError *child_error = NULL;
@@ -4574,7 +4574,7 @@ nice_agent_get_local_candidates (
guint stream_id,
guint component_id)
{
- Component *component;
+ NiceComponent *component;
GSList * ret = NULL;
GSList * item = NULL;
@@ -4603,7 +4603,7 @@ nice_agent_get_remote_candidates (
guint stream_id,
guint component_id)
{
- Component *component;
+ NiceComponent *component;
GSList *ret = NULL, *item = NULL;
g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
@@ -4755,7 +4755,7 @@ gboolean
component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
{
SocketSource *socket_source = user_data;
- Component *component;
+ NiceComponent *component;
NiceAgent *agent;
NiceStream *stream;
gboolean has_io_callback;
@@ -4790,21 +4790,22 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
stream->id, component->id, NICE_COMPONENT_STATE_FAILED);
}
- component_detach_socket (component, socket_source->socket);
+ nice_component_detach_socket (component, socket_source->socket);
agent_unlock ();
g_object_unref (agent);
return G_SOURCE_REMOVE;
}
- has_io_callback = component_has_io_callback (component);
+ has_io_callback = nice_component_has_io_callback (component);
/* Choose which receive buffer to use. If we’re reading for
* nice_agent_attach_recv(), use a local static buffer. If we’re reading for
* nice_agent_recv_messages(), use the buffer provided by the client.
*
* has_io_callback cannot change throughout this function, as we operate
- * entirely with the agent lock held, and component_set_io_callback() would
- * need to take the agent lock to change the Component’s io_callback. */
+ * entirely with the agent lock held, and nice_component_set_io_callback()
+ * would need to take the agent lock to change the Component’s
+ * io_callback. */
g_assert (!has_io_callback || component->recv_messages == NULL);
if (agent->reliable && !nice_socket_is_reliable (socket_source->socket)) {
@@ -4869,7 +4870,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
break;
}
- has_io_callback = component_has_io_callback (component);
+ has_io_callback = nice_component_has_io_callback (component);
}
} else if (has_io_callback) {
while (has_io_callback) {
@@ -4896,13 +4897,13 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
}
if (retval == RECV_SUCCESS && local_message.length > 0)
- component_emit_io_callback (component, local_buf, local_message.length);
+ nice_component_emit_io_callback (component, local_buf, local_message.length);
if (g_source_is_destroyed (g_main_current_source ())) {
nice_debug ("Component IO source disappeared during the callback");
goto out;
}
- has_io_callback = component_has_io_callback (component);
+ has_io_callback = nice_component_has_io_callback (component);
}
} else if (component->recv_messages != NULL) {
RecvStatus retval;
@@ -4977,7 +4978,7 @@ nice_agent_attach_recv (
NiceAgentRecvFunc func,
gpointer data)
{
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *stream = NULL;
gboolean ret = FALSE;
@@ -5000,8 +5001,8 @@ nice_agent_attach_recv (
ctx = g_main_context_default ();
/* Set the component’s I/O context. */
- component_set_io_context (component, ctx);
- component_set_io_callback (component, func, data, NULL, 0, NULL);
+ nice_component_set_io_context (component, ctx);
+ nice_component_set_io_callback (component, func, data, NULL, 0, NULL);
ret = TRUE;
if (func) {
@@ -5029,7 +5030,7 @@ nice_agent_set_selected_pair (
const gchar *lfoundation,
const gchar *rfoundation)
{
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
CandidatePair pair;
gboolean ret = FALSE;
@@ -5047,7 +5048,7 @@ nice_agent_set_selected_pair (
goto done;
}
- if (!component_find_pair (component, agent, lfoundation, rfoundation, &pair)){
+ if (!nice_component_find_pair (component, agent, lfoundation, rfoundation, &pair)){
goto done;
}
@@ -5076,7 +5077,7 @@ nice_agent_set_selected_pair (
NICE_COMPONENT_STATE_READY);
/* step: set the selected pair */
- component_update_selected_pair (component, &pair);
+ nice_component_update_selected_pair (component, &pair);
agent_signal_new_selected_pair (agent, stream_id, component_id,
pair.local, pair.remote);
@@ -5091,7 +5092,7 @@ NICEAPI_EXPORT gboolean
nice_agent_get_selected_pair (NiceAgent *agent, guint stream_id,
guint component_id, NiceCandidate **local, NiceCandidate **remote)
{
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
gboolean ret = FALSE;
@@ -5124,7 +5125,7 @@ NICEAPI_EXPORT GSocket *
nice_agent_get_selected_socket (NiceAgent *agent, guint stream_id,
guint component_id)
{
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
NiceSocket *nice_socket;
GSocket *g_socket = NULL;
@@ -5204,7 +5205,7 @@ nice_agent_set_selected_remote_candidate (
guint component_id,
NiceCandidate *candidate)
{
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
NiceCandidate *lcandidate = NULL;
gboolean ret = FALSE;
@@ -5232,7 +5233,7 @@ nice_agent_set_selected_remote_candidate (
priority = component->selected_pair.priority;
/* step: set the selected pair */
- lcandidate = component_set_selected_remote_candidate (agent, component,
+ lcandidate = nice_component_set_selected_remote_candidate (component, agent,
candidate);
if (!lcandidate)
goto done;
@@ -5312,7 +5313,7 @@ nice_agent_set_stream_tos (NiceAgent *agent,
stream->tos = tos;
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
+ NiceComponent *component = i->data;
for (j = component->local_candidates; j; j = j->next) {
NiceCandidate *local_candidate = j->data;
@@ -5415,14 +5416,14 @@ nice_agent_get_stream_name (NiceAgent *agent, guint stream_id)
static NiceCandidate *
_get_default_local_candidate_locked (NiceAgent *agent,
- NiceStream *stream, Component *component)
+ NiceStream *stream, NiceComponent *component)
{
GSList *i;
NiceCandidate *default_candidate = NULL;
NiceCandidate *default_rtp_candidate = NULL;
if (component->id != NICE_COMPONENT_TYPE_RTP) {
- Component *rtp_component;
+ NiceComponent *rtp_component;
if (!agent_find_component (agent, stream->id, NICE_COMPONENT_TYPE_RTP,
NULL, &rtp_component))
@@ -5463,7 +5464,7 @@ nice_agent_get_default_local_candidate (NiceAgent *agent,
guint stream_id, guint component_id)
{
NiceStream *stream = NULL;
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceCandidate *default_candidate = NULL;
g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
@@ -5578,7 +5579,7 @@ _generate_stream_sdp (NiceAgent *agent, NiceStream *stream,
/* Find default candidates */
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
+ NiceComponent *component = i->data;
NiceCandidate *default_candidate;
if (component->id == NICE_COMPONENT_TYPE_RTP) {
@@ -5607,7 +5608,7 @@ _generate_stream_sdp (NiceAgent *agent, NiceStream *stream,
g_string_append_printf (sdp, "a=ice-pwd:%s\n", stream->local_password);
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
+ NiceComponent *component = i->data;
for (j = component->local_candidates; j; j = j->next) {
NiceCandidate *candidate = j->data;
@@ -5737,7 +5738,7 @@ nice_agent_parse_remote_sdp (NiceAgent *agent, const gchar *sdp)
NICE_STREAM_MAX_PWD);
} else if (g_str_has_prefix (sdp_lines[i], "a=candidate:")) {
NiceCandidate *candidate = NULL;
- Component *component = NULL;
+ NiceComponent *component = NULL;
GSList *cands = NULL;
gint added;
@@ -5960,7 +5961,7 @@ nice_agent_get_io_stream (NiceAgent *agent, guint stream_id,
guint component_id)
{
GIOStream *iostream = NULL;
- Component *component;
+ NiceComponent *component;
g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
g_return_val_if_fail (stream_id >= 1, NULL);
@@ -5987,7 +5988,7 @@ nice_agent_get_io_stream (NiceAgent *agent, guint stream_id,
NICEAPI_EXPORT gboolean
nice_agent_forget_relays (NiceAgent *agent, guint stream_id, guint component_id)
{
- Component *component;
+ NiceComponent *component;
gboolean ret = TRUE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
@@ -6001,7 +6002,7 @@ nice_agent_forget_relays (NiceAgent *agent, guint stream_id, guint component_id)
goto done;
}
- component_clean_turn_servers (component);
+ nice_component_clean_turn_servers (component);
done:
agent_unlock_and_emit (agent);
@@ -6049,7 +6050,7 @@ nice_agent_get_component_state (NiceAgent *agent,
guint stream_id, guint component_id)
{
NiceComponentState state = NICE_COMPONENT_STATE_FAILED;
- Component *component;
+ NiceComponent *component;
agent_lock ();
diff --git a/agent/component.c b/agent/component.c
index 3d12da9..d6712f4 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -79,9 +79,9 @@ static void
nice_component_finalize (GObject *obj);
static void
-component_schedule_io_callback (Component *component);
+nice_component_schedule_io_callback (NiceComponent *component);
static void
-component_deschedule_io_callback (Component *component);
+nice_component_deschedule_io_callback (NiceComponent *component);
void
@@ -92,7 +92,7 @@ incoming_check_free (IncomingCheck *icheck)
}
/* Must *not* take the agent lock, since it’s called from within
- * component_set_io_context(), which holds the Component’s I/O lock. */
+ * nice_component_set_io_context(), which holds the Component’s I/O lock. */
static void
socket_source_attach (SocketSource *socket_source, GMainContext *context)
{
@@ -139,8 +139,8 @@ socket_source_free (SocketSource *source)
g_slice_free (SocketSource, source);
}
-Component *
-component_new (guint id, NiceAgent *agent, NiceStream *stream)
+NiceComponent *
+nice_component_new (guint id, NiceAgent *agent, NiceStream *stream)
{
return g_object_new (NICE_TYPE_COMPONENT,
"id", id,
@@ -150,7 +150,7 @@ component_new (guint id, NiceAgent *agent, NiceStream *stream)
}
void
-component_clean_turn_servers (Component *cmp)
+nice_component_clean_turn_servers (NiceComponent *cmp)
{
GSList *i;
@@ -181,7 +181,7 @@ component_clean_turn_servers (Component *cmp)
discovery_prune_socket (cmp->agent, cmp->turn_candidate->sockptr);
conn_check_prune_socket (cmp->agent, cmp->stream, cmp,
cmp->turn_candidate->sockptr);
- component_detach_socket (cmp, cmp->turn_candidate->sockptr);
+ nice_component_detach_socket (cmp, cmp->turn_candidate->sockptr);
nice_candidate_free (cmp->turn_candidate);
}
/* Bring the priority down to 0, so that it will be replaced
@@ -194,7 +194,7 @@ component_clean_turn_servers (Component *cmp)
discovery_prune_socket (cmp->agent, candidate->sockptr);
conn_check_prune_socket (cmp->agent, cmp->stream, cmp,
candidate->sockptr);
- component_detach_socket (cmp, candidate->sockptr);
+ nice_component_detach_socket (cmp, candidate->sockptr);
agent_remove_local_candidate (cmp->agent, candidate);
nice_candidate_free (candidate);
}
@@ -204,7 +204,7 @@ component_clean_turn_servers (Component *cmp)
}
static void
-component_clear_selected_pair (Component *component)
+nice_component_clear_selected_pair (NiceComponent *component)
{
if (component->selected_pair.keepalive.tick_source != NULL) {
g_source_destroy (component->selected_pair.keepalive.tick_source);
@@ -218,7 +218,7 @@ component_clear_selected_pair (Component *component)
/* Must be called with the agent lock held as it touches internal Component
* state. */
void
-component_close (Component *cmp)
+nice_component_close (NiceComponent *cmp)
{
IOCallbackData *data;
GOutputVector *vec;
@@ -226,13 +226,13 @@ component_close (Component *cmp)
/* Start closing the pseudo-TCP socket first. FIXME: There is a very big and
* reliably triggerable race here. pseudo_tcp_socket_close() does not block
* on the socket closing — it only sends the first packet of the FIN
- * handshake. component_close() will immediately afterwards close the
+ * handshake. nice_component_close() will immediately afterwards close the
* underlying component sockets, aborting the handshake.
*
* On the principle that starting the FIN handshake is better than not
* starting it, even if it’s later truncated, call pseudo_tcp_socket_close().
- * A long-term fix is needed in the form of making component_close() (and all
- * its callers) async, so we can properly block on closure. */
+ * A long-term fix is needed in the form of making nice_component_close() (and
+ * all its callers) async, so we can properly block on closure. */
if (cmp->tcp) {
pseudo_tcp_socket_close (cmp->tcp, TRUE);
}
@@ -255,12 +255,12 @@ component_close (Component *cmp)
g_slist_free_full (cmp->remote_candidates,
(GDestroyNotify) nice_candidate_free);
cmp->remote_candidates = NULL;
- component_free_socket_sources (cmp);
+ nice_component_free_socket_sources (cmp);
g_slist_free_full (cmp->incoming_checks,
(GDestroyNotify) incoming_check_free);
cmp->incoming_checks = NULL;
- component_clean_turn_servers (cmp);
+ nice_component_clean_turn_servers (cmp);
if (cmp->tcp_clock) {
g_source_destroy (cmp->tcp_clock);
@@ -275,7 +275,7 @@ component_close (Component *cmp)
while ((data = g_queue_pop_head (&cmp->pending_io_messages)) != NULL)
io_callback_data_free (data);
- component_deschedule_io_callback (cmp);
+ nice_component_deschedule_io_callback (cmp);
g_cancellable_cancel (cmp->stop_cancellable);
@@ -285,21 +285,13 @@ component_close (Component *cmp)
}
}
-/* Must be called with the agent lock released as it could dispose of
- * NiceIOStreams. */
-void
-component_free (Component *cmp)
-{
- g_object_unref (cmp);
-}
-
/*
* Finds a candidate pair that has matching foundation ids.
*
* @return TRUE if pair found, pointer to pair stored at 'pair'
*/
gboolean
-component_find_pair (Component *cmp, NiceAgent *agent, const gchar *lfoundation, const gchar *rfoundation, CandidatePair *pair)
+nice_component_find_pair (NiceComponent *cmp, NiceAgent *agent, const gchar *lfoundation, const gchar *rfoundation, CandidatePair *pair)
{
GSList *i;
CandidatePair result = { 0, };
@@ -335,7 +327,7 @@ component_find_pair (Component *cmp, NiceAgent *agent, const gchar *lfoundation,
* session.
*/
void
-component_restart (Component *cmp)
+nice_component_restart (NiceComponent *cmp)
{
GSList *i;
@@ -370,7 +362,8 @@ component_restart (Component *cmp)
* Changes the selected pair for the component to 'pair'. Does not
* emit the "selected-pair-changed" signal.
*/
-void component_update_selected_pair (Component *component, const CandidatePair *pair)
+void
+nice_component_update_selected_pair (NiceComponent *component, const CandidatePair *pair)
{
g_assert (component);
g_assert (pair);
@@ -385,12 +378,12 @@ void component_update_selected_pair (Component *component, const CandidatePair *
component->turn_candidate->sockptr);
conn_check_prune_socket (component->agent, component->stream, component,
component->turn_candidate->sockptr);
- component_detach_socket (component, component->turn_candidate->sockptr);
+ nice_component_detach_socket (component, component->turn_candidate->sockptr);
nice_candidate_free (component->turn_candidate);
component->turn_candidate = NULL;
}
- component_clear_selected_pair (component);
+ nice_component_clear_selected_pair (component);
component->selected_pair.local = pair->local;
component->selected_pair.remote = pair->remote;
@@ -405,7 +398,7 @@ void component_update_selected_pair (Component *component, const CandidatePair *
* @return pointer to candidate or NULL if not found
*/
NiceCandidate *
-component_find_remote_candidate (const Component *component, const NiceAddress *addr, NiceCandidateTransport transport)
+nice_component_find_remote_candidate (NiceComponent *component, const NiceAddress *addr, NiceCandidateTransport transport)
{
GSList *i;
@@ -429,8 +422,8 @@ component_find_remote_candidate (const Component *component, const NiceAddress *
*/
NiceCandidate *
-component_set_selected_remote_candidate (NiceAgent *agent, Component *component,
- NiceCandidate *candidate)
+nice_component_set_selected_remote_candidate (NiceComponent *component,
+ NiceAgent *agent, NiceCandidate *candidate)
{
NiceCandidate *local = NULL;
NiceCandidate *remote = NULL;
@@ -459,7 +452,7 @@ component_set_selected_remote_candidate (NiceAgent *agent, Component *component,
if (local == NULL)
return NULL;
- remote = component_find_remote_candidate (component, &candidate->addr,
+ remote = nice_component_find_remote_candidate (component, &candidate->addr,
candidate->transport);
if (!remote) {
@@ -469,7 +462,7 @@ component_set_selected_remote_candidate (NiceAgent *agent, Component *component,
agent_signal_new_remote_candidate (agent, remote);
}
- component_clear_selected_pair (component);
+ nice_component_clear_selected_pair (component);
component->selected_pair.local = local;
component->selected_pair.remote = remote;
@@ -490,7 +483,7 @@ _find_socket_source (gconstpointer a, gconstpointer b)
/* This takes ownership of the socket.
* It creates and attaches a source to the component’s context. */
void
-component_attach_socket (Component *component, NiceSocket *nicesock)
+nice_component_attach_socket (NiceComponent *component, NiceSocket *nicesock)
{
GSList *l;
SocketSource *socket_source;
@@ -531,9 +524,9 @@ component_attach_socket (Component *component, NiceSocket *nicesock)
/* Reattaches socket handles of @component to the main context.
*
* Must *not* take the agent lock, since it’s called from within
- * component_set_io_context(), which holds the Component’s I/O lock. */
+ * nice_component_set_io_context(), which holds the Component’s I/O lock. */
static void
-component_reattach_all_sockets (Component *component)
+nice_component_reattach_all_sockets (NiceComponent *component)
{
GSList *i;
@@ -546,7 +539,7 @@ component_reattach_all_sockets (Component *component)
}
/**
- * component_detach_socket:
+ * nice_component_detach_socket:
* @component: a #Component
* @socket: the socket to detach the source for
*
@@ -556,7 +549,7 @@ component_reattach_all_sockets (Component *component)
* If the @socket doesn’t exist in this @component, do nothing.
*/
void
-component_detach_socket (Component *component, NiceSocket *nicesock)
+nice_component_detach_socket (NiceComponent *component, NiceSocket *nicesock)
{
GSList *l;
SocketSource *socket_source;
@@ -597,10 +590,10 @@ component_detach_socket (Component *component, NiceSocket *nicesock)
* sockets themselves untouched.
*
* Must *not* take the agent lock, since it’s called from within
- * component_set_io_context(), which holds the Component’s I/O lock.
+ * nice_component_set_io_context(), which holds the Component’s I/O lock.
*/
void
-component_detach_all_sockets (Component *component)
+nice_component_detach_all_sockets (NiceComponent *component)
{
GSList *i;
@@ -613,7 +606,7 @@ component_detach_all_sockets (Component *component)
}
void
-component_free_socket_sources (Component *component)
+nice_component_free_socket_sources (NiceComponent *component)
{
nice_debug ("Free socket sources for component %p.", component);
@@ -622,11 +615,11 @@ component_free_socket_sources (Component *component)
component->socket_sources = NULL;
component->socket_sources_age++;
- component_clear_selected_pair (component);
+ nice_component_clear_selected_pair (component);
}
GMainContext *
-component_dup_io_context (Component *component)
+nice_component_dup_io_context (NiceComponent *component)
{
return g_main_context_ref (component->own_ctx);
}
@@ -634,7 +627,7 @@ component_dup_io_context (Component *component)
/* If @context is %NULL, it's own context is used, so component->ctx is always
* guaranteed to be non-%NULL. */
void
-component_set_io_context (Component *component, GMainContext *context)
+nice_component_set_io_context (NiceComponent *component, GMainContext *context)
{
g_mutex_lock (&component->io_mutex);
@@ -644,11 +637,11 @@ component_set_io_context (Component *component, GMainContext *context)
else
g_main_context_ref (context);
- component_detach_all_sockets (component);
+ nice_component_detach_all_sockets (component);
g_main_context_unref (component->ctx);
component->ctx = context;
- component_reattach_all_sockets (component);
+ nice_component_reattach_all_sockets (component);
}
g_mutex_unlock (&component->io_mutex);
@@ -665,7 +658,7 @@ component_set_io_context (Component *component, GMainContext *context)
* emitted for it (which could cause data loss if the I/O callback function was
* unset in that time). */
void
-component_set_io_callback (Component *component,
+nice_component_set_io_callback (NiceComponent *component,
NiceAgentRecvFunc func, gpointer user_data,
NiceInputMessage *recv_messages, guint n_recv_messages,
GError **error)
@@ -682,14 +675,14 @@ component_set_io_callback (Component *component,
component->recv_messages = NULL;
component->n_recv_messages = 0;
- component_schedule_io_callback (component);
+ nice_component_schedule_io_callback (component);
} else {
component->io_callback = NULL;
component->io_user_data = NULL;
component->recv_messages = recv_messages;
component->n_recv_messages = n_recv_messages;
- component_deschedule_io_callback (component);
+ nice_component_deschedule_io_callback (component);
}
nice_input_message_iter_reset (&component->recv_messages_iter);
@@ -699,7 +692,7 @@ component_set_io_callback (Component *component,
}
gboolean
-component_has_io_callback (Component *component)
+nice_component_has_io_callback (NiceComponent *component)
{
gboolean has_io_callback;
@@ -735,7 +728,7 @@ io_callback_data_free (IOCallbackData *data)
static gboolean
emit_io_callback_cb (gpointer user_data)
{
- Component *component = user_data;
+ NiceComponent *component = user_data;
IOCallbackData *data;
NiceAgentRecvFunc io_callback;
gpointer io_user_data;
@@ -752,7 +745,7 @@ emit_io_callback_cb (gpointer user_data)
g_mutex_lock (&component->io_mutex);
/* The members of Component are guaranteed not to have changed since this
- * GSource was attached in component_emit_io_callback(). The Component’s agent
+ * GSource was attached in nice_component_emit_io_callback(). The Component’s agent
* and stream are immutable after construction, as are the stream and
* component IDs. The callback and its user data may have changed, but are
* guaranteed to be non-%NULL at the start as the idle source is removed when
@@ -762,7 +755,7 @@ emit_io_callback_cb (gpointer user_data)
*
* If the component is destroyed (which happens if the agent or stream are
* destroyed) between attaching the GSource and firing it, the GSource is
- * detached in component_free() and this callback is never invoked. If the
+ * detached during dispose and this callback is never invoked. If the
* agent is destroyed during an io_callback, its weak pointer will be
* nullified. Similarly, the Component needs to be re-queried for after every
* iteration, just in case the client has removed the stream in the
@@ -805,7 +798,7 @@ emit_io_callback_cb (gpointer user_data)
/* This must be called with the agent lock *held*. */
void
-component_emit_io_callback (Component *component,
+nice_component_emit_io_callback (NiceComponent *component,
const guint8 *buf, gsize buf_len)
{
NiceAgent *agent;
@@ -857,7 +850,7 @@ component_emit_io_callback (Component *component,
nice_debug ("%s: **WARNING: SLOW PATH**", G_STRFUNC);
- component_schedule_io_callback (component);
+ nice_component_schedule_io_callback (component);
g_mutex_unlock (&component->io_mutex);
}
@@ -865,7 +858,7 @@ component_emit_io_callback (Component *component,
/* Note: Must be called with the io_mutex held. */
static void
-component_schedule_io_callback (Component *component)
+nice_component_schedule_io_callback (NiceComponent *component)
{
GSource *source;
@@ -888,7 +881,7 @@ component_schedule_io_callback (Component *component)
/* Note: Must be called with the io_mutex held. */
static void
-component_deschedule_io_callback (Component *component)
+nice_component_deschedule_io_callback (NiceComponent *component)
{
/* Already descheduled? */
if (component->io_callback_id == 0)
@@ -983,8 +976,8 @@ nice_component_init (NiceComponent *component)
/* Start off with a fresh main context and all I/O paused. This
* will be updated when nice_agent_attach_recv() or nice_agent_recv_messages()
* are called. */
- component_set_io_context (component, NULL);
- component_set_io_callback (component, NULL, NULL, NULL, 0, NULL);
+ nice_component_set_io_context (component, NULL);
+ nice_component_set_io_callback (component, NULL, NULL, NULL, 0, NULL);
g_queue_init (&component->queued_tcp_packets);
}
@@ -1136,7 +1129,7 @@ component_source_prepare (GSource *source, gint *timeout_)
{
ComponentSource *component_source = (ComponentSource *) source;
NiceAgent *agent;
- Component *component;
+ NiceComponent *component;
GSList *parentl, *childl;
agent = g_weak_ref_get (&component_source->agent_ref);
@@ -1306,7 +1299,7 @@ static GSourceFuncs component_source_funcs = {
* Returns: (transfer full): a new #ComponentSource; unref with g_source_unref()
*/
GSource *
-component_input_source_new (NiceAgent *agent, guint stream_id,
+nice_component_input_source_new (NiceAgent *agent, guint stream_id,
guint component_id, GPollableInputStream *pollable_istream,
GCancellable *cancellable)
{
diff --git a/agent/component.h b/agent/component.h
index 9ef3127..bc5d0c7 100644
--- a/agent/component.h
+++ b/agent/component.h
@@ -42,8 +42,7 @@
#include <glib.h>
-typedef struct _Component Component G_GNUC_DEPRECATED_FOR(NiceComponent);
-typedef Component NiceComponent;
+typedef struct _NiceComponent NiceComponent;
#include "agent.h"
#include "agent-priv.h"
@@ -111,7 +110,7 @@ incoming_check_free (IncomingCheck *icheck);
typedef struct {
NiceSocket *socket;
GSource *source;
- Component *component;
+ NiceComponent *component;
} SocketSource;
@@ -150,8 +149,7 @@ io_callback_data_free (IOCallbackData *data);
#define NICE_COMPONENT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_COMPONENT, NiceComponentClass))
-struct _Component
-{
+struct _NiceComponent {
/*< private >*/
GObject parent;
@@ -233,82 +231,64 @@ typedef struct {
GType nice_component_get_type (void);
-G_DEPRECATED
-Component *
-component_new (guint component_id, NiceAgent *agent, NiceStream *stream);
-
-G_DEPRECATED
-void
-component_close (Component *cmp);
+NiceComponent *
+nice_component_new (guint component_id, NiceAgent *agent, NiceStream *stream);
-G_DEPRECATED_FOR(g_object_unref)
void
-component_free (Component *cmp);
+nice_component_close (NiceComponent *component);
-G_DEPRECATED
gboolean
-component_find_pair (Component *cmp, NiceAgent *agent, const gchar *lfoundation, const gchar *rfoundation, CandidatePair *pair);
+nice_component_find_pair (NiceComponent *component, NiceAgent *agent,
+ const gchar *lfoundation, const gchar *rfoundation, CandidatePair *pair);
-G_DEPRECATED
void
-component_restart (Component *cmp);
+nice_component_restart (NiceComponent *component);
-G_DEPRECATED
void
-component_update_selected_pair (Component *component, const CandidatePair *pair);
+nice_component_update_selected_pair (NiceComponent *component,
+ const CandidatePair *pair);
-G_DEPRECATED
NiceCandidate *
-component_find_remote_candidate (const Component *component, const NiceAddress *addr, NiceCandidateTransport transport);
+nice_component_find_remote_candidate (NiceComponent *component,
+ const NiceAddress *addr, NiceCandidateTransport transport);
-G_DEPRECATED
NiceCandidate *
-component_set_selected_remote_candidate (NiceAgent *agent, Component *component,
- NiceCandidate *candidate);
+nice_component_set_selected_remote_candidate (NiceComponent *component,
+ NiceAgent *agent, NiceCandidate *candidate);
-G_DEPRECATED
void
-component_attach_socket (Component *component, NiceSocket *nsocket);
+nice_component_attach_socket (NiceComponent *component, NiceSocket *nsocket);
-G_DEPRECATED
void
-component_detach_socket (Component *component, NiceSocket *nsocket);
+nice_component_detach_socket (NiceComponent *component, NiceSocket *nsocket);
-G_DEPRECATED
void
-component_detach_all_sockets (Component *component);
+nice_component_detach_all_sockets (NiceComponent *component);
-G_DEPRECATED
void
-component_free_socket_sources (Component *component);
+nice_component_free_socket_sources (NiceComponent *component);
GSource *
-component_input_source_new (NiceAgent *agent, guint stream_id,
+nice_component_input_source_new (NiceAgent *agent, guint stream_id,
guint component_id, GPollableInputStream *pollable_istream,
GCancellable *cancellable);
-G_DEPRECATED
GMainContext *
-component_dup_io_context (Component *component);
-G_DEPRECATED
+nice_component_dup_io_context (NiceComponent *component);
void
-component_set_io_context (Component *component, GMainContext *context);
-G_DEPRECATED
+nice_component_set_io_context (NiceComponent *component, GMainContext *context);
void
-component_set_io_callback (Component *component,
+nice_component_set_io_callback (NiceComponent *component,
NiceAgentRecvFunc func, gpointer user_data,
NiceInputMessage *recv_messages, guint n_recv_messages,
GError **error);
-G_DEPRECATED
void
-component_emit_io_callback (Component *component,
+nice_component_emit_io_callback (NiceComponent *component,
const guint8 *buf, gsize buf_len);
-G_DEPRECATED
gboolean
-component_has_io_callback (Component *component);
-G_DEPRECATED
+nice_component_has_io_callback (NiceComponent *component);
void
-component_clean_turn_servers (Component *component);
+nice_component_clean_turn_servers (NiceComponent *component);
TurnServer *
diff --git a/agent/conncheck.c b/agent/conncheck.c
index c0fc279..60d2fbf 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -62,17 +62,17 @@
#include "stun/usages/turn.h"
static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStream *stream);
-static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream *stream, Component *component);
+static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream *stream, NiceComponent *component);
static guint priv_prune_pending_checks (NiceStream *stream, guint component_id);
-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, NiceStream *stream, Component *component, NiceCandidate *remotecand);
+static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate);
+static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceCandidate *remotecand);
static size_t priv_create_username (NiceAgent *agent, NiceStream *stream,
guint component_id, NiceCandidate *remote, NiceCandidate *local,
uint8_t *dest, guint dest_len, gboolean inbound);
static size_t priv_get_password (NiceAgent *agent, NiceStream *stream,
NiceCandidate *remote, uint8_t **password);
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, NiceComponent *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state);
static int priv_timer_expired (GTimeVal *timer, GTimeVal *now)
{
@@ -245,7 +245,7 @@ static void
candidate_check_pair_fail (NiceStream *stream, NiceAgent *agent, CandidateCheckPair *p)
{
StunTransactionId id;
- Component *component;
+ NiceComponent *component;
component = nice_stream_find_component_by_id (stream, p->component_id);
@@ -365,7 +365,7 @@ static gboolean priv_conn_check_tick_stream (NiceStream *stream, NiceAgent *agen
for (component_item = stream->components; component_item;
component_item = component_item->next) {
- Component *component = component_item->data;
+ NiceComponent *component = component_item->data;
for (k = stream->conncheck_list; k ; k = k->next) {
CandidateCheckPair *p = k->data;
@@ -446,7 +446,7 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent)
NiceStream *stream = i->data;
priv_update_check_list_failed_components (agent, stream);
for (j = stream->components; j; j = j->next) {
- Component *component = j->data;
+ NiceComponent *component = j->data;
priv_update_check_list_state_for_ready (agent, stream, component);
}
}
@@ -512,7 +512,7 @@ static gboolean priv_conn_keepalive_retransmissions_tick (gpointer pointer)
{
/* Time out */
StunTransactionId id;
- Component *component;
+ NiceComponent *component;
if (!agent_find_component (pair->keepalive.agent,
pair->keepalive.stream_id, pair->keepalive.component_id,
@@ -620,7 +620,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) {
- Component *component = j->data;
+ NiceComponent *component = j->data;
if (component->selected_pair.local != NULL) {
CandidatePair *p = &component->selected_pair;
@@ -712,7 +712,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
for (i = agent->streams; i; i = i->next) {
NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) {
- Component *component = j->data;
+ NiceComponent *component = j->data;
if (component->state < NICE_COMPONENT_STATE_READY &&
agent->stun_server_ip) {
NiceAddress stun_server;
@@ -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 pair newly added connectivity check
*/
-static void priv_preprocess_conn_check_pending_data (NiceAgent *agent, NiceStream *stream, Component *component, CandidateCheckPair *pair)
+static void priv_preprocess_conn_check_pending_data (NiceAgent *agent, NiceStream *stream, NiceComponent *component, CandidateCheckPair *pair)
{
GSList *i;
for (i = component->incoming_checks; i; i = i->next) {
@@ -1048,7 +1048,7 @@ void conn_check_remote_candidates_set(NiceAgent *agent)
NiceStream *stream = i->data;
for (j = stream->conncheck_list; j ; j = j->next) {
CandidateCheckPair *pair = j->data;
- Component *component = nice_stream_find_component_by_id (stream, pair->component_id);
+ NiceComponent *component = nice_stream_find_component_by_id (stream, pair->component_id);
gboolean match = FALSE;
/* performn delayed processing of spec steps section 7.2.1.4,
@@ -1205,20 +1205,20 @@ static void priv_limit_conn_check_list_size (GSList *conncheck_list, guint upper
* and has higher priority than the currently selected pair. See
* ICE sect 11.1.1. "Procedures for Full Implementations" (ID-19).
*/
-static gboolean priv_update_selected_pair (NiceAgent *agent, Component *component, CandidateCheckPair *pair)
+static gboolean priv_update_selected_pair (NiceAgent *agent, NiceComponent *component, CandidateCheckPair *pair)
{
CandidatePair cpair;
g_assert (component);
g_assert (pair);
if (pair->priority > component->selected_pair.priority &&
- component_find_pair (component, agent, pair->local->foundation,
+ nice_component_find_pair (component, agent, pair->local->foundation,
pair->remote->foundation, &cpair)) {
nice_debug ("Agent %p : changing SELECTED PAIR for component %u: %s:%s "
"(prio:%" G_GUINT64_FORMAT ").", agent, component->id,
pair->local->foundation, pair->remote->foundation, pair->priority);
- component_update_selected_pair (component, &cpair);
+ nice_component_update_selected_pair (component, &cpair);
priv_conn_keepalive_tick_unlocked (agent);
@@ -1262,7 +1262,7 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStre
/* note: iterate the conncheck list for each component separately */
for (c = 0; c < components; c++) {
- Component *comp = NULL;
+ NiceComponent *comp = NULL;
if (!agent_find_component (agent, stream->id, c+1, NULL, &comp))
continue;
@@ -1300,7 +1300,7 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStre
*
* Sends a component state changesignal via 'agent'.
*/
-static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream *stream, Component *component)
+static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream *stream, NiceComponent *component)
{
GSList *i;
guint succeeded = 0, nominated = 0;
@@ -1347,7 +1347,7 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream
* described by 'component' and 'remotecand' is nominated
* for use.
*/
-static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, Component *component, NiceCandidate *remotecand)
+static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceCandidate *remotecand)
{
GSList *i;
@@ -1374,7 +1374,7 @@ static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, Comp
* Creates a new connectivity check pair and adds it to
* the agent's list of checks.
*/
-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, NiceComponent *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state, gboolean use_candidate)
{
NiceStream *stream;
CandidateCheckPair *pair;
@@ -1433,7 +1433,7 @@ conn_check_match_transport (NiceCandidateTransport transport)
}
static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent,
- guint stream_id, Component *component, NiceCandidate *local,
+ guint stream_id, NiceComponent *component, NiceCandidate *local,
NiceCandidate *remote, NiceCheckState initial_state)
{
nice_debug ("Agent %p, Adding check pair between %s and %s", agent,
@@ -1455,7 +1455,7 @@ static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent,
}
gboolean conn_check_add_for_candidate_pair (NiceAgent *agent,
- guint stream_id, Component *component, NiceCandidate *local,
+ guint stream_id, NiceComponent *component, NiceCandidate *local,
NiceCandidate *remote)
{
gboolean ret = FALSE;
@@ -1501,7 +1501,7 @@ gboolean conn_check_add_for_candidate_pair (NiceAgent *agent,
*
* @return number of checks added, negative on fatal errors
*/
-int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *remote)
+int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *remote)
{
GSList *i;
int added = 0;
@@ -1532,7 +1532,7 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
*
* @return number of checks added, negative on fatal errors
*/
-int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local)
+int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *local)
{
GSList *i;
int added = 0;
@@ -1836,7 +1836,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
uint8_t uname[NICE_STREAM_MAX_UNAME];
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
gsize uname_len;
uint8_t *password = NULL;
gsize password_len;
@@ -1914,7 +1914,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
if (pair->sockptr->fileno == NULL &&
pair->local->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE) {
NiceStream *stream2 = NULL;
- Component *component2 = NULL;
+ NiceComponent *component2 = NULL;
NiceSocket *new_socket;
if (agent_find_component (agent, pair->stream_id, pair->component_id,
@@ -1930,7 +1930,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
_tcp_sock_is_writable, component2);
}
- component_attach_socket (component2, new_socket);
+ nice_component_attach_socket (component2, new_socket);
}
}
}
@@ -2031,7 +2031,7 @@ static guint priv_prune_pending_checks (NiceStream *stream, guint component_id)
* @param remote_cand remote candidate from which the inbound check was sent
* @param use_candidate whether the original check had USE-CANDIDATE attribute set
*/
-static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *stream, Component *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate)
+static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *local_socket, NiceCandidate *remote_cand, gboolean use_candidate)
{
GSList *i;
NiceCandidate *local = NULL;
@@ -2137,7 +2137,7 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *str
*
* @pre (rcand == NULL || nice_address_equal(rcand->addr, toaddr) == TRUE)
*/
-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)
+static void priv_reply_to_conn_check (NiceAgent *agent, NiceStream *stream, NiceComponent *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);
@@ -2172,7 +2172,7 @@ static void priv_reply_to_conn_check (NiceAgent *agent, NiceStream *stream, Comp
*
* @return non-zero on error, zero on success
*/
-static int priv_store_pending_check (NiceAgent *agent, Component *component,
+static int priv_store_pending_check (NiceAgent *agent, NiceComponent *component,
const NiceAddress *from, NiceSocket *sockptr, uint8_t *username,
uint16_t username_len, uint32_t priority, gboolean use_candidate)
{
@@ -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
*/
-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)
+static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *agent, NiceStream *stream, NiceComponent *component, CandidateCheckPair *p, NiceSocket *sockptr, struct sockaddr *mapped_sockaddr, NiceCandidate *local_candidate, NiceCandidate *remote_candidate)
{
CandidateCheckPair *new_pair = NULL;
NiceAddress mapped;
@@ -2353,7 +2353,7 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
*
* @return TRUE if a matching transaction is found
*/
-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)
+static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *sockptr, const NiceAddress *from, NiceCandidate *local_candidate, NiceCandidate *remote_candidate, StunMessage *resp)
{
union {
struct sockaddr_storage storage;
@@ -2907,7 +2907,7 @@ static gboolean priv_map_reply_to_relay_refresh (NiceAgent *agent, StunMessage *
static gboolean priv_map_reply_to_keepalive_conncheck (NiceAgent *agent,
- Component *component, StunMessage *resp)
+ NiceComponent *component, StunMessage *resp)
{
StunTransactionId conncheck_id;
StunTransactionId response_id;
@@ -2936,7 +2936,7 @@ static gboolean priv_map_reply_to_keepalive_conncheck (NiceAgent *agent,
typedef struct {
NiceAgent *agent;
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
uint8_t *password;
} conncheck_validater_data;
@@ -3033,7 +3033,7 @@ static bool conncheck_stun_validater (StunAgent *agent,
* @return XXX (what FALSE means exactly?)
*/
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream,
- Component *component, NiceSocket *nicesock, const NiceAddress *from,
+ NiceComponent *component, NiceSocket *nicesock, const NiceAddress *from,
gchar *buf, guint len)
{
union {
@@ -3378,7 +3378,7 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream,
/* Remove all pointers to the given @sock from the connection checking process.
* These are entirely NiceCandidates pointed to from various places. */
void
-conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, Component *component,
+conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *component,
NiceSocket *sock)
{
GSList *l;
diff --git a/agent/conncheck.h b/agent/conncheck.h
index 90332fc..add89cf 100644
--- a/agent/conncheck.h
+++ b/agent/conncheck.h
@@ -94,19 +94,19 @@ struct _CandidateCheckPair
StunMessage stun_message;
};
-int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *remote);
-int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local);
-gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote);
+int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *remote);
+int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *local);
+gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *local, NiceCandidate *remote);
void conn_check_free (NiceAgent *agent);
gboolean conn_check_schedule_next (NiceAgent *agent);
int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream);
-gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, Component *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
+gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b);
void conn_check_remote_candidates_set(NiceAgent *agent);
NiceCandidateTransport conn_check_match_transport (NiceCandidateTransport transport);
void
-conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, Component *component,
+conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *component,
NiceSocket *sock);
#endif /*_NICE_CONNCHECK_H */
diff --git a/agent/discovery.c b/agent/discovery.c
index 25a7472..8910899 100644
--- a/agent/discovery.c
+++ b/agent/discovery.c
@@ -305,7 +305,7 @@ void refresh_cancel (CandidateRefresh *refresh)
* defined in ICE spec section 4.1.3 "Eliminating Redundant
* Candidates" (ID-19).
*/
-static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *candidate)
+static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *candidate)
{
GSList *i;
@@ -329,7 +329,7 @@ static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_
return TRUE;
}
-static guint priv_highest_remote_foundation (Component *component)
+static guint priv_highest_remote_foundation (NiceComponent *component)
{
GSList *i;
guint highest = 1;
@@ -384,7 +384,7 @@ static void priv_assign_foundation (NiceAgent *agent, NiceCandidate *candidate)
for (i = agent->streams; i; i = i->next) {
NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) {
- Component *component = j->data;
+ NiceComponent *component = j->data;
for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *n = k->data;
@@ -427,12 +427,12 @@ static void priv_assign_remote_foundation (NiceAgent *agent, NiceCandidate *cand
{
GSList *i, *j, *k;
guint next_remote_id;
- Component *component = NULL;
+ NiceComponent *component = NULL;
for (i = agent->streams; i; i = i->next) {
NiceStream *stream = i->data;
for (j = stream->components; j; j = j->next) {
- Component *c = j->data;
+ NiceComponent *c = j->data;
if (c->id == candidate->component_id)
component = c;
@@ -523,7 +523,7 @@ HostCandidateResult discovery_add_local_host_candidate (
NiceCandidate **outcandidate)
{
NiceCandidate *candidate;
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
NiceSocket *nicesock = NULL;
HostCandidateResult res = HOST_CANDIDATE_FAILED;
@@ -580,7 +580,7 @@ HostCandidateResult discovery_add_local_host_candidate (
}
_priv_set_socket_tos (agent, nicesock, stream->tos);
- component_attach_socket (component, nicesock);
+ nice_component_attach_socket (component, nicesock);
*outcandidate = candidate;
@@ -610,7 +610,7 @@ discovery_add_server_reflexive_candidate (
gboolean nat_assisted)
{
NiceCandidate *candidate;
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
gboolean result = FALSE;
@@ -670,7 +670,7 @@ discovery_discover_tcp_server_reflexive_candidates (
NiceAddress *address,
NiceSocket *base_socket)
{
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
NiceAddress base_addr = base_socket->addr;
GSList *i;
@@ -718,7 +718,7 @@ discovery_add_relay_candidate (
TurnServer *turn)
{
NiceCandidate *candidate;
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
NiceSocket *relay_socket = NULL;
@@ -769,7 +769,7 @@ discovery_add_relay_candidate (
if (!priv_add_local_candidate_pruned (agent, stream_id, component, candidate))
goto errors;
- component_attach_socket (component, relay_socket);
+ nice_component_attach_socket (component, relay_socket);
agent_signal_new_candidate (agent, candidate);
return candidate;
@@ -798,7 +798,7 @@ discovery_add_peer_reflexive_candidate (
NiceCandidate *remote)
{
NiceCandidate *candidate;
- Component *component;
+ NiceComponent *component;
NiceStream *stream;
gboolean result;
@@ -892,7 +892,7 @@ discovery_add_peer_reflexive_candidate (
NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
NiceAgent *agent,
NiceStream *stream,
- Component *component,
+ NiceComponent *component,
guint32 priority,
const NiceAddress *remote_address,
NiceSocket *nicesock,
diff --git a/agent/discovery.h b/agent/discovery.h
index 70d29e9..67e2186 100644
--- a/agent/discovery.h
+++ b/agent/discovery.h
@@ -54,7 +54,7 @@ typedef struct
gboolean pending; /* is discovery in progress? */
gboolean done; /* is discovery complete? */
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
TurnServer *turn;
StunAgent stun_agent;
StunTimer timer;
@@ -71,7 +71,7 @@ typedef struct
NiceAddress server; /* STUN/TURN server address */
NiceCandidate *candidate; /* candidate to refresh */
NiceStream *stream;
- Component *component;
+ NiceComponent *component;
StunAgent stun_agent;
GSource *timer_source;
GSource *tick_source;
@@ -152,7 +152,7 @@ NiceCandidate *
discovery_learn_remote_peer_reflexive_candidate (
NiceAgent *agent,
NiceStream *stream,
- Component *component,
+ NiceComponent *component,
guint32 priority,
const NiceAddress *remote_address,
NiceSocket *udp_socket,
diff --git a/agent/inputstream.c b/agent/inputstream.c
index 8e17c02..58a4a0d 100644
--- a/agent/inputstream.c
+++ b/agent/inputstream.c
@@ -332,7 +332,7 @@ nice_input_stream_close (GInputStream *stream, GCancellable *cancellable,
GError **error)
{
NiceInputStreamPrivate *priv = NICE_INPUT_STREAM (stream)->priv;
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *_stream = NULL;
NiceAgent *agent; /* owned */
@@ -361,7 +361,7 @@ static gboolean
nice_input_stream_is_readable (GPollableInputStream *stream)
{
NiceInputStreamPrivate *priv = NICE_INPUT_STREAM (stream)->priv;
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *_stream = NULL;
gboolean retval = FALSE;
GSList *i;
@@ -458,7 +458,7 @@ nice_input_stream_create_source (GPollableInputStream *stream,
if (agent == NULL)
goto dummy_source;
- component_source = component_input_source_new (agent, priv->stream_id,
+ component_source = nice_component_input_source_new (agent, priv->stream_id,
priv->component_id, stream, cancellable);
g_object_unref (agent);
diff --git a/agent/outputstream.c b/agent/outputstream.c
index 2ad004f..4c918a7 100644
--- a/agent/outputstream.c
+++ b/agent/outputstream.c
@@ -476,7 +476,7 @@ nice_output_stream_close (GOutputStream *stream, GCancellable *cancellable,
GError **error)
{
NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv;
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *_stream = NULL;
NiceAgent *agent; /* owned */
@@ -505,7 +505,7 @@ static gboolean
nice_output_stream_is_writable (GPollableOutputStream *stream)
{
NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv;
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *_stream = NULL;
gboolean retval = FALSE;
NiceAgent *agent; /* owned */
@@ -595,7 +595,7 @@ nice_output_stream_create_source (GPollableOutputStream *stream,
{
NiceOutputStreamPrivate *priv = NICE_OUTPUT_STREAM (stream)->priv;
GSource *component_source = NULL;
- Component *component = NULL;
+ NiceComponent *component = NULL;
NiceStream *_stream = NULL;
NiceAgent *agent; /* owned */
diff --git a/agent/stream.c b/agent/stream.c
index 505e140..8121e12 100644
--- a/agent/stream.c
+++ b/agent/stream.c
@@ -67,9 +67,9 @@ nice_stream_new (guint n_components, NiceAgent *agent)
/* Create the components. */
for (n = 0; n < n_components; n++) {
- Component *component = NULL;
+ NiceComponent *component = NULL;
- component = component_new (n + 1, agent, stream);
+ component = nice_component_new (n + 1, agent, stream);
stream->components = g_slist_append (stream->components, component);
}
@@ -84,18 +84,18 @@ nice_stream_close (NiceStream *stream)
GSList *i;
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
- component_close (component);
+ NiceComponent *component = i->data;
+ nice_component_close (component);
}
}
-Component *
+NiceComponent *
nice_stream_find_component_by_id (NiceStream *stream, guint id)
{
GSList *i;
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
+ NiceComponent *component = i->data;
if (component && component->id == id)
return component;
}
@@ -113,7 +113,7 @@ nice_stream_all_components_ready (NiceStream *stream)
GSList *i;
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
+ NiceComponent *component = i->data;
if (component &&
!(component->state == NICE_COMPONENT_STATE_CONNECTED ||
component->state == NICE_COMPONENT_STATE_READY))
@@ -153,9 +153,9 @@ nice_stream_restart (NiceStream *stream, NiceAgent *agent)
nice_stream_initialize_credentials (stream, agent->rng);
for (i = stream->components; i; i = i->next) {
- Component *component = i->data;
+ NiceComponent *component = i->data;
- component_restart (component);
+ nice_component_restart (component);
}
}
@@ -188,7 +188,7 @@ nice_stream_finalize (GObject *obj)
stream = NICE_STREAM (obj);
g_free (stream->name);
- g_slist_free_full (stream->components, (GDestroyNotify) component_free);
+ g_slist_free_full (stream->components, (GDestroyNotify) g_object_unref);
g_atomic_int_inc (&n_streams_destroyed);
nice_debug ("Destroyed NiceStream (%u created, %u destroyed)",
diff --git a/agent/stream.h b/agent/stream.h
index b3c4482..e524f62 100644
--- a/agent/stream.h
+++ b/agent/stream.h
@@ -79,7 +79,7 @@ struct _NiceStream {
guint id;
guint n_components;
gboolean initial_binding_request_received;
- GSList *components; /* list of 'Component' structs */
+ GSList *components; /* list of 'NiceComponent' objects */
GSList *conncheck_list; /* list of CandidateCheckPair items */
gchar local_ufrag[NICE_STREAM_MAX_UFRAG];
gchar local_password[NICE_STREAM_MAX_PWD];
@@ -105,7 +105,7 @@ nice_stream_close (NiceStream *stream);
gboolean
nice_stream_all_components_ready (NiceStream *stream);
-Component *
+NiceComponent *
nice_stream_find_component_by_id (NiceStream *stream, guint id);
void