Fork me on GitHub
Data Structures | Macros | Typedefs
eventhandler.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <inttypes.h>
#include <glib.h>
#include <jansson.h>
#include "../utils.h"
Include dependency graph for eventhandler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  janus_eventhandler
 The event handler plugin session and callbacks interface. More...
 

Macros

#define JANUS_EVENTHANDLER_API_VERSION   1
 Version of the API, to match the one event handler plugins were compiled against. More...
 
#define JANUS_EVENTHANDLER_INIT(...)
 
Type of events Janus could notify, and the handler subscribe to

Initialization of all event handler plugin properties to NULL

Note
All event handler plugins MUST add this as the FIRST line when initializing their event handler plugin structure, e.g.:
static janus_eventhandler janus_fake_eventhandler handler plugin =
        {
                JANUS_EVENTHANDLER_INIT,
                
                .init = janus_fake_init,
                [..]

This mask makes it easy to subscribe to, and unsubscribe from, specific events, as all you need to do is to use janus_flags_set and janus_flags_clear on the events_mask property of the handler instance, and the core will know whether you care about something or not.

#define JANUS_EVENT_TYPE_NONE   (0)
 No event. More...
 
#define JANUS_EVENT_TYPE_SESSION   (1 << 0)
 Session related events (e.g., session created/destroyed, etc.) More...
 
#define JANUS_EVENT_TYPE_HANDLE   (1 << 1)
 Handle related events (e.g., handle attached/detached, etc.) More...
 
#define JANUS_EVENT_TYPE_JSEP   (1 << 3)
 JSEP related events (e.g., got/sent offer/answer) More...
 
#define JANUS_EVENT_TYPE_WEBRTC   (1 << 4)
 WebRTC related events (e.g., PeerConnection up/down, ICE updates, DTLS updates, etc.) More...
 
#define JANUS_EVENT_TYPE_MEDIA   (1 << 5)
 Media related events (e.g., media started/stopped flowing, stats on packets/bytes, etc.) More...
 
#define JANUS_EVENT_TYPE_PLUGIN   (1 << 6)
 Events originated by plugins (at the moment, all of them, no way to pick) More...
 
#define JANUS_EVENT_TYPE_TRANSPORT   (1 << 7)
 Events originated by transports (at the moment, all of them, no way to pick) More...
 
#define JANUS_EVENT_TYPE_CORE   (1 << 8)
 Events originated by the core for its own events (e.g., Janus starting/shutting down) More...
 
#define JANUS_EVENT_TYPE_ALL   (0xffffffff)
 Mask with all events enabled (shortcut when you want to subscribe to everything) More...
 

Typedefs

typedef struct janus_eventhandler_callbacks janus_eventhandler_callbacks
 Callbacks to contact the gateway. More...
 
typedef struct janus_eventhandler janus_eventhandler
 The event handler plugin session and callbacks interface. More...
 
typedef janus_eventhandlercreate_e(void)
 The hook that event handler plugins need to implement to be created from the gateway. More...
 

Macro Definition Documentation

◆ JANUS_EVENT_TYPE_ALL

#define JANUS_EVENT_TYPE_ALL   (0xffffffff)

Mask with all events enabled (shortcut when you want to subscribe to everything)

◆ JANUS_EVENT_TYPE_CORE

#define JANUS_EVENT_TYPE_CORE   (1 << 8)

Events originated by the core for its own events (e.g., Janus starting/shutting down)

◆ JANUS_EVENT_TYPE_HANDLE

#define JANUS_EVENT_TYPE_HANDLE   (1 << 1)

Handle related events (e.g., handle attached/detached, etc.)

◆ JANUS_EVENT_TYPE_JSEP

#define JANUS_EVENT_TYPE_JSEP   (1 << 3)

JSEP related events (e.g., got/sent offer/answer)

◆ JANUS_EVENT_TYPE_MEDIA

#define JANUS_EVENT_TYPE_MEDIA   (1 << 5)

Media related events (e.g., media started/stopped flowing, stats on packets/bytes, etc.)

◆ JANUS_EVENT_TYPE_NONE

#define JANUS_EVENT_TYPE_NONE   (0)

No event.

◆ JANUS_EVENT_TYPE_PLUGIN

#define JANUS_EVENT_TYPE_PLUGIN   (1 << 6)

Events originated by plugins (at the moment, all of them, no way to pick)

◆ JANUS_EVENT_TYPE_SESSION

#define JANUS_EVENT_TYPE_SESSION   (1 << 0)

Session related events (e.g., session created/destroyed, etc.)

◆ JANUS_EVENT_TYPE_TRANSPORT

#define JANUS_EVENT_TYPE_TRANSPORT   (1 << 7)

Events originated by transports (at the moment, all of them, no way to pick)

◆ JANUS_EVENT_TYPE_WEBRTC

#define JANUS_EVENT_TYPE_WEBRTC   (1 << 4)

WebRTC related events (e.g., PeerConnection up/down, ICE updates, DTLS updates, etc.)

◆ JANUS_EVENTHANDLER_API_VERSION

#define JANUS_EVENTHANDLER_API_VERSION   1

Version of the API, to match the one event handler plugins were compiled against.

◆ JANUS_EVENTHANDLER_INIT

#define JANUS_EVENTHANDLER_INIT (   ...)
Value:
{ \
.init = NULL, \
.destroy = NULL, \
.get_api_compatibility = NULL, \
.get_version = NULL, \
.get_version_string = NULL, \
.get_description = NULL, \
.get_name = NULL, \
.get_author = NULL, \
.get_package = NULL, \
.incoming_event = NULL, \
.events_mask = JANUS_EVENT_TYPE_NONE, \
## __VA_ARGS__ }
#define JANUS_EVENT_TYPE_NONE
No event.
Definition: eventhandler.h:129

Typedef Documentation

◆ create_e

typedef janus_eventhandler* create_e(void)

The hook that event handler plugins need to implement to be created from the gateway.

◆ janus_eventhandler

The event handler plugin session and callbacks interface.

◆ janus_eventhandler_callbacks

Callbacks to contact the gateway.