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 "text2pcap.h"
28 #include "utils.h"
29 #include "refcount.h"
30 #include "plugins/plugin.h"
31 
32 
40 void janus_ice_init(gboolean ice_lite, gboolean ice_tcp, gboolean full_trickle, gboolean ipv6, uint16_t rtp_min_port, uint16_t rtp_max_port);
42 void janus_ice_deinit(void);
47 int janus_ice_set_stun_server(gchar *stun_server, uint16_t stun_port);
55 int janus_ice_set_turn_server(gchar *turn_server, uint16_t turn_port, gchar *turn_type, gchar *turn_user, gchar *turn_pwd);
63 int janus_ice_set_turn_rest_api(gchar *api_server, gchar *api_key, gchar *api_method);
66 char *janus_ice_get_stun_server(void);
69 uint16_t janus_ice_get_stun_port(void);
72 char *janus_ice_get_turn_server(void);
75 uint16_t janus_ice_get_turn_port(void);
78 char *janus_ice_get_turn_rest_api(void);
80 void janus_ice_enable_nat_1_1(void);
87 void janus_ice_enforce_interface(const char *ip);
91 gboolean janus_ice_is_enforced(const char *ip);
99 void janus_ice_ignore_interface(const char *ip);
103 gboolean janus_ice_is_ignored(const char *ip);
106 gboolean janus_ice_is_ice_lite_enabled(void);
109 gboolean janus_ice_is_ice_tcp_enabled(void);
112 gboolean janus_ice_is_full_trickle_enabled(void);
115 gboolean janus_ice_is_ipv6_enabled(void);
118 void janus_set_max_nack_queue(uint mnq);
121 uint janus_get_max_nack_queue(void);
124 void janus_set_no_media_timer(uint timer);
127 uint janus_get_no_media_timer(void);
130 void janus_set_rfc4588_enabled(gboolean enabled);
133 gboolean janus_is_rfc4588_enabled(void);
136 void janus_ice_set_event_stats_period(int period);
144 void janus_ice_debugging_enable(void);
146 void janus_ice_debugging_disable(void);
147 
148 
152 const gchar *janus_get_ice_state_name(gint state);
153 
154 
163 
164 #define JANUS_ICE_HANDLE_WEBRTC_PROCESSING_OFFER (1 << 0)
165 #define JANUS_ICE_HANDLE_WEBRTC_START (1 << 1)
166 #define JANUS_ICE_HANDLE_WEBRTC_READY (1 << 2)
167 #define JANUS_ICE_HANDLE_WEBRTC_STOP (1 << 3)
168 #define JANUS_ICE_HANDLE_WEBRTC_ALERT (1 << 4)
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_CLEANING (1 << 11)
174 #define JANUS_ICE_HANDLE_WEBRTC_HAS_AUDIO (1 << 12)
175 #define JANUS_ICE_HANDLE_WEBRTC_HAS_VIDEO (1 << 13)
176 #define JANUS_ICE_HANDLE_WEBRTC_GOT_OFFER (1 << 14)
177 #define JANUS_ICE_HANDLE_WEBRTC_GOT_ANSWER (1 << 15)
178 #define JANUS_ICE_HANDLE_WEBRTC_HAS_AGENT (1 << 16)
179 #define JANUS_ICE_HANDLE_WEBRTC_ICE_RESTART (1 << 17)
180 #define JANUS_ICE_HANDLE_WEBRTC_RESEND_TRICKLES (1 << 18)
181 #define JANUS_ICE_HANDLE_WEBRTC_RFC4588_RTX (1 << 19)
182 
183 
186 typedef struct janus_ice_stats_info {
188  guint32 packets;
190  guint64 bytes;
194  gint64 updated;
198  guint32 nacks;
200 
203 typedef struct janus_ice_stats {
217 
221 void janus_ice_notify_hangup(janus_ice_handle *handle, const char *reason);
222 
223 
227 gboolean janus_plugin_session_is_alive(janus_plugin_session *plugin_session);
228 
229 
231 typedef struct janus_seq_info {
232  gint64 ts;
233  guint16 seq;
234  guint16 state;
239 enum {
244 };
245 
246 
250  void *session;
252  guint64 handle_id;
254  char *opaque_id;
256  gint64 created;
258  void *app;
264  gint cdone;
266  GMainContext *icectx;
268  GMainLoop *iceloop;
270  GThread *icethread;
272  GSource *rtp_source, *rtcp_source, *stats_source;
274  NiceAgent *agent;
278  gboolean controlling;
280  gchar *audio_mid;
282  gchar *video_mid;
284  gchar *data_mid;
286  gchar *stream_mid;
288  guint stream_id;
292  gchar *rtp_profile;
294  gchar *local_sdp;
296  gchar *remote_sdp;
298  const gchar *hangup_reason;
302  GAsyncQueue *queued_packets;
306  gint last_srtp_error, last_srtp_summary;
310  volatile gint dump_packets;
316  volatile gint destroyed;
319 };
320 
326  guint stream_id;
328  gint cdone:1;
330  guint32 audio_ssrc;
332  guint32 video_ssrc;
334  guint32 video_ssrc_rtx;
336  guint32 audio_ssrc_peer, audio_ssrc_peer_new, audio_ssrc_peer_orig;
338  guint32 video_ssrc_peer[3], video_ssrc_peer_new[3], video_ssrc_peer_orig[3];
340  guint32 video_ssrc_peer_rtx[3], video_ssrc_peer_rtx_new[3], video_ssrc_peer_rtx_orig[3];
342  char *rid[3];
350  GHashTable *rtx_payload_types;
352  gint audio_payload_type, video_payload_type, video_rtx_payload_type;
354  char *audio_codec, *video_codec;
356  gboolean (* video_is_keyframe)(char* buffer, int len);
358  gboolean audio_send, audio_recv, video_send, video_recv;
362  janus_rtcp_context *video_rtcp_ctx[3];
364  GHashTable *rtx_nacked[3];
370  gint64 video_first_ntp_ts[3];
372  guint32 video_first_rtp_ts[3];
374  guint32 audio_last_ts;
376  guint32 video_last_ts;
398  gchar *ruser;
400  gchar *rpass;
402  GHashTable *components;
406  gboolean noerrorlog;
410  volatile gint destroyed;
413 };
414 
415 #define LAST_SEQS_MAX_LEN 160
416 
421  guint stream_id;
425  guint state;
429  GSList *candidates;
437  gboolean process_started;
439  GSource *icestate_source;
443  GSource *dtlsrt_source;
447  gboolean do_audio_nacks;
449  gboolean do_video_nacks;
451  GQueue *audio_retransmit_buffer, *video_retransmit_buffer;
453  GHashTable *audio_retransmit_seqs, *video_retransmit_seqs;
455  guint16 rtx_seq_number;
467  janus_seq_info *last_seqs_video[3];
473  gboolean noerrorlog;
477  volatile gint destroyed;
480 };
481 
487  gint64 received;
489  char *transaction;
492 };
493 
496 
502 janus_ice_trickle *janus_ice_trickle_new(const char *transaction, json_t *candidate);
508 gint janus_ice_trickle_parse(janus_ice_handle *handle, json_t *candidate, const char **error);
513 
514 
517 
522 janus_ice_handle *janus_ice_handle_create(void *core_session, const char *opaque_id);
529 gint janus_ice_handle_attach_plugin(void *core_session, janus_ice_handle *handle, janus_plugin *plugin);
534 gint janus_ice_handle_destroy(void *core_session, janus_ice_handle *handle);
538 void janus_ice_webrtc_hangup(janus_ice_handle *handle, const char *reason);
549 
550 
553 
559 void janus_ice_relay_rtp(janus_ice_handle *handle, int video, char *buf, int len);
565 void janus_ice_relay_rtcp(janus_ice_handle *handle, int video, char *buf, int len);
570 void janus_ice_relay_data(janus_ice_handle *handle, char *buf, int len);
575 void janus_ice_incoming_data(janus_ice_handle *handle, char *buffer, int length);
580 void janus_ice_relay_sctp(janus_ice_handle *handle, char *buffer, int length);
582 
583 
586 
595 int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int video, int data, int trickle);
601 void janus_ice_candidates_to_sdp(janus_ice_handle *handle, janus_sdp_mline *mline, guint stream_id, guint component_id);
606 void janus_ice_setup_remote_candidates(janus_ice_handle *handle, guint stream_id, guint component_id);
614 void janus_ice_restart(janus_ice_handle *handle);
619 
620 #endif
guint srtp_errors_count
Count of the recent SRTP replay errors, in order to avoid spamming the logs.
Definition: ice.h:304
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:540
janus_ice_stats in_stats
Stats for incoming data (audio/video/data)
Definition: ice.h:469
gboolean noerrorlog
Helper flag to avoid flooding the console with the same error all over again.
Definition: ice.h:473
void janus_ice_resend_trickles(janus_ice_handle *handle)
Method to resend all the existing candidates via trickle (e.g., after an ICE restart) ...
Definition: ice.c:3213
const gchar * hangup_reason
Reason this handle has been hung up.
Definition: ice.h:298
guint state
libnice ICE component state
Definition: ice.h:425
janus_ice_handle * janus_ice_handle_create(void *core_session, const char *opaque_id)
Method to create a new Janus ICE handle.
Definition: ice.c:949
gboolean video_send
Definition: ice.h:358
GHashTable * rtx_payload_types
Mapping of rtx payload types to actual media-related packet types.
Definition: ice.h:350
json_t * candidate
JSON object of the trickle candidate(s)
Definition: ice.h:491
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:909
gint64 retransmit_log_ts
Last time a log message about sending retransmits was printed.
Definition: ice.h:457
gchar * audio_mid
Audio mid (media ID)
Definition: ice.h:280
janus_flags webrtc_flags
Mask of WebRTC-related flags for this handle.
Definition: ice.h:262
guint32 audio_ssrc
Audio SSRC of the gateway for this stream.
Definition: ice.h:330
gboolean janus_ice_is_full_trickle_enabled(void)
Method to check whether full-trickle support is enabled or not.
Definition: ice.c:88
SCTP processing for data channels (headers)
guint32 packets
Packets sent or received.
Definition: ice.h:188
gchar * local_sdp
SDP generated locally (just for debugging purposes)
Definition: ice.h:294
guint32 audio_ssrc_peer_orig
Definition: ice.h:336
Reference counter mechanism.
struct janus_seq_info * prev
Definition: ice.h:236
gsize janus_flags
Janus flags container.
Definition: utils.h:85
struct json_t json_t
Definition: plugin.h:223
guint nack_sent_recent_cnt
Number of NACKs sent since last log message.
Definition: ice.h:463
guint component_id
libnice ICE component ID
Definition: ice.h:423
void janus_seq_list_free(janus_seq_info **head)
Definition: ice.c:428
janus_ice_stream * stream
Janus ICE stream this component belongs to.
Definition: ice.h:419
gint64 audio_first_ntp_ts
First received audio NTP timestamp.
Definition: ice.h:366
Janus media statistics container.
Definition: ice.h:203
void janus_ice_component_destroy(janus_ice_component *component)
Method to only free resources related to a specific ICE component allocated by a Janus ICE handle...
Definition: ice.c:1290
uint16_t janus_ice_get_stun_port(void)
Method to get the STUN server port.
Definition: ice.c:45
gboolean janus_ice_is_ice_lite_enabled(void)
Method to check whether ICE Lite mode is enabled or not (still WIP)
Definition: ice.c:76
janus_mutex mutex
Mutex to lock/unlock this component.
Definition: ice.h:475
GThread * icethread
GLib thread for libnice.
Definition: ice.h:270
gchar * stream_mid
Main mid (will be a pointer to one of the above)
Definition: ice.h:286
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:715
struct janus_seq_info janus_seq_info
A helper struct for determining when to send NACKs.
janus_refcount ref
Reference counter for this instance.
Definition: ice.h:412
janus_mutex mutex
Mutex to lock/unlock this stream.
Definition: ice.h:408
GSource * stats_source
Definition: ice.h:272
NiceAgent * agent
libnice ICE agent
Definition: ice.h:274
gint64 nack_sent_log_ts
Last time a log message about sending NACKs was printed.
Definition: ice.h:461
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:352
struct janus_ice_stats janus_ice_stats
Janus media statistics container.
char * janus_ice_get_turn_rest_api(void)
Method to get the specified TURN REST API backend, if any.
Definition: ice.c:65
Definition: ice.h:241
gboolean process_started
Whether the setup of remote candidates for this component has started or not.
Definition: ice.h:437
janus_refcount ref
Reference counter for this instance.
Definition: ice.h:479
SDP m-line representation.
Definition: sdp-utils.h:128
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.
Plugin-Gateway communication (implementation)
Janus ICE stream.
Definition: ice.h:322
gint janus_ice_handle_attach_plugin(void *core_session, janus_ice_handle *handle, janus_plugin *plugin)
Method to attach a Janus ICE handle to a plugin.
Definition: ice.c:981
void janus_ice_webrtc_hangup(janus_ice_handle *handle, const char *reason)
Method to only hangup (e.g., DTLS alert) the WebRTC PeerConnection allocated by a Janus ICE handle...
Definition: ice.c:1120
void janus_ice_set_event_stats_period(int period)
Method to modify the event handler statistics period (i.e., the number of seconds that should pass be...
Definition: ice.c:192
ogg_stream_state * stream
Definition: pp-opus.c:31
Janus ICE component.
Definition: ice.h:417
void janus_ice_restart(janus_ice_handle *handle)
Method to restart ICE and the connectivity checks.
Definition: ice.c:3203
uint janus_get_no_media_timer(void)
Method to get the current no-media event timer (see above)
Definition: ice.c:313
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:456
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:3970
GSList * candidates
GLib list of libnice remote candidates for this component.
Definition: ice.h:429
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:172
gboolean janus_ice_is_ipv6_enabled(void)
Method to check whether IPv6 candidates are enabled/supported or not (still WIP)
Definition: ice.c:94
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:2604
gint last_event_stats
Count of how many seconds passed since the last stats passed to event handlers.
Definition: ice.h:308
Instance of a text2pcap recorder.
Definition: text2pcap.h:47
guint16 seq
Definition: ice.h:233
janus_ice_handle * handle
Janus ICE handle this trickle candidate belongs to.
Definition: ice.h:485
gchar * remote_fingerprint
Hashed fingerprint of the peer&#39;s certificate, as parsed in SDP.
Definition: ice.h:396
void janus_set_rfc4588_enabled(gboolean enabled)
Method to enable or disable the RFC4588 support negotiation.
Definition: ice.c:320
void janus_ice_init(gboolean ice_lite, gboolean ice_tcp, gboolean full_trickle, gboolean ipv6, uint16_t rtp_min_port, uint16_t rtp_max_port)
ICE stuff initialization.
Definition: ice.c:658
Definition: refcount.h:78
GSList * remote_candidates
GLib list of remote candidates for this component (summary)
Definition: ice.h:433
GHashTable * components
GLib hash table of components (IDs are the keys)
Definition: ice.h:402
gint cdone
Number of gathered candidates.
Definition: ice.h:264
gchar * video_mid
Video mid (media ID)
Definition: ice.h:282
gchar * rtp_profile
RTP profile set by caller (so that we can match it)
Definition: ice.h:292
TURN REST API client.
char * transaction
Janus API transaction ID of the original trickle request.
Definition: ice.h:489
void janus_ice_stream_destroy(janus_ice_stream *stream)
Method to only free resources related to a specific ICE stream allocated by a Janus ICE handle...
Definition: ice.c:1213
Helper to handle pending trickle candidates (e.g., when we&#39;re still waiting for an offer) ...
Definition: ice.h:483
struct janus_seq_info * next
Definition: ice.h:235
guint stream_id
libnice ICE stream ID
Definition: ice.h:421
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:82
gint64 created
Monotonic time of when the handle has been created.
Definition: ice.h:256
const gchar * janus_get_ice_state_name(gint state)
Helper method to get a string representation of a libnice ICE state.
Definition: ice.c:936
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:161
void janus_ice_relay_sctp(janus_ice_handle *handle, char *buffer, int length)
Gateway SCTP/DataChannel callback, called by the SCTP stack when when there&#39;s data to send...
Definition: ice.c:4051
gboolean do_transport_wide_cc
Wether we do transport wide cc for video.
Definition: ice.h:378
GMainLoop * iceloop
GLib loop for libnice.
Definition: ice.h:268
volatile gint destroyed
Atomic flag to check if this instance has been destroyed.
Definition: ice.h:316
GSList * transport_wide_received_seq_nums
GLib list of transport wide cc stats in reverse received order.
Definition: ice.h:390
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:2841
GSource * dtlsrt_source
Re-transmission timer for DTLS.
Definition: ice.h:443
The plugin session and callbacks interface.
Definition: plugin.h:239
janus_refcount ref
Reference counter for this instance.
Definition: ice.h:318
guint transport_wide_cc_ext_id
Transport wide cc rtp ext ID.
Definition: ice.h:380
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:359
janus_plugin_session * app_handle
Opaque gateway/plugin session pointer.
Definition: ice.h:260
guint retransmit_recent_cnt
Number of retransmitted packets since last log message.
Definition: ice.h:459
RTP context, in order to make sure SSRC changes result in coherent seq/ts increases.
Definition: rtp.h:155
volatile gint destroyed
Atomic flag to check if this instance has been destroyed.
Definition: ice.h:477
janus_ice_handle * handle
Janus ICE handle this stream belongs to.
Definition: ice.h:324
Definition: ice.h:240
janus_ice_stats out_stats
Stats for outgoing data (audio/video/data)
Definition: ice.h:471
void janus_ice_debugging_disable(void)
Method to disable libnice debugging (the default)
Definition: ice.c:119
RTCP processing (headers)
gint64 updated
Time we last updated the last second counter.
Definition: ice.h:194
uint16_t janus_ice_get_turn_port(void)
Method to get the TURN server port.
Definition: ice.c:59
GSList * local_candidates
GLib list of local candidates for this component (summary)
Definition: ice.h:431
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:2804
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:1155
GQueue * video_retransmit_buffer
Definition: ice.h:451
guint stream_id
ICE Stream ID.
Definition: ice.h:288
gint64 ts
Definition: ice.h:232
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:128
void janus_ice_deinit(void)
ICE stuff de-initialization.
Definition: ice.c:709
janus_ice_stats_info audio
Audio info.
Definition: ice.h:205
gchar * remote_hashing
Hashing algorhitm used by the peer for the DTLS certificate (e.g., "SHA-256")
Definition: ice.h:394
gchar * ruser
The ICE username for this stream.
Definition: ice.h:398
gboolean janus_is_rfc4588_enabled(void)
Method to check whether the RFC4588 support is enabled.
Definition: ice.c:324
gchar * remote_sdp
SDP received by the peer (just for debugging purposes)
Definition: ice.h:296
A helper struct for determining when to send NACKs.
Definition: ice.h:231
char * janus_ice_get_stun_server(void)
Method to get the STUN server IP address.
Definition: ice.c:42
void * app
Opaque application (plugin) pointer.
Definition: ice.h:258
int janus_ice_get_event_stats_period(void)
Method to get the current event handler statistics period (see above)
Definition: ice.c:195
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:4030
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:101
guint32 transport_wide_cc_last_seq_num
Last received transport wide seq num.
Definition: ice.h:382
janus_ice_stream * stream
ICE stream.
Definition: ice.h:290
void janus_ice_trickle_destroy(janus_ice_trickle *trickle)
Helper method to destroy a janus_ice_trickle instance.
Definition: ice.c:645
gint cdone
Whether this stream is ready to be used.
Definition: ice.h:328
gboolean notified_lastsec
Whether or not we notified about lastsec issues already.
Definition: ice.h:196
gint video_rtx_payload_type
Definition: ice.h:352
gint last_srtp_summary
Definition: ice.h:306
Definition: ice.h:243
guint32 audio_first_rtp_ts
First received audio RTP timestamp.
Definition: ice.h:368
Janus ICE handle.
Definition: ice.h:248
guint32 video_ssrc
Video SSRC of the gateway for this stream.
Definition: ice.h:332
char * opaque_id
Opaque identifier, e.g., to provide inter-handle relationships to external tools. ...
Definition: ice.h:254
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:859
struct janus_ice_stats_info janus_ice_stats_info
Janus media statistics.
GList * video_payload_types
List of payload types we can expect for video.
Definition: ice.h:348
gboolean controlling
ICE role (controlling or controlled)
Definition: ice.h:278
GMainContext * icectx
GLib context for libnice.
Definition: ice.h:266
GHashTable * video_retransmit_seqs
Definition: ice.h:453
guint32 audio_last_ts
Last sent audio RTP timestamp.
Definition: ice.h:374
Janus media statistics.
Definition: ice.h:186
gboolean do_audio_nacks
Whether we should do NACKs (in or out) for audio.
Definition: ice.h:447
void * session
Opaque pointer to the gateway/peer session.
Definition: ice.h:250
guint32 video_last_ts
Last sent video RTP timestamp.
Definition: ice.h:376
guint32 nacks
Number of NACKs sent or received.
Definition: ice.h:198
gchar * rpass
The ICE password for this stream.
Definition: ice.h:400
pthread_mutex_t janus_mutex
Janus mutex implementation.
Definition: mutex.h:21
janus_text2pcap * text2pcap
In case this session must be saved to text2pcap, the instance to dump packets to. ...
Definition: ice.h:312
gint64 component_connected
Monotonic time of when this component has successfully connected.
Definition: ice.h:427
int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int video, int data, int trickle)
Method to locally set up the ICE candidates (initialization and gathering)
Definition: ice.c:2904
Janus DTLS-SRTP handle.
Definition: dtls.h:55
janus_mutex mutex
Mutex to lock/unlock the ICE session.
Definition: ice.h:314
volatile gint destroyed
Atomic flag to check if this instance has been destroyed.
Definition: ice.h:410
janus_rtcp_context * audio_rtcp_ctx
RTCP context for the audio stream.
Definition: ice.h:360
volatile gint dump_packets
Flag to decide whether or not packets need to be dumped to a text2pcap file.
Definition: ice.h:310
guint64 bytes
Bytes sent or received.
Definition: ice.h:190
gint janus_ice_trickle_parse(janus_ice_handle *handle, json_t *candidate, const char **error)
Helper method to parse trickle candidates.
Definition: ice.c:580
GList * audio_payload_types
List of payload types we can expect for audio.
Definition: ice.h:346
guint sl_nack_recent_cnt
Count of recent NACKs (for slow_link)
Definition: ice.h:215
Internal RTCP state context (for RR/SR)
Definition: rtcp.h:226
guint32 bytes_lastsec
Bytes sent or received in the last second.
Definition: ice.h:192
gchar * data_mid
Data channel mid (media ID)
Definition: ice.h:284
guint64 handle_id
Handle identifier, guaranteed to be non-zero.
Definition: ice.h:252
Plugin-Gateway session mapping.
Definition: plugin.h:226
gint64 agent_created
Monotonic time of when the ICE agent has been created.
Definition: ice.h:276
guint transport_wide_cc_feedback_count
Transport wide cc rtp ext ID.
Definition: ice.h:388
GAsyncQueue * queued_packets
Queue of outgoing packets to send.
Definition: ice.h:302
guint32 transport_wide_cc_last_feedback_seq_num
Last transport wide seq num sent on feedback.
Definition: ice.h:384
janus_dtls_srtp * dtls
DTLS-SRTP stack.
Definition: ice.h:445
janus_seq_info * last_seqs_audio
List of recently received audio sequence numbers (as a support to NACK generation) ...
Definition: ice.h:465
GList * pending_trickles
List of pending trickle candidates (those we received before getting the JSEP offer) ...
Definition: ice.h:300
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:136
gint64 received
Monotonic time of when this trickle candidate has been received.
Definition: ice.h:487
gboolean do_video_nacks
Whether we should do NACKs (in or out) for video.
Definition: ice.h:449
janus_ice_component * component
ICE component.
Definition: ice.h:404
gint64 icefailed_detected
Time of when we first detected an ICE failed (we&#39;ll need this for the timer above) ...
Definition: ice.h:441
void janus_ice_debugging_enable(void)
Method to enable libnice debugging (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html)
Definition: ice.c:104
SDP processing (headers)
guint16 rtx_seq_number
Current sequence number for the RFC4588 rtx SSRC session.
Definition: ice.h:455
gint janus_ice_handle_destroy(void *core_session, janus_ice_handle *handle)
Method to destroy a Janus ICE handle.
Definition: ice.c:1022
guint16 transport_wide_cc_cycles
Transport wide cc transport seq num wrap cycles.
Definition: ice.h:386
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:144
guint32 video_ssrc_rtx
Video retransmission SSRC of the peer for this stream.
Definition: ice.h:334
guint16 state
Definition: ice.h:234
Dumping of RTP/RTCP packets to text2pcap format (headers)
char * janus_ice_get_turn_server(void)
Method to get the TURN server IP address.
Definition: ice.c:56
guint stream_id
libnice ICE stream ID
Definition: ice.h:326
Definition: ice.h:242
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:306
GSource * icestate_source
Timer to check when we should consider ICE as failed.
Definition: ice.h:439
gint64 sl_nack_period_ts
Start time of recent NACKs (for slow_link)
Definition: ice.h:213
gchar * selected_pair
String representation of the selected pair as notified by libnice (foundations)
Definition: ice.h:435
janus_ice_stats_info data
Data info.
Definition: ice.h:209
janus_dtls_role
DTLS roles.
Definition: dtls.h:40
char * video_codec
Definition: ice.h:354
janus_ice_trickle * janus_ice_trickle_new(const char *transaction, json_t *candidate)
Helper method to allocate a janus_ice_trickle instance.
Definition: ice.c:569
janus_dtls_role dtls_role
DTLS role of the gateway for this stream.
Definition: ice.h:392
gint64 last_slowlink_time
Last time the slow_link callback (of the plugin) was called.
Definition: ice.h:211
guint32 bytes_lastsec_temp
Definition: ice.h:192
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:4068
gboolean noerrorlog
Helper flag to avoid flooding the console with the same error all over again.
Definition: ice.h:406