Janus handles and ICE/STUN/TURN processing (headers) More...
#include <glib.h>
#include <agent.h>
#include "sdp.h"
#include "dtls.h"
#include "sctp.h"
#include "rtcp.h"
#include "text2pcap.h"
#include "utils.h"
#include "ip-utils.h"
#include "refcount.h"
#include "plugins/plugin.h"
Go to the source code of this file.
Data Structures | |
struct | janus_media_stats_info |
Janus media statistics. More... | |
struct | janus_media_stats |
Janus media statistics container. More... | |
struct | janus_seq_info |
A helper struct for determining when to send NACKs. More... | |
struct | janus_handle |
Janus handle. More... | |
struct | janus_handle_webrtc |
Janus handle WebRTC PeerConnection. More... | |
struct | janus_handle_webrtc_medium |
A single media in a PeerConnection. More... | |
struct | janus_trickle |
Helper to handle pending trickle candidates (e.g., when we're still waiting for an offer) More... | |
Macros | |
#define | JANUS_HANDLE_WEBRTC_PROCESSING_OFFER (1 << 0) |
#define | JANUS_HANDLE_WEBRTC_START (1 << 1) |
#define | JANUS_HANDLE_WEBRTC_READY (1 << 2) |
#define | JANUS_HANDLE_WEBRTC_STOP (1 << 3) |
#define | JANUS_HANDLE_WEBRTC_ALERT (1 << 4) |
#define | JANUS_HANDLE_WEBRTC_NEGOTIATED (1 << 5) |
#define | JANUS_HANDLE_WEBRTC_TRICKLE (1 << 7) |
#define | JANUS_HANDLE_WEBRTC_ALL_TRICKLES (1 << 8) |
#define | JANUS_HANDLE_WEBRTC_TRICKLE_SYNCED (1 << 9) |
#define | JANUS_HANDLE_WEBRTC_DATA_CHANNELS (1 << 10) |
#define | JANUS_HANDLE_WEBRTC_CLEANING (1 << 11) |
#define | JANUS_HANDLE_WEBRTC_GOT_OFFER (1 << 14) |
#define | JANUS_HANDLE_WEBRTC_GOT_ANSWER (1 << 15) |
#define | JANUS_HANDLE_WEBRTC_HAS_AGENT (1 << 16) |
#define | JANUS_HANDLE_WEBRTC_ICE_RESTART (1 << 17) |
#define | JANUS_HANDLE_WEBRTC_RESEND_TRICKLES (1 << 18) |
#define | JANUS_HANDLE_WEBRTC_RFC4588_RTX (1 << 19) |
#define | JANUS_HANDLE_WEBRTC_NEW_DATACHAN_SDP (1 << 20) |
#define | LAST_SEQS_MAX_LEN 160 |
Typedefs | |
typedef struct janus_handle | janus_handle |
Janus handle in a session. More... | |
typedef struct janus_handle_webrtc | janus_handle_webrtc |
Janus handle WebRTC PeerConnection. More... | |
typedef struct janus_handle_webrtc_medium | janus_handle_webrtc_medium |
A single medium (i.e., m-line) in a Janus handle PeerConnection: can be bidirectional. More... | |
typedef struct janus_trickle | janus_trickle |
Helper to handle pending trickle candidates (e.g., when we're still waiting for an offer) More... | |
typedef enum janus_media_type | janus_media_type |
Janus media types. More... | |
typedef struct janus_media_stats_info | janus_media_stats_info |
Janus media statistics. More... | |
typedef struct janus_media_stats | janus_media_stats |
Janus media statistics container. More... | |
typedef struct janus_seq_info | janus_seq_info |
A helper struct for determining when to send NACKs. More... | |
Enumerations | |
enum | janus_media_type { JANUS_MEDIA_UNKNOWN = 0, JANUS_MEDIA_AUDIO, JANUS_MEDIA_VIDEO, JANUS_MEDIA_DATA } |
Janus media types. More... | |
enum | { SEQ_MISSING, SEQ_NACKED, SEQ_GIVEUP, SEQ_RECVED } |
Functions | |
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. More... | |
void | janus_ice_deinit (void) |
ICE stuff de-initialization. More... | |
int | janus_ice_test_stun_server (janus_network_address *addr, uint16_t port, janus_network_address *public_addr) |
Method to check whether a STUN server is reachable. More... | |
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. More... | |
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. More... | |
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 candidates. The TURN REST API takes precedence over any static credential passed via janus_ice_set_turn_server. More... | |
char * | janus_ice_get_stun_server (void) |
Method to get the STUN server IP address. More... | |
uint16_t | janus_ice_get_stun_port (void) |
Method to get the STUN server port. More... | |
char * | janus_ice_get_turn_server (void) |
Method to get the TURN server IP address. More... | |
uint16_t | janus_ice_get_turn_port (void) |
Method to get the TURN server port. More... | |
char * | janus_ice_get_turn_rest_api (void) |
Method to get the specified TURN REST API backend, if any. More... | |
void | janus_ice_enable_nat_1_1 (void) |
Helper method to force Janus to overwrite all host candidates with the public IP. More... | |
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 and ignore the others) More... | |
gboolean | janus_ice_is_enforced (const char *ip) |
Method to check whether an interface is currently in the enforce list for ICE (that is, won't have candidates) More... | |
void | janus_ice_ignore_interface (const char *ip) |
Method to add an interface/IP to the ignore list for ICE (that is, don't gather candidates) More... | |
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, won't have candidates) More... | |
gboolean | janus_ice_is_ice_lite_enabled (void) |
Method to check whether ICE Lite mode is enabled or not (still WIP) More... | |
gboolean | janus_ice_is_ice_tcp_enabled (void) |
Method to check whether ICE-TCP support is enabled/supported or not (still WIP) More... | |
gboolean | janus_ice_is_full_trickle_enabled (void) |
Method to check whether full-trickle support is enabled or not. More... | |
gboolean | janus_ice_is_ipv6_enabled (void) |
Method to check whether IPv6 candidates are enabled/supported or not (still WIP) More... | |
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 retransmissions) More... | |
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 retransmissions) More... | |
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 Janus notifies this) More... | |
uint | janus_get_no_media_timer (void) |
Method to get the current no-media event timer (see above) More... | |
void | janus_set_slowlink_threshold (uint packets) |
Method to modify the slowlink-threshold property (i.e., the number of lost packets per seconds that should trigger a slow-link event) More... | |
uint | janus_get_slowlink_threshold (void) |
Method to get the current slowlink-threshold value (see above) More... | |
void | janus_set_twcc_period (uint period) |
Method to modify the TWCC feedback period (i.e., how often TWCC feedback is sent back to media senders) More... | |
uint | janus_get_twcc_period (void) |
Method to get the current TWCC period (see above) More... | |
void | janus_set_rfc4588_enabled (gboolean enabled) |
Method to enable or disable the RFC4588 support negotiation. More... | |
gboolean | janus_is_rfc4588_enabled (void) |
Method to check whether the RFC4588 support is enabled. More... | |
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 before Janus notifies event handlers about media statistics for a PeerConnection) More... | |
int | janus_ice_get_event_stats_period (void) |
Method to get the current event handler statistics period (see above) More... | |
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) More... | |
void | janus_ice_debugging_enable (void) |
Method to enable libnice debugging (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html) More... | |
void | janus_ice_debugging_disable (void) |
Method to disable libnice debugging (the default) More... | |
void | janus_enable_opaqueid_in_api (void) |
Method to enable opaque ID in Janus API responses/events. More... | |
gboolean | janus_is_opaqueid_in_api_enabled (void) |
Method to check whether opaque ID have to be added to Janus API responses/events. More... | |
const gchar * | janus_get_ice_state_name (gint state) |
Helper method to get a string representation of a libnice ICE state. More... | |
void | janus_ice_notify_hangup (janus_handle *handle, const char *reason) |
Quick helper method to notify a WebRTC hangup through the Janus API. More... | |
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. More... | |
void | janus_seq_list_free (janus_seq_info **head) |
janus_handle_webrtc_medium * | janus_handle_webrtc_medium_create (janus_handle *handle, janus_media_type type) |
Method to quickly create a medium to be added to a handle PeerConnection. More... | |
void | janus_ice_set_static_event_loops (int loops) |
Method to configure the static event loops mechanism at startup. More... | |
int | janus_ice_get_static_event_loops (void) |
Method to return the number of static event loops, if enabled. More... | |
void | janus_ice_stop_static_event_loops (void) |
Method to stop all the static event loops, if enabled. More... | |
Janus ICE trickle candidates methods | |
janus_trickle * | janus_trickle_new (const char *transaction, json_t *candidate) |
Helper method to allocate a janus_trickle instance. More... | |
gint | janus_trickle_parse (janus_handle *handle, json_t *candidate, const char **error) |
Helper method to parse trickle candidates. More... | |
void | janus_trickle_destroy (janus_trickle *trickle) |
Helper method to destroy a janus_trickle instance. More... | |
Janus handle methods | |
janus_handle * | janus_handle_create (void *core_session, const char *opaque_id) |
Method to create a new Janus handle. More... | |
gint | janus_handle_attach_plugin (void *core_session, janus_handle *handle, janus_plugin *plugin) |
Method to attach a Janus handle to a plugin. More... | |
gint | janus_handle_destroy (void *core_session, janus_handle *handle) |
Method to destroy a Janus handle. More... | |
void | janus_handle_webrtc_hangup (janus_handle *handle, const char *reason) |
Method to only hangup (e.g., DTLS alert) the WebRTC PeerConnection allocated by a Janus handle. More... | |
void | janus_handle_webrtc_destroy (janus_handle_webrtc *pc) |
Method to only free resources related to a specific PeerConnection allocated by a Janus handle. More... | |
Janus media relaying callbacks | |
void | janus_ice_relay_rtp (janus_handle *handle, int mindex, gboolean video, char *buf, int len) |
Core RTP callback, called when a plugin has an RTP packet to send to a peer. More... | |
void | janus_ice_relay_rtcp (janus_handle *handle, int mindex, gboolean video, char *buf, int len) |
Core RTCP callback, called when a plugin has an RTCP message to send to a peer. More... | |
void | janus_ice_relay_data (janus_handle *handle, char *label, char *buf, int len) |
Core SCTP/DataChannel callback, called when a plugin has data to send to a peer. More... | |
void | janus_ice_incoming_data (janus_handle *handle, char *label, char *buffer, int length) |
Plugin SCTP/DataChannel callback, called by the SCTP stack when when there's data for a plugin. More... | |
void | janus_ice_relay_sctp (janus_handle *handle, char *buffer, int length) |
Core SCTP/DataChannel callback, called by the SCTP stack when when there's data to send. More... | |
Janus handle helpers | |
int | janus_handle_setup_local (janus_handle *handle, gboolean offer, gboolean trickle) |
Method to locally set up the ICE candidates (initialization and gathering) More... | |
void | janus_handle_candidates_to_sdp (janus_handle *handle, janus_sdp_mline *mline, guint stream_id, guint component_id) |
Method to add local candidates to a janus_sdp SDP object representation. More... | |
void | janus_handle_setup_remote_candidates (janus_handle *handle, guint stream_id, guint component_id) |
Method to handle remote candidates and start the connectivity checks. More... | |
void | janus_handle_dtls_handshake_done (janus_handle *handle) |
Callback to be notified when the DTLS handshake for a specific component has been completed. More... | |
void | janus_handle_ice_restart (janus_handle *handle) |
Method to restart ICE and the connectivity checks. More... | |
void | janus_handle_resend_trickles (janus_handle *handle) |
Method to resend all the existing candidates via trickle (e.g., after an ICE restart) More... | |
Janus handles and ICE/STUN/TURN processing (headers)
A Janus handle represents an abstraction of the communication between a user and a specific plugin, within a Janus session. This is particularly important in terms of media connectivity, as each handle can be associated with a single WebRTC PeerConnection. This code also contains the implementation (based on libnice) of a WebRTC PeerConnection. The code handles the whole ICE process, from the gathering of candidates to the final setup of a virtual channel RTP and RTCP can be transported on. Incoming RTP and RTCP packets from peers are relayed to the associated plugins by means of the incoming_rtp and incoming_rtcp callbacks. Packets to be sent to peers are relayed by peers invoking the relay_rtp and relay_rtcp core callbacks instead.
#define JANUS_HANDLE_WEBRTC_ALERT (1 << 4) |
#define JANUS_HANDLE_WEBRTC_ALL_TRICKLES (1 << 8) |
#define JANUS_HANDLE_WEBRTC_CLEANING (1 << 11) |
#define JANUS_HANDLE_WEBRTC_DATA_CHANNELS (1 << 10) |
#define JANUS_HANDLE_WEBRTC_GOT_ANSWER (1 << 15) |
#define JANUS_HANDLE_WEBRTC_GOT_OFFER (1 << 14) |
#define JANUS_HANDLE_WEBRTC_HAS_AGENT (1 << 16) |
#define JANUS_HANDLE_WEBRTC_ICE_RESTART (1 << 17) |
#define JANUS_HANDLE_WEBRTC_NEGOTIATED (1 << 5) |
#define JANUS_HANDLE_WEBRTC_NEW_DATACHAN_SDP (1 << 20) |
#define JANUS_HANDLE_WEBRTC_PROCESSING_OFFER (1 << 0) |
#define JANUS_HANDLE_WEBRTC_READY (1 << 2) |
#define JANUS_HANDLE_WEBRTC_RESEND_TRICKLES (1 << 18) |
#define JANUS_HANDLE_WEBRTC_RFC4588_RTX (1 << 19) |
#define JANUS_HANDLE_WEBRTC_START (1 << 1) |
#define JANUS_HANDLE_WEBRTC_STOP (1 << 3) |
#define JANUS_HANDLE_WEBRTC_TRICKLE (1 << 7) |
#define JANUS_HANDLE_WEBRTC_TRICKLE_SYNCED (1 << 9) |
#define LAST_SEQS_MAX_LEN 160 |
typedef struct janus_handle janus_handle |
Janus handle in a session.
typedef struct janus_handle_webrtc janus_handle_webrtc |
Janus handle WebRTC PeerConnection.
typedef struct janus_handle_webrtc_medium janus_handle_webrtc_medium |
A single medium (i.e., m-line) in a Janus handle PeerConnection: can be bidirectional.
typedef struct janus_media_stats janus_media_stats |
Janus media statistics container.
typedef struct janus_media_stats_info janus_media_stats_info |
Janus media statistics.
typedef enum janus_media_type janus_media_type |
Janus media types.
typedef struct janus_seq_info janus_seq_info |
A helper struct for determining when to send NACKs.
typedef struct janus_trickle janus_trickle |
Helper to handle pending trickle candidates (e.g., when we're still waiting for an offer)
enum janus_media_type |
void janus_enable_opaqueid_in_api | ( | void | ) |
Method to enable opaque ID in Janus API responses/events.
const gchar* janus_get_ice_state_name | ( | gint | state | ) |
Helper method to get a string representation of a libnice ICE state.
[in] | state | The libnice ICE state |
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 retransmissions)
uint janus_get_no_media_timer | ( | void | ) |
Method to get the current no-media event timer (see above)
uint janus_get_slowlink_threshold | ( | void | ) |
Method to get the current slowlink-threshold value (see above)
uint janus_get_twcc_period | ( | void | ) |
Method to get the current TWCC period (see above)
gint janus_handle_attach_plugin | ( | void * | core_session, |
janus_handle * | handle, | ||
janus_plugin * | plugin | ||
) |
Method to attach a Janus handle to a plugin.
This method is very important, as it allows plugins to send/receive media (RTP/RTCP) to/from a WebRTC peer.
[in] | core_session | The core/peer session this ICE handle belongs to |
[in] | handle | The Janus handle |
[in] | plugin | The plugin the ICE handle needs to be attached to |
void janus_handle_candidates_to_sdp | ( | janus_handle * | handle, |
janus_sdp_mline * | mline, | ||
guint | stream_id, | ||
guint | component_id | ||
) |
Method to add local candidates to a janus_sdp SDP object representation.
[in] | handle | The Janus handle this method refers to |
[in] | mline | The Janus SDP m-line object to add candidates to |
[in] | stream_id | The stream ID of the candidate to add to the SDP |
[in] | component_id | The component ID of the candidate to add to the SDP |
janus_handle* janus_handle_create | ( | void * | core_session, |
const char * | opaque_id | ||
) |
Method to create a new Janus handle.
[in] | core_session | The core/peer session this ICE handle will belong to |
[in] | opaque_id | The opaque identifier provided by the creator, if any (optional) |
gint janus_handle_destroy | ( | void * | core_session, |
janus_handle * | handle | ||
) |
Method to destroy a Janus handle.
[in] | core_session | The core/peer session this ICE handle belongs to |
[in] | handle | The Janus handle to destroy |
void janus_handle_dtls_handshake_done | ( | janus_handle * | handle | ) |
Callback to be notified when the DTLS handshake for a specific component has been completed.
This method also decides when to notify attached plugins about the availability of a reliable PeerConnection
[in] | handle | The Janus handle this callback refers to |
void janus_handle_ice_restart | ( | janus_handle * | handle | ) |
Method to restart ICE and the connectivity checks.
[in] | handle | The Janus handle this method refers to |
void janus_handle_resend_trickles | ( | janus_handle * | handle | ) |
Method to resend all the existing candidates via trickle (e.g., after an ICE restart)
[in] | handle | The Janus handle this method refers to |
int janus_handle_setup_local | ( | janus_handle * | handle, |
gboolean | offer, | ||
gboolean | trickle | ||
) |
Method to locally set up the ICE candidates (initialization and gathering)
[in] | handle | The Janus handle this method refers to |
[in] | offer | Whether this is for an OFFER or an ANSWER |
[in] | trickle | Whether ICE trickling is supported or not |
void janus_handle_setup_remote_candidates | ( | janus_handle * | handle, |
guint | stream_id, | ||
guint | component_id | ||
) |
Method to handle remote candidates and start the connectivity checks.
[in] | handle | The Janus handle this method refers to |
[in] | stream_id | The stream ID of the candidate to add to the SDP |
[in] | component_id | The component ID of the candidate to add to the SDP |
void janus_handle_webrtc_destroy | ( | janus_handle_webrtc * | pc | ) |
Method to only free resources related to a specific PeerConnection allocated by a Janus handle.
[in] | pc | The WebRTC PeerConnection instance to free |
void janus_handle_webrtc_hangup | ( | janus_handle * | handle, |
const char * | reason | ||
) |
Method to only hangup (e.g., DTLS alert) the WebRTC PeerConnection allocated by a Janus handle.
[in] | handle | The Janus handle instance managing the WebRTC PeerConnection to hangup |
[in] | reason | A description of why this happened |
janus_handle_webrtc_medium* janus_handle_webrtc_medium_create | ( | janus_handle * | handle, |
janus_media_type | type | ||
) |
Method to quickly create a medium to be added to a handle PeerConnection.
[in] | handle | The Janus handle instance to add the medium to |
[in] | type | The medium type |
void janus_ice_debugging_disable | ( | void | ) |
Method to disable libnice debugging (the default)
void janus_ice_debugging_enable | ( | void | ) |
Method to enable libnice debugging (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html)
void janus_ice_deinit | ( | void | ) |
ICE stuff de-initialization.
void janus_ice_enable_nat_1_1 | ( | void | ) |
Helper method to force Janus to overwrite all host candidates with the public IP.
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 and ignore the others)
[in] | ip | Interface/IP to enforce (e.g., 192.168. or eth0) |
int janus_ice_get_event_stats_period | ( | void | ) |
Method to get the current event handler statistics period (see above)
int janus_ice_get_static_event_loops | ( | void | ) |
Method to return the number of static event loops, if enabled.
uint16_t janus_ice_get_stun_port | ( | void | ) |
Method to get the STUN server port.
char* janus_ice_get_stun_server | ( | void | ) |
Method to get the STUN server IP address.
uint16_t janus_ice_get_turn_port | ( | void | ) |
Method to get the TURN server port.
char* janus_ice_get_turn_rest_api | ( | void | ) |
Method to get the specified TURN REST API backend, if any.
char* janus_ice_get_turn_server | ( | void | ) |
Method to get the TURN server IP address.
void janus_ice_ignore_interface | ( | const char * | ip | ) |
Method to add an interface/IP to the ignore list for ICE (that is, don't gather candidates)
[in] | ip | Interface/IP to ignore (e.g., 192.168. or eth1) |
void janus_ice_incoming_data | ( | janus_handle * | handle, |
char * | label, | ||
char * | buffer, | ||
int | length | ||
) |
Plugin SCTP/DataChannel callback, called by the SCTP stack when when there's data for a plugin.
[in] | handle | The Janus handle associated with the peer |
[in] | label | The label of the data channel the message is from |
[in] | buffer | The message data (buffer) |
[in] | length | The buffer lenght |
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.
[in] | ice_lite | Whether the ICE Lite mode should be enabled or not |
[in] | ice_tcp | Whether ICE-TCP support should be enabled or not (only libnice >= 0.1.8, currently broken) |
[in] | full_trickle | Whether full-trickle must be used (instead of half-trickle) |
[in] | ipv6 | Whether IPv6 candidates must be negotiated or not |
[in] | rtp_min_port | Minimum port to use for RTP/RTCP, if a range is to be used |
[in] | rtp_max_port | Maximum port to use for RTP/RTCP, if a range is to be used |
nice_agent_set_port_range
so this is checked by the install.sh script in advance. gboolean janus_ice_is_enforced | ( | const char * | ip | ) |
Method to check whether an interface is currently in the enforce list for ICE (that is, won't have candidates)
[in] | ip | Interface/IP to check (e.g., 192.168.244.1 or eth1) |
gboolean janus_ice_is_full_trickle_enabled | ( | void | ) |
Method to check whether full-trickle support is enabled or not.
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)
gboolean janus_ice_is_ice_lite_enabled | ( | void | ) |
Method to check whether ICE Lite mode is enabled or not (still WIP)
gboolean janus_ice_is_ice_tcp_enabled | ( | void | ) |
Method to check whether ICE-TCP support is enabled/supported or not (still WIP)
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, won't have candidates)
[in] | ip | Interface/IP to check (e.g., 192.168.244.1 or eth1) |
gboolean janus_ice_is_ipv6_enabled | ( | void | ) |
Method to check whether IPv6 candidates are enabled/supported or not (still WIP)
void janus_ice_notify_hangup | ( | janus_handle * | handle, |
const char * | reason | ||
) |
Quick helper method to notify a WebRTC hangup through the Janus API.
handle | The janus_handle instance this event refers to |
reason | A description of why this happened |
void janus_ice_relay_data | ( | janus_handle * | handle, |
char * | label, | ||
char * | buf, | ||
int | len | ||
) |
Core SCTP/DataChannel callback, called when a plugin has data to send to a peer.
[in] | handle | The Janus handle associated with the peer |
[in] | label | The label of the data channel to use |
[in] | buf | The message data (buffer) |
[in] | len | The buffer lenght |
void janus_ice_relay_rtcp | ( | janus_handle * | handle, |
int | mindex, | ||
gboolean | video, | ||
char * | buf, | ||
int | len | ||
) |
Core RTCP callback, called when a plugin has an RTCP message to send to a peer.
[in] | handle | The Janus handle associated with the peer |
[in] | mindex | Index of the target stream (relative to the SDP), -1 for the first audio/video stream |
[in] | video | Whether this is related to an audio or a video stream |
[in] | buf | The message data (buffer) |
[in] | len | The buffer lenght |
void janus_ice_relay_rtp | ( | janus_handle * | handle, |
int | mindex, | ||
gboolean | video, | ||
char * | buf, | ||
int | len | ||
) |
Core RTP callback, called when a plugin has an RTP packet to send to a peer.
[in] | handle | The Janus handle associated with the peer |
[in] | mindex | Index of the target stream (relative to the SDP), -1 for the first audio/video stream |
[in] | video | Whether this is an audio or a video frame |
[in] | buf | The packet data (buffer) |
[in] | len | The buffer lenght |
void janus_ice_relay_sctp | ( | janus_handle * | handle, |
char * | buffer, | ||
int | length | ||
) |
Core SCTP/DataChannel callback, called by the SCTP stack when when there's data to send.
[in] | handle | The Janus handle associated with the peer |
[in] | buffer | The message data (buffer) |
[in] | length | The buffer lenght |
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 before Janus notifies event handlers about media statistics for a PeerConnection)
[in] | period | The new period value, in seconds |
void janus_ice_set_static_event_loops | ( | int | loops | ) |
Method to configure the static event loops mechanism at startup.
event_loops
property in the janus.jcfg
configuration for an explanation of this feature, and the possible impact on Janus and users [in] | loops | The number of static event loops to start (0 to disable the feature) |
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.
[in] | stun_server | STUN server address to use |
[in] | stun_port | STUN port to use |
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 candidates. The TURN REST API takes precedence over any static credential passed via janus_ice_set_turn_server.
[in] | api_server | TURN REST API backend (NULL to disable the API) |
[in] | api_key | API key to use, if required |
[in] | api_method | HTTP method to use (POST by default) |
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.
[in] | turn_server | TURN server address to use |
[in] | turn_port | TURN port to use |
[in] | turn_type | Relay type (udp, tcp or tls) |
[in] | turn_user | TURN username, if needed |
[in] | turn_pwd | TURN password, if needed |
void janus_ice_stop_static_event_loops | ( | void | ) |
Method to stop all the static event loops, if enabled.
int janus_ice_test_stun_server | ( | janus_network_address * | addr, |
uint16_t | port, | ||
janus_network_address * | public_addr | ||
) |
Method to check whether a STUN server is reachable.
[in] | addr | Address of the STUN server as a janus_network_address instance |
[in] | port | Port of the STUN server |
[out] | public_addr | Public address returned by the STUN server as a janus_network_address instance |
gboolean janus_is_opaqueid_in_api_enabled | ( | void | ) |
Method to check whether opaque ID have to be added to Janus API responses/events.
gboolean janus_is_rfc4588_enabled | ( | void | ) |
Method to check whether the RFC4588 support is enabled.
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.
plugin_session | The janus_plugin_session instance to validate |
void janus_seq_list_free | ( | janus_seq_info ** | head | ) |
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 retransmissions)
[in] | mnq | The new max NACK value |
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 Janus notifies this)
[in] | timer | The new timer value, in seconds |
void janus_set_rfc4588_enabled | ( | gboolean | enabled | ) |
Method to enable or disable the RFC4588 support negotiation.
[in] | enabled | The new timer value, in seconds |
void janus_set_slowlink_threshold | ( | uint | packets | ) |
Method to modify the slowlink-threshold property (i.e., the number of lost packets per seconds that should trigger a slow-link event)
[in] | packets | The new value, in lost packets per seconds |
void janus_set_twcc_period | ( | uint | period | ) |
Method to modify the TWCC feedback period (i.e., how often TWCC feedback is sent back to media senders)
[in] | timer | The new period value, in milliseconds |
void janus_trickle_destroy | ( | janus_trickle * | trickle | ) |
Helper method to destroy a janus_trickle instance.
[in] | trickle | The janus_trickle instance to destroy |
janus_trickle* janus_trickle_new | ( | const char * | transaction, |
json_t * | candidate | ||
) |
Helper method to allocate a janus_trickle instance.
[in] | transaction | The Janus API ID of the original trickle request |
[in] | candidate | The trickle candidate, as a Jansson object |
gint janus_trickle_parse | ( | janus_handle * | handle, |
json_t * | candidate, | ||
const char ** | error | ||
) |
Helper method to parse trickle candidates.
[in] | handle | The Janus handle this candidate belongs to |
[in] | candidate | The trickle candidate to parse, as a Jansson object |
[in,out] | error | Error string describing the failure, if any |