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 # component-status-changed
VOID:UINT,UINT,UINT VOID:UINT,UINT,UINT
# candidate-gathering-done
VOID:VOID
This diff is collapsed.
...@@ -71,11 +71,34 @@ G_BEGIN_DECLS ...@@ -71,11 +71,34 @@ G_BEGIN_DECLS
typedef enum typedef enum
{ {
NICE_COMPONENT_STATE_DISCONNECTED, NICE_COMPONENT_STATE_DISCONNECTED, /* no activity scheduled */
NICE_COMPONENT_STATE_CONNECTING, NICE_COMPONENT_STATE_GATHERING, /* gathering local candidates */
NICE_COMPONENT_STATE_CONNECTED, 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; } 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 struct _NiceAgent NiceAgent;
typedef void (*NiceAgentRecvFunc) ( typedef void (*NiceAgentRecvFunc) (
...@@ -87,6 +110,7 @@ struct _NiceAgent ...@@ -87,6 +110,7 @@ struct _NiceAgent
GObject parent; GObject parent;
guint next_candidate_id; guint next_candidate_id;
guint next_stream_id; guint next_stream_id;
gboolean full_mode;
NiceUDPSocketFactory *socket_factory; NiceUDPSocketFactory *socket_factory;
GSList *local_addresses; GSList *local_addresses;
GSList *streams; GSList *streams;
...@@ -94,7 +118,14 @@ struct _NiceAgent ...@@ -94,7 +118,14 @@ struct _NiceAgent
GMainContext *main_context; GMainContext *main_context;
NiceAgentRecvFunc read_func; NiceAgentRecvFunc read_func;
gpointer read_func_data; 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; NiceRNG *rng;
}; };
...@@ -133,6 +164,13 @@ nice_agent_add_remote_candidate ( ...@@ -133,6 +164,13 @@ nice_agent_add_remote_candidate (
const gchar *username, const gchar *username,
const gchar *password); const gchar *password);
void
nice_agent_set_remote_candidates (
NiceAgent *agent,
guint stream_id,
guint component_id,
GSList *candidates);
guint guint
nice_agent_recv ( nice_agent_recv (
NiceAgent *agent, NiceAgent *agent,
......
...@@ -65,6 +65,9 @@ nice_candidate_free (NiceCandidate *candidate) ...@@ -65,6 +65,9 @@ nice_candidate_free (NiceCandidate *candidate)
if (candidate->source) if (candidate->source)
g_source_destroy (candidate->source); g_source_destroy (candidate->source);
if (candidate->foundation)
g_free (candidate->foundation);
g_slice_free (NiceCandidate, candidate); g_slice_free (NiceCandidate, candidate);
} }
......
...@@ -50,23 +50,28 @@ typedef enum ...@@ -50,23 +50,28 @@ typedef enum
NICE_CANDIDATE_TYPE_RELAYED, NICE_CANDIDATE_TYPE_RELAYED,
} NiceCandidateType; } NiceCandidateType;
typedef enum
{
NICE_CANDIDATE_TRANSPORT_UDP,
} NiceCandidateTransport;
typedef struct _NiceCandidate NiceCandidate; typedef struct _NiceCandidate NiceCandidate;
struct _NiceCandidate struct _NiceCandidate
{ {
NiceCandidateType type; NiceCandidateType type;
guint id; NiceCandidateTransport transport;
guint id;
NiceAddress addr; NiceAddress addr;
NiceAddress base_addr; NiceAddress base_addr;
guint32 priority; guint32 priority;
guint stream_id; guint stream_id;
guint component_id; guint component_id;
// guint generation; // guint generation;
// gchar *foundation; gchar *foundation; /* note: if NULL, derive foundation from 'id' */
NiceUDPSocket sock; NiceUDPSocket sock;
gchar username[128]; gchar username[128]; /* XXX: why 128 chars? */
gchar password[128]; gchar password[128]; /* XXX: why 128 chars? */
GSource *source; 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