JSGPACCoreSystem API.
More...
import"core.idl";
The JSGPACCoreSystem interface has a single instance exposed to the script under the name "Sys". It implements binding to the underlying instance of libgpac.
◆ gc()
| void JSGPACCoreSystem::gc |
( |
| ) |
|
◆ set_arg_used()
| void JSGPACCoreSystem::set_arg_used |
( |
unsigned int |
arg_idx, |
|
|
boolean |
arg_used |
|
) |
| |
marks an argument as used (for argument tracking at prompt)
- Parameters
-
| arg_idx | index of argument to mark as used |
| arg_used | if true, argument is marked as used |
◆ error_string()
| DOMString JSGPACCoreSystem::error_string |
( |
GF_Err |
e | ) |
|
gets string for error
- Parameters
-
- Returns
- the corresponding string
◆ prompt_input()
| DOMString JSGPACCoreSystem::prompt_input |
( |
| ) |
|
returns character input from prompt, or null if no input (this will be moved soon to core API)
- Returns
- input char, or NULL if no input
◆ prompt_string()
| DOMString JSGPACCoreSystem::prompt_string |
( |
| ) |
|
wait character input from prompt and returns it
- Returns
- string entered at prompt
◆ prompt_echo_off()
| void JSGPACCoreSystem::prompt_echo_off |
( |
boolean |
echo_off | ) |
|
sets prompt echo off (input characters not visible) or on - see gf_prompt_set_echo_off
- Parameters
-
| echo_off | if true, echo is disabled |
◆ prompt_code()
| void JSGPACCoreSystem::prompt_code |
( |
unsigned long |
code | ) |
|
sets stderr color and other code for upcoming strings - see gf_sys_set_console_code
- Parameters
-
◆ prompt_size()
| WinRect JSGPACCoreSystem::prompt_size |
( |
| ) |
|
gets stdin terminal size - see gf_prompt_get_size
- Returns
- terminal size object, or null if not available
◆ enum_directory()
| Array JSGPACCoreSystem::enum_directory |
( |
DOMString |
dir, |
|
|
optional DOMString |
filter = null, |
|
|
optional DOMString |
filter = null, |
|
|
optional bool |
go_up = false |
|
) |
| |
enumerate directories
- Parameters
-
| dir | the directory to enumerate |
| filter | the filter for file extensions. If "dir", only enumerate directories |
| go_up | if true, enumerate parent directory or root (/). |
- Returns
- array of FileInformation interface
◆ clock_ms()
| unsigned long JSGPACCoreSystem::clock_ms |
( |
| ) |
|
get system clock in milliseconds - see gf_sys_clock
- Returns
- clock value
◆ clock_us()
| unsigned long long JSGPACCoreSystem::clock_us |
( |
| ) |
|
get system clock in microseconds - see gf_sys_clock_high_res
- Returns
- clock value
◆ fcc_to_str()
| DOMString JSGPACCoreSystem::fcc_to_str |
( |
unsigned long |
value | ) |
|
convert a 4CC code to its string representation - see gf_4cc_to_str
- Parameters
-
| value | the 4CC code to convert |
- Returns
- string representation
◆ rand_init()
| void JSGPACCoreSystem::rand_init |
( |
optional boolean |
reset = false | ) |
|
inits random number - see gf_rand_init
- Parameters
-
| reset | if true, resets the random seed |
◆ rand()
| unsigned long JSGPACCoreSystem::rand |
( |
| ) |
|
gets a random number - see gf_rand
- Returns
- random 32 bit value
◆ rand64()
| unsigned long long JSGPACCoreSystem::rand64 |
( |
| ) |
|
gets a random number
- Returns
- random 64 bit value
◆ getenv()
| DOMString JSGPACCoreSystem::getenv |
( |
DOMString |
var_name | ) |
|
gets an environment variable
- Parameters
-
| var_name | environment variable name |
- Returns
- environment variable value, or null if variable is not defined
◆ get_utc() [1/3]
| unsigned long long JSGPACCoreSystem::get_utc |
( |
| ) |
|
gets UTC clock - see gf_net_get_utc
- Returns
- UTC 64 bit timestamp
◆ get_utc() [2/3]
| unsigned long long JSGPACCoreSystem::get_utc |
( |
| ) |
|
gets UTC timestamp for a given date - see gf_net_get_utc_ts
- Parameters
-
| year | date's year |
| month | date's month of the year |
| day | date's day of the week |
| hour | date's hours |
| min | date's minutes |
| sec | date's seconds |
- Returns
- UTC 64 bit timestamp
◆ get_utc() [3/3]
| unsigned long long JSGPACCoreSystem::get_utc |
( |
DOMString |
date | ) |
|
gets UTC clock from a date - see gf_net_parse_date
- Parameters
-
- Returns
- UTC 64 bit timestamp corresponding to the date
◆ crc32()
| unsigned long JSGPACCoreSystem::crc32 |
( |
ArrayBuffer |
abuf | ) |
|
gets CRC32 of an arraybuffer - see gf_crc_32
- Parameters
-
- Returns
- CRC32 of the data
◆ sha1() [1/2]
| ArrayBuffer JSGPACCoreSystem::sha1 |
( |
DOMString |
fname | ) |
|
gets SHA1 digest of an arraybuffer - see gf_sha1_file
- Parameters
-
| fname | name of file to hash |
- Returns
- ArrayBuffer containing SHA1 of the file data
◆ sha1() [2/2]
| ArrayBuffer JSGPACCoreSystem::sha1 |
( |
ArrayBuffer |
abuf | ) |
|
gets SHA1 digest of a file - see gf_sha1_csum
- Parameters
-
- Returns
- ArrayBuffer containing SHA1 of the data
◆ load_file()
| ArrayBuffer JSGPACCoreSystem::load_file |
( |
DOMString |
fname | ) |
|
loads file content into an array buffer - see gf_file_load_data
- Parameters
-
| fname | name of file to load |
- Returns
- ArrayBuffer containing data of the file
◆ compress()
| ArrayBuffer JSGPACCoreSystem::compress |
( |
ArrayBuffer |
in_data | ) |
|
compress using deflate() an array buffer
- Parameters
-
| in_data | input data to compress |
- Returns
- ArrayBuffer containing compressed data
◆ decompress()
| ArrayBuffer JSGPACCoreSystem::decompress |
( |
ArrayBuffer |
in_data | ) |
|
decompress using inflate() an array buffer
- Parameters
-
| in_data | input data to decompress |
- Returns
- ArrayBuffer containing decompressed data
◆ rmdir()
| void JSGPACCoreSystem::rmdir |
( |
DOMString |
dirname | ) |
|
removes directory - cf gf_rmdir
- Parameters
-
◆ mkdir()
| void JSGPACCoreSystem::mkdir |
( |
DOMString |
dirname | ) |
|
creates directory - cf gf_mkdir
- Parameters
-
◆ dir_exists()
| boolean JSGPACCoreSystem::dir_exists |
( |
DOMString |
dirname | ) |
|
checks if directory exists - cf gf_dir_exists
- Parameters
-
- Returns
- true if directory exists
◆ dir_clean()
| void JSGPACCoreSystem::dir_clean |
( |
DOMString |
dirname | ) |
|
remove files in directory - cf gf_cleanup_dir
- Parameters
-
◆ basename()
| DOMString JSGPACCoreSystem::basename |
( |
DOMString |
filename | ) |
|
get basename of file or dir - cf gf_file_basename
- Parameters
-
- Returns
- file basename
◆ file_ext()
| DOMString JSGPACCoreSystem::file_ext |
( |
DOMString |
filename | ) |
|
get file extension - cf gf_file_ext_start
- Parameters
-
- Returns
- file extension or null if none
◆ file_exists()
| boolean JSGPACCoreSystem::file_exists |
( |
DOMString |
filename | ) |
|
check if file exists - cf gf_file_exists
- Parameters
-
- Returns
- true if directory exists
◆ del()
| void JSGPACCoreSystem::del |
( |
DOMString |
filename | ) |
|
deletes a file - cf gf_file_delete
- Parameters
-
◆ mod_time()
| unsigned long long JSGPACCoreSystem::mod_time |
( |
DOMString |
filename | ) |
|
get file modification time - cf gf_file_modification_time
- Parameters
-
- Returns
- file modification time
◆ move()
| void JSGPACCoreSystem::move |
( |
DOMString |
filename, |
|
|
DOMString |
newname |
|
) |
| |
get file modification time - cf gf_file_modification_time
- Parameters
-
| filename | name of file |
| newname | new name of the file |
◆ get_opt()
| DOMString JSGPACCoreSystem::get_opt |
( |
DOMString |
secname, |
|
|
DOMString |
keyname |
|
) |
| |
get option from GPAC config - cf gf_opts_get_key
- Parameters
-
| secname | name of section |
| keyname | name of key |
- Returns
- value of key or null if no key
◆ set_opt()
| void JSGPACCoreSystem::set_opt |
( |
DOMString |
secname, |
|
|
DOMString |
keyname, |
|
|
optional DOMString |
value = null |
|
) |
| |
get option from GPAC config - cf gf_opts_get_key
- Parameters
-
| secname | name of section |
| keyname | name of key |
| value | new value of key or null to remove key |
◆ discard_opts()
| void JSGPACCoreSystem::discard_opts |
( |
| ) |
|
discard all changes in GPAC config - see gf_opts_discard_changes
◆ base64enc() [1/2]
| DOMString JSGPACCoreSystem::base64enc |
( |
ArrayBuffer |
in_data | ) |
|
encodes an arraybuffer to a base64 string
- Parameters
-
- Returns
- encoded string
◆ base64enc() [2/2]
| ArrayBuffer JSGPACCoreSystem::base64enc |
( |
DOMString |
in_data | ) |
|
decodes a base64 string to an arraybuffer
- Parameters
-
| in_data | input encoded string |
- Returns
- output decoded buffer
◆ base16enc() [1/2]
| DOMString JSGPACCoreSystem::base16enc |
( |
ArrayBuffer |
in_data | ) |
|
encodes an arraybuffer to a base16 string
- Parameters
-
- Returns
- encoded string
◆ base16enc() [2/2]
| ArrayBuffer JSGPACCoreSystem::base16enc |
( |
DOMString |
in_data | ) |
|
decodes a base16 string to an arraybuffer
- Parameters
-
| in_data | input encoded string |
- Returns
- output decoded buffer
◆ htonl()
| unsigned long JSGPACCoreSystem::htonl |
( |
unsigned long |
value | ) |
|
converts 32 bit value from host to network byte order
- Parameters
-
- Returns
- converted value
◆ htons()
| unsigned long JSGPACCoreSystem::htons |
( |
unsigned long |
value | ) |
|
converts 16 bit value from host to network byte order
- Parameters
-
- Returns
- converted value
◆ ntohl()
| unsigned long JSGPACCoreSystem::ntohl |
( |
unsigned long |
value | ) |
|
converts 32 bit value from network to host byte order
- Parameters
-
- Returns
- converted value
◆ ntohs()
| unsigned long JSGPACCoreSystem::ntohs |
( |
unsigned long |
value | ) |
|
converts 16 bit value from network to host byte order
- Parameters
-
- Returns
- converted value
◆ args
| attribute Array JSGPACCoreSystem::args |
◆ nb_cores
| attribute readonly unsigned long JSGPACCoreSystem::nb_cores |
◆ sampling_period_duration
| attribute readonly unsigned long JSGPACCoreSystem::sampling_period_duration |
◆ total_cpu_time
| attribute readonly unsigned long JSGPACCoreSystem::total_cpu_time |
◆ process_cpu_time
| attribute readonly unsigned long JSGPACCoreSystem::process_cpu_time |
◆ total_cpu_time_diff
| attribute readonly unsigned long JSGPACCoreSystem::total_cpu_time_diff |
◆ process_cpu_time_diff
| attribute readonly unsigned long JSGPACCoreSystem::process_cpu_time_diff |
◆ cpu_idle_time
| attribute readonly unsigned long JSGPACCoreSystem::cpu_idle_time |
◆ total_cpu_usage
| attribute readonly unsigned long JSGPACCoreSystem::total_cpu_usage |
◆ process_cpu_usage
| attribute readonly unsigned long JSGPACCoreSystem::process_cpu_usage |
◆ pid
| attribute readonly unsigned long JSGPACCoreSystem::pid |
◆ thread_count
| attribute readonly unsigned long JSGPACCoreSystem::thread_count |
◆ process_memory
| attribute readonly unsigned long long JSGPACCoreSystem::process_memory |
◆ physical_memory
| attribute readonly unsigned long long JSGPACCoreSystem::physical_memory |
◆ physical_memory_avail
| attribute readonly unsigned long long JSGPACCoreSystem::physical_memory_avail |
◆ gpac_memory
| attribute readonly unsigned long long JSGPACCoreSystem::gpac_memory |
◆ last_wdir
| attribute DOMString JSGPACCoreSystem::last_wdir |
◆ batteryOn
| readonly attribute boolean JSGPACCoreSystem::batteryOn |
indicates if running on battery or with power charge
◆ batteryCharging
| readonly attribute boolean JSGPACCoreSystem::batteryCharging |
indicates if battery is charging
◆ batteryPercent
| readonly attribute unsigned long JSGPACCoreSystem::batteryPercent |
battery percent (0 to 100)
◆ batteryLifeTime
| readonly attribute unsigned long JSGPACCoreSystem::batteryLifeTime |
estimated battery lifetime - see gf_sys_get_battery_state
◆ batteryFullLifeTime
| readonly attribute unsigned long JSGPACCoreSystem::batteryFullLifeTime |
estimated battery lifetime in full charge - see gf_sys_get_battery_state
◆ hostname
| readonly DOMString JSGPACCoreSystem::hostname |
◆ test_mode
| readonly boolean JSGPACCoreSystem::test_mode |
test mode - see gf_sys_is_test_mode
◆ old_arch
| readonly boolean JSGPACCoreSystem::old_arch |
old arch compatibility mode - see gf_sys_old_arch_compat
◆ log_color
| readonly boolean JSGPACCoreSystem::log_color |
check if logs use color - see gf_log_use_color
◆ quiet
| readonly boolean JSGPACCoreSystem::quiet |
quiet mode - see gf_sys_is_quiet
◆ timezone
| readonly signed int JSGPACCoreSystem::timezone |
timezone - see gf_net_get_timezone
◆ nb_files_open
| readonly unsigned int JSGPACCoreSystem::nb_files_open |
number of opened file handles - see gf_file_handles_count
◆ cache_dir
| readonly DOMString JSGPACCoreSystem::cache_dir |
default cache directory - see gf_get_default_cache_directory
◆ shared_dir
| readonly DOMString JSGPACCoreSystem::shared_dir |
default shared directory (containing gui, shaders, etc) - see gf_opts_default_shared_directory
◆ version
| readonly DOMString JSGPACCoreSystem::version |
◆ version_full
| readonly DOMString JSGPACCoreSystem::version_full |
GPAC full version string, including GIT rev
◆ copyright
| readonly DOMString JSGPACCoreSystem::copyright |
◆ version_major
| readonly unsigned long JSGPACCoreSystem::version_major |
◆ version_minor
| readonly unsigned long JSGPACCoreSystem::version_minor |
◆ version_micro
| readonly unsigned long JSGPACCoreSystem::version_micro |