libgpac
Documentation of the core library of GPAC
qjs_common.h File Reference
#include <gpac/list.h>
#include <gpac/scenegraph.h>
#include "../quickjs/quickjs.h"
+ Include dependency graph for qjs_common.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  GF_HTMLMediaJS
 
struct  GF_JSClass
 
struct  js_handler_context
 
struct  _node_js_binding
 
struct  GF_ScriptPriv
 

Macros

#define countof(x)   (sizeof(x) / sizeof((x)[0]))
 
#define JS_CHECK_STRING(_v)   (JS_IsString(_v) || JS_IsNull(_v))
 
#define JS_DOM3_EVENT_TARGET_INTERFACE
 
#define GF_JS_EXCEPTION(_ctx)    js_throw_err_msg(_ctx, GF_BAD_PARAM, "Invalid value in function %s (%s@%d)", __func__, strrchr(__FILE__, GF_PATH_SEPARATOR)+1, __LINE__)
 

Functions

struct JSContextgf_js_create_context ()
 
void gf_js_delete_context (struct JSContext *)
 
JSValue js_throw_err (JSContext *ctx, s32 err)
 
JSValue js_throw_err_msg (JSContext *ctx, s32 err, const char *fmt,...)
 
void js_std_loop (JSContext *ctx)
 
void js_dump_error (JSContext *ctx)
 
void js_dump_error_exc (JSContext *ctx, const JSValue exception_val)
 
JSValue js_print (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
void js_load_constants (JSContext *ctx, JSValue global_obj)
 
void dom_node_changed (GF_Node *n, Bool child_modif, GF_FieldInfo *info)
 
void dom_element_finalize (JSRuntime *rt, JSValue obj)
 
void dom_document_finalize (JSRuntime *rt, JSValue obj)
 
GF_Nodedom_get_element (JSContext *c, JSValue obj)
 
GF_SceneGraph * dom_get_doc (JSContext *c, JSValue obj)
 
JSValue dom_element_construct (JSContext *c, GF_Node *n)
 
void dom_js_load (GF_SceneGraph *scene, struct JSContext *c)
 
void dom_js_unload ()
 
void gf_sg_js_dom_pre_destroy (struct JSRuntime *rt, GF_SceneGraph *sg, GF_Node *script_or_handler_node)
 
JSValue dom_event_add_listener (JSContext *c, JSValueConst obj, int argc, JSValueConst *argv)
 
JSValue dom_event_remove_listener (JSContext *c, JSValueConst obj, int argc, JSValueConst *argv)
 
JSValue xml_dom3_not_implemented (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
JSValue dom_js_define_event (struct JSContext *c)
 
JSValue gf_dom_new_event (struct JSContext *c)
 
JSValue dom_document_construct_external (JSContext *c, GF_SceneGraph *sg)
 
struct _gf_ft_mgrjsf_get_font_manager (JSContext *c)
 
GF_Err jsf_request_opengl (JSContext *c)
 
GF_Err jsf_set_gl_active (JSContext *c, Bool do_activate)
 
GF_Err jsf_get_filter_packet_planes (JSContext *c, JSValue obj, u32 *width, u32 *height, u32 *pf, u32 *stride, u32 *stride_uv, const u8 **data, const u8 **p_u, const u8 **p_v, const u8 **p_a)
 
Bool jsf_is_packet (JSContext *c, JSValue obj)
 
const char * jsf_get_script_filename (JSContext *c)
 
void qjs_module_init_xhr_global (JSContext *c, JSValue global)
 
void qjs_init_all_modules (JSContext *ctx, Bool no_webgl, Bool for_vrml)
 
Bool gs_js_context_is_valid (JSContext *ctx)
 
JSRuntimegf_js_get_rt ()
 

Data Structure Documentation

◆ GF_HTMLMediaJS

struct GF_HTMLMediaJS
+ Collaboration diagram for GF_HTMLMediaJS:
Data Fields
struct JSContext * js_ctx
struct JSObject * global
struct JSObject * event
Bool force_gc

◆ GF_JSClass

struct GF_JSClass
+ Collaboration diagram for GF_JSClass:
Data Fields
JSClassDef class
JSClassID class_id

◆ js_handler_context

struct js_handler_context
+ Collaboration diagram for js_handler_context:
Data Fields
void * ctx
JSValue fun_val
JSValue evt_listen_obj

◆ _node_js_binding

struct _node_js_binding
+ Collaboration diagram for _node_js_binding:
Data Fields
JSValue obj
struct __gf_js_field * pf
GF_List * fields

Macro Definition Documentation

◆ countof

#define countof (   x)    (sizeof(x) / sizeof((x)[0]))

◆ JS_CHECK_STRING

#define JS_CHECK_STRING (   _v)    (JS_IsString(_v) || JS_IsNull(_v))

◆ JS_DOM3_EVENT_TARGET_INTERFACE

#define JS_DOM3_EVENT_TARGET_INTERFACE
Value:
JS_CFUNC_DEF("addEventListenerNS", 3, dom_event_add_listener), \
JS_CFUNC_DEF("removeEventListenerNS", 3, dom_event_remove_listener), \
JS_CFUNC_DEF("addEventListener", 2, dom_event_add_listener), \
JS_CFUNC_DEF("removeEventListener", 2, dom_event_remove_listener), \
JS_CFUNC_DEF("dispatchEvent", 1, xml_dom3_not_implemented),
JSValue dom_event_add_listener(JSContext *c, JSValueConst obj, int argc, JSValueConst *argv)
JSValue dom_event_remove_listener(JSContext *c, JSValueConst obj, int argc, JSValueConst *argv)
JSValue xml_dom3_not_implemented(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
#define JS_CFUNC_DEF(name, length, func1)
Definition: quickjs.h:1042

◆ GF_JS_EXCEPTION

#define GF_JS_EXCEPTION (   _ctx)     js_throw_err_msg(_ctx, GF_BAD_PARAM, "Invalid value in function %s (%s@%d)", __func__, strrchr(__FILE__, GF_PATH_SEPARATOR)+1, __LINE__)

Function Documentation

◆ gf_js_create_context()

struct JSContext* gf_js_create_context ( )
+ Here is the caller graph for this function:

◆ gf_js_delete_context()

void gf_js_delete_context ( struct JSContext )

◆ js_throw_err()

JSValue js_throw_err ( JSContext ctx,
s32  err 
)
+ Here is the caller graph for this function:

◆ js_throw_err_msg()

JSValue js_throw_err_msg ( JSContext ctx,
s32  err,
const char *  fmt,
  ... 
)

◆ js_std_loop()

void js_std_loop ( JSContext ctx)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_dump_error()

void js_dump_error ( JSContext ctx)
+ Here is the caller graph for this function:

◆ js_dump_error_exc()

void js_dump_error_exc ( JSContext ctx,
const JSValue  exception_val 
)

◆ js_print()

JSValue js_print ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)

◆ js_load_constants()

void js_load_constants ( JSContext ctx,
JSValue  global_obj 
)
+ Here is the caller graph for this function:

◆ dom_node_changed()

void dom_node_changed ( GF_Node n,
Bool  child_modif,
GF_FieldInfo info 
)

◆ dom_element_finalize()

void dom_element_finalize ( JSRuntime rt,
JSValue  obj 
)

◆ dom_document_finalize()

void dom_document_finalize ( JSRuntime rt,
JSValue  obj 
)

◆ dom_get_element()

GF_Node* dom_get_element ( JSContext c,
JSValue  obj 
)

◆ dom_get_doc()

GF_SceneGraph* dom_get_doc ( JSContext c,
JSValue  obj 
)

◆ dom_element_construct()

JSValue dom_element_construct ( JSContext c,
GF_Node n 
)

◆ dom_js_load()

void dom_js_load ( GF_SceneGraph *  scene,
struct JSContext c 
)

◆ dom_js_unload()

void dom_js_unload ( )

◆ gf_sg_js_dom_pre_destroy()

void gf_sg_js_dom_pre_destroy ( struct JSRuntime rt,
GF_SceneGraph *  sg,
GF_Node script_or_handler_node 
)

◆ dom_event_add_listener()

JSValue dom_event_add_listener ( JSContext c,
JSValueConst  obj,
int  argc,
JSValueConst argv 
)

◆ dom_event_remove_listener()

JSValue dom_event_remove_listener ( JSContext c,
JSValueConst  obj,
int  argc,
JSValueConst argv 
)

◆ xml_dom3_not_implemented()

JSValue xml_dom3_not_implemented ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)

◆ dom_js_define_event()

JSValue dom_js_define_event ( struct JSContext c)

◆ gf_dom_new_event()

JSValue gf_dom_new_event ( struct JSContext c)

◆ dom_document_construct_external()

JSValue dom_document_construct_external ( JSContext c,
GF_SceneGraph *  sg 
)

◆ jsf_get_font_manager()

struct _gf_ft_mgr* jsf_get_font_manager ( JSContext c)

◆ jsf_request_opengl()

GF_Err jsf_request_opengl ( JSContext c)

◆ jsf_set_gl_active()

GF_Err jsf_set_gl_active ( JSContext c,
Bool  do_activate 
)

◆ jsf_get_filter_packet_planes()

GF_Err jsf_get_filter_packet_planes ( JSContext c,
JSValue  obj,
u32 width,
u32 height,
u32 pf,
u32 stride,
u32 stride_uv,
const u8 **  data,
const u8 **  p_u,
const u8 **  p_v,
const u8 **  p_a 
)

◆ jsf_is_packet()

Bool jsf_is_packet ( JSContext c,
JSValue  obj 
)

◆ jsf_get_script_filename()

const char * jsf_get_script_filename ( JSContext c)

◆ qjs_module_init_xhr_global()

void qjs_module_init_xhr_global ( JSContext c,
JSValue  global 
)

◆ qjs_init_all_modules()

void qjs_init_all_modules ( JSContext ctx,
Bool  no_webgl,
Bool  for_vrml 
)
+ Here is the caller graph for this function:

◆ gs_js_context_is_valid()

Bool gs_js_context_is_valid ( JSContext ctx)

◆ gf_js_get_rt()

JSRuntime* gf_js_get_rt ( )