Fork me on GitHub
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
events.c File Reference

Event handler notifications. More...

#include <stdarg.h>
#include "events.h"
#include "utils.h"
Include dependency graph for events.c:

Functions

void * janus_events_thread (void *data)
 
int janus_events_init (gboolean enabled, char *server_name, GHashTable *handlers)
 Initialize the event handlers broadcaster. More...
 
void janus_events_deinit (void)
 De-initialize the event handlers broadcaster. More...
 
gboolean janus_events_is_enabled (void)
 Quick method to check whether event handlers are enabled at all or not. More...
 
void janus_events_notify_handlers (int type, guint64 session_id,...)
 Notify an event to all interested handlers. More...
 

Detailed Description

Event handler notifications.

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Event handler plugins can receive events from the Janus core and other plugins, in order to handle them somehow. This methods provide helpers to notify events to such handlers.

Core

Function Documentation

void janus_events_deinit ( void  )

De-initialize the event handlers broadcaster.

int janus_events_init ( gboolean  enabled,
char *  server_name,
GHashTable *  handlers 
)

Initialize the event handlers broadcaster.

Parameters
[in]enabledWhether broadcasting events should be supported at all
[in]server_nameThe name of this server, to be added to all events
[in]handlersMap of all registered event handlers
Returns
0 on success, a negative integer otherwise
gboolean janus_events_is_enabled ( void  )

Quick method to check whether event handlers are enabled at all or not.

Returns
TRUE if they're enabled, FALSE if not
void janus_events_notify_handlers ( int  type,
guint64  session_id,
  ... 
)

Notify an event to all interested handlers.

Note
According to the type of event to notify, different arguments may be required and used in order to prepare the actual object to pass to handlers.
Parameters
[in]typeType of the event to notify
[in]session_idJanus session identifier this event refers to
void * janus_events_thread ( void *  data)