libgpac
Documentation of the core library of GPAC
FilterInstance Interface Reference

import"jsf.idl";

Public Member Functions

attribute void on_setup_failure (GF_Err e)
 
void send_event (FilterEvent evt)
 
FilterProperty get_info (DOMString info_name, optional boolean is_string=false)
 
void send_update (DOMString filter_id, DOMString arg_name, DOMString arg_value, long propagate_mask)
 
void set_source (Filter from, optional DOMString source_id=null)
 
void set_source_restricted (Filter from, optional DOMString source_id=null)
 
void remove ()
 
boolean has_pid_connections_pending (optional Filter stop_at=null)
 
FilterProperty get_arg (DOMString arg_name, optional boolean as_string=false)
 
void disable_probe ()
 
void disable_inputs ()
 
void reset_source ()
 
void set_blocking (boolean is_blocking)
 

Data Fields

attribute readonly DOMString name
 
attribute readonly DOMString type
 
attribute DOMString iname
 

Detailed Description

FilterInstance wraps the set of functions available for filters loaded by the script

Member Function Documentation

◆ on_setup_failure()

attribute void FilterInstance::on_setup_failure ( GF_Err  e)

setup failure notification. This is a callback function assignable by the script. It is when loading a source or destination filter fails asynchronously

Parameters
eerror code if any
Returns
void

◆ send_event()

void FilterInstance::send_event ( FilterEvent  evt)

sends an event on the filter - see gf_filter_send_event

Parameters
evtthe event to send

◆ get_info()

FilterProperty FilterInstance::get_info ( DOMString  info_name,
optional boolean  is_string = false 
)

queries info on a filter an event on the filter - see gf_filter_get_info and gf_filter_get_info_str

Parameters
info_namethe property name or ID of the info to query
is_stringindicate if the name describes a built-in property or a user-defined property
Returns
the property if found, null otherwise

◆ send_update()

void FilterInstance::send_update ( DOMString  filter_id,
DOMString  arg_name,
DOMString  arg_value,
long  propagate_mask 
)

sends an update to a filter - see gf_filter_send_update

Parameters
filter_idID of the filter
arg_namename of the argument
arg_valuevalue of the argument
propagate_maskpropagate mask

◆ set_source()

void FilterInstance::set_source ( Filter  from,
optional DOMString  source_id = null 
)

assigns source name to a filter - see gf_filter_set_source

Parameters
froma Filter or a FilterInstance object to set a a source for this filter
source_idthe source ID to assign

◆ set_source_restricted()

void FilterInstance::set_source_restricted ( Filter  from,
optional DOMString  source_id = null 
)

assigns restricted source name to a filter - see gf_filter_set_source_restricted

Parameters
froma Filter or a FilterInstance object to set a a source for this filter
source_idthe source ID to assign

◆ remove()

void FilterInstance::remove ( )

removes a source filter - see gf_filter_remove_src

◆ has_pid_connections_pending()

boolean FilterInstance::has_pid_connections_pending ( optional Filter  stop_at = null)

checks if a filter and its connected output chain(s) have PID connection pending

Parameters
stop_ata Filter or a FilterInstance object indicating where to stop the analysis. If not set and the filter is a source filter, automatically set to the Filter running the script
Returns
true if pid connections are pending

◆ get_arg()

FilterProperty FilterInstance::get_arg ( DOMString  arg_name,
optional boolean  as_string = false 
)

gets the value of a filter instance argument

Parameters
arg_namethe argument name to query
as_stringif true, returns the value as a string, otherwise as a property object
Returns
the argument value as string or object, or null if no such argument

◆ disable_probe()

void FilterInstance::disable_probe ( )

disables data probing on the filter - see gf_filter_disable_probe

◆ disable_inputs()

void FilterInstance::disable_inputs ( )

disables input on the filter - see gf_filter_disable_inputs

◆ reset_source()

void FilterInstance::reset_source ( )

reset source identifier for the filter - see gf_filter_reset_source

◆ set_blocking()

void FilterInstance::set_blocking ( boolean  is_blocking)

indicates if filter is likely blocking or not - see gf_filter_set_blocking

Parameters
is_blockingif true, indicates the filter is likely to block upon process

Field Documentation

◆ name

attribute readonly DOMString FilterInstance::name

filter name

◆ type

attribute readonly DOMString FilterInstance::type

filter type (registry name)

◆ iname

attribute DOMString FilterInstance::iname

internal name - this can only be set and modified by JS API and allows for filter identification from JS