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)
 
json_tjanus_duktape_handle_admin_message (json_t *message)
 
void janus_duktape_setup_media (janus_plugin_session *handle)
 
void janus_duktape_incoming_rtp (janus_plugin_session *handle, janus_plugin_rtp *packet)
 
void janus_duktape_incoming_rtcp (janus_plugin_session *handle, janus_plugin_rtcp *packet)
 
void janus_duktape_incoming_data (janus_plugin_session *handle, janus_plugin_data *packet)
 
void janus_duktape_data_ready (janus_plugin_session *handle)
 
void janus_duktape_slow_link (janus_plugin_session *handle, int mindex, gboolean video, gboolean uplink)
 
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_callbacksduktape_janus_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

Plugins Duktape plugin API

Macro Definition Documentation

◆ DUK_CASE_STR

#define DUK_CASE_STR (   type)    case type: return #type

◆ JANUS_DUKTAPE_AUTHOR

#define JANUS_DUKTAPE_AUTHOR   "Meetecho s.r.l."

◆ JANUS_DUKTAPE_DESCRIPTION

#define JANUS_DUKTAPE_DESCRIPTION   "A custom plugin for implementing the logic in JavaScript, via Duktape."

◆ JANUS_DUKTAPE_NAME

#define JANUS_DUKTAPE_NAME   "Janus JavaScript plugin (Duktape)"

◆ JANUS_DUKTAPE_PACKAGE

#define JANUS_DUKTAPE_PACKAGE   "janus.plugin.duktape"

◆ JANUS_DUKTAPE_VERSION

#define JANUS_DUKTAPE_VERSION   1

◆ JANUS_DUKTAPE_VERSION_STRING

#define JANUS_DUKTAPE_VERSION_STRING   "0.0.1"

Typedef Documentation

◆ janus_duktape_async_event

◆ janus_duktape_async_event_type

◆ janus_duktape_callback

◆ janus_duktape_event

◆ janus_duktape_rtp_relay_packet

Enumeration Type Documentation

◆ janus_duktape_async_event_type

Enumerator
janus_duktape_async_event_type_none 
janus_duktape_async_event_type_pushevent 

◆ janus_duktape_event

Enumerator
janus_duktape_event_none 
janus_duktape_event_resume 
janus_duktape_event_exit 

Function Documentation

◆ create()

janus_plugin* create ( void  )

◆ janus_duktape_create_session()

void janus_duktape_create_session ( janus_plugin_session handle,
int *  error 
)

◆ janus_duktape_data_ready()

void janus_duktape_data_ready ( janus_plugin_session handle)

◆ janus_duktape_destroy()

void janus_duktape_destroy ( void  )

◆ janus_duktape_destroy_session()

void janus_duktape_destroy_session ( janus_plugin_session handle,
int *  error 
)

◆ janus_duktape_get_api_compatibility()

int janus_duktape_get_api_compatibility ( void  )

◆ janus_duktape_get_author()

const char * janus_duktape_get_author ( void  )

◆ janus_duktape_get_description()

const char * janus_duktape_get_description ( void  )

◆ janus_duktape_get_name()

const char * janus_duktape_get_name ( void  )

◆ janus_duktape_get_package()

const char * janus_duktape_get_package ( void  )

◆ janus_duktape_get_version()

int janus_duktape_get_version ( void  )

◆ janus_duktape_get_version_string()

const char * janus_duktape_get_version_string ( void  )

◆ janus_duktape_handle_admin_message()

json_t * janus_duktape_handle_admin_message ( json_t message)

◆ janus_duktape_handle_message()

struct janus_plugin_result * janus_duktape_handle_message ( janus_plugin_session handle,
char *  transaction,
json_t message,
json_t jsep 
)

◆ janus_duktape_hangup_media()

void janus_duktape_hangup_media ( janus_plugin_session handle)

◆ janus_duktape_incoming_data()

void janus_duktape_incoming_data ( janus_plugin_session handle,
janus_plugin_data packet 
)

◆ janus_duktape_incoming_rtcp()

void janus_duktape_incoming_rtcp ( janus_plugin_session handle,
janus_plugin_rtcp packet 
)

◆ janus_duktape_incoming_rtp()

void janus_duktape_incoming_rtp ( janus_plugin_session handle,
janus_plugin_rtp packet 
)

◆ janus_duktape_init()

int janus_duktape_init ( janus_callbacks callback,
const char *  config_path 
)

◆ janus_duktape_lookup_session()

janus_duktape_session* janus_duktape_lookup_session ( janus_plugin_session handle)

◆ janus_duktape_query_session()

json_t * janus_duktape_query_session ( janus_plugin_session handle)

◆ janus_duktape_setup_media()

void janus_duktape_setup_media ( janus_plugin_session handle)

◆ janus_duktape_slow_link()

void janus_duktape_slow_link ( janus_plugin_session handle,
int  mindex,
gboolean  video,
gboolean  uplink 
)

Variable Documentation

◆ duktape_ctx

duk_context* duktape_ctx = NULL

◆ duktape_ids

GHashTable * duktape_ids

◆ duktape_initialized

volatile gint duktape_initialized = 0

◆ duktape_janus_core

janus_callbacks* duktape_janus_core = NULL

◆ duktape_mutex

◆ duktape_sessions

GHashTable* duktape_sessions

◆ duktape_sessions_mutex

janus_mutex duktape_sessions_mutex = JANUS_MUTEX_INITIALIZER

◆ duktape_stopping

volatile gint duktape_stopping = 0