Fork me on GitHub
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
janus_lua.c File Reference

Janus Lua plugin. More...

#include <jansson.h>
#include "janus_lua_data.h"
#include "janus_lua_extra.h"
Include dependency graph for janus_lua.c:

Data Structures

struct  janus_lua_callback
 
struct  janus_lua_rtp_relay_packet
 
struct  janus_lua_async_event
 

Macros

#define JANUS_LUA_VERSION   1
 
#define JANUS_LUA_VERSION_STRING   "0.0.1"
 
#define JANUS_LUA_DESCRIPTION   "A custom plugin for the Lua framework."
 
#define JANUS_LUA_NAME   "Janus Lua plugin"
 
#define JANUS_LUA_AUTHOR   "Meetecho s.r.l."
 
#define JANUS_LUA_PACKAGE   "janus.plugin.lua"
 

Typedefs

typedef enum janus_lua_event janus_lua_event
 
typedef struct janus_lua_callback janus_lua_callback
 
typedef struct janus_lua_rtp_relay_packet janus_lua_rtp_relay_packet
 
typedef enum janus_lua_async_event_type janus_lua_async_event_type
 
typedef struct janus_lua_async_event janus_lua_async_event
 

Enumerations

enum  janus_lua_event { janus_lua_event_none = 0, janus_lua_event_resume, janus_lua_event_exit }
 
enum  janus_lua_async_event_type { janus_lua_async_event_type_none = 0, janus_lua_async_event_type_pushevent }
 

Functions

janus_plugincreate (void)
 
int janus_lua_init (janus_callbacks *callback, const char *config_path)
 
void janus_lua_destroy (void)
 
int janus_lua_get_api_compatibility (void)
 
int janus_lua_get_version (void)
 
const char * janus_lua_get_version_string (void)
 
const char * janus_lua_get_description (void)
 
const char * janus_lua_get_name (void)
 
const char * janus_lua_get_author (void)
 
const char * janus_lua_get_package (void)
 
void janus_lua_create_session (janus_plugin_session *handle, int *error)
 
struct janus_plugin_resultjanus_lua_handle_message (janus_plugin_session *handle, char *transaction, json_t *message, json_t *jsep)
 
void janus_lua_setup_media (janus_plugin_session *handle)
 
void janus_lua_incoming_rtp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_lua_incoming_rtcp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_lua_incoming_data (janus_plugin_session *handle, char *buf, int len)
 
void janus_lua_slow_link (janus_plugin_session *handle, int uplink, int video)
 
void janus_lua_hangup_media (janus_plugin_session *handle)
 
void janus_lua_destroy_session (janus_plugin_session *handle, int *error)
 
json_tjanus_lua_query_session (janus_plugin_session *handle)
 
janus_lua_sessionjanus_lua_lookup_session (janus_plugin_session *handle)
 

Variables

volatile gint lua_initialized = 0
 
volatile gint lua_stopping = 0
 
janus_callbacksjanus_core = NULL
 
lua_State * lua_state = NULL
 
janus_mutex lua_mutex = JANUS_MUTEX_INITIALIZER
 
GHashTable * lua_sessions
 
GHashTable * lua_ids
 
janus_mutex lua_sessions_mutex = JANUS_MUTEX_INITIALIZER
 

Detailed Description

Janus Lua plugin.

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

Check the Lua plugin documentation for more details.

Plugins Lua plugin API

Macro Definition Documentation

#define JANUS_LUA_AUTHOR   "Meetecho s.r.l."
#define JANUS_LUA_DESCRIPTION   "A custom plugin for the Lua framework."
#define JANUS_LUA_NAME   "Janus Lua plugin"
#define JANUS_LUA_PACKAGE   "janus.plugin.lua"
#define JANUS_LUA_VERSION   1
#define JANUS_LUA_VERSION_STRING   "0.0.1"

Typedef Documentation

Enumeration Type Documentation

Enumerator
janus_lua_async_event_type_none 
janus_lua_async_event_type_pushevent 
Enumerator
janus_lua_event_none 
janus_lua_event_resume 
janus_lua_event_exit 

Function Documentation

janus_plugin* create ( void  )
void janus_lua_create_session ( janus_plugin_session handle,
int *  error 
)
void janus_lua_destroy ( void  )
void janus_lua_destroy_session ( janus_plugin_session handle,
int *  error 
)
int janus_lua_get_api_compatibility ( void  )
const char * janus_lua_get_author ( void  )
const char * janus_lua_get_description ( void  )
const char * janus_lua_get_name ( void  )
const char * janus_lua_get_package ( void  )
int janus_lua_get_version ( void  )
const char * janus_lua_get_version_string ( void  )
struct janus_plugin_result * janus_lua_handle_message ( janus_plugin_session handle,
char *  transaction,
json_t message,
json_t jsep 
)
void janus_lua_hangup_media ( janus_plugin_session handle)
void janus_lua_incoming_data ( janus_plugin_session handle,
char *  buf,
int  len 
)
void janus_lua_incoming_rtcp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
void janus_lua_incoming_rtp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
int janus_lua_init ( janus_callbacks callback,
const char *  config_path 
)
janus_lua_session* janus_lua_lookup_session ( janus_plugin_session handle)
json_t * janus_lua_query_session ( janus_plugin_session handle)
void janus_lua_setup_media ( janus_plugin_session handle)
void janus_lua_slow_link ( janus_plugin_session handle,
int  uplink,
int  video 
)

Variable Documentation

janus_callbacks* janus_core = NULL
GHashTable * lua_ids
volatile gint lua_initialized = 0
GHashTable* lua_sessions
janus_mutex lua_sessions_mutex = JANUS_MUTEX_INITIALIZER
lua_State* lua_state = NULL
volatile gint lua_stopping = 0