149 #ifndef JANUS_PLUGIN_H 150 #define JANUS_PLUGIN_H 158 #include <inttypes.h> 174 #define JANUS_PLUGIN_API_VERSION 15 192 #define JANUS_PLUGIN_INIT(...) { \ 195 .get_api_compatibility = NULL, \ 196 .get_version = NULL, \ 197 .get_version_string = NULL, \ 198 .get_description = NULL, \ 200 .get_author = NULL, \ 201 .get_package = NULL, \ 202 .create_session = NULL, \ 203 .handle_message = NULL, \ 204 .handle_admin_message = NULL, \ 205 .setup_media = NULL, \ 206 .incoming_rtp = NULL, \ 207 .incoming_rtcp = NULL, \ 208 .incoming_data = NULL, \ 209 .data_ready = NULL, \ 211 .hangup_media = NULL, \ 212 .destroy_session = NULL, \ 213 .query_session = NULL, \ 259 void (*
const destroy)(void);
267 int (*
const get_api_compatibility)(void);
269 int (*
const get_version)(void);
407 gboolean (*
const events_is_enabled)(void);
419 gboolean (*
const auth_is_signature_valid)(
janus_plugin *plugin,
const char *token);
425 gboolean (*
const auth_signature_contains)(
janus_plugin *plugin,
const char *token,
const char *descriptor);
void janus_plugin_rtp_reset(janus_plugin_rtp *packet)
Helper method to initialise/reset the RTP packet.
Definition: plugin.c:49
gboolean video
Whether this is an audio or video RTP packet.
Definition: plugin.h:573
The request was correctly handled and a response is provided (synchronous)
Definition: plugin.h:456
Janus plugin data message.
Definition: plugin.h:606
char * buffer
The message data.
Definition: plugin.h:614
gboolean video
Whether this is an audio or video RTCP packet.
Definition: plugin.h:591
uint16_t length
The packet length.
Definition: plugin.h:577
volatile gint stopped
Whether this mapping has been stopped definitely or not: if so, the plugin shouldn't make use of it a...
Definition: plugin.h:246
Reference counter mechanism.
json_t *(*const query_session)(janus_plugin_session *handle)
Method to get plugin-specific info of a session/handle.
Definition: plugin.h:349
struct json_t json_t
Definition: plugin.h:236
void * gateway_handle
Opaque pointer to the Janus core-level handle.
Definition: plugin.h:241
void janus_plugin_data_reset(janus_plugin_data *packet)
Helper method to initialise/reset the data message.
Definition: plugin.c:59
Janus plugin RTP packet.
Definition: plugin.h:571
const char *(*const get_author)(void)
Informative method to request the author of the plugin.
Definition: plugin.h:277
const char *(*const get_version_string)(void)
Informative method to request the string version of the plugin.
Definition: plugin.h:271
const char *(*const get_name)(void)
Informative method to request the name of the plugin.
Definition: plugin.h:275
Definition: refcount.h:78
void janus_plugin_result_destroy(janus_plugin_result *result)
Helper to quickly destroy a janus_plugin_result instance.
Definition: plugin.c:29
Janus plugin result.
Definition: plugin.h:462
gboolean audio_level_vad
Whether the encoder detected voice activity (part of audio-level extension)
Definition: plugin.h:552
janus_plugin_result_type
Result types.
Definition: plugin.h:452
const char *(*const get_package)(void)
Informative method to request the package name of the plugin (what will be used in web applications t...
Definition: plugin.h:279
The request was correctly handled and notifications will follow with more info (asynchronous) ...
Definition: plugin.h:458
The plugin session and callbacks interface.
Definition: plugin.h:252
char * label
The label this message belongs to.
Definition: plugin.h:608
int8_t audio_level
Audio level, in DB (0-127, 127=silence); -1 means no extension.
Definition: plugin.h:549
gboolean binary
Whether the message data is text (default=FALSE) or binary.
Definition: plugin.h:612
const char *(*const get_description)(void)
Informative method to request a description of the plugin.
Definition: plugin.h:273
json_t * content
Result content.
Definition: plugin.h:479
char * protocol
The subprotocol this message refers to.
Definition: plugin.h:610
char * buffer
The packet data.
Definition: plugin.h:593
janus_plugin_rtp_extensions extensions
RTP extensions.
Definition: plugin.h:579
A severe error happened (not an application level error)
Definition: plugin.h:454
janus_refcount ref
Reference counter for this instance.
Definition: plugin.h:248
janus_plugin * create_p(void)
The hook that plugins need to implement to be created from the Janus core.
Definition: plugin.h:429
Callbacks to contact the Janus core.
Definition: plugin.h:354
uint16_t length
The message length.
Definition: plugin.h:616
janus_plugin_result * janus_plugin_result_new(janus_plugin_result_type type, const char *text, json_t *content)
Helper to quickly create a janus_plugin_result instance.
Definition: plugin.c:20
Janus plugin RTP extensions.
Definition: plugin.h:547
uint16_t length
The packet length.
Definition: plugin.h:595
void * plugin_handle
Opaque pointer to the plugin session.
Definition: plugin.h:243
int16_t video_rotation
Video orientation rotation (0, 90, 180, 270); -1 means no extension.
Definition: plugin.h:554
Janus plugin RTCP packet.
Definition: plugin.h:589
void janus_plugin_rtcp_reset(janus_plugin_rtcp *packet)
Helper method to initialise/reset the RTCP packet.
Definition: plugin.c:55
Plugin-Gateway session mapping.
Definition: plugin.h:239
const char * text
Text associated with this plugin result.
Definition: plugin.h:471
char * buffer
The packet data.
Definition: plugin.h:575
gboolean video_flipped
Whether the video orientation extension says it's flipped horizontally.
Definition: plugin.h:560
void janus_plugin_rtp_extensions_reset(janus_plugin_rtp_extensions *extensions)
Helper method to initialise/reset the RTP extensions field.
Definition: plugin.c:39
janus_plugin_result_type type
Result type.
Definition: plugin.h:464
gboolean video_back_camera
Whether the video orientation extension says this is the back camera.
Definition: plugin.h:557