Fork me on GitHub
ice.h
Go to the documentation of this file.
1 
17 #ifndef _JANUS_ICE_H
18 #define _JANUS_ICE_H
19 
20 #include <glib.h>
21 #include <agent.h>
22 
23 #include "sdp.h"
24 #include "dtls.h"
25 #include "sctp.h"
26 #include "rtcp.h"
27 #include "utils.h"
28 #include "plugins/plugin.h"
29 
30 
37 void janus_ice_init(gboolean ice_lite, gboolean ice_tcp, gboolean ipv6, uint16_t rtp_min_port, uint16_t rtp_max_port);
39 void janus_ice_deinit(void);
44 int janus_ice_set_stun_server(gchar *stun_server, uint16_t stun_port);
52 int janus_ice_set_turn_server(gchar *turn_server, uint16_t turn_port, gchar *turn_type, gchar *turn_user, gchar *turn_pwd);
60 int janus_ice_set_turn_rest_api(gchar *api_server, gchar *api_key, gchar *api_method);
63 char *janus_ice_get_stun_server(void);
66 uint16_t janus_ice_get_stun_port(void);
69 char *janus_ice_get_turn_server(void);
72 uint16_t janus_ice_get_turn_port(void);
75 char *janus_ice_get_turn_rest_api(void);
77 void janus_ice_enable_nat_1_1(void);
84 void janus_ice_enforce_interface(const char *ip);
88 gboolean janus_ice_is_enforced(const char *ip);
96 void janus_ice_ignore_interface(const char *ip);
100 gboolean janus_ice_is_ignored(const char *ip);
103 gboolean janus_ice_is_ice_lite_enabled(void);
106 gboolean janus_ice_is_ice_tcp_enabled(void);
109 gboolean janus_ice_is_ipv6_enabled(void);
112 gboolean janus_ice_is_bundle_forced(void);
115 void janus_ice_force_bundle(gboolean forced);
118 gboolean janus_ice_is_rtcpmux_forced(void);
121 void janus_ice_force_rtcpmux(gboolean forced);
127 void janus_set_max_nack_queue(uint mnq);
130 uint janus_get_max_nack_queue(void);
133 void janus_set_no_media_timer(uint timer);
136 uint janus_get_no_media_timer(void);
141 void janus_ice_debugging_enable(void);
143 void janus_ice_debugging_disable(void);
144 
145 
149 const gchar *janus_get_ice_state_name(gint state);
150 
151 
160 
161 
162 #define JANUS_ICE_HANDLE_WEBRTC_PROCESSING_OFFER (1 << 0)
163 #define JANUS_ICE_HANDLE_WEBRTC_START (1 << 1)
164 #define JANUS_ICE_HANDLE_WEBRTC_READY (1 << 2)
165 #define JANUS_ICE_HANDLE_WEBRTC_STOP (1 << 3)
166 #define JANUS_ICE_HANDLE_WEBRTC_ALERT (1 << 4)
167 #define JANUS_ICE_HANDLE_WEBRTC_BUNDLE (1 << 5)
168 #define JANUS_ICE_HANDLE_WEBRTC_RTCPMUX (1 << 6)
169 #define JANUS_ICE_HANDLE_WEBRTC_TRICKLE (1 << 7)
170 #define JANUS_ICE_HANDLE_WEBRTC_ALL_TRICKLES (1 << 8)
171 #define JANUS_ICE_HANDLE_WEBRTC_TRICKLE_SYNCED (1 << 9)
172 #define JANUS_ICE_HANDLE_WEBRTC_DATA_CHANNELS (1 << 10)
173 #define JANUS_ICE_HANDLE_WEBRTC_PLAN_B (1 << 11)
174 #define JANUS_ICE_HANDLE_WEBRTC_CLEANING (1 << 12)
175 #define JANUS_ICE_HANDLE_WEBRTC_HAS_AUDIO (1 << 13)
176 #define JANUS_ICE_HANDLE_WEBRTC_HAS_VIDEO (1 << 14)
177 #define JANUS_ICE_HANDLE_WEBRTC_GOT_OFFER (1 << 15)
178 #define JANUS_ICE_HANDLE_WEBRTC_GOT_ANSWER (1 << 16)
179 
180 
183 typedef struct janus_ice_stats {
185  guint32 audio_packets;
187  guint64 audio_bytes;
193  guint32 audio_nacks;
195  guint32 video_packets;
197  guint64 video_bytes;
203  guint32 video_nacks;
205  guint32 data_packets;
207  guint64 data_bytes;
215 
218 typedef struct janus_ice_stats_item {
220  guint64 bytes;
222  gint64 when;
224 
228 
232 void janus_ice_notify_hangup(janus_ice_handle *handle, const char *reason);
233 
234 
238 gboolean janus_plugin_session_is_alive(janus_plugin_session *plugin_session);
239 
240 
242 typedef struct janus_seq_info {
243  gint64 ts;
244  guint16 seq;
245  guint16 state;
248 } seq_info_t;
249 enum {
254 };
255 
256 
260  void *session;
262  guint64 handle_id;
264  char *opaque_id;
266  gint64 created;
268  void *app;
274  gint cdone;
276  GMainContext *icectx;
278  GMainLoop *iceloop;
280  GThread *icethread;
282  NiceAgent *agent;
286  gboolean controlling;
288  guint audio_id;
290  guint video_id;
292  guint data_id;
294  gchar *audio_mid;
296  gchar *video_mid;
298  gchar *data_mid;
302  GHashTable *streams;
310  gchar *rtp_profile;
312  gchar *local_sdp;
314  gchar *remote_sdp;
318  GAsyncQueue *queued_packets;
320  GThread *send_thread;
322  volatile gint send_thread_created;
325 };
326 
332  guint stream_id;
334  gint cdone:1;
336  guint disabled;
338  guint32 audio_ssrc;
340  guint32 video_ssrc;
358  guint32 audio_last_ts;
360  guint32 video_last_ts;
368  gchar *ruser;
370  gchar *rpass;
372  GHashTable *components;
378  gint noerrorlog:1;
381 };
382 
383 #define LAST_SEQS_MAX_LEN 160
384 
389  guint stream_id;
393  guint state;
397  GSList *candidates;
405  gboolean process_started;
407  GSource *source;
429  gint noerrorlog:1;
432 };
433 
439  gint64 received;
441  char *transaction;
443  json_t *candidate;
444 };
445 
448 
454 janus_ice_trickle *janus_ice_trickle_new(janus_ice_handle *handle, const char *transaction, json_t *candidate);
460 gint janus_ice_trickle_parse(janus_ice_handle *handle, json_t *candidate, const char **error);
465 
466 
469 
474 janus_ice_handle *janus_ice_handle_create(void *gateway_session, const char *opaque_id);
479 janus_ice_handle *janus_ice_handle_find(void *gateway_session, guint64 handle_id);
486 gint janus_ice_handle_attach_plugin(void *gateway_session, guint64 handle_id, janus_plugin *plugin);
491 gint janus_ice_handle_destroy(void *gateway_session, guint64 handle_id);
494 void janus_ice_free(janus_ice_handle *handle);
504 void janus_ice_stream_free(GHashTable *container, janus_ice_stream *stream);
508 void janus_ice_component_free(GHashTable *container, janus_ice_component *component);
510 
511 
514 
519 void janus_ice_cb_candidate_gathering_done (NiceAgent *agent, guint stream_id, gpointer ice);
526 void janus_ice_cb_component_state_changed (NiceAgent *agent, guint stream_id, guint component_id, guint state, gpointer ice);
534 #ifndef HAVE_LIBNICE_TCP
535 void janus_ice_cb_new_selected_pair (NiceAgent *agent, guint stream_id, guint component_id, gchar *local, gchar *remote, gpointer ice);
536 #else
537 void janus_ice_cb_new_selected_pair (NiceAgent *agent, guint stream_id, guint component_id, NiceCandidate *local, NiceCandidate *remote, gpointer ice);
538 #endif
539 
543 #ifndef HAVE_LIBNICE_TCP
544 void janus_ice_cb_new_remote_candidate (NiceAgent *agent, guint stream_id, guint component_id, gchar *candidate, gpointer ice);
545 #else
546 void janus_ice_cb_new_remote_candidate (NiceAgent *agent, NiceCandidate *candidate, gpointer ice);
547 #endif
548 
555 void janus_ice_cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id, guint len, gchar *buf, gpointer ice);
556 
562 void janus_ice_relay_rtp(janus_ice_handle *handle, int video, char *buf, int len);
568 void janus_ice_relay_rtcp(janus_ice_handle *handle, int video, char *buf, int len);
573 void janus_ice_relay_data(janus_ice_handle *handle, char *buf, int len);
578 void janus_ice_incoming_data(janus_ice_handle *handle, char *buffer, int length);
580 
581 
584 
586 void *janus_ice_thread(void *data);
588 void *janus_ice_send_thread(void *data);
599 int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int video, int data, int bundle, int rtcpmux, int trickle);
605 void janus_ice_candidates_to_sdp(janus_ice_handle *handle, janus_sdp_mline *mline, guint stream_id, guint component_id);
610 void janus_ice_setup_remote_candidates(janus_ice_handle *handle, guint stream_id, guint component_id);
617 
618 #endif
void janus_ice_notify_hangup(janus_ice_handle *handle, const char *reason)
Quick helper method to notify a WebRTC hangup through the Janus API.
Definition: ice.c:508
janus_ice_stats in_stats
Stats for incoming data (audio/video/data)
Definition: ice.h:425
gint janus_ice_handle_attach_plugin(void *gateway_session, guint64 handle_id, janus_plugin *plugin)
Method to attach a Janus ICE handle to a plugin.
Definition: ice.c:994
guint state
libnice ICE component state
Definition: ice.h:393
gboolean audio_notified_lastsec
Whether or not we notified about audio lastsec issues already.
Definition: ice.h:191
json_t * candidate
JSON object of the trickle candidate(s)
Definition: ice.h:443
int janus_ice_set_turn_rest_api(gchar *api_server, gchar *api_key, gchar *api_method)
Method to force Janus to contact a TURN REST API server to get a TURN service to use when gathering c...
Definition: ice.c:882
gint64 retransmit_log_ts
Last time a log message about sending retransmits was printed.
Definition: ice.h:413
gchar * audio_mid
Audio mid (media ID)
Definition: ice.h:294
janus_flags webrtc_flags
Mask of WebRTC-related flags for this handle.
Definition: ice.h:272
guint32 audio_ssrc
Audio SSRC of the gateway for this stream (may be bundled)
Definition: ice.h:338
gint janus_ice_handle_destroy(void *gateway_session, guint64 handle_id)
Method to destroy a Janus ICE handle.
Definition: ice.c:1039
SCTP processing for data channels (headers)
gchar * local_sdp
SDP generated locally (just for debugging purposes)
Definition: ice.h:312
guint data_id
libnice ICE DataChannels ID
Definition: ice.h:292
struct janus_seq_info * prev
Definition: ice.h:247
guint nack_sent_recent_cnt
Number of NACKs sent since last log message.
Definition: ice.h:419
guint component_id
libnice ICE component ID
Definition: ice.h:391
janus_ice_stream * stream
Janus ICE stream this component belongs to.
Definition: ice.h:387
Janus media statistics.
Definition: ice.h:183
uint16_t janus_ice_get_stun_port(void)
Method to get the STUN server port.
Definition: ice.c:43
gboolean janus_ice_is_ice_lite_enabled(void)
Method to check whether ICE Lite mode is enabled or not (still WIP)
Definition: ice.c:74
janus_mutex mutex
Mutex to lock/unlock this component.
Definition: ice.h:431
GThread * icethread
GLib thread for libnice.
Definition: ice.h:280
int janus_ice_set_stun_server(gchar *stun_server, uint16_t stun_port)
Method to force Janus to use a STUN server when gathering candidates.
Definition: ice.c:733
janus_mutex mutex
Mutex to lock/unlock this stream.
Definition: ice.h:380
int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int video, int data, int bundle, int rtcpmux, int trickle)
Method to locally set up the ICE candidates (initialization and gathering)
Definition: ice.c:2572
void * janus_ice_thread(void *data)
Janus ICE handle thread.
Definition: ice.c:2241
NiceAgent * agent
libnice ICE agent
Definition: ice.h:282
gint64 nack_sent_log_ts
Last time a log message about sending NACKs was printed.
Definition: ice.h:417
void janus_set_max_nack_queue(uint mnq)
Method to modify the max NACK value (i.e., the number of packets per handle to store for retransmissi...
Definition: ice.c:304
struct janus_ice_stats janus_ice_stats
Janus media statistics.
struct janus_ice_stats_item janus_ice_stats_item
Janus media statistics: received packet info.
GHashTable * streams
GLib hash table of streams (IDs are the keys)
Definition: ice.h:302
char * janus_ice_get_turn_rest_api(void)
Method to get the specified TURN REST API backend, if any.
Definition: ice.c:63
Definition: ice.h:251
gboolean process_started
Whether the setup of remote candidates for this component has started or not.
Definition: ice.h:405
guint64 video_bytes
Video bytes sent or received.
Definition: ice.h:197
SDP m-line representation.
Definition: sdp-utils.h:79
void janus_ice_relay_data(janus_ice_handle *handle, char *buf, int len)
Gateway SCTP/DataChannel callback, called when a plugin has data to send to a peer.
void janus_ice_component_free(GHashTable *container, janus_ice_component *component)
Method to only free resources related to a specific ICE component allocated by a Janus ICE handle...
Definition: ice.c:1309
Plugin-Gateway communication (implementation)
Janus ICE stream.
Definition: ice.h:328
ogg_stream_state * stream
Definition: pp-opus.c:31
void * janus_ice_send_thread(void *data)
Janus ICE thread for sending outgoing packets.
Definition: ice.c:3161
Janus ICE component.
Definition: ice.h:385
janus_ice_stream * data_stream
SCTP/DataChannel stream.
Definition: ice.h:308
void janus_ice_force_bundle(gboolean forced)
Method to set the BUNDLE support mode (true means mandatory, false means optional) ...
Definition: ice.c:92
uint janus_get_no_media_timer(void)
Method to get the current no-media event timer (see above)
Definition: ice.c:293
gboolean janus_plugin_session_is_alive(janus_plugin_session *plugin_session)
Quick helper method to check if a plugin session associated with a Janus handle is still valid...
Definition: ice.c:395
void janus_ice_relay_rtp(janus_ice_handle *handle, int video, char *buf, int len)
Gateway RTP callback, called when a plugin has an RTP packet to send to a peer.
Definition: ice.c:3719
GSList * candidates
GLib list of libnice remote candidates for this component.
Definition: ice.h:397
guint video_id
libnice ICE video ID
Definition: ice.h:290
gboolean janus_ice_is_ignored(const char *ip)
Method to check whether an interface/IP is currently in the ignore list for ICE (that is...
Definition: ice.c:228
janus_ice_handle * janus_ice_handle_find(void *gateway_session, guint64 handle_id)
Method to find an existing Janus ICE handle from its ID.
Definition: ice.c:984
gboolean janus_ice_is_ipv6_enabled(void)
Method to check whether IPv6 candidates are enabled/supported or not (still WIP)
Definition: ice.c:86
void janus_ice_incoming_data(janus_ice_handle *handle, char *buffer, int length)
Plugin SCTP/DataChannel callback, called by the SCTP stack when when there&#39;s data for a plugin...
Definition: ice.c:2231
struct janus_seq_info seq_info_t
A helper struct for determining when to send NACKs.
void janus_ice_cb_new_selected_pair(NiceAgent *agent, guint stream_id, guint component_id, gchar *local, gchar *remote, gpointer ice)
libnice callback to notify when a pair of candidates has been selected for an ICE agent ...
Definition: ice.c:1556
guint16 seq
Definition: ice.h:244
janus_ice_handle * handle
Janus ICE handle this trickle candidate belongs to.
Definition: ice.h:437
gchar * remote_fingerprint
Hashed fingerprint of the peer&#39;s certificate, as parsed in SDP.
Definition: ice.h:366
void janus_ice_stats_reset(janus_ice_stats *stats)
Quick helper method to reset stats.
Definition: ice.c:921
GSList * remote_candidates
GLib list of remote candidates for this component (summary)
Definition: ice.h:401
GHashTable * components
GLib hash table of components (IDs are the keys)
Definition: ice.h:372
gint cdone
Number of gathered candidates.
Definition: ice.h:274
guint64 data_bytes
Data bytes sent or received.
Definition: ice.h:207
guint audio_id
libnice ICE audio ID
Definition: ice.h:288
gchar * video_mid
Video mid (media ID)
Definition: ice.h:296
void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint component_id, guint len, gchar *buf, gpointer ice)
libnice callback to notify when data has been received by an ICE agent
Definition: ice.c:1813
gboolean janus_ice_is_rtcpmux_forced(void)
Method to check whether rtcp-mux support is forced or not.
Definition: ice.c:150
gchar * rtp_profile
RTP profile set by caller (so that we can match it)
Definition: ice.h:310
TURN REST API client.
char * transaction
Janus API transaction ID of the original trickle request.
Definition: ice.h:441
janus_ice_handle * janus_ice_handle_create(void *gateway_session, const char *opaque_id)
Method to create a new Janus ICE handle.
Definition: ice.c:947
Helper to handle pending trickle candidates (e.g., when we&#39;re still waiting for an offer) ...
Definition: ice.h:435
struct janus_seq_info * next
Definition: ice.h:246
guint stream_id
libnice ICE stream ID
Definition: ice.h:389
gboolean janus_ice_is_ice_tcp_enabled(void)
Method to check whether ICE-TCP support is enabled/supported or not (still WIP)
Definition: ice.c:80
gint64 created
Monotonic time of when the handle has been created.
Definition: ice.h:266
const gchar * janus_get_ice_state_name(gint state)
Helper method to get a string representation of a libnice ICE state.
Definition: ice.c:909
void janus_ice_ignore_interface(const char *ip)
Method to add an interface/IP to the ignore list for ICE (that is, don&#39;t gather candidates) ...
Definition: ice.c:217
GMainLoop * iceloop
GLib loop for libnice.
Definition: ice.h:278
void janus_ice_setup_remote_candidates(janus_ice_handle *handle, guint stream_id, guint component_id)
Method to handle remote candidates and start the connectivity checks.
Definition: ice.c:2505
Janus media statistics: received packet info.
Definition: ice.h:218
gint payload_type
RTP payload type of this stream.
Definition: ice.h:352
void janus_ice_init(gboolean ice_lite, gboolean ice_tcp, gboolean ipv6, uint16_t rtp_min_port, uint16_t rtp_max_port)
ICE stuff initialization.
Definition: ice.c:653
janus_ice_stream * audio_stream
Audio stream.
Definition: ice.h:304
gint janus_ice_get_rtcpmux_blackhole_port(void)
Method to get the port that has been assigned for the RTCP component blackhole in case of rtcp-mux...
Definition: ice.c:147
The plugin session and callbacks interface.
Definition: plugin.h:232
uint janus_get_max_nack_queue(void)
Method to get the current max NACK value (i.e., the number of packets per handle to store for retrans...
Definition: ice.c:311
janus_plugin_session * app_handle
Opaque gateway/plugin session pointer.
Definition: ice.h:270
guint retransmit_recent_cnt
Number of retransmitted packets since last log message.
Definition: ice.h:415
janus_ice_handle * handle
Janus ICE handle this stream belongs to.
Definition: ice.h:330
Definition: ice.h:250
janus_ice_stats out_stats
Stats for outgoing data (audio/video/data)
Definition: ice.h:427
void janus_ice_debugging_disable(void)
Method to disable libnice debugging (the default)
Definition: ice.c:175
RTCP processing (headers)
uint16_t janus_ice_get_turn_port(void)
Method to get the TURN server port.
Definition: ice.c:57
gint64 when
Time at which this happened.
Definition: ice.h:222
GSList * local_candidates
GLib list of local candidates for this component (summary)
Definition: ice.h:399
void janus_ice_candidates_to_sdp(janus_ice_handle *handle, janus_sdp_mline *mline, guint stream_id, guint component_id)
Method to add local candidates to a janus_sdp SDP object representation.
Definition: ice.c:2269
void janus_ice_webrtc_free(janus_ice_handle *handle)
Method to only free the WebRTC related resources allocated by a Janus ICE handle. ...
Definition: ice.c:1188
void janus_ice_stream_free(GHashTable *container, janus_ice_stream *stream)
Method to only free resources related to a specific ICE stream allocated by a Janus ICE handle...
Definition: ice.c:1266
gint64 ts
Definition: ice.h:243
janus_ice_component * rtcp_component
RTCP component.
Definition: ice.h:376
void janus_ice_enable_nat_1_1(void)
Helper method to force Janus to overwrite all host candidates with the public IP. ...
Definition: ice.c:184
void janus_ice_deinit(void)
ICE stuff de-initialization.
Definition: ice.c:714
gchar * remote_hashing
Hashing algorhitm used by the peer for the DTLS certificate (e.g., "SHA-256")
Definition: ice.h:364
gchar * ruser
The ICE username for this stream.
Definition: ice.h:368
gchar * remote_sdp
SDP received by the peer (just for debugging purposes)
Definition: ice.h:314
A helper struct for determining when to send NACKs.
Definition: ice.h:242
uint32_t janus_flags
Janus flags container.
Definition: utils.h:83
char * janus_ice_get_stun_server(void)
Method to get the STUN server IP address.
Definition: ice.c:40
void * app
Opaque application (plugin) pointer.
Definition: ice.h:268
gint noerrorlog
Helper flag to avoid flooding the console with the same error all over again.
Definition: ice.h:429
DTLS/SRTP processing (headers)
void janus_ice_relay_rtcp(janus_ice_handle *handle, int video, char *buf, int len)
Gateway RTCP callback, called when a plugin has an RTCP message to send to a peer.
Definition: ice.c:3769
gboolean janus_ice_is_ice_debugging_enabled(void)
Method to check whether libnice debugging has been enabled (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html)
Definition: ice.c:157
void janus_ice_trickle_destroy(janus_ice_trickle *trickle)
Helper method to destroy a janus_ice_trickle instance.
Definition: ice.c:638
gint cdone
Whether this stream is ready to be used.
Definition: ice.h:334
seq_info_t * last_seqs_audio
List of recently received audio sequence numbers (as a support to NACK generation) ...
Definition: ice.h:421
Definition: ice.h:253
guint32 video_ssrc_peer_rtx
Video retransmissions SSRC of the peer for this stream (may be bundled)
Definition: ice.h:346
GList * audio_bytes_lastsec
Audio bytes sent or received in the last second.
Definition: ice.h:189
Janus ICE handle.
Definition: ice.h:258
guint32 video_ssrc
Video SSRC of the gateway for this stream (may be bundled)
Definition: ice.h:340
guint32 audio_nacks
Number of audio NACKs sent or received.
Definition: ice.h:193
guint64 bytes
Bytes sent or received.
Definition: ice.h:220
GList * retransmit_buffer
List of previously sent janus_rtp_packet RTP packets, in case we receive NACKs.
Definition: ice.h:411
void janus_ice_cb_component_state_changed(NiceAgent *agent, guint stream_id, guint component_id, guint state, gpointer ice)
libnice callback to notify when the state of a component changes for an ICE agent ...
Definition: ice.c:1476
volatile gint send_thread_created
Atomic flag to make sure we only create the thread once.
Definition: ice.h:322
char * opaque_id
Opaque identifier, e.g., to provide inter-handle relationships to external tools. ...
Definition: ice.h:264
void janus_ice_free(janus_ice_handle *handle)
Method to actually free the resources allocated by a Janus ICE handle.
Definition: ice.c:1123
int janus_ice_set_turn_server(gchar *turn_server, uint16_t turn_port, gchar *turn_type, gchar *turn_user, gchar *turn_pwd)
Method to force Janus to use a TURN server when gathering candidates.
Definition: ice.c:833
GList * video_payload_types
List of payload types we can expect for video.
Definition: ice.h:350
guint64 audio_bytes
Audio bytes sent or received.
Definition: ice.h:187
gboolean controlling
ICE role (controlling or controlled)
Definition: ice.h:286
GMainContext * icectx
GLib context for libnice.
Definition: ice.h:276
guint32 audio_ssrc_peer
Audio SSRC of the peer for this stream (may be bundled)
Definition: ice.h:342
guint32 audio_last_ts
Last sent audio RTP timestamp.
Definition: ice.h:358
GThread * send_thread
GLib thread for sending outgoing packets.
Definition: ice.h:320
void * session
Opaque pointer to the gateway/peer session.
Definition: ice.h:260
guint32 video_last_ts
Last sent video RTP timestamp.
Definition: ice.h:360
gchar * rpass
The ICE password for this stream.
Definition: ice.h:370
pthread_mutex_t janus_mutex
Janus mutex implementation.
Definition: mutex.h:19
gint64 component_connected
Monotonic time of when this component has successfully connected.
Definition: ice.h:395
Janus DTLS-SRTP handle.
Definition: dtls.h:52
janus_ice_stream * video_stream
Video stream.
Definition: ice.h:306
void janus_ice_cb_new_remote_candidate(NiceAgent *agent, guint stream_id, guint component_id, gchar *candidate, gpointer ice)
libnice callback to notify when a new remote candidate has been discovered for an ICE agent ...
Definition: ice.c:1662
janus_mutex mutex
Mutex to lock/unlock the ICE session.
Definition: ice.h:324
guint32 audio_packets
Audio packets sent or received.
Definition: ice.h:185
guint32 video_packets
Video packets sent or received.
Definition: ice.h:195
gint janus_ice_trickle_parse(janus_ice_handle *handle, json_t *candidate, const char **error)
Helper method to parse trickle candidates.
Definition: ice.c:546
GList * audio_payload_types
List of payload types we can expect for audio.
Definition: ice.h:348
void janus_ice_webrtc_hangup(janus_ice_handle *handle)
Method to only hangup (e.g., DTLS alert) the WebRTC PeerConnection allocated by a Janus ICE handle...
Definition: ice.c:1147
gboolean janus_ice_is_bundle_forced(void)
Method to check whether BUNDLE support is forced or not.
Definition: ice.c:96
guint32 data_packets
Data packets sent or received.
Definition: ice.h:205
guint sl_nack_recent_cnt
Count of recent NACKs (for slow_link)
Definition: ice.h:213
Internal RTCP state context (for RR/SR)
Definition: rtcp.h:209
GList * video_bytes_lastsec
Video bytes sent or received in the last second.
Definition: ice.h:199
gchar * data_mid
Data channel mid (media ID)
Definition: ice.h:298
rtcp_context * audio_rtcp_ctx
RTCP context for the audio stream (may be bundled)
Definition: ice.h:354
guint64 handle_id
Handle identifier, guaranteed to be non-zero.
Definition: ice.h:262
Plugin-Gateway session mapping.
Definition: plugin.h:221
void janus_ice_force_rtcpmux(gboolean forced)
Method to set the rtcp-mux support mode (true means mandatory, false means optional) ...
Definition: ice.c:104
gint64 agent_created
Monotonic time of when the ICE agent has been created.
Definition: ice.h:284
gint noerrorlog
Helper flag to avoid flooding the console with the same error all over again.
Definition: ice.h:378
GAsyncQueue * queued_packets
Queue of outgoing packets to send.
Definition: ice.h:318
janus_dtls_srtp * dtls
DTLS-SRTP stack.
Definition: ice.h:409
GList * pending_trickles
List of pending trickle candidates (those we received before getting the JSEP offer) ...
Definition: ice.h:316
void janus_ice_enforce_interface(const char *ip)
Method to add an interface/IP to the enforce list for ICE (that is, only gather candidates from these...
Definition: ice.c:192
gint64 received
Monotonic time of when this trickle candidate has been received.
Definition: ice.h:439
guint32 video_nacks
Number of video NACKs sent or received.
Definition: ice.h:203
void janus_ice_debugging_enable(void)
Method to enable libnice debugging (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html)
Definition: ice.c:160
SDP processing (headers)
gboolean janus_ice_is_enforced(const char *ip)
Method to check whether an interface is currently in the enforce list for ICE (that is...
Definition: ice.c:200
rtcp_context * video_rtcp_ctx
RTCP context for the video stream (may be bundled)
Definition: ice.h:356
guint16 state
Definition: ice.h:245
char * janus_ice_get_turn_server(void)
Method to get the TURN server IP address.
Definition: ice.c:54
guint stream_id
libnice ICE stream ID
Definition: ice.h:332
Definition: ice.h:252
void janus_set_no_media_timer(uint timer)
Method to modify the no-media event timer (i.e., the number of seconds where no media arrives before ...
Definition: ice.c:286
gint streams_num
Number of streams.
Definition: ice.h:300
janus_ice_trickle * janus_ice_trickle_new(janus_ice_handle *handle, const char *transaction, json_t *candidate)
Helper method to allocate a janus_ice_trickle instance.
Definition: ice.c:535
gboolean video_notified_lastsec
Whether or not we notified about video lastsec issues already.
Definition: ice.h:201
guint disabled
Whether the medium associated with this stream has been disabled (e.g., m=audio 0) ...
Definition: ice.h:336
GSource * source
Re-transmission timer for DTLS.
Definition: ice.h:407
gint64 sl_nack_period_ts
Start time of recent NACKs (for slow_link)
Definition: ice.h:211
gchar * selected_pair
String representation of the selected pair as notified by libnice (foundations)
Definition: ice.h:403
janus_ice_component * rtp_component
RTP (or SCTP, if this is the data stream) component.
Definition: ice.h:374
janus_dtls_role
DTLS roles.
Definition: dtls.h:37
guint32 video_ssrc_peer
Video SSRC of the peer for this stream (may be bundled)
Definition: ice.h:344
janus_dtls_role dtls_role
DTLS role of the gateway for this stream.
Definition: ice.h:362
void janus_ice_cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpointer ice)
libnice callback to notify when candidates have been gathered for an ICE agent
Definition: ice.c:1462
seq_info_t * last_seqs_video
List of recently received video sequence numbers (as a support to NACK generation) ...
Definition: ice.h:423
gint64 last_slowlink_time
Last time the slow_link callback (of the plugin) was called.
Definition: ice.h:209
void janus_ice_dtls_handshake_done(janus_ice_handle *handle, janus_ice_component *component)
Callback to be notified when the DTLS handshake for a specific component has been completed...
Definition: ice.c:3790