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