libgpac
Documentation of the core library of GPAC
|
JSFSFilter API. More...
import"filtersession.idl";
Public Member Functions | |
boolean | is_destroyed () |
FilterProperty | ipid_props (unsigned long idx, DOMString name) |
void | ipid_props (unsigned long idx, function fun_callback) |
FilterProperty | opid_props (unsigned long idx, DOMString name) |
void | opid_props (unsigned long idx, function fun_callback) |
Object | ipid_stats (unsigned long idx, optional unsigned int mode=0) |
Object | opid_stats (unsigned long idx, optional unsigned int mode=0) |
void | require_source_id () |
Array | compute_link (unsigned long idx, DOMString description, optional Boolean load_args=false) |
DOMString | get_destinations (unsigned long pid_idx=-1) |
JSFSFilter | ipid_source (unsigned long idx) |
Array | opid_sinks (unsigned long idx) |
Array | all_args (optional boolean value_only=true) |
FilterProperty | get_arg (DOMString arg_name) |
void | update (DOMString arg_name, DOMString arg_val, unsigned int propagate_mask=0) |
void | remove () |
void | insert (DOMString filter_to_add, optional DOMString link_args=null) |
void | reconnect (long pid_idx=-1) |
void | bind (Object obj) |
void | lock (boolean do_lock) |
Data Fields | |
attribute readonly DOMString | name |
attribute readonly DOMString | ID |
attribute readonly DOMString | type |
attribute readonly DOMString | tag |
attribute readonly DOMString | itag |
attribute readonly unsigned long | nb_ipid |
attribute readonly unsigned long | nb_opid |
attribute readonly DOMString | status |
attribute readonly boolean | alias |
attribute readonly DOMString | args |
attribute readonly boolean | dynamic |
attribute readonly boolean | done |
attribute readonly unsigned long long | time |
attribute readonly unsigned long long | pck_done |
attribute readonly unsigned long long | bytes_done |
attribute readonly unsigned long long | pck_sent |
attribute readonly unsigned long long | pck_ifce_sent |
attribute readonly unsigned long long | bytes_sent |
attribute readonly unsigned long | tasks |
attribute readonly unsigned long | errors |
attribute readonly boolean | report_updated |
attribute readonly DOMString | class |
attribute readonly DOMString | streamtype |
attribute readonly DOMString | codec |
attribute DOMString | iname |
attribute boolean | event_target |
attribute Fraction | last_ts_sent |
attribute Fraction | last_ts_drop |
The JSFSFilter interface provides tools to query and update filters in a session. It implements binding to the underlying filter object, see GF_Filter.
boolean JSFSFilter::is_destroyed | ( | ) |
Checks if a filter is valid or if it has been destroyed. Any query on a destroyed filter will raise an exception.
FilterProperty JSFSFilter::ipid_props | ( | unsigned long | idx, |
DOMString | name | ||
) |
Gets properties on input pid This function accepts the following extra names (not property names) to query PID status:
idx | the index of the input pid to query |
name | name of the property to query |
void JSFSFilter::ipid_props | ( | unsigned long | idx, |
function | fun_callback | ||
) |
Enumerates properties on input pid
idx | the index of the input pid to query |
fun_callback | function called for each property in the input pid. The function has three parameters: name (DOMString), type (DOMString), value (FilterProperty) |
FilterProperty JSFSFilter::opid_props | ( | unsigned long | idx, |
DOMString | name | ||
) |
Gets properties on output pid
idx | the index of the output pid to query |
name | name of the property to query |
void JSFSFilter::opid_props | ( | unsigned long | idx, |
function | fun_callback | ||
) |
Enumerates properties on output pid
idx | the index of the output pid to query |
fun_callback | function called for each property in the output pid. The function has three parameters: name (DOMString), type (DOMString), value (FilterProperty) |
Object JSFSFilter::ipid_stats | ( | unsigned long | idx, |
optional unsigned int | mode = 0 |
||
) |
get statistics on input pid
idx | the index of the input pid to query |
mode | mode used to query stats - cf GF_FilterPidStatsLocation |
Object JSFSFilter::opid_stats | ( | unsigned long | idx, |
optional unsigned int | mode = 0 |
||
) |
get statistics on output pid
idx | the index of the output pid to query |
mode | mode used to query stats - cf GF_FilterPidStatsLocation |
void JSFSFilter::require_source_id | ( | ) |
Forces a filter to only link to filters having at least one sourceID defined - cf gf_filter_require_source_id
Array JSFSFilter::compute_link | ( | unsigned long | idx, |
DOMString | description, | ||
optional Boolean | load_args = false |
||
) |
computes link from an output pid of the filter to a given filter description - cf gf_filter_probe_link
idx | the index of the output pid to query |
description | filter descrition, destination can be specified using dst=URL |
load_args | if set, will load all possible arguments for each filter |
If arguments are loaded, the return value is an array of object with property fname
set to the registry name and args
set to an array of JSFSFilterArg, including arguments of meta filters (not visible otherwise)
If arguments are not loaded, the return value is an array registry names
DOMString JSFSFilter::get_destinations | ( | unsigned long | pid_idx = -1 | ) |
get possible direct destinations for a filter - cf gf_filter_get_possible_destinations
pid_idx | the index of the output pid to query, -1 to consider all output pids |
JSFSFilter JSFSFilter::ipid_source | ( | unsigned long | idx | ) |
Gets source filter for an input pid
idx | the index of the input pid to query |
Array JSFSFilter::opid_sinks | ( | unsigned long | idx | ) |
Gets destination filter(s) for an output pid
idx | the index of the output pid to query |
Array JSFSFilter::all_args | ( | optional boolean | value_only = true | ) |
Gets all arguments (options) of the filter
value_only | if true, only returns name (DOMString) and value (FilterProperty) of each argument. Otherwise returns the full argument (JSFSFilterArg) |
FilterProperty JSFSFilter::get_arg | ( | DOMString | arg_name | ) |
Gets value of a given argument of the filter
arg_name | argument name |
sends argument update to filter
arg_name | name of argument to update |
arg_val | value of argument to update. Can be a string or a native type which will be serialized based on the argument type |
propagate_mask | flags indicating if updates must be send to up-chain filters (2), down-chain filters (1), both (3) or only on filter (0) |
void JSFSFilter::remove | ( | ) |
removes filter from graph
inserts a filter in graph linked to the current filter
filter_to_add | string describing the filter to add, can be in the form "src=" for sources, "dst=" for sinks or regular string for filters. |
link_args | specify any additional arguments to pass to the SID option of the new filter - see gf_filter_set_source |
void JSFSFilter::reconnect | ( | long | pid_idx = -1 | ) |
reconnects a filter ouput(s)
pid_idx | output pid to reconnect, -1 for all output pids |
void JSFSFilter::bind | ( | Object | obj | ) |
binds a JSObject with underlying filter javascript extensions, if any. Currently only dashin (see JSDASHClient) and httpout (see JSHTTPServer) filters have such an extension. This will throw an exception if failure or no JS binding available
obj | the JS object to use as interface for the underlying filter script |
void JSFSFilter::lock | ( | boolean | do_lock | ) |
locks a filter. This should only be used when updating sync arguments of the filter - see gf_filter_lock.
do_lock | if true, locks the filter global mutex, otherwise unlocks it. |
attribute readonly DOMString JSFSFilter::name |
filter name - may be changed at run-time by the filter
attribute readonly DOMString JSFSFilter::ID |
filter ID - cannot be modified by filter, but may be null
attribute readonly DOMString JSFSFilter::type |
filter registry name
attribute readonly DOMString JSFSFilter::tag |
filter TAG
attribute readonly DOMString JSFSFilter::itag |
filter inherited TAG
attribute readonly unsigned long JSFSFilter::nb_ipid |
number of input PIDs for the filter
attribute readonly unsigned long JSFSFilter::nb_opid |
number of output PIDs for the filter
attribute readonly DOMString JSFSFilter::status |
status string of the filter, or null
attribute readonly boolean JSFSFilter::alias |
set to true if the filter is an alias filter (should be ignored)
attribute readonly DOMString JSFSFilter::args |
set to the arguments passed to the filter, null if none
attribute readonly boolean JSFSFilter::dynamic |
set to true if filter was dynamically loaded during graph resolution, false if filter was explicitly loaded by user/app
attribute readonly boolean JSFSFilter::done |
set to true if filter is done processing and will soon be removed
attribute readonly unsigned long long JSFSFilter::time |
time in microseconds the filter has been running
attribute readonly unsigned long long JSFSFilter::pck_done |
number of input packets received
attribute readonly unsigned long long JSFSFilter::bytes_done |
number of input bytes received
attribute readonly unsigned long long JSFSFilter::pck_sent |
number of packets sent
attribute readonly unsigned long long JSFSFilter::pck_ifce_sent |
number of frame interfaces packets sent
attribute readonly unsigned long long JSFSFilter::bytes_sent |
number of bytes sent
attribute readonly unsigned long JSFSFilter::tasks |
number of tasks executed
attribute readonly unsigned long JSFSFilter::errors |
number of errors
attribute readonly boolean JSFSFilter::report_updated |
set to true if report has been updated since last query
attribute readonly DOMString JSFSFilter::class |
class of filter, can be "rawin", "demuxer", "decoder", "encoder", "muxer", "rawout", "mediasink", "mediasource", "unknown"
attribute readonly DOMString JSFSFilter::streamtype |
stream type (audio, visual, ...)
attribute readonly DOMString JSFSFilter::codec |
codec name or null if unknown
attribute DOMString JSFSFilter::iname |
internal name - this can only be set and modified by this JS and allows for filter identification from JS
attribute boolean JSFSFilter::event_target |
set to true if filter accepts user events
attribute Fraction JSFSFilter::last_ts_sent |
set to max timestamp of last packet sent by the filter, or null if not available
attribute Fraction JSFSFilter::last_ts_drop |
set to max timestamp of last packet dropped by the filter, or null if not available