libgpac
Documentation of the core library of GPAC
CustomFilter Interface Reference

import"nodejs.idl";

+ Collaboration diagram for CustomFilter:

Public Member Functions

GF_Err configure_pid (_FilterPid pid, boolean is_remove)
 
GF_Err process ()
 
boolean process_event (_FilterEvent event)
 
GF_Err reconfigure_output (_FilterPid *opid)
 
void push_cap (DOMString pcode, PropertyValue prop, unsigned long flag, unsigned long priority=0, unsigned long custom_type=0)
 
_FilterPid new_pid ()
 
void update_status (DOMString status, unsigned long percent=0)
 
void reschedule (unsigned long when=0)
 
void notify_failure (GF_Err err, unsigned long error_type=GF_SETUP_ERROR)
 
void make_sticky ()
 
void prevent_blocking (boolean enable)
 
void block_eos (boolean enable)
 
void set_max_pids (long max_pids)
 
void hint_clock (unsigned long long clock_us, nFraction media_time)
 

Data Fields

attribute readonly boolean block_enabled
 
attribute readonly unsigned long output_buffer
 
attribute readonly unsigned long playout_buffer
 
attribute readonly boolean sinks_done
 
attribute readonly unsigned long nb_evts_queued
 
attribute readonly unsigned long long clock_hint_time
 
attribute readonly nFraction clock_hint_mediatime
 
attribute readonly boolean connections_pending
 

Detailed Description

Custom filter object

Member Function Documentation

◆ configure_pid()

GF_Err CustomFilter::configure_pid ( _FilterPid  pid,
boolean  is_remove 
)

callback used whenever a new filter pid is configured, initially set to null

Parameters
pidthe PID to configure
is_removeset to true if PID is being removed
Returns
error code
Warning
the return value SHALL be set

◆ process()

GF_Err CustomFilter::process ( )

callback used by the filter to process data, initially set to null

Returns
error code
Warning
the return value SHALL be set

◆ process_event()

boolean CustomFilter::process_event ( _FilterEvent  event)

callback used whenever a new filter is added, initially set to null

Parameters
eventthe event being processed (read-only)
Returns
true to cancel the event, false otherwise
Warning
the return value SHALL be set

◆ reconfigure_output()

GF_Err CustomFilter::reconfigure_output ( _FilterPid opid)

callback used whenever an output pid is to be reconfigured (capability negotiation), initially set to null

Parameters
opidthe filter output pid to reconfigure
Returns
error if any, usualy GF_NOT_SUPPORTED if capability cannot be changed
Warning
the return value SHALL be set

◆ push_cap()

void CustomFilter::push_cap ( DOMString  pcode,
PropertyValue  prop,
unsigned long  flag,
unsigned long  priority = 0,
unsigned long  custom_type = 0 
)

push a capability in the current capability bundle - see gf_filter_push_caps

Parameters
pcodecapability name
propcapability value
flagcapability flags (input, output, etc)
prioritycapability priority
custom_typetype of property if user-defined property. If not set and user-defined, property is a string

◆ new_pid()

_FilterPid CustomFilter::new_pid ( )

create a new output pid for this filter - see gf_filter_pid_new

Returns
_FilterPid object

◆ update_status()

void CustomFilter::update_status ( DOMString  status,
unsigned long  percent = 0 
)

update filter status - see gf_filter_update_status

Parameters
statusstatus
percentprogress in per 10000

◆ reschedule()

void CustomFilter::reschedule ( unsigned long  when = 0)

reschedule the filter after a given delay - see gf_filter_ask_rt_reschedule and gf_filter_post_process_task

Parameters
whendelay in microseconds

◆ notify_failure()

void CustomFilter::notify_failure ( GF_Err  err,
unsigned long  error_type = GF_SETUP_ERROR 
)

notify an internal failure of the filter has happend - see gf_filter_notification_failure and gf_filter_setup_failure

Parameters
errthe failure reason (gpac error code, int)
error_typethe failure notification type. Can be one of:
  • GF_SETUP_ERROR: notification is a setup error, the filter chain was never connected
  • GF_NOTIF_ERROR: notification is an error but keep the filter chain connected
  • GF_NOTIF_ERROR_AND_DISCONNECT: notification is an error and disconnect the filter chain

◆ make_sticky()

void CustomFilter::make_sticky ( )

make the filter sticky - see gf_filter_make_sticky

◆ prevent_blocking()

void CustomFilter::prevent_blocking ( boolean  enable)

prevent blocking on the filter - see gf_filter_prevent_blocking

Parameters
enableif true, blocking prevention is enabled

◆ block_eos()

void CustomFilter::block_eos ( boolean  enable)

block eos signaling on the filter - see gf_filter_block_eos

Parameters
enableif true, eos blocking is enabled

◆ set_max_pids()

void CustomFilter::set_max_pids ( long  max_pids)

set maximum number of extra pids accepted by this filter - see gf_filter_set_max_extra_input_pids

Parameters
max_pidsnumber of extra pids, -1 for no limits

◆ hint_clock()

void CustomFilter::hint_clock ( unsigned long long  clock_us,
nFraction  media_time 
)

set clock hint - see gf_filter_hint_single_clock

Parameters
clock_usclock in microseconds
media_timemedia time as nFraction

Field Documentation

◆ block_enabled

attribute readonly boolean CustomFilter::block_enabled

filter blocking is enabled - see gf_filter_block_enabled

◆ output_buffer

attribute readonly unsigned long CustomFilter::output_buffer

maximum output buffer time - see gf_filter_get_output_buffer_max

◆ playout_buffer

attribute readonly unsigned long CustomFilter::playout_buffer

maximum plyaout buffer time - see gf_filter_get_output_buffer_max

◆ sinks_done

attribute readonly boolean CustomFilter::sinks_done

all sinks are done for this filter - see gf_filter_all_sinks_done

◆ nb_evts_queued

attribute readonly unsigned long CustomFilter::nb_evts_queued

number of queued events on the filter - see gf_filter_get_num_events_queued

◆ clock_hint_time

attribute readonly unsigned long long CustomFilter::clock_hint_time

clock hint value in microseconds - see gf_filter_get_clock_hint

◆ clock_hint_mediatime

attribute readonly nFraction CustomFilter::clock_hint_mediatime

clock hint media time as fraction - see gf_filter_get_clock_hint

◆ connections_pending

attribute readonly boolean CustomFilter::connections_pending

indicating connections are pending on the filter, readonly - see gf_filter_connections_pending