libgpac
Documentation of the core library of GPAC
FilterPid Interface Reference

import"webgl.idl";

Public Member Functions

void send_event (FilterEvent evt)
 
Object enum_properties (unsigned long index, optional boolean enum_info=false)
 
FilterProperty get_prop (DOMString name, optional boolean is_user=false)
 
FilterProperty get_info (DOMString name, optional boolean is_user=false)
 
FilterPaquet get_packet ()
 
void drop_packet ()
 
boolean is_filter_in_parents (GF_Filter filter)
 
boolean get_buffer_occupancy (GF_Filter filter)
 
void clear_eos ()
 
boolean check_caps ()
 
void discard_block ()
 
void allow_direct_dispatch ()
 
DOMString resolve_file_template (DOMString template, unsigned long file_idx, optional DOMString suffix=null)
 
FilterProperty query_caps (DOMString name, optional boolean is_user)
 
Object get_stats ()
 
Object get_clock_info ()
 
void set_prop (DOMString name, FilterProperty prop, optional boolean is_user=false)
 
void set_info (DOMString name, FilterProperty prop, optional boolean is_user=false)
 
void negotiate_prop (DOMString name, FilterProperty prop, optional boolean is_user=false)
 
void remove ()
 
void reset_props ()
 
void copy_props (FilterPid from)
 
void ignore_blocking (optional boolean do_ignore=true)
 
FilterPacket new_packet ()
 
FilterPacket new_packet (DOMString str, optional boolean use_shared=false, optional function destroy_callback_fun=null)
 
FilterPacket new_packet (unsigned long size)
 
FilterPacket new_packet (ArrayBuffer ab, optional boolean use_shared=false, optional function destroy_callback_fun=null)
 
FilterPacket new_packet (FilterPacket pck, optional boolean use_shared=false, optional boolean do_copy=false)
 
FilterPacket new_packet (FilterPacket pck, optional boolean use_shared=false, optional function destroy_callback_fun=null)
 
FilterPacket new_packet (function fetch_texture_fun, optional function destroy_callback_fun=null, optional boolean is_blocking=false)
 
void forward (FilterPacket pck)
 
FilterPacket new_packet (WebGLContext gl, function on_frame_consumed, optional boolean use_depth)
 

Data Fields

attribute DOMString name
 
attribute boolean eos
 
readonly attribute boolean eos_seen
 
readonly attribute boolean eos_received
 
readonly attribute boolean is_flush
 
readonly attribute boolean would_block
 
readonly attribute boolean sparse
 
readonly attribute DOMString filter_name
 
readonly attribute DOMString src_name
 
readonly attribute DOMString args
 
readonly attribute DOMString src_args
 
readonly attribute DOMString unicity_args
 
attribute long max_buffer
 
writeonly boolean loose_connect
 
writeonly boolean framing
 
readonly attribute long long buffer
 
readonly attribute boolean full
 
readonly attribute boolean first_empty
 
readonly attribute long long first_cts
 
readonly attribute unsigned long nb_pck_queued
 
readonly attribute unsigned long timescale
 
writeonly unsigned long clock_mode
 
writeonly unsigned boolean discard
 
readonly attribute DOMString src_url
 
readonly attribute DOMString dst_url
 
writeonly unsigned boolean require_source_id
 
writeonly unsigned boolean recompute_dts
 
readonly attribute unsigned long min_pck_dur
 
readonly attribute unsigned long playing
 
readonly attribute unsigned long long next_ts
 
readonly attribute boolean has_decoder
 

Detailed Description

The FilterPid object is a binding for GF_FilterPid

The FilterPid object is extended as follows

Member Function Documentation

◆ send_event()

void FilterPid::send_event ( FilterEvent  evt)

sends an event on the pid - see gf_filter_pid_send_event

Parameters
evtthe event to send

◆ enum_properties()

Object FilterPid::enum_properties ( unsigned long  index,
optional boolean  enum_info = false 
)

enumerates properties or info on the pid - see gf_filter_pid_enum_properties and gf_filter_pid_enum_info

Parameters
indexthe 0-based index of the property.
enum_infoif set, enumerates info instead of properties
Returns
null if no more properties to enumerate; otherwise an object:
{
unsigned long type;
}
char * DOMString
Definition: core.idl:6
Object FilterProperty
Definition: jsf.idl:1016
attribute DOMString name
Definition: jsf.idl:396

◆ get_prop()

FilterProperty FilterPid::get_prop ( DOMString  name,
optional boolean  is_user = false 
)

gets a property by name/id - see gf_filter_pid_get_property and gf_filter_pid_get_property_str

Parameters
namethe ID or name of the builtin property
is_userif set, indicates the queried property is a user-defined property rather than a built-in property
Returns
property if found, null otherwise

◆ get_info()

FilterProperty FilterPid::get_info ( DOMString  name,
optional boolean  is_user = false 
)

gets info by name/id - see gf_filter_pid_get_info and gf_filter_pid_get_info_str

Parameters
namethe ID or name of the builtin property
is_userif set, indicates the queried property is a user-defined property rather than a built-in property
Returns
the property if found, null otherwise

◆ get_packet()

FilterPaquet FilterPid::get_packet ( )

gets first packet in pid buffer - see gf_filter_pid_get_packet

Returns
first packet of buffer or null

◆ drop_packet()

void FilterPid::drop_packet ( )

drops first packet in pid buffer - see gf_filter_pid_drop_packet

◆ is_filter_in_parents()

boolean FilterPid::is_filter_in_parents ( GF_Filter  filter)

checks if a filter is in parent chain of pid - see gf_filter_pid_is_filter_in_parents

Parameters
filterfilter to check
Returns
true if in parent chain

◆ get_buffer_occupancy()

boolean FilterPid::get_buffer_occupancy ( GF_Filter  filter)

gets buffer occupancy - see gf_filter_pid_get_buffer_occupancy

Parameters
filterthe Filter or FilterInstance object to check
Returns
a buffer occupancy object:
{
unsigned long max_units;
unsigned long nb_pck;
unsigned long max_dur;
unsigned long dur;
boolean final_flush;
}

◆ clear_eos()

void FilterPid::clear_eos ( )

clears EOS on pid - see gf_filter_pid_clear_eos

◆ check_caps()

boolean FilterPid::check_caps ( )

clears capability of pid - see gf_filter_pid_check_caps

Returns
true if all caps are honored by the PID properties, false otherwise

◆ discard_block()

void FilterPid::discard_block ( )

discard blocking mode of pid - see gf_filter_pid_discard_block

◆ allow_direct_dispatch()

void FilterPid::allow_direct_dispatch ( )

allow direct disatch to next filter in chain - see gf_filter_pid_allow_direct_dispatch

◆ resolve_file_template()

DOMString FilterPid::resolve_file_template ( DOMString  template,
unsigned long  file_idx,
optional DOMString  suffix = null 
)

resolves a file template string - see gf_filter_pid_resolve_file_template

Parameters
templatethe template string to resolve
file_idxthe file index for segmented outputs
suffixthe file suffix to append
Returns
the resolved template

◆ query_caps()

FilterProperty FilterPid::query_caps ( DOMString  name,
optional boolean  is_user 
)

queries a capability marked for negotiation - see gf_filter_pid_caps_query

Parameters
namethe ID or name of the builtin property
is_userif set, indicates the queried property is a user-defined property rather than a built-in property
Returns
property if found, null otherwise

◆ get_stats()

Object FilterPid::get_stats ( )

gets statistics for the pid

Returns
A statistics object
boolean disconnected;
unsigned long average_process_rate;
unsigned long max_process_rate;
unsigned long average_bitrate;
unsigned long max_bitrate;
unsigned long nb_processed;
unsigned long max_process_time;
unsigned long long total_process_time;
unsigned long long first_process_time;
unsigned long long last_process_time;
unsigned long min_frame_dur;
unsigned long nb_saps;
unsigned long max_sap_process_time;
unsigned long long total_sap_process_time;
unsigned long long max_buffer_time;
unsigned long long max_playout_time;
unsigned long long min_playout_time;
unsigned long long buffer_time;
unsigned long nb_buffer_units;

◆ get_clock_info()

Object FilterPid::get_clock_info ( )

gets clock info for the pid

Returns
A clock info object:
unsigned long type;
unsigned long timescale;
unsigned long long value;
readonly attribute unsigned long timescale
Definition: jsf.idl:436

◆ set_prop()

void FilterPid::set_prop ( DOMString  name,
FilterProperty  prop,
optional boolean  is_user = false 
)

sets property on a pid - see gf_filter_pid_set_property and gf_filter_pid_set_property_str

Note
if the name identifies the SenderNTP or ReceiverNTP properties:
  • if the value is 'true', the property is set to the current NTP timestamp
  • if the value is an object with properties 'n' and 'd', NTP timestamp is computed using 'n' as seconds and 'd' as fractional part
Parameters
namethe ID or name of the builtin property
propthe property to set. If null, removes the property.
is_userif set, indicates the queried property is a user-defined property rather than a built-in property

◆ set_info()

void FilterPid::set_info ( DOMString  name,
FilterProperty  prop,
optional boolean  is_user = false 
)

sets info on a pid - see gf_filter_pid_set_info and gf_filter_pid_set_info_str

Parameters
namethe ID or name of the builtin property
propthe property to set
is_userif set, indicates the queried property is a user-defined property rather than a built-in property

◆ negotiate_prop()

void FilterPid::negotiate_prop ( DOMString  name,
FilterProperty  prop,
optional boolean  is_user = false 
)

negotiates property on an output pid - see gf_filter_pid_negotiate_property and gf_filter_pid_negotiate_property_str

Parameters
namethe ID or name of the builtin property
propthe property to set
is_userif set, indicates the queried property is a user-defined property rather than a built-in property

◆ remove()

void FilterPid::remove ( )

removes an output pid - see gf_filter_pid_remove

◆ reset_props()

void FilterPid::reset_props ( )

reset properties of a pid - see gf_filter_pid_reset_properties

◆ copy_props()

void FilterPid::copy_props ( FilterPid  from)

copy properties of a pid - see gf_filter_pid_copy_properties*

Parameters
fromsource pid

◆ ignore_blocking()

void FilterPid::ignore_blocking ( optional boolean  do_ignore = true)

ignore this pid in blocking computations - see gf_filter_pid_ignore_blocking*

Parameters
do_ignoreif true, pid is not used in blocking mode evaluation

◆ new_packet() [1/8]

FilterPacket FilterPid::new_packet ( )

creates a new output packet with no associated data

Returns
new packet or null

◆ new_packet() [2/8]

FilterPacket FilterPid::new_packet ( DOMString  str,
optional boolean  use_shared = false,
optional function  destroy_callback_fun = null 
)

creates a new output packet using string as payload

Parameters
strthe string to use
use_sharedcreates a shared packet, holding a GC reference to the string until release - see gf_filter_pck_new_shared
destroy_callback_funwhen shared mode is used, specify a callback function to be used upon destruction of the packet. The function has two parameters pid (output pid of the packet destroyed) and packet (the packet destroyed)
Returns
new packet or null

◆ new_packet() [3/8]

FilterPacket FilterPid::new_packet ( unsigned long  size)

creates a new output packet of the given size, zero the payload

Parameters
sizethe desired size
Returns
new packet or null

◆ new_packet() [4/8]

FilterPacket FilterPid::new_packet ( ArrayBuffer  ab,
optional boolean  use_shared = false,
optional function  destroy_callback_fun = null 
)

creates a new output packet using ArrayBuffer as payload

Parameters
abthe ArrayBuffer to use (views are also allowed)
use_sharedcreates a shared packet, holding a GC reference to the array buffer until release - see gf_filter_pck_new_shared
destroy_callback_funwhen shared mode is used, specify a callback function to be used upon destruction of the packet. The function has two parameters pid (output pid of the packet destroyed) and packet (the packet destroyed)
Returns
new packet or null

◆ new_packet() [5/8]

FilterPacket FilterPid::new_packet ( FilterPacket  pck,
optional boolean  use_shared = false,
optional boolean  do_copy = false 
)

creates a new output packet from a source packet

Parameters
pckthe source packet to use
use_sharedcreates a shared packet - see gf_filter_pck_new_shared
do_copyif set, indicates that the packet shall be copied rather than cloned (gf_filter_pck_new_copy) otherwise clones the packet (gf_filter_pck_new_clone). Ignored if use_shared is true
Returns
new packet or null

◆ new_packet() [6/8]

FilterPacket FilterPid::new_packet ( FilterPacket  pck,
optional boolean  use_shared = false,
optional function  destroy_callback_fun = null 
)

creates a new output packet from a source packet

Parameters
pckthe source packet to use
use_sharedcreates a shared packet - see gf_filter_pck_new_shared
destroy_callback_funwhen shared mode is used, specify a callback function to be used upon destruction of the packet. The function has two parameters pid (output pid of the packet destroyed) and packet (the packet destroyed). Ignored if use_shared is false
Returns
new packet or null

◆ new_packet() [7/8]

FilterPacket FilterPid::new_packet ( function  fetch_texture_fun,
optional function  destroy_callback_fun = null,
optional boolean  is_blocking = false 
)

creates a new output packet for OpenGL texture interface

Parameters
fetch_texture_funspecify a callback function to use to fetch textures. The function has three parameters pid (output pid of the packet queried), packet (the packet queried) and plane_index (the plane/texture index). The function shall return null if error, or an object with attributes "id" (a WebGL texture or openGL texture identifier) and "fmt" (openGL texture format, e.g. GL_TEXTURE_2D).
destroy_callback_funspecify a callback function to be used upon destruction of the packet. The function has two parameters pid (output pid of the packet destroyed) and packet (the packet destroyed).
is_blockingindicates if this frame is blocking (filter cannot dispatch new frame until this frame is destroyed)
Returns
new packet or null

◆ forward()

void FilterPid::forward ( FilterPacket  pck)

forwards a source packet to outout - see gf_filter_pck_forward

Parameters
pckthe source packet to forward

◆ new_packet() [8/8]

FilterPacket FilterPid::new_packet ( WebGLContext  gl,
function  on_frame_consumed,
optional boolean  use_depth 
)

creates a new output packet using the underlying texture attachement of the context as a texture source (see GF_FilterFrameInterface).

Warning
This will throw an error if called more than once on a given context but the associated packet has not been consumed yet!
Parameters
glthe WebGL context used to create the packet.
on_frame_consumeda callback function notified when the associated packet has been consumed
use_depthif set, uses the depth framebuffer attachment if enabled rather than the texture. See WebGLContext
Returns
new packet or null with exception

Field Documentation

◆ name

attribute DOMString FilterPid::name

name of the PID

◆ eos

attribute boolean FilterPid::eos

end of stream state - see gf_filter_pid_set_eos and gf_filter_pid_is_eos

◆ eos_seen

readonly attribute boolean FilterPid::eos_seen

end of stream pending state - see gf_filter_pid_has_seen_eos

◆ eos_received

readonly attribute boolean FilterPid::eos_received

end of stream pending state - see gf_filter_pid_eos_received

◆ is_flush

readonly attribute boolean FilterPid::is_flush

true if end of stream is a flush event - see gf_filter_pid_is_flush_eos

◆ would_block

readonly attribute boolean FilterPid::would_block

blocking state - see gf_filter_pid_would_block

◆ sparse

readonly attribute boolean FilterPid::sparse

sparse status - see gf_filter_pid_is_sparse

◆ filter_name

readonly attribute DOMString FilterPid::filter_name

name of parent filter

◆ src_name

readonly attribute DOMString FilterPid::src_name

name of source filter

◆ args

readonly attribute DOMString FilterPid::args

arguments of parent filter

◆ src_args

readonly attribute DOMString FilterPid::src_args

argument of source filter

◆ unicity_args

readonly attribute DOMString FilterPid::unicity_args

argument of source filter or first filter responsible for a fan-out

◆ max_buffer

attribute long FilterPid::max_buffer

max buffer requirement of the pid - see gf_filter_pid_get_max_buffer and gf_filter_pid_set_max_buffer

◆ loose_connect

writeonly boolean FilterPid::loose_connect

enables loose connect of the pid - see gf_filter_pid_set_loose_connect

◆ framing

writeonly boolean FilterPid::framing

sets framin mode of the pid - see gf_filter_pid_set_framing_mode

◆ buffer

readonly attribute long long FilterPid::buffer

buffer duration of the pid - see gf_filter_pid_query_buffer_duration

◆ full

readonly attribute boolean FilterPid::full

pid buffer full flag - see gf_filter_pid_query_buffer_duration

◆ first_empty

readonly attribute boolean FilterPid::first_empty

indicates if no valid packet with data is pending - see gf_filter_pid_first_packet_is_empty

◆ first_cts

readonly attribute long long FilterPid::first_cts

CTS of the first packet in packet queue - see gf_filter_pid_get_first_packet_cts

◆ nb_pck_queued

readonly attribute unsigned long FilterPid::nb_pck_queued

number of packets in pid buffer - see gf_filter_pid_get_packet_count

◆ timescale

readonly attribute unsigned long FilterPid::timescale

current timescale for the pid - see gf_filter_pid_get_timescale

◆ clock_mode

writeonly unsigned long FilterPid::clock_mode

sets clock mode of pid - see gf_filter_pid_set_clock_mode

◆ discard

writeonly unsigned boolean FilterPid::discard

sets discard mode of pid - see gf_filter_pid_set_discard

◆ src_url

readonly attribute DOMString FilterPid::src_url

source URL of input pids

◆ dst_url

readonly attribute DOMString FilterPid::dst_url

destination URL of output pids

◆ require_source_id

writeonly unsigned boolean FilterPid::require_source_id

requires source ID for the pid - see gf_filter_pid_require_source_id

◆ recompute_dts

writeonly unsigned boolean FilterPid::recompute_dts

enables DTS recomputing on the pid - see gf_filter_pid_recompute_dts

◆ min_pck_dur

readonly attribute unsigned long FilterPid::min_pck_dur

gets minimum packet duration observed on the pid - see gf_filter_pid_get_min_pck_duration

◆ playing

readonly attribute unsigned long FilterPid::playing

playing state - see gf_filter_pid_is_playing

◆ next_ts

readonly attribute unsigned long long FilterPid::next_ts

next estimated timestamp, or null if not computable - see gf_filter_pid_get_next_ts

◆ has_decoder

readonly attribute boolean FilterPid::has_decoder

set to true if input chain has a decoder filter - see gf_filter_pid_has_decoder