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);
......
This diff is collapsed.
...@@ -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
......
This diff is collapsed.
...@@ -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