Loading...
Searching...
No Matches
janus_duktape_data.h
Go to the documentation of this file.
#ifndef JANUS_DUKTAPE_DATA_H
#define JANUS_DUKTAPE_DATA_H
#include <duktape.h>
#include "duktape-deps/duk_console.h"
#include "duktape-deps/duk_module_duktape.h"
#include "plugin.h"
#include "debug.h"
#include "apierror.h"
#include "config.h"
#include "mutex.h"
#include "rtp.h"
#include "rtcp.h"
#include "sdp-utils.h"
#include "record.h"
#include "utils.h"
/* Core pointer and related flags */
extern volatile gint duktape_initialized, duktape_stopping;
extern janus_callbacks *duktape_janus_core;
/* Duktape context: we define context and mutex as extern */
extern duk_context *duktape_ctx;
extern janus_mutex duktape_mutex;
/* Duktape session: we keep only the barebone stuff here, the rest will be in the JavaScript script */
typedef struct janus_duktape_session {
janus_plugin_session *handle; /* Pointer to the core-plugin session */
uint32_t id; /* Unique session ID (will be used to correlate with the JavaScript script) */
/* The following are only needed for media manipulation, feedback and routing, and may not all be used */
gboolean accept_audio; /* Whether incoming audio can be accepted or must be dropped */
gboolean accept_video; /* Whether incoming video can be accepted or must be dropped */
gboolean accept_data; /* Whether incoming data can be accepted or must be dropped */
gboolean send_audio; /* Whether outgoing audio can be sent or must be dropped */
gboolean send_video; /* Whether outgoing video can be sent or must be dropped */
gboolean send_data; /* Whether outgoing data can be sent or must be dropped */
janus_rtp_switching_context artpctx, vrtpctx;
janus_rtp_switching_context rtpctx; /* RTP switching context */
janus_videocodec vcodec; /* Video codec this session is using */
uint32_t ssrc[3]; /* Only needed in case VP8 (or H.264) simulcasting is involved */
char *rid[3]; /* Only needed if simulcasting is rid-based */
int rid_extmap_id; /* rid extmap ID */
janus_mutex rid_mutex; /* Mutex to protect access to the rid array and the extmap ID */
janus_rtp_simulcasting_context sim_context;
janus_vp8_simulcast_context vp8_context;
uint32_t bitrate; /* Bitrate limit */
uint16_t pli_freq; /* Regular PLI frequency (0=disabled) */
gint64 pli_latest; /* Time of latest sent PLI (to avoid flooding) */
GSList *recipients; /* Sessions that should receive media from this session */
struct janus_duktape_session *sender; /* Other session this session is receiving media from */
janus_mutex recipients_mutex; /* Mutex to lock the recipients list */
janus_recorder *arc; /* The Janus recorder instance for audio, if enabled */
janus_recorder *vrc; /* The Janus recorder instance for video, if enabled */
janus_recorder *drc; /* The Janus recorder instance for data, if enabled */
janus_rtp_switching_context rec_ctx;
janus_rtp_simulcasting_context rec_simctx;
gboolean e2ee; /* Whether media is encrypted, e.g., using Insertable Streams */
janus_mutex rec_mutex; /* Mutex to protect the recorders from race conditions */
volatile gint started; /* Whether this session's PeerConnection is ready or not */
volatile gint dataready; /* Whether the data channel was established on this sessions's PeerConnection */
volatile gint hangingup; /* Whether this session's PeerConnection is hanging up */
volatile gint destroyed; /* Whether this session's been marked as destroyed */
/* If you need any additional property (e.g., for hooks you added in janus_duktape_extra.c) add them below this line */
/* Reference counter */
janus_refcount ref;
} janus_duktape_session;
extern GHashTable *duktape_sessions, *duktape_ids;
extern janus_mutex duktape_sessions_mutex;
janus_duktape_session *janus_duktape_lookup_session(janus_plugin_session *handle);
#endif
apierror.h
Janus API errors definition.
config.h
Configuration files parsing (headers).
debug.h
Logging and Debugging.
duktape_initialized
volatile gint duktape_initialized
Definition janus_duktape.c:268
duktape_janus_core
janus_callbacks * duktape_janus_core
Definition janus_duktape.c:269
duktape_ctx
duk_context * duktape_ctx
Definition janus_duktape.c:273
duktape_sessions_mutex
janus_mutex duktape_sessions_mutex
Definition janus_duktape.c:346
duktape_ids
GHashTable * duktape_ids
Definition janus_duktape.c:345
duktape_stopping
volatile gint duktape_stopping
Definition janus_duktape.c:268
duktape_mutex
janus_mutex duktape_mutex
Definition janus_duktape.c:274
duktape_sessions
GHashTable * duktape_sessions
Definition janus_duktape.c:345
janus_duktape_lookup_session
janus_duktape_session * janus_duktape_lookup_session(janus_plugin_session *handle)
Definition janus_duktape.c:2031
mutex.h
Semaphors, Mutexes and Conditions.
janus_mutex
GMutex janus_mutex
Janus mutex implementation.
Definition mutex.h:73
plugin.h
Plugin-Core communication (implementation).
record.h
Audio/Video recorder.
rtcp.h
RTCP processing (headers).
rtp.h
RTP processing (headers).
janus_videocodec
janus_videocodec
Definition rtp.h:116
sdp-utils.h
SDP utilities (headers).
janus_callbacks
Callbacks to contact the Janus core.
Definition plugin.h:355
janus_duktape_session
Definition janus_duktape_data.h:51
janus_duktape_session::send_audio
gboolean send_audio
Definition janus_duktape_data.h:58
janus_duktape_session::vp8_context
janus_vp8_simulcast_context vp8_context
Definition janus_duktape_data.h:69
janus_duktape_session::accept_video
gboolean accept_video
Definition janus_duktape_data.h:56
janus_duktape_session::bitrate
uint32_t bitrate
Definition janus_duktape_data.h:70
janus_duktape_session::dataready
volatile gint dataready
Definition janus_duktape_data.h:84
janus_duktape_session::rtpctx
janus_rtp_switching_context rtpctx
Definition janus_duktape_data.h:62
janus_duktape_session::accept_audio
gboolean accept_audio
Definition janus_duktape_data.h:55
janus_duktape_session::id
uint32_t id
Definition janus_duktape_data.h:53
janus_duktape_session::drc
janus_recorder * drc
Definition janus_duktape_data.h:78
janus_duktape_session::handle
janus_plugin_session * handle
Definition janus_duktape_data.h:52
janus_duktape_session::recipients
GSList * recipients
Definition janus_duktape_data.h:73
janus_duktape_session::arc
janus_recorder * arc
Definition janus_duktape_data.h:76
janus_duktape_session::send_video
gboolean send_video
Definition janus_duktape_data.h:59
janus_duktape_session::accept_data
gboolean accept_data
Definition janus_duktape_data.h:57
janus_duktape_session::rid
char * rid[3]
Definition janus_duktape_data.h:65
janus_duktape_session::started
volatile gint started
Definition janus_duktape_data.h:83
janus_duktape_session::send_data
gboolean send_data
Definition janus_duktape_data.h:60
janus_duktape_session::ssrc
uint32_t ssrc[3]
Definition janus_duktape_data.h:64
janus_duktape_session::vrtpctx
janus_rtp_switching_context vrtpctx
Definition janus_duktape_data.h:61
janus_duktape_session::rid_mutex
janus_mutex rid_mutex
Definition janus_duktape_data.h:67
janus_duktape_session::e2ee
gboolean e2ee
Definition janus_duktape_data.h:81
janus_duktape_session::sim_context
janus_rtp_simulcasting_context sim_context
Definition janus_duktape_data.h:68
janus_duktape_session::rid_extmap_id
int rid_extmap_id
Definition janus_duktape_data.h:66
janus_duktape_session::ref
janus_refcount ref
Definition janus_duktape_data.h:90
janus_duktape_session::destroyed
volatile gint destroyed
Definition janus_duktape_data.h:86
janus_duktape_session::pli_latest
gint64 pli_latest
Definition janus_duktape_data.h:72
janus_duktape_session::vcodec
janus_videocodec vcodec
Definition janus_duktape_data.h:63
janus_duktape_session::rec_mutex
janus_mutex rec_mutex
Definition janus_duktape_data.h:82
janus_duktape_session::artpctx
janus_rtp_switching_context artpctx
Definition janus_duktape_data.h:61
janus_duktape_session::pli_freq
uint16_t pli_freq
Definition janus_duktape_data.h:71
janus_duktape_session::rec_ctx
janus_rtp_switching_context rec_ctx
Definition janus_duktape_data.h:79
janus_duktape_session::hangingup
volatile gint hangingup
Definition janus_duktape_data.h:85
janus_duktape_session::rec_simctx
janus_rtp_simulcasting_context rec_simctx
Definition janus_duktape_data.h:80
janus_duktape_session::recipients_mutex
janus_mutex recipients_mutex
Definition janus_duktape_data.h:75
janus_duktape_session::sender
struct janus_duktape_session * sender
Definition janus_duktape_data.h:74
janus_duktape_session::vrc
janus_recorder * vrc
Definition janus_duktape_data.h:77
janus_plugin_session
Plugin-Gateway session mapping.
Definition plugin.h:239
janus_recorder
Structure that represents a recorder.
Definition record.h:41
janus_refcount
Definition refcount.h:78
janus_rtp_simulcasting_context
Helper struct for processing and tracking simulcast streams.
Definition rtp.h:301
janus_rtp_switching_context
RTP context, in order to make sure SSRC changes result in coherent seq/ts increases.
Definition rtp.h:259
janus_vp8_simulcast_context
VP8 simulcasting context, in order to make sure SSRC changes result in coherent picid/temporal level ...
Definition utils.h:347
utils.h
TURN REST API client.