krillplayer-plugin 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -1
- package/README.md +1 -0
- package/dist/cli.js +351 -73
- package/dist/crypto.js +37 -11
- package/dist/engine/engine.c +6 -3
- package/kernel/Sources/CQuickJS/include/kernel_qjs.h +8 -1
- package/kernel/Sources/CQuickJS/kernel_internal.h +54 -0
- package/kernel/Sources/CQuickJS/kernel_qjs.c +17 -29
- package/kernel/Sources/CQuickJS/kernel_wasm.c +1155 -0
- package/kernel/Sources/CWAMR/include/kernel_wamr.h +151 -0
- package/kernel/Sources/CWAMR/include/kernel_wamr_config.h +66 -0
- package/kernel/Sources/CWAMR/vendor/LICENSE +219 -0
- package/kernel/Sources/CWAMR/vendor/core/config.h +727 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/aot/aot_runtime.h +899 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/arch/invokeNative_general.c +123 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_application.c +933 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_blocking_op.c +92 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_c_api.c +5391 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_c_api_internal.h +246 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_exec_env.c +336 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_exec_env.h +328 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_loader_common.c +242 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_loader_common.h +62 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_memory.c +1999 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_memory.h +154 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_native.c +1532 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_native.h +117 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_runtime_common.c +8070 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_runtime_common.h +1396 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_shared_memory.c +477 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_shared_memory.h +63 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_suspend_flags.h +52 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/compilation/aot.h +366 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/include/lib_export.h +60 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/include/wasm_c_api.h +910 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/include/wasm_export.h +2440 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm.h +1492 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_interp.h +122 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_interp_fast.c +7998 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_loader.c +16909 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_loader.h +80 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_opcode.h +1043 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_runtime.c +5174 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_runtime.h +912 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/libraries/thread-mgr/thread_manager.c +1569 -0
- package/kernel/Sources/CWAMR/vendor/core/iwasm/libraries/thread-mgr/thread_manager.h +256 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_alloc.c +1169 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc.c +497 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc.h +350 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc_internal.h +384 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_hmu.c +95 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_kfc.c +547 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/mem_alloc.c +252 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/mem_alloc.h +96 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/memory/mremap.c +12 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_blocking_op.c +70 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_malloc.c +72 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_memmap.c +302 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_sleep.c +20 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_thread.c +784 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_time.c +28 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/darwin/platform_init.c +43 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/darwin/platform_internal.h +126 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_api_extension.h +1676 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_api_vmcore.h +192 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_common.h +204 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_wasi_types.h +610 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/linux/platform_init.c +43 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/platform/linux/platform_internal.h +139 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_assert.c +25 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_assert.h +42 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_atomic.h +300 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_bitmap.c +27 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_bitmap.h +114 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_common.c +217 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_common.h +83 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_hashmap.c +339 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_hashmap.h +168 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_leb128.c +77 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_leb128.h +30 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_list.c +111 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_list.h +109 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_log.c +111 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_log.h +94 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_platform.h +38 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_queue.c +256 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_queue.h +80 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_vector.c +279 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_vector.h +126 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/gnuc.h +14 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/runtime_timer.c +469 -0
- package/kernel/Sources/CWAMR/vendor/core/shared/utils/runtime_timer.h +51 -0
- package/kernel/Sources/CWAMR/vendor/core/version.h +24 -0
- package/kernel/Sources/CWAMR/wamr_bh_assert.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_bitmap.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_common.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_hashmap.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_leb128.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_list.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_log.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_queue.c +98 -0
- package/kernel/Sources/CWAMR/wamr_bh_vector.c +98 -0
- package/kernel/Sources/CWAMR/wamr_ems_alloc.c +98 -0
- package/kernel/Sources/CWAMR/wamr_ems_gc.c +98 -0
- package/kernel/Sources/CWAMR/wamr_ems_hmu.c +98 -0
- package/kernel/Sources/CWAMR/wamr_ems_kfc.c +98 -0
- package/kernel/Sources/CWAMR/wamr_invokeNative_general.c +98 -0
- package/kernel/Sources/CWAMR/wamr_mem_alloc.c +98 -0
- package/kernel/Sources/CWAMR/wamr_mremap.c +98 -0
- package/kernel/Sources/CWAMR/wamr_platform_init_darwin.c +100 -0
- package/kernel/Sources/CWAMR/wamr_platform_init_linux.c +100 -0
- package/kernel/Sources/CWAMR/wamr_posix_blocking_op.c +98 -0
- package/kernel/Sources/CWAMR/wamr_posix_malloc.c +98 -0
- package/kernel/Sources/CWAMR/wamr_posix_memmap.c +98 -0
- package/kernel/Sources/CWAMR/wamr_posix_sleep.c +98 -0
- package/kernel/Sources/CWAMR/wamr_posix_thread.c +98 -0
- package/kernel/Sources/CWAMR/wamr_posix_time.c +98 -0
- package/kernel/Sources/CWAMR/wamr_runtime_timer.c +98 -0
- package/kernel/Sources/CWAMR/wamr_thread_manager.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_application.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_blocking_op.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_c_api.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_exec_env.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_interp_fast.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_loader.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_loader_common.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_memory.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_native.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_runtime.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_runtime_common.c +98 -0
- package/kernel/Sources/CWAMR/wamr_wasm_shared_memory.c +98 -0
- package/kernel/Sources/Kernel/PluginPrelude.js +5 -2
- package/kernel/Tests/KernelTests/CasePins.js +50 -0
- package/package.json +2 -2
- package/skill/krillplayer-plugin/SKILL.md +2 -0
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-content-rejected.json +8 -4
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-login-expired.json +8 -4
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-muted.json +8 -4
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-other.json +8 -4
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-rate-limited.json +8 -4
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-sent.json +8 -4
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-logged-in.json +39 -0
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-selected-backup-line.json +8 -0
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-selected-line-gone.json +8 -0
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live.json +8 -0
- package/skill/krillplayer-plugin/assets/samples/live-video-platform/plugin.ts +26 -9
- package/skill/krillplayer-plugin/references/cases.md +19 -1
- package/skill/krillplayer-plugin/references/contract.d.ts +104 -11
- package/skill/krillplayer-plugin/references/crypto-tools.md +104 -0
- package/skill/krillplayer-plugin/references/errors-and-fixes.md +5 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef _WASM_NATIVE_H
|
|
7
|
+
#define _WASM_NATIVE_H
|
|
8
|
+
|
|
9
|
+
#include "bh_common.h"
|
|
10
|
+
#include "../include/wasm_export.h"
|
|
11
|
+
#include "../interpreter/wasm.h"
|
|
12
|
+
|
|
13
|
+
#ifdef __cplusplus
|
|
14
|
+
extern "C" {
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
typedef struct NativeSymbolsNode {
|
|
18
|
+
struct NativeSymbolsNode *next;
|
|
19
|
+
const char *module_name;
|
|
20
|
+
NativeSymbol *native_symbols;
|
|
21
|
+
uint32 n_native_symbols;
|
|
22
|
+
bool call_conv_raw;
|
|
23
|
+
} NativeSymbolsNode, *NativeSymbolsList;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Lookup global variable of a given import global
|
|
27
|
+
* from libc builtin globals
|
|
28
|
+
*
|
|
29
|
+
* @param module_name the module name of the import global
|
|
30
|
+
* @param global_name the global name of the import global
|
|
31
|
+
* @param global return the global data
|
|
32
|
+
*
|
|
33
|
+
* @param true if success, false otherwise
|
|
34
|
+
*/
|
|
35
|
+
bool
|
|
36
|
+
wasm_native_lookup_libc_builtin_global(const char *module_name,
|
|
37
|
+
const char *global_name,
|
|
38
|
+
WASMGlobalImport *global);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Resolve native symbol in all libraries, including libc-builtin, libc-wasi,
|
|
42
|
+
* base lib and extension lib, and user registered natives
|
|
43
|
+
* function, which can be auto checked by vm before calling native function
|
|
44
|
+
*
|
|
45
|
+
* @param module_name the module name of the import function
|
|
46
|
+
* @param func_name the function name of the import function
|
|
47
|
+
* @param func_type the function prototype of the import function
|
|
48
|
+
* @param p_signature output the signature if resolve success
|
|
49
|
+
*
|
|
50
|
+
* @return the native function pointer if success, NULL otherwise
|
|
51
|
+
*/
|
|
52
|
+
void *
|
|
53
|
+
wasm_native_resolve_symbol(const char *module_name, const char *field_name,
|
|
54
|
+
const WASMFuncType *func_type,
|
|
55
|
+
const char **p_signature, void **p_attachment,
|
|
56
|
+
bool *p_call_conv_raw);
|
|
57
|
+
|
|
58
|
+
bool
|
|
59
|
+
wasm_native_register_natives(const char *module_name,
|
|
60
|
+
NativeSymbol *native_symbols,
|
|
61
|
+
uint32 n_native_symbols);
|
|
62
|
+
|
|
63
|
+
bool
|
|
64
|
+
wasm_native_register_natives_raw(const char *module_name,
|
|
65
|
+
NativeSymbol *native_symbols,
|
|
66
|
+
uint32 n_native_symbols);
|
|
67
|
+
|
|
68
|
+
bool
|
|
69
|
+
wasm_native_unregister_natives(const char *module_name,
|
|
70
|
+
NativeSymbol *native_symbols);
|
|
71
|
+
|
|
72
|
+
#if WASM_ENABLE_MODULE_INST_CONTEXT != 0
|
|
73
|
+
struct WASMModuleInstanceCommon;
|
|
74
|
+
|
|
75
|
+
void *
|
|
76
|
+
wasm_native_create_context_key(
|
|
77
|
+
void (*dtor)(struct WASMModuleInstanceCommon *inst, void *ctx));
|
|
78
|
+
|
|
79
|
+
void
|
|
80
|
+
wasm_native_destroy_context_key(void *key);
|
|
81
|
+
|
|
82
|
+
void
|
|
83
|
+
wasm_native_set_context(struct WASMModuleInstanceCommon *inst, void *key,
|
|
84
|
+
void *ctx);
|
|
85
|
+
void
|
|
86
|
+
wasm_native_set_context_spread(struct WASMModuleInstanceCommon *inst, void *key,
|
|
87
|
+
void *ctx);
|
|
88
|
+
void *
|
|
89
|
+
wasm_native_get_context(struct WASMModuleInstanceCommon *inst, void *key);
|
|
90
|
+
|
|
91
|
+
void
|
|
92
|
+
wasm_native_call_context_dtors(struct WASMModuleInstanceCommon *inst);
|
|
93
|
+
|
|
94
|
+
void
|
|
95
|
+
wasm_native_inherit_contexts(struct WASMModuleInstanceCommon *child,
|
|
96
|
+
struct WASMModuleInstanceCommon *parent);
|
|
97
|
+
#else /* WASM_ENABLE_MODULE_INST_CONTEXT */
|
|
98
|
+
#define wasm_native_call_context_dtors(inst) (void)(inst)
|
|
99
|
+
#define wasm_native_inherit_contexts(child, parent) (void)(parent)
|
|
100
|
+
#endif /* WASM_ENABLE_MODULE_INST_CONTEXT */
|
|
101
|
+
|
|
102
|
+
bool
|
|
103
|
+
wasm_native_init(void);
|
|
104
|
+
|
|
105
|
+
void
|
|
106
|
+
wasm_native_destroy(void);
|
|
107
|
+
|
|
108
|
+
#if WASM_ENABLE_QUICK_AOT_ENTRY != 0
|
|
109
|
+
void *
|
|
110
|
+
wasm_native_lookup_quick_aot_entry(const WASMFuncType *func_type);
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
#ifdef __cplusplus
|
|
114
|
+
}
|
|
115
|
+
#endif
|
|
116
|
+
|
|
117
|
+
#endif /* end of _WASM_NATIVE_H */
|