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