Commit 008739a5 authored by Philip Withnall's avatar Philip Withnall

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's avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D309
parent 529bc193
......@@ -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);
......
This diff is collapsed.
This diff is collapsed.
......@@ -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 *
......
This diff is collapsed.
......@@ -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 */
......@@ -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,
......
......@@ -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,
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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)",
......
......@@ -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
......
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