Commit b9ba0195 authored by Kai Vehmanen's avatar Kai Vehmanen

Added initial full-mode extensions to the API. Added support for gathering...

Added initial full-mode extensions to the API. Added support for gathering candidates using STUN binding discovery API.

darcs-hash:20070502142419-77cd4-6e295bdf89c80a6cdab778fe25e26c9e780ce2b5.gz
parent cde5ed64
# component-status-changed
VOID:UINT,UINT,UINT
# candidate-gathering-done
VOID:VOID
This diff is collapsed.
......@@ -71,11 +71,34 @@ G_BEGIN_DECLS
typedef enum
{
NICE_COMPONENT_STATE_DISCONNECTED,
NICE_COMPONENT_STATE_CONNECTING,
NICE_COMPONENT_STATE_CONNECTED,
NICE_COMPONENT_STATE_DISCONNECTED, /* no activity scheduled */
NICE_COMPONENT_STATE_GATHERING, /* gathering local candidates */
NICE_COMPONENT_STATE_CONNECTING, /* establishing connectivity */
NICE_COMPONENT_STATE_CONNECTED, /* at least one working candidate pair */
NICE_COMPONENT_STATE_READY, /* ICE concluded, candidate pair
selection is now final */
NICE_COMPONENT_STATE_FAILED /* connectivity checks have been completed,
but connectivity was not established */
} NiceComponentState;
typedef enum
{
NICE_COMPONENT_TYPE_RTP = 1,
NICE_COMPONENT_TYPE_RTCP = 2
} NiceComponentType;
typedef struct _NiceCandidateDesc NiceCandidateDesc;
struct _NiceCandidateDesc {
const gchar *foundation;
guint component_id;
NiceCandidateTransport transport;
guint32 priority;
const NiceAddress *addr;
NiceCandidateType type;
const NiceAddress *related_addr; /* optional */
};
typedef struct _NiceAgent NiceAgent;
typedef void (*NiceAgentRecvFunc) (
......@@ -87,6 +110,7 @@ struct _NiceAgent
GObject parent;
guint next_candidate_id;
guint next_stream_id;
gboolean full_mode;
NiceUDPSocketFactory *socket_factory;
GSList *local_addresses;
GSList *streams;
......@@ -94,7 +118,14 @@ struct _NiceAgent
GMainContext *main_context;
NiceAgentRecvFunc read_func;
gpointer read_func_data;
gchar *stun_server;
GSList *discovery_list;
guint discovery_unsched_items;
GSList *conncheck_list;
gchar *stun_server_ip;
guint stun_server_port;
gchar *turn_server_ip;
guint turn_server_port;
GTimeVal next_check_tv;
NiceRNG *rng;
};
......@@ -133,6 +164,13 @@ nice_agent_add_remote_candidate (
const gchar *username,
const gchar *password);
void
nice_agent_set_remote_candidates (
NiceAgent *agent,
guint stream_id,
guint component_id,
GSList *candidates);
guint
nice_agent_recv (
NiceAgent *agent,
......
......@@ -65,6 +65,9 @@ nice_candidate_free (NiceCandidate *candidate)
if (candidate->source)
g_source_destroy (candidate->source);
if (candidate->foundation)
g_free (candidate->foundation);
g_slice_free (NiceCandidate, candidate);
}
......
......@@ -50,23 +50,28 @@ typedef enum
NICE_CANDIDATE_TYPE_RELAYED,
} NiceCandidateType;
typedef enum
{
NICE_CANDIDATE_TRANSPORT_UDP,
} NiceCandidateTransport;
typedef struct _NiceCandidate NiceCandidate;
struct _NiceCandidate
{
NiceCandidateType type;
guint id;
NiceCandidateTransport transport;
guint id;
NiceAddress addr;
NiceAddress base_addr;
guint32 priority;
guint stream_id;
guint component_id;
// guint generation;
// gchar *foundation;
gchar *foundation; /* note: if NULL, derive foundation from 'id' */
NiceUDPSocket sock;
gchar username[128];
gchar password[128];
gchar username[128]; /* XXX: why 128 chars? */
gchar password[128]; /* XXX: why 128 chars? */
GSource *source;
};
......
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