JSFSFilter API.
More...
import"filtersession.idl";
The JSFSFilter interface provides tools to query and update filters in a session. It implements binding to the underlying filter object, see GF_Filter.
◆ is_destroyed()
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.
- Returns
- true if the filter has been destroyed, false otherwise
◆ ipid_props() [1/2]
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:
- buffer: return the PID buffer level in microsecond
- buffer_total: return the cumulated buffer from source to PID level in microsecond
- name: return the PID name
- eos: return true if PID is in EOS state
- Parameters
-
idx | the index of the input pid to query |
name | name of the property to query |
- Returns
- property value, or null if not found
◆ ipid_props() [2/2]
void JSFSFilter::ipid_props |
( |
unsigned long |
idx, |
|
|
function |
fun_callback |
|
) |
| |
Enumerates properties on input pid
- Parameters
-
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) |
◆ opid_props() [1/2]
FilterProperty JSFSFilter::opid_props |
( |
unsigned long |
idx, |
|
|
DOMString |
name |
|
) |
| |
Gets properties on output pid
- Parameters
-
idx | the index of the output pid to query |
name | name of the property to query |
- Returns
- property value, or null if not found
◆ opid_props() [2/2]
void JSFSFilter::opid_props |
( |
unsigned long |
idx, |
|
|
function |
fun_callback |
|
) |
| |
Enumerates properties on output pid
- Parameters
-
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) |
◆ ipid_source()
JSFSFilter JSFSFilter::ipid_source |
( |
unsigned long |
idx | ) |
|
Gets source filter for an input pid
- Parameters
-
idx | the index of the input pid to query |
- Returns
- input filter or null
◆ opid_sinks()
Array JSFSFilter::opid_sinks |
( |
unsigned long |
idx | ) |
|
Gets destination filter(s) for an output pid
- Parameters
-
idx | the index of the output pid to query |
- Returns
- array of output filters
◆ all_args()
Array JSFSFilter::all_args |
( |
optional boolean |
value_only = true | ) |
|
Gets all arguments (options) of the filter
- Parameters
-
value_only | if true, only returns name (DOMString) and value (FilterProperty) of each argument. Otherwise returns the full argument (JSFSFilterArg) |
- Returns
- array of JSFSFilterArg
◆ get_arg()
Gets value of a given argument of the filter
- Parameters
-
- Returns
- property value, or null
◆ update()
void JSFSFilter::update |
( |
DOMString |
arg_name, |
|
|
DOMString |
arg_val |
|
) |
| |
sends argument update to filter
- Parameters
-
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 |
◆ remove()
void JSFSFilter::remove |
( |
| ) |
|
removes filter from graph
◆ insert()
void JSFSFilter::insert |
( |
DOMString |
filter_to_add, |
|
|
optional DOMString |
link_args = null |
|
) |
| |
inserts a filter in graph linked to the current filter
- Parameters
-
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 |
◆ bind()
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
- Parameters
-
obj | the JS object to use as interface for the underlying filter script |
◆ lock()
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.
- Parameters
-
do_lock | if true, locks the filter global mutex, otherwise unlocks it. |
◆ name
attribute readonly DOMString JSFSFilter::name |
filter name - may be changed at run-time by the filter
◆ ID
attribute readonly DOMString JSFSFilter::ID |
filter ID - cannot be modified by filter, but may be null
◆ type
attribute readonly DOMString JSFSFilter::type |
◆ nb_ipid
attribute readonly unsigned long JSFSFilter::nb_ipid |
number of input PIDs for the filter
◆ nb_opid
attribute readonly unsigned long JSFSFilter::nb_opid |
number of output PIDs for the filter
◆ status
attribute readonly DOMString JSFSFilter::status |
status string of the filter, or null
◆ alias
attribute readonly boolean JSFSFilter::alias |
set to true if the filter is an alias filter (should be ignored)
◆ args
attribute readonly DOMString JSFSFilter::args |
set to the arguments passed to the filter, null if none
◆ dynamic
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
◆ done
attribute readonly boolean JSFSFilter::done |
set to true if filter is done processing and will soon be removed
◆ time
attribute readonly unsigned long long JSFSFilter::time |
time in microseconds the filter has been running
◆ pck_done
attribute readonly unsigned long long JSFSFilter::pck_done |
number of input packets received
◆ bytes_done
attribute readonly unsigned long long JSFSFilter::bytes_done |
number of input bytes received
◆ pck_sent
attribute readonly unsigned long long JSFSFilter::pck_sent |
◆ pck_ifce_sent
attribute readonly unsigned long long JSFSFilter::pck_ifce_sent |
number of frame interfaces packets sent
◆ bytes_sent
attribute readonly unsigned long long JSFSFilter::bytes_sent |
◆ tasks
attribute readonly unsigned long JSFSFilter::tasks |
◆ errors
attribute readonly unsigned long JSFSFilter::errors |
◆ report_updated
attribute readonly boolean JSFSFilter::report_updated |
set to true if report has been updated since last query
◆ class
attribute readonly DOMString JSFSFilter::class |
class of filter, can be "rawin", "demuxer", "decoder", "encoder", "muxer", "rawout", "mediasink", "mediasource", "unknown"
◆ streamtype
attribute readonly DOMString JSFSFilter::streamtype |
stream type (audio, visual, ...)
◆ codec
attribute readonly DOMString JSFSFilter::codec |
codec name or null if unknown
◆ iname
attribute DOMString JSFSFilter::iname |
internal name - this can only be set and modified by this JS and allows for filter identification from JS
◆ event_target
attribute boolean JSFSFilter::event_target |
set to true if filter accepts user events
◆ last_ts_sent
attribute Fraction JSFSFilter::last_ts_sent |
set to max timestamp of last packet sent by the filter, or null if not available
◆ last_ts_drop
attribute Fraction JSFSFilter::last_ts_drop |
set to max timestamp of last packet dropped by the filter, or null if not available