![]() |
libgpac
Documentation of the core library of GPAC
|
JSFSFilter API. More...
Collaboration diagram for JSFSFilter: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) |
| 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) |
| void | remove () |
| void | insert (DOMString filter_to_add, optional DOMString link_args=null) |
| 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 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) |
| 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 |
| void JSFSFilter::update | ( | DOMString | arg_name, |
| DOMString | arg_val | ||
| ) |
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 |
| void JSFSFilter::remove | ( | ) |
removes filter from graph
| void JSFSFilter::insert | ( | DOMString | filter_to_add, |
| optional DOMString | link_args = null |
||
| ) |
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::bind | ( | Object | obj | ) |
binds a JSObject with underlying filter javascript extensions, if any. Currently only dashin filter has such an extension (see JSDASHClient). 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 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