libgpac
Documentation of the core library of GPAC
Custom Filter

Custom Filter. More...

+ Collaboration diagram for Custom Filter:

Functions

GF_Filtergf_fs_new_filter (GF_FilterSession *session, const char *name, u32 flags, GF_Err *e)
 
GF_Err gf_filter_push_caps (GF_Filter *filter, u32 code, GF_PropertyValue *value, const char *name, u32 flags, u8 priority)
 
GF_Err gf_filter_set_process_ckb (GF_Filter *filter, GF_Err(*process_cbk)(GF_Filter *filter))
 
GF_Err gf_filter_set_configure_ckb (GF_Filter *filter, GF_Err(*configure_cbk)(GF_Filter *filter, GF_FilterPid *PID, Bool is_remove))
 
GF_Err gf_filter_set_process_event_ckb (GF_Filter *filter, Bool(*process_event_cbk)(GF_Filter *filter, const GF_FilterEvent *evt))
 
GF_Err gf_filter_set_reconfigure_output_ckb (GF_Filter *filter, GF_Err(*reconfigure_output_cbk)(GF_Filter *filter, GF_FilterPid *PID))
 
GF_Err gf_filter_set_probe_data_cbk (GF_Filter *filter, const char *(*probe_data_cbk)(const u8 *data, u32 size, GF_FilterProbeScore *score))
 

Detailed Description

Custom filters are filters created by the app with no associated registry. The app is responsible for assigning capabilities to the filter, and setting callback functions. Each callback is optional, but a custom filter should at least have a process callback, and a configure_pid callback if not a source filter.

Custom filters do not have any arguments exposed, and cannot be selected for sink or source filters. If your app requires custom I/Os for source or sinks, use GF_FileIO.

Function Documentation

◆ gf_fs_new_filter()

GF_Filter* gf_fs_new_filter ( GF_FilterSession session,
const char *  name,
u32  flags,
GF_Err e 
)

Loads custom filter

Parameters
sessionfilter session
namename of filter to use - optional, may be NULL
flagsflags for filter registry, currently only GF_FS_REG_MAIN_THREAD is used
eset to the error code if any - optional, may be NULL
Returns
filter or NULL if error

◆ gf_filter_push_caps()

GF_Err gf_filter_push_caps ( GF_Filter filter,
u32  code,
GF_PropertyValue *  value,
const char *  name,
u32  flags,
u8  priority 
)

Push a new capability for a custom filter

Parameters
filterthe target filter
codethe capability code - cf GF_FilterCapability
valuethe capability value - cf GF_FilterCapability
namethe capability name - cf GF_FilterCapability
flagsthe capability flags - cf GF_FilterCapability
prioritythe capability priority - cf GF_FilterCapability
Returns
error if any

◆ gf_filter_set_process_ckb()

GF_Err gf_filter_set_process_ckb ( GF_Filter filter,
GF_Err(*)(GF_Filter *filter process_cbk 
)

Set the process function for a custom filter

Parameters
filterthe target filter
process_cbkthe process callback, may be NULL - cf process in __gf_filter_register
Returns
error if any

◆ gf_filter_set_configure_ckb()

GF_Err gf_filter_set_configure_ckb ( GF_Filter filter,
GF_Err(*)(GF_Filter *filter, GF_FilterPid *PID, Bool is_remove)  configure_cbk 
)

Set the PID configuration function for a custom filter

Parameters
filterthe target filter
configure_cbkthe configure callback, may be NULL - cf configure_pid in __gf_filter_register
Returns
error if any

◆ gf_filter_set_process_event_ckb()

GF_Err gf_filter_set_process_event_ckb ( GF_Filter filter,
Bool(*)(GF_Filter *filter, const GF_FilterEvent *evt)  process_event_cbk 
)

Set the process event function for a custom filter

Parameters
filterthe target filter
process_event_cbkthe process event callback, may be NULL - cf process_event in __gf_filter_register
Returns
error if any

◆ gf_filter_set_reconfigure_output_ckb()

GF_Err gf_filter_set_reconfigure_output_ckb ( GF_Filter filter,
GF_Err(*)(GF_Filter *filter, GF_FilterPid *PID)  reconfigure_output_cbk 
)

Set the reconfigure output function for a custom filter

Parameters
filterthe target filter
reconfigure_output_cbkthe reconfigure callback, may be NULL - cf reconfigure_output_cbk in __gf_filter_register
Returns
error if any

◆ gf_filter_set_probe_data_cbk()

GF_Err gf_filter_set_probe_data_cbk ( GF_Filter filter,
const char *(*)(const u8 *data, u32 size, GF_FilterProbeScore *score)  probe_data_cbk 
)

Set the data prober function for a custom filter

Parameters
filterthe target filter
probe_data_cbkthe data prober callback , may be NULL- cf probe_data in __gf_filter_register
Returns
error if any