Fork me on GitHub
Data Fields
janus_callbacks Struct Reference

Callbacks to contact the Janus core. More...

#include <plugin.h>

Data Fields

int(*const push_event )(janus_plugin_session *handle, janus_plugin *plugin, const char *transaction, json_t *message, json_t *jsep)
 Callback to push events/messages to a peer. More...
 
void(*const relay_rtp )(janus_plugin_session *handle, janus_plugin_rtp *packet)
 Callback to relay RTP packets to a peer. More...
 
void(*const relay_rtcp )(janus_plugin_session *handle, janus_plugin_rtcp *packet)
 Callback to relay RTCP messages to a peer. More...
 
void(*const relay_data )(janus_plugin_session *handle, janus_plugin_data *packet)
 Callback to relay SCTP/DataChannel messages to a peer. More...
 
void(*const send_pli )(janus_plugin_session *handle)
 Helper to ask for a keyframe via a RTCP PLI to all video streams. More...
 
void(*const send_pli_stream )(janus_plugin_session *handle, int mindex)
 Helper to ask for a keyframe via a RTCP PLI to a specific video stream. More...
 
void(*const send_remb )(janus_plugin_session *handle, guint32 bitrate)
 Helper to ask for a keyframe via a RTCP PLI. More...
 
void(*const close_pc )(janus_plugin_session *handle)
 Callback to ask the core to close a WebRTC PeerConnection. More...
 
void(*const end_session )(janus_plugin_session *handle)
 Callback to ask the core to get rid of a plugin/gateway session. More...
 
gboolean(*const events_is_enabled )(void)
 Callback to check whether the event handlers mechanism is enabled. More...
 
void(*const notify_event )(janus_plugin *plugin, janus_plugin_session *handle, json_t *event)
 Callback to notify an event to the registered and subscribed event handlers. More...
 
gboolean(*const auth_is_signature_valid )(janus_plugin *plugin, const char *token)
 Method to check whether a signed token is valid. More...
 
gboolean(*const auth_signature_contains )(janus_plugin *plugin, const char *token, const char *descriptor)
 Method to verify a signed token grants access to a descriptor. More...
 

Detailed Description

Callbacks to contact the Janus core.

Field Documentation

◆ auth_is_signature_valid

gboolean(* const janus_callbacks::auth_is_signature_valid) (janus_plugin *plugin, const char *token)

Method to check whether a signed token is valid.

Note
accepts only tokens with the plugin identifier as realm
Parameters
[in]tokenThe token to validate
Returns
TRUE if the signature is valid and not expired, FALSE otherwise

◆ auth_signature_contains

gboolean(* const janus_callbacks::auth_signature_contains) (janus_plugin *plugin, const char *token, const char *descriptor)

Method to verify a signed token grants access to a descriptor.

Note
accepts only tokens with the plugin identifier as realm
Parameters
[in]tokenThe token to validate
[in]descThe descriptor to search for
Returns
TRUE if the token is valid, not expired and contains the descriptor, FALSE otherwise

◆ close_pc

void(* const janus_callbacks::close_pc) (janus_plugin_session *handle)

Callback to ask the core to close a WebRTC PeerConnection.

Note
A call to this method will result in the core invoking the hangup_media callback on this plugin when done
Parameters
[in]handleThe plugin/gateway session that the PeerConnection is related to

◆ end_session

void(* const janus_callbacks::end_session) (janus_plugin_session *handle)

Callback to ask the core to get rid of a plugin/gateway session.

Note
A call to this method will result in the core invoking the destroy_session callback on this plugin when done
Parameters
[in]handleThe plugin/gateway session to get rid of

◆ events_is_enabled

gboolean(* const janus_callbacks::events_is_enabled) (void)

Callback to check whether the event handlers mechanism is enabled.

Returns
TRUE if it is, FALSE if it isn't (which means notify_event should NOT be called)

◆ notify_event

void(* const janus_callbacks::notify_event) (janus_plugin *plugin, janus_plugin_session *handle, json_t *event)

Callback to notify an event to the registered and subscribed event handlers.

Note
Don't unref the event object, the core will do that for you
Parameters
[in]pluginThe plugin originating the event
[in]handleThe plugin/gateway session originating the event, if any
[in]eventThe event to notify as a Jansson json_t object

◆ push_event

int(* const janus_callbacks::push_event) (janus_plugin_session *handle, janus_plugin *plugin, const char *transaction, json_t *message, json_t *jsep)

Callback to push events/messages to a peer.

Note
The Janus core increases the references to both the message and jsep json_t objects. This means that you'll have to decrease your own reference yourself with a json_decref after calling push_event.
Parameters
[in]handleThe plugin/gateway session used for this peer
[in]pluginThe plugin instance that is sending the message/event
[in]transactionThe transaction identifier this message refers to
[in]messageThe json_t object containing the JSON message
[in]jsepThe json_t object containing the JSEP type, the SDP attached to the message/event, if any (offer/answer), and whether this is an update

◆ relay_data

void(* const janus_callbacks::relay_data) (janus_plugin_session *handle, janus_plugin_data *packet)

Callback to relay SCTP/DataChannel messages to a peer.

Note
The protocol is only used for the first message sent on a new data channel, as it will be used to create it; it will be ignored for following messages on the same label, so you can set NULL after that
Parameters
[in]handleThe plugin/gateway session that will be used for this peer
[in]packetThe message data and related info

◆ relay_rtcp

void(* const janus_callbacks::relay_rtcp) (janus_plugin_session *handle, janus_plugin_rtcp *packet)

Callback to relay RTCP messages to a peer.

Parameters
[in]handleThe plugin/gateway session that will be used for this peer
[in]packetThe RTCP packet and related data

◆ relay_rtp

void(* const janus_callbacks::relay_rtp) (janus_plugin_session *handle, janus_plugin_rtp *packet)

Callback to relay RTP packets to a peer.

Parameters
[in]handleThe plugin/gateway session used for this peer
[in]packetThe RTP packet and related data

◆ send_pli

void(* const janus_callbacks::send_pli) (janus_plugin_session *handle)

Helper to ask for a keyframe via a RTCP PLI to all video streams.

Note
This is a shortcut, as it is also possible to do the same by crafting an RTCP PLI message manually, and passing it to the core via relay_rtcp
Parameters
[in]handleThe plugin/gateway session that will be used for this peer

◆ send_pli_stream

void(* const janus_callbacks::send_pli_stream) (janus_plugin_session *handle, int mindex)

Helper to ask for a keyframe via a RTCP PLI to a specific video stream.

Note
This is a shortcut, as it is also possible to do the same by crafting an RTCP PLI message manually, and passing it to the core via relay_rtcp
Parameters
[in]handleThe plugin/gateway session that will be used for this peer
[in]mindexIndex of the stream to send the PLI to (relative to the SDP; passing -1 will send it to the first video stream in the SDP)

◆ send_remb

void(* const janus_callbacks::send_remb) (janus_plugin_session *handle, guint32 bitrate)

Helper to ask for a keyframe via a RTCP PLI.

Note
This is a shortcut, as it is also possible to do the same by crafting an RTCP REMB message manually, and passing it to the core via relay_rtcp
Parameters
[in]handleThe plugin/gateway session that will be used for this peer
[in]bitrateThe bitrate value to send in the REMB message

The documentation for this struct was generated from the following file: