libgpac
Documentation of the core library of GPAC
|
import"jsf.idl";
Public Member Functions | |
attribute GF_Err | initialize () |
attribute void | finalize () |
attribute GF_Err | configure_pid (FilterPid pid) |
attribute GF_Err | remove_pid (FilterPid pid) |
attribute GF_Err | process () |
attribute boolean | process_event (FilterPid pid, FilterEvent evt) |
attribute GF_Err | update_arg (DOMString arg_name, DOMString arg_val) |
void | set_desc (DOMString description) |
void | set_author (DOMString author) |
void | set_version (DOMString version) |
void | set_help (DOMString help) |
void | set_arg (JSArgDesc arg) |
void | set_cap (optional JSCapDesc cap_desc=null) |
void | set_name (DOMString name) |
FilterPid | new_pid () |
void | send_event (FilterEvent evt, optional boolean upstream=false) |
FilterProperty | get_info (DOMString info_name, optional boolean is_string=false) |
boolean | is_supported_mime (DOMString mime) |
void | update_status (DOMString status, optional long percent=0) |
void | reschedule (optional long reschedule_us=0) |
void | post_task (function task_callback, optional Object task_this=null) |
void | notify_failure (GF_Err error, optional long error_type=JSF_SETUP_ERROR) |
boolean | is_supported_source (DOMString source_url) |
void | hint_clock (unsigned long long time_in_microseconds, double media_time_sec) |
void | send_update (DOMString filter_id, DOMString arg_name, DOMString arg_value, long propagate_mask) |
void | lock_all (boolean do_lock) |
void | lock (boolean do_lock) |
FilterInstance | add_source (DOMString source, optional DOMString parent=null, optional boolean inherit_args=false) |
FilterInstance | add_destination (DOMString destination, optional DOMString mux_mime=null) |
FilterInstance | add_filter (DOMString args) |
void | make_sticky () |
void | prevent_blocking (boolean do_prevent) |
void | block_eos (boolean do_block) |
void | abort () |
void | set_source (Filter from, optional DOMString source_id=null) |
void | set_source_restricted (Filter from, optional DOMString source_id=null) |
void | reset_source () |
Data Fields | |
attribute long | max_pids |
readonly attribute boolean | block_enabled |
readonly attribute unsigned long | output_buffer |
readonly attribute unsigned long | output_playout |
readonly attribute DOMString | sep_args |
readonly attribute DOMString | sep_name |
readonly attribute DOMString | sep_list |
readonly attribute DOMString | src_args |
readonly attribute DOMString | dst_args |
readonly attribute DOMString | dst_name |
readonly attribute boolean | sinks_done |
attribute boolean | reports_on |
attribute unsigned long | max_screen_width |
attribute unsigned long | max_screen_height |
attribute unsigned long | max_screen_depth |
attribute unsigned long | max_screen_fps |
attribute unsigned long | max_screen_views |
attribute unsigned long | max_audio_channels |
attribute unsigned long | max_audio_samplerate |
attribute unsigned long | max_audio_depth |
readonly attribute unsigned long | events_queued |
readonly attribute unsigned long long readonly | clock_hint_us |
readonly attribute unsigned long long | clock_hint_mediatime |
readonly attribute unsigned long long | connections_pending |
attribute DOMString | iname |
writeonly unsigned boolean | require_source_id |
readonly attribute DOMString | jspath |
The JSFilter interface has a single instance exposed to the script under the name "filter". It implements binding to the underlying filter object, see GF_Filter. The JSFilter provides callback functions mapping the functionnalities of __gf_filter_register.
attribute GF_Err JSFilter::initialize | ( | ) |
initialize the filter. This is a callback function assignable by the script. It is called once all filter arguments have been parsed. See __gf_filter_register::initialize.
attribute void JSFilter::finalize | ( | ) |
finalize the filter. This is a callback function assignable by the script. It is called immediately before destruction of the JavaScript context. See __gf_filter_register::finalize.
configures or reconfigures an input pid See __gf_filter_register::configure_pid.
pid | pid to (re)configure |
removes an input pid See __gf_filter_register::configure_pid.
pid | pid to remove |
attribute GF_Err JSFilter::process | ( | ) |
process See __gf_filter_register::process.
attribute boolean JSFilter::process_event | ( | FilterPid | pid, |
FilterEvent | evt | ||
) |
process an event on a given pid See __gf_filter_register::process_event.
pid | pid on which the event is received |
evt | event tp process |
process an event on a given pid See __gf_filter_register::process_event.
arg_name | argument name |
arg_val | argument value |
void JSFilter::set_desc | ( | DOMString | description | ) |
sets filter description as visible when checking filter info
description | description of filter |
void JSFilter::set_author | ( | DOMString | author | ) |
sets filter author as visible when checking filter info
author | author of filter |
void JSFilter::set_version | ( | DOMString | version | ) |
sets filter version as visible when checking filter info
version | version of filter |
void JSFilter::set_help | ( | DOMString | help | ) |
sets filter help as visible when checking filter info
help | help of filter - can use the usual MarkDown syntax of GPAC help |
void JSFilter::set_arg | ( | JSArgDesc | arg | ) |
adds an argument to the filter. JavaScript Filter arguments can be specified from command line in the same way as reguar filters. The argument is then exposed as a property of the "filter" object of the javascript context. If the argument name is a wildcard (*), the filter will be forwarded any argument name.
arg | object exposing the same interface as the JSArgDesc interface |
void JSFilter::set_cap | ( | optional JSCapDesc | cap_desc = null | ) |
sets a new capability for the filter. If no argument, starts a new capability bundle.
cap_desc | capability descriptor object |
void JSFilter::set_name | ( | DOMString | name | ) |
sets the name of the filter, used for logs
name | the filter name |
FilterPid JSFilter::new_pid | ( | ) |
creates a new PID - see gf_filter_pid_new
void JSFilter::send_event | ( | FilterEvent | evt, |
optional boolean | upstream = false |
||
) |
sends an event on the filter - see gf_filter_send_event
evt | the event to send |
upstream | sends the evnet upstream |
FilterProperty JSFilter::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
info_name | the property name or ID of the info to query |
is_string | indicate if the name describes a built-in property or a user-defined property |
boolean JSFilter::is_supported_mime | ( | DOMString | mime | ) |
checks if a MIME type is supported - see gf_filter_is_supported_mime
mime | the mime type to query |
void JSFilter::update_status | ( | DOMString | status, |
optional long | percent = 0 |
||
) |
update filter status string - see gf_filter_update_status
status | the status string, may be null to reset the status string |
percent | percent of processing, if known |
void JSFilter::reschedule | ( | optional long | reschedule_us = 0 | ) |
reschedule filter - see gf_filter_ask_rt_reschedule and gf_filter_post_process_task
reschedule_us | if not 0, reschedule the filter in the given amount of microseconds. Otherwise post a filter processing task |
void JSFilter::post_task | ( | function | task_callback, |
optional Object | task_this = null |
||
) |
posts a task to the main scheduler - see gf_filter_post_task
task_callback | the callback function to use. This callback returns -1 or an exception to abort the task, or a reschedule time in milliseconds |
task_this | optional value for this object of the callback function. If not set, the filter object is used |
void JSFilter::notify_failure | ( | GF_Err | error, |
optional long | error_type = JSF_SETUP_ERROR |
||
) |
notify a failure of the filter upon source connections - see gf_filter_notification_failure, gf_filter_notification_failure
error | the error code |
error_type | the type of notification.
|
boolean JSFilter::is_supported_source | ( | DOMString | source_url | ) |
checks if a MIME type is supported - see gf_filter_is_supported_mime
source_url | the URL to check |
void JSFilter::hint_clock | ( | unsigned long long | time_in_microseconds, |
double | media_time_sec | ||
) |
checks if a MIME type is supported - see gf_filter_hint_single_clock
time_in_microseconds | time in microseconds |
media_time_sec | media timestamp inseconds |
void JSFilter::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
filter_id | ID of the filter |
arg_name | name of the argument |
arg_value | value of the argument |
propagate_mask | propagate mask |
void JSFilter::lock_all | ( | boolean | do_lock | ) |
locks filter session - see gf_filter_lock_all
do_lock | if true locks filter |
void JSFilter::lock | ( | boolean | do_lock | ) |
locks a filter - see gf_filter_lock
do_lock | if true locks filter |
FilterInstance JSFilter::add_source | ( | DOMString | source, |
optional DOMString | parent = null , |
||
optional boolean | inherit_args = false |
||
) |
adds a source filter in the media session - see gf_filter_connect_source
source | URL of source to load |
parent | URL of parent, used as baseURL for the source. May be NULL |
inherit_args | if true, new filter will inherit arguments of this filter's destination |
FilterInstance JSFilter::add_destination | ( | DOMString | destination, |
optional DOMString | mux_mime = null |
||
) |
adds a destination filter in the media session - see gf_filter_connect_destination
destination | URL of destination to instantiate |
mux_mime | mime identifying destination format. If not set or null, format will be guessed from URL |
FilterInstance JSFilter::add_filter | ( | DOMString | args | ) |
loads a new filter in the media session - see gf_filter_load_filter
args | name and arguments of the filter to load |
void JSFilter::make_sticky | ( | ) |
makes the filter sticky - see gf_filter_make_sticky
void JSFilter::prevent_blocking | ( | boolean | do_prevent | ) |
makes the filter unblocking - see gf_filter_prevent_blocking
do_prevent | if true, filter will not be blocking if all its output pids are blocking |
void JSFilter::block_eos | ( | boolean | do_block | ) |
makes the filter prevent EOS queries - see gf_filter_block_eos
do_block | if true, filter input pids cannot be checked for end of stream during EOS queries |
void JSFilter::abort | ( | ) |
aborts the filter - see gf_filter_abort
void JSFilter::set_source | ( | Filter | from, |
optional DOMString | source_id = null |
||
) |
assigns source name to a filter - see gf_filter_set_source
from | a Filter or a FilterInstance object to set a a source for this filter |
source_id | the source ID to assign - empty string means no source_id |
void JSFilter::set_source_restricted | ( | Filter | from, |
optional DOMString | source_id = null |
||
) |
assigns restricted source name to a filter - see gf_filter_set_source_restricted
from | a Filter or a FilterInstance object to set a a source for this filter |
source_id | the source ID to assign - empty string means no source_id |
void JSFilter::reset_source | ( | ) |
reset source identifier for the filter - see gf_filter_reset_source
attribute long JSFilter::max_pids |
readonly attribute boolean JSFilter::block_enabled |
readonly attribute unsigned long JSFilter::output_buffer |
readonly attribute unsigned long JSFilter::output_playout |
readonly attribute DOMString JSFilter::sep_args |
readonly attribute DOMString JSFilter::sep_name |
readonly attribute DOMString JSFilter::sep_list |
readonly attribute DOMString JSFilter::src_args |
source args, only valid during initialize callback - see gf_filter_get_src_args
readonly attribute DOMString JSFilter::dst_args |
readonly attribute DOMString JSFilter::dst_name |
readonly attribute boolean JSFilter::sinks_done |
attribute boolean JSFilter::reports_on |
attribute unsigned long JSFilter::max_screen_width |
attribute unsigned long JSFilter::max_screen_height |
attribute unsigned long JSFilter::max_screen_depth |
attribute unsigned long JSFilter::max_screen_fps |
attribute unsigned long JSFilter::max_screen_views |
attribute unsigned long JSFilter::max_audio_channels |
attribute unsigned long JSFilter::max_audio_samplerate |
attribute unsigned long JSFilter::max_audio_depth |
readonly attribute unsigned long JSFilter::events_queued |
readonly attribute unsigned long long readonly JSFilter::clock_hint_us |
readonly attribute unsigned long long JSFilter::clock_hint_mediatime |
readonly attribute unsigned long long JSFilter::connections_pending |
attribute DOMString JSFilter::iname |
internal name - this can only be set and modified by JS API and allows for filter identification from JS
writeonly unsigned boolean JSFilter::require_source_id |
requires source ID for the filter - see gf_filter_require_source_id
readonly attribute DOMString JSFilter::jspath |
gets JS path