Callbacks to contact the Janus core.
More...
#include <plugin.h>
|
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, int mindex, gboolean video, char *buf, int len) |
| Callback to relay RTP packets to a peer. More...
|
|
void(*const | relay_rtcp )(janus_plugin_session *handle, int mindex, gboolean video, char *buf, int len) |
| Callback to relay RTCP messages to a peer. More...
|
|
void(*const | relay_data )(janus_plugin_session *handle, char *label, char *buf, int len) |
| Callback to relay SCTP/DataChannel messages to a peer. 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...
|
|
Callbacks to contact the Janus core.
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] | token | The token to validate |
- Returns
- TRUE if the signature is valid and not expired, FALSE otherwise
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] | token | The token to validate |
[in] | desc | The descriptor to search for |
- Returns
- TRUE if the token is valid, not expired and contains the descriptor, FALSE otherwise
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] | handle | The plugin/gateway session that the PeerConnection is related to |
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] | handle | The plugin/gateway session to get rid of |
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)
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] | plugin | The plugin originating the event |
[in] | handle | The plugin/gateway session originating the event, if any |
[in] | event | The event to notify as a Jansson json_t object |
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] | handle | The plugin/gateway session used for this peer |
[in] | plugin | The plugin instance that is sending the message/event |
[in] | transaction | The transaction identifier this message refers to |
[in] | message | The json_t object containing the JSON message |
[in] | jsep | The json_t object containing the JSEP type, the SDP attached to the message/event, if any (offer/answer), and whether this is an update |
void(* const janus_callbacks::relay_data)(janus_plugin_session *handle, char *label, char *buf, int len) |
Callback to relay SCTP/DataChannel messages to a peer.
- Note
- Notice that no mindex is needed here, as there can only be a single data channel stream.
- Parameters
-
[in] | handle | The plugin/gateway session that will be used for this peer |
[in] | label | The label of the data channel to use |
[in] | buf | The message data (buffer) |
[in] | len | The buffer lenght |
void(* const janus_callbacks::relay_rtcp)(janus_plugin_session *handle, int mindex, gboolean video, char *buf, int len) |
Callback to relay RTCP messages to a peer.
- Parameters
-
[in] | handle | The plugin/gateway session that will be used for this 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(* const janus_callbacks::relay_rtp)(janus_plugin_session *handle, int mindex, gboolean video, char *buf, int len) |
Callback to relay RTP packets to a peer.
- Parameters
-
[in] | handle | The plugin/gateway session used for this 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 |
The documentation for this struct was generated from the following file: