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

Janus JavaScript plugin (via Duktape) More...

#include <jansson.h>
#include "janus_duktape_data.h"
#include "janus_duktape_extra.h"
Include dependency graph for janus_duktape.c:

Data Structures

struct  janus_duktape_callback
 
struct  janus_duktape_rtp_relay_packet
 
struct  janus_duktape_async_event
 

Macros

#define JANUS_DUKTAPE_VERSION   1
 
#define JANUS_DUKTAPE_VERSION_STRING   "0.0.1"
 
#define JANUS_DUKTAPE_DESCRIPTION   "A custom plugin for implementing the logic in JavaScript, via Duktape."
 
#define JANUS_DUKTAPE_NAME   "Janus JavaScript plugin (Duktape)"
 
#define JANUS_DUKTAPE_AUTHOR   "Meetecho s.r.l."
 
#define JANUS_DUKTAPE_PACKAGE   "janus.plugin.duktape"
 
#define DUK_CASE_STR(type)   case type: return #type
 

Typedefs

typedef enum janus_duktape_event janus_duktape_event
 
typedef struct janus_duktape_callback janus_duktape_callback
 
typedef struct janus_duktape_rtp_relay_packet janus_duktape_rtp_relay_packet
 
typedef enum janus_duktape_async_event_type janus_duktape_async_event_type
 
typedef struct janus_duktape_async_event janus_duktape_async_event
 

Enumerations

enum  janus_duktape_event { janus_duktape_event_none = 0, janus_duktape_event_resume, janus_duktape_event_exit }
 
enum  janus_duktape_async_event_type { janus_duktape_async_event_type_none = 0, janus_duktape_async_event_type_pushevent }
 

Functions

janus_plugincreate (void)
 
int janus_duktape_init (janus_callbacks *callback, const char *config_path)
 
void janus_duktape_destroy (void)
 
int janus_duktape_get_api_compatibility (void)
 
int janus_duktape_get_version (void)
 
const char * janus_duktape_get_version_string (void)
 
const char * janus_duktape_get_description (void)
 
const char * janus_duktape_get_name (void)
 
const char * janus_duktape_get_author (void)
 
const char * janus_duktape_get_package (void)
 
void janus_duktape_create_session (janus_plugin_session *handle, int *error)
 
struct janus_plugin_resultjanus_duktape_handle_message (janus_plugin_session *handle, char *transaction, json_t *message, json_t *jsep)
 
void janus_duktape_setup_media (janus_plugin_session *handle)
 
void janus_duktape_incoming_rtp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_duktape_incoming_rtcp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_duktape_incoming_data (janus_plugin_session *handle, char *buf, int len)
 
void janus_duktape_slow_link (janus_plugin_session *handle, int uplink, int video)
 
void janus_duktape_hangup_media (janus_plugin_session *handle)
 
void janus_duktape_destroy_session (janus_plugin_session *handle, int *error)
 
json_tjanus_duktape_query_session (janus_plugin_session *handle)
 
janus_duktape_sessionjanus_duktape_lookup_session (janus_plugin_session *handle)
 

Variables

volatile gint duktape_initialized = 0
 
volatile gint duktape_stopping = 0
 
janus_callbacksjanus_core = NULL
 
duk_context * duktape_ctx = NULL
 
janus_mutex duktape_mutex = JANUS_MUTEX_INITIALIZER
 
GHashTable * duktape_sessions
 
GHashTable * duktape_ids
 
janus_mutex duktape_sessions_mutex = JANUS_MUTEX_INITIALIZER
 

Detailed Description

Janus JavaScript plugin (via Duktape)

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

Check the JavaScript (Duktape) plugin documentation for more details.

Plugins Duktape plugin API

Macro Definition Documentation

#define DUK_CASE_STR (   type)    case type: return #type
#define JANUS_DUKTAPE_AUTHOR   "Meetecho s.r.l."
#define JANUS_DUKTAPE_DESCRIPTION   "A custom plugin for implementing the logic in JavaScript, via Duktape."
#define JANUS_DUKTAPE_NAME   "Janus JavaScript plugin (Duktape)"
#define JANUS_DUKTAPE_PACKAGE   "janus.plugin.duktape"
#define JANUS_DUKTAPE_VERSION   1
#define JANUS_DUKTAPE_VERSION_STRING   "0.0.1"

Typedef Documentation

Enumeration Type Documentation

Enumerator
janus_duktape_async_event_type_none 
janus_duktape_async_event_type_pushevent 
Enumerator
janus_duktape_event_none 
janus_duktape_event_resume 
janus_duktape_event_exit 

Function Documentation

janus_plugin* create ( void  )
void janus_duktape_create_session ( janus_plugin_session handle,
int *  error 
)
void janus_duktape_destroy ( void  )
void janus_duktape_destroy_session ( janus_plugin_session handle,
int *  error 
)
int janus_duktape_get_api_compatibility ( void  )
const char * janus_duktape_get_author ( void  )
const char * janus_duktape_get_description ( void  )
const char * janus_duktape_get_name ( void  )
const char * janus_duktape_get_package ( void  )
int janus_duktape_get_version ( void  )
const char * janus_duktape_get_version_string ( void  )
struct janus_plugin_result * janus_duktape_handle_message ( janus_plugin_session handle,
char *  transaction,
json_t message,
json_t jsep 
)
void janus_duktape_hangup_media ( janus_plugin_session handle)
void janus_duktape_incoming_data ( janus_plugin_session handle,
char *  buf,
int  len 
)
void janus_duktape_incoming_rtcp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
void janus_duktape_incoming_rtp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
int janus_duktape_init ( janus_callbacks callback,
const char *  config_path 
)
janus_duktape_session* janus_duktape_lookup_session ( janus_plugin_session handle)
json_t * janus_duktape_query_session ( janus_plugin_session handle)
void janus_duktape_setup_media ( janus_plugin_session handle)
void janus_duktape_slow_link ( janus_plugin_session handle,
int  uplink,
int  video 
)

Variable Documentation

duk_context* duktape_ctx = NULL
GHashTable * duktape_ids
volatile gint duktape_initialized = 0
GHashTable* duktape_sessions
janus_mutex duktape_sessions_mutex = JANUS_MUTEX_INITIALIZER
volatile gint duktape_stopping = 0
janus_callbacks* janus_core = NULL