| agent.h | | agent.h | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| <title>Simple example on how to use libnice</title> | | <title>Simple example on how to use libnice</title> | |
| <programlisting> | | <programlisting> | |
| NiceAddress base_addr; | | NiceAddress base_addr; | |
| guint stream_id; | | guint stream_id; | |
| gchar buffer[] = "hello world!"; | | gchar buffer[] = "hello world!"; | |
| GSList *lcands = NULL; | | GSList *lcands = NULL; | |
| | | | |
| // Create a nice agent | | // Create a nice agent | |
| NiceAgent *agent = nice_agent_new (NULL, NICE_COMPATIBILITY_DRAFT19); | | NiceAgent *agent = nice_agent_new (NULL, NICE_COMPATIBILITY_DRAFT19); | |
| | | | |
|
| // Specify which local interface to use | | | |
| nice_address_set_from_string (&base_addr, "127.0.0.1"); | | | |
| nice_agent_add_local_address (agent, &base_addr); | | | |
| | | | |
| // Connect the signals | | // Connect the signals | |
| g_signal_connect (G_OBJECT (agent), "candidate-gathering-done", | | g_signal_connect (G_OBJECT (agent), "candidate-gathering-done", | |
| G_CALLBACK (cb_candidate_gathering_done), NULL); | | G_CALLBACK (cb_candidate_gathering_done), NULL); | |
| g_signal_connect (G_OBJECT (lagent), "component-state-changed", | | g_signal_connect (G_OBJECT (lagent), "component-state-changed", | |
| G_CALLBACK (cb_component_state_changed), NULL); | | G_CALLBACK (cb_component_state_changed), NULL); | |
| g_signal_connect (G_OBJECT (lagent), "new-selected-pair", | | g_signal_connect (G_OBJECT (lagent), "new-selected-pair", | |
| G_CALLBACK (cb_new_selected_pair), NULL); | | G_CALLBACK (cb_new_selected_pair), NULL); | |
| | | | |
| // Create a new stream with one component and start gathering candidates | | // Create a new stream with one component and start gathering candidates | |
| stream_id = nice_agent_add_stream (agent, 1); | | stream_id = nice_agent_add_stream (agent, 1); | |
| | | | |
| skipping to change at line 155 | | skipping to change at line 151 | |
| struct _NiceAgentClass | | struct _NiceAgentClass | |
| { | | { | |
| GObjectClass parent_class; | | GObjectClass parent_class; | |
| }; | | }; | |
| | | | |
| GType nice_agent_get_type (void); | | GType nice_agent_get_type (void); | |
| | | | |
| /** | | /** | |
| * NICE_AGENT_MAX_REMOTE_CANDIDATES: | | * NICE_AGENT_MAX_REMOTE_CANDIDATES: | |
| * | | * | |
|
| * A hard limit for number for remote candidates. This | | * A hard limit for the number of remote candidates. This | |
| * limit is enforced to protect against malevolent remote | | * limit is enforced to protect against malevolent remote | |
| * clients. | | * clients. | |
| */ | | */ | |
| #define NICE_AGENT_MAX_REMOTE_CANDIDATES 25 | | #define NICE_AGENT_MAX_REMOTE_CANDIDATES 25 | |
| | | | |
| /** | | /** | |
| * NiceComponentState: | | * NiceComponentState: | |
| * @NICE_COMPONENT_STATE_DISCONNECTED: No activity scheduled | | * @NICE_COMPONENT_STATE_DISCONNECTED: No activity scheduled | |
| * @NICE_COMPONENT_STATE_GATHERING: Gathering local candidates | | * @NICE_COMPONENT_STATE_GATHERING: Gathering local candidates | |
| * @NICE_COMPONENT_STATE_CONNECTING: Establishing connectivity | | * @NICE_COMPONENT_STATE_CONNECTING: Establishing connectivity | |
| * @NICE_COMPONENT_STATE_CONNECTED: At least one working candidate pair | | * @NICE_COMPONENT_STATE_CONNECTED: At least one working candidate pair | |
| * @NICE_COMPONENT_STATE_READY: ICE concluded, candidate pair selection | | * @NICE_COMPONENT_STATE_READY: ICE concluded, candidate pair selection | |
| * is now final | | * is now final | |
| * @NICE_COMPONENT_STATE_FAILED: Connectivity checks have been completed, | | * @NICE_COMPONENT_STATE_FAILED: Connectivity checks have been completed, | |
| * but connectivity was not established | | * but connectivity was not established | |
| * @NICE_COMPONENT_STATE_LAST: Dummy state | | * @NICE_COMPONENT_STATE_LAST: Dummy state | |
| * | | * | |
| * An enum representing the state of a component. | | * An enum representing the state of a component. | |
|
| * See #NiceAgent::component-state-changed | | * <para> See also: #NiceAgent::component-state-changed </para> | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| NICE_COMPONENT_STATE_DISCONNECTED, | | NICE_COMPONENT_STATE_DISCONNECTED, | |
| NICE_COMPONENT_STATE_GATHERING, | | NICE_COMPONENT_STATE_GATHERING, | |
| NICE_COMPONENT_STATE_CONNECTING, | | NICE_COMPONENT_STATE_CONNECTING, | |
| NICE_COMPONENT_STATE_CONNECTED, | | NICE_COMPONENT_STATE_CONNECTED, | |
| NICE_COMPONENT_STATE_READY, | | NICE_COMPONENT_STATE_READY, | |
| NICE_COMPONENT_STATE_FAILED, | | NICE_COMPONENT_STATE_FAILED, | |
| NICE_COMPONENT_STATE_LAST | | NICE_COMPONENT_STATE_LAST | |
| | | | |
| skipping to change at line 212 | | skipping to change at line 208 | |
| { | | { | |
| NICE_COMPONENT_TYPE_RTP = 1, | | NICE_COMPONENT_TYPE_RTP = 1, | |
| NICE_COMPONENT_TYPE_RTCP = 2 | | NICE_COMPONENT_TYPE_RTCP = 2 | |
| } NiceComponentType; | | } NiceComponentType; | |
| | | | |
| /** | | /** | |
| * NiceCompatibility: | | * NiceCompatibility: | |
| * @NICE_COMPATIBILITY_DRAFT19: Use compatibility for ICE Draft 19 specs | | * @NICE_COMPATIBILITY_DRAFT19: Use compatibility for ICE Draft 19 specs | |
| * @NICE_COMPATIBILITY_GOOGLE: Use compatibility for Google Talk specs | | * @NICE_COMPATIBILITY_GOOGLE: Use compatibility for Google Talk specs | |
| * @NICE_COMPATIBILITY_MSN: Use compatibility for MSN Messenger specs | | * @NICE_COMPATIBILITY_MSN: Use compatibility for MSN Messenger specs | |
|
| | | * @NICE_COMPATIBILITY_WLM2009: Use compatibility with Windows Live Messeng | |
| | | er | |
| | | * 2009 | |
| * @NICE_COMPATIBILITY_LAST: Dummy last compatibility mode | | * @NICE_COMPATIBILITY_LAST: Dummy last compatibility mode | |
| * | | * | |
| * An enum to specify which compatible specifications the #NiceAgent should
use. | | * An enum to specify which compatible specifications the #NiceAgent should
use. | |
| * Use with nice_agent_new() | | * Use with nice_agent_new() | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| NICE_COMPATIBILITY_DRAFT19 = 0, | | NICE_COMPATIBILITY_DRAFT19 = 0, | |
| NICE_COMPATIBILITY_GOOGLE, | | NICE_COMPATIBILITY_GOOGLE, | |
| NICE_COMPATIBILITY_MSN, | | NICE_COMPATIBILITY_MSN, | |
|
| NICE_COMPATIBILITY_LAST = NICE_COMPATIBILITY_MSN | | NICE_COMPATIBILITY_WLM2009, | |
| | | NICE_COMPATIBILITY_LAST = NICE_COMPATIBILITY_WLM2009 | |
| } NiceCompatibility; | | } NiceCompatibility; | |
| | | | |
| /** | | /** | |
| * NiceProxyType: | | * NiceProxyType: | |
| * @NICE_PROXY_TYPE_NONE: Do not use a proxy | | * @NICE_PROXY_TYPE_NONE: Do not use a proxy | |
| * @NICE_PROXY_TYPE_SOCKS5: Use a SOCKS5 proxy | | * @NICE_PROXY_TYPE_SOCKS5: Use a SOCKS5 proxy | |
| * @NICE_PROXY_TYPE_HTTP: Use an HTTP proxy | | * @NICE_PROXY_TYPE_HTTP: Use an HTTP proxy | |
| * @NICE_PROXY_TYPE_LAST: Dummy last proxy type | | * @NICE_PROXY_TYPE_LAST: Dummy last proxy type | |
| * | | * | |
| * An enum to specify which proxy type to use for relaying. | | * An enum to specify which proxy type to use for relaying. | |
| * Note that the proxies will only be used with TCP TURN relaying. | | * Note that the proxies will only be used with TCP TURN relaying. | |
|
| * See #NiceAgent:proxy-type | | * <para> See also: #NiceAgent:proxy-type </para> | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| NICE_PROXY_TYPE_NONE = 0, | | NICE_PROXY_TYPE_NONE = 0, | |
| NICE_PROXY_TYPE_SOCKS5, | | NICE_PROXY_TYPE_SOCKS5, | |
| NICE_PROXY_TYPE_HTTP, | | NICE_PROXY_TYPE_HTTP, | |
| NICE_PROXY_TYPE_LAST = NICE_PROXY_TYPE_HTTP, | | NICE_PROXY_TYPE_LAST = NICE_PROXY_TYPE_HTTP, | |
| } NiceProxyType; | | } NiceProxyType; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 350 | | skipping to change at line 349 | |
| /** | | /** | |
| * nice_agent_gather_candidates: | | * nice_agent_gather_candidates: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| * @stream_id: The id of the stream to start | | * @stream_id: The id of the stream to start | |
| * | | * | |
| * Start the candidate gathering process. | | * Start the candidate gathering process. | |
| * Once done, #NiceAgent::candidate-gathering-done is called for the stream | | * Once done, #NiceAgent::candidate-gathering-done is called for the stream | |
| * | | * | |
| <note> | | <note> | |
| <para> | | <para> | |
|
| Local addresses must be previously set with nice_agent_add_local_addres | | Local addresses can be previously set with nice_agent_add_local_address | |
| s() | | () | |
| | | </para> | |
| | | <para> | |
| | | If no local address was previously added, then the nice agent will | |
| | | automatically detect the local address using nice_interfaces_get_local_ | |
| | | ips() | |
| </para> | | </para> | |
| </note> | | </note> | |
| */ | | */ | |
| void | | void | |
| nice_agent_gather_candidates ( | | nice_agent_gather_candidates ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id); | | guint stream_id); | |
| | | | |
| /** | | /** | |
| * nice_agent_set_remote_credentials: | | * nice_agent_set_remote_credentials: | |
| | | | |
End of changes. 7 change blocks. |
| 10 lines changed or deleted | | 15 lines changed or added | |
|