libgpac
Documentation of the core library of GPAC
JSFSFilter Interface Reference

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)
 
JSFSFilter ipid_source (unsigned long idx)
 
Array opid_sinks (unsigned long idx)
 
Array all_args (optional boolean value_only=true)
 
void update (DOMString arg_name, DOMString arg_val)
 
void remove ()
 
void insert (DOMString filter_to_add, optional DOMString link_args=NULL)
 

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 boolean last_ts_sent
 
attribute boolean last_ts_drop
 

Detailed Description

The JSFSFilter interface provides tools to query and update filters in a session. It implements binding to the underlying filter object, see GF_Filter.

Member Function Documentation

◆ 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

Parameters
idxthe index of the input pid to query
namename 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
idxthe index of the input pid to query
fun_callbackfunction 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
idxthe index of the output pid to query
namename 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
idxthe index of the output pid to query
fun_callbackfunction 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
idxthe 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
idxthe 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_onlyif true, only returns name (DOMString) and value (FilterProperty) of each argument. Otherwise returns the full argument (JSFSFilterArg)
Returns
array of JSFSFilterArg

◆ update()

void JSFSFilter::update ( DOMString  arg_name,
DOMString  arg_val 
)

sends argument update to filter

Parameters
arg_namename of argument to update
arg_valvalue of argument to update

◆ 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_addstring describing the filter to add, can be in the form "src=" for sources, "dst=" for sinks or regular string for filters.
link_argsspecify any additional arguments to pass to the SID option of the new filter - see gf_filter_set_source

Field Documentation

◆ 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

filter registry name

◆ 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 explicetly 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

number of packets 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

number of bytes sent

◆ tasks

attribute readonly unsigned long JSFSFilter::tasks

number of tasks executed

◆ errors

attribute readonly unsigned long JSFSFilter::errors

number of 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 boolean JSFSFilter::last_ts_sent

set to max timestamp of last packet sent by the filter, or null if not available

◆ last_ts_drop

attribute boolean JSFSFilter::last_ts_drop

set to max timestamp of last packet dropped by the filter, or null if not available