LiVES  3.2.0
Macros | Typedefs | Functions | Variables
effects-weed.c File Reference
#include <dlfcn.h>
#include "main.h"
#include "effects.h"
#include "weed-effects-utils.h"
#include "callbacks.h"
#include "rte_window.h"
#include "resample.h"
#include "audio.h"
#include "ce_thumbs.h"
#include "paramwindow.h"

Go to the source code of this file.

Macros

#define MAX_WEED_INSTANCES   65536
 
#define NHASH_TYPES   8
 
#define MIN_CHAN_WIDTH   4
 
#define MIN_CHAN_HEIGHT   4
 
#define MAX_CHAN_WIDTH   16384
 
#define MAX_CHAN_HEIGHT   16384
 
#define SLICE_ALIGN   2
 
#define FX_WAIT_LIM   10000
 
#define KEYSCALE   255.
 
#define MAX_AUTHOR_LEN   10
 
#define REALIGN_MAX   (40 * 1024 * 1024)
 
#define MAX_FRAME_SIZE   MILLIONS(100)
 
#define MAX_FRAME_SIZE64   3019898880
 

Typedefs

typedef lives_hashentry lives_hashjoint[NHASH_TYPES]
 

Functions

LIVES_GLOBAL_INLINE weed_error_t weed_leaf_copy_or_delete (weed_layer_t *dlayer, const char *key, weed_layer_t *slayer)
 
LIVES_GLOBAL_INLINE int filter_mutex_trylock (int key)
 
LIVES_GLOBAL_INLINE int filter_mutex_lock (int key)
 
LIVES_GLOBAL_INLINE int filter_mutex_unlock (int key)
 
int num_compound_fx (weed_plant_t *plant)
 return number of filters in a compound fx (1 if it is not compound) - works for filter or inst More...
 
boolean has_non_alpha_palette (weed_plant_t *ctmpl, weed_plant_t *filter)
 
boolean has_alpha_palette (weed_plant_t *ctmpl, weed_plant_t *filter)
 
weed_plant_t * weed_instance_get_filter (weed_plant_t *inst, boolean get_compound_parent)
 
lives_fx_cat_t weed_filter_categorise (weed_plant_t *pl, int in_channels, int out_channels)
 
lives_fx_cat_t weed_filter_subcategorise (weed_plant_t *pl, lives_fx_cat_t category, boolean count_opt)
 
int num_alpha_channels (weed_plant_t *filter, boolean out)
 
void backup_weed_instances (void)
 for multitrack More...
 
void restore_weed_instances (void)
 
void update_host_info (weed_plant_t *hinfo)
 
void update_all_host_info (void)
 
weed_plant_t * get_enabled_channel (weed_plant_t *inst, int which, boolean is_in)
 for FILTER_INST More...
 
weed_plant_t * get_enabled_audio_channel (weed_plant_t *inst, int which, boolean is_in)
 for FILTER_INST More...
 
weed_plant_t * get_mandatory_channel (weed_plant_t *filter, int which, boolean is_in)
 for FILTER_CLASS More...
 
LIVES_GLOBAL_INLINE boolean weed_instance_is_resizer (weed_plant_t *inst)
 
boolean is_audio_channel_in (weed_plant_t *inst, int chnum)
 
weed_plant_t * get_audio_channel_in (weed_plant_t *inst, int achnum)
 
boolean has_video_chans_in (weed_plant_t *filter, boolean count_opt)
 
boolean has_audio_chans_in (weed_plant_t *filter, boolean count_opt)
 
boolean is_audio_channel_out (weed_plant_t *inst, int chnum)
 
boolean has_video_chans_out (weed_plant_t *filter, boolean count_opt)
 
boolean has_audio_chans_out (weed_plant_t *filter, boolean count_opt)
 
boolean is_pure_audio (weed_plant_t *plant, boolean count_opt)
 TRUE if audio in or out and no vid in/out. More...
 
boolean weed_parameter_has_variable_elements_strict (weed_plant_t *inst, weed_plant_t *ptmpl)
 
weed_plant_t * add_filter_deinit_events (weed_plant_t *event_list)
 add effect_deinit events to an event_list More...
 
weed_plant_t * add_filter_init_events (weed_plant_t *event_list, weed_timecode_t tc)
 add init events for every effect which is switched on More...
 
int best_palette_match (int *palette_list, int num_palettes, int palette)
 check palette vs. More...
 
int weed_flagset_array_count (weed_plant_t **array, boolean set_readonly)
 
char * cd_to_plugin_dir (weed_plant_t *filter)
 change directory to plugin installation dir so it can find any data files More...
 
LIVES_GLOBAL_INLINE weed_plant_t * get_next_compound_inst (weed_plant_t *inst)
 
lives_filter_error_t weed_reinit_effect (weed_plant_t *inst, boolean reinit_compound)
 
void weed_reinit_all (void)
 
lives_filter_error_t weed_apply_instance (weed_plant_t *inst, weed_plant_t *init_event, weed_plant_t **layers, int opwidth, int opheight, weed_timecode_t tc)
 process a single video filter instance More...
 
lives_filter_error_t run_process_func (weed_plant_t *instance, weed_timecode_t tc, int key)
 
lives_filter_error_t weed_apply_audio_instance (weed_plant_t *init_event, weed_layer_t **layers, int nbtracks, int nchans, int64_t nsamps, double arate, weed_timecode_t tc, double *vis)
 apply an audio filter to a stack of audio tracks More...
 
weed_plant_t * weed_apply_effects (weed_plant_t **layers, weed_plant_t *filter_map, weed_timecode_t tc, int opwidth, int opheight, void ***pchains)
 
void weed_apply_audio_effects (weed_plant_t *filter_map, weed_layer_t **layers, int nbtracks, int nchans, int64_t nsamps, double arate, weed_timecode_t tc, double *vis)
 
void weed_apply_audio_effects_rt (weed_layer_t *alayer, weed_timecode_t tc, boolean analysers_only, boolean is_audio_thread)
 
boolean has_audio_filters (lives_af_t af_type)
 
boolean has_video_filters (boolean analysers_only)
 
int num_in_params (weed_plant_t *plant, boolean skip_hidden, boolean skip_internal)
 
int num_out_params (weed_plant_t *plant)
 
boolean has_usable_palette (weed_plant_t *chantmpl)
 
int enabled_in_channels (weed_plant_t *plant, boolean count_repeats)
 
int enabled_out_channels (weed_plant_t *plant, boolean count_repeats)
 
weed_error_t weed_plant_free_host (weed_plant_t *plant)
 
weed_error_t weed_leaf_delete_host (weed_plant_t *plant, const char *key)
 
weed_error_t weed_leaf_set_host (weed_plant_t *plant, const char *key, uint32_t seed_type, weed_size_t num_elems, void *values)
 
void * lives_monitor_malloc (size_t size)
 
void lives_monitor_free (void *p)
 
weed_error_t weed_leaf_set_monitor (weed_plant_t *plant, const char *key, uint32_t seed_type, weed_size_t num_elems, void *values)
 
weed_error_t weed_leaf_get_monitor (weed_plant_t *plant, const char *key, int32_t idx, void *value)
 
weed_size_t weed_leaf_num_elements_monitor (weed_plant_t *plant, const char *key)
 
void show_weed_stats (weed_plant_t *statsplant)
 
weed_plant_t * host_info_cb (weed_plant_t *xhost_info, void *data)
 
void weed_load_all (void)
 load effects More...
 
void weed_unload_all (void)
 unload all effects More...
 
void weed_in_params_free (weed_plant_t **parameters, int num_parameters)
 
void weed_in_parameters_free (weed_plant_t *inst)
 
LIVES_GLOBAL_INLINE int _weed_instance_unref (weed_plant_t *inst)
 
int _weed_instance_ref (weed_plant_t *inst)
 
weed_plant_t * _weed_instance_obtain (int line, char *file, int key, int mode)
 
LIVES_GLOBAL_INLINE int weed_instance_ref (weed_plant_t *inst)
 
LIVES_GLOBAL_INLINE int weed_instance_unref (weed_plant_t *inst)
 
LIVES_GLOBAL_INLINE weed_plant_t * weed_instance_obtain (int key, int mode)
 
weed_plant_t ** weed_params_create (weed_plant_t *filter, boolean in)
 
void add_param_connections (weed_plant_t *inst)
 
weed_plant_t * weed_instance_from_filter (weed_plant_t *filter)
 
boolean weed_init_effect (int hotkey)
 hotkey starts at 1 More...
 
weed_error_t weed_call_init_func (weed_plant_t *inst)
 
weed_error_t weed_call_deinit_func (weed_plant_t *instance)
 
boolean weed_deinit_effect (int hotkey)
 hotkey starts at 1 More...
 
void deinit_render_effects (void)
 switch off effects after render preview during rendering/render preview, we use the "keys" FX_KEYS_MAX_VIRTUAL -> FX_KEYS_MAX here we deinit all active ones, similar to weed_deinit_all, but we use higher keys More...
 
void deinit_easing_effects (void)
 switch off effects in easing out state after playback ends during playback, some effects don't deinit right awy, instead they ease out if plyback ends while they are in the easing out state they won't get deinited, so we need to take care of that More...
 
void weed_deinit_all (boolean shutdown)
 deinit all effects (except generators* during playback) this is called on ctrl-0 or on shutdown background generators will be killed because their transition will be deinited More...
 
int check_filter_chain_palettes (boolean is_bg, int *palette_list, int npals)
 
weed_plant_t * weed_layer_create_from_generator (weed_plant_t *inst, weed_timecode_t tc, int clipno)
 
int weed_generator_start (weed_plant_t *inst, int key)
 
void wge_inner (weed_plant_t *inst)
 deinit and instance(s) for generator, reset instance mapping More...
 
void weed_generator_end (weed_plant_t *inst)
 
void weed_bg_generator_end (weed_plant_t *inst)
 
boolean weed_playback_gen_start (void)
 
boolean is_hidden_param (weed_plant_t *plant, int i)
 returns the permanent (structural) state c.f check_hidden_gui() which sets flag values for params linked to an rfx extension More...
 
int get_transition_param (weed_plant_t *filter, boolean skip_internal)
 
int get_master_vol_param (weed_plant_t *filter, boolean skip_internal)
 
boolean is_perchannel_multiw (weed_plant_t *param)
 
boolean has_perchannel_multiw (weed_plant_t *filter)
 
weed_plant_t * weed_inst_in_param (weed_plant_t *inst, int param_num, boolean skip_hidden, boolean skip_internal)
 
weed_plant_t * weed_inst_out_param (weed_plant_t *inst, int param_num)
 
weed_plant_t * weed_filter_in_paramtmpl (weed_plant_t *filter, int param_num, boolean skip_internal)
 
weed_plant_t * weed_filter_out_paramtmpl (weed_plant_t *filter, int param_num)
 
int get_nth_simple_param (weed_plant_t *plant, int pnum)
 
int count_simple_params (weed_plant_t *plant)
 
int set_copy_to (weed_plant_t *inst, int pnum, lives_rfx_t *rfx, boolean update)
 
void rec_param_change (weed_plant_t *inst, int pnum)
 record a parameter value change in our event_list More...
 
void weed_set_blend_factor (int hotkey)
 
int weed_get_blend_factor (int hotkey)
 
weed_plant_t * get_new_inst_for_keymode (int key, int mode)
 get new refcounted inst (during recording playback) More...
 
LIVES_INLINE char * weed_instance_get_type (weed_plant_t *inst, boolean getsub)
 
char * rte_keymode_get_type (int key, int mode)
 returns a string filter/instance type (or "") More...
 
lives_fx_cat_t rte_keymode_get_category (int key, int mode)
 
int get_next_free_key (void)
 next free "key" for the multitrack system More...
 
boolean weed_delete_effectkey (int key, int mode)
 unbinds a filter_class from a key/mode More...
 
boolean rte_key_valid (int key, boolean is_userkey)
 returns TRUE if there is a filter bound to active mode of hotkey More...
 
boolean rte_keymode_valid (int key, int mode, boolean is_userkey)
 returns TRUE if a filter_class is bound to key/mode, is_userkey should be set to TRUE More...
 
int rte_keymode_get_filter_idx (int key, int mode)
 returns filter_class index of key/mode (or -1 if no filter bound) More...
 
int rte_key_getmode (int key)
 returns current active mode for a key (or -1) More...
 
int rte_key_getmaxmode (int key)
 returns highest mode which is set More...
 
weed_plant_t * rte_keymode_get_instance (int key, int mode)
 returns refcounted filter_instance bound to key/mode (or NULL) More...
 
weed_plant_t * rte_keymode_get_filter (int key, int mode)
 returns filter_class bound to key/mode (or NULL) More...
 
char * weed_filter_idx_get_name (int idx, boolean add_subcats, boolean add_notes)
 
char * weed_filter_idx_get_package_name (int idx)
 
char * weed_instance_get_filter_name (weed_plant_t *inst, boolean get_compound_parent)
 
char * rte_keymode_get_filter_name (int key, int mode, boolean add_notes)
 returns name of filter_class bound to key/mode (or "") More...
 
char * rte_keymode_get_plugin_name (int key, int mode)
 returns name of plugin package containing filter_class (or "") More...
 
LIVES_GLOBAL_INLINE int rte_bg_gen_key (void)
 
LIVES_GLOBAL_INLINE int rte_fg_gen_key (void)
 
LIVES_GLOBAL_INLINE int rte_bg_gen_mode (void)
 
LIVES_GLOBAL_INLINE int rte_fg_gen_mode (void)
 
weed_plant_t * get_textparm (void)
 for rte textmode, get first string parameter for current key/mode instance we will then forward all keystrokes to this parm WEED_LEAF_VALUE until the exit key (TAB) is pressed More...
 
boolean rte_key_setmode (int key, int newmode)
 newmode has two special values, -1 = cycle forwards, -2 = cycle backwards key is 1 based, but may be 0 to use the current mainw->rte_keys special handling ensures that if we switch transitions, any background generators survive the switchover call with filter mutex unlocked More...
 
int weed_add_effectkey_by_idx (int key, int idx)
 we will add a filter_class at the next free slot for key, and return the slot number if idx is -1 (probably meaning the filter was not found), we return -1 if all slots are full, we return -3 currently, generators and non-generators cannot be mixed on the same key (causes problems if the mode is switched) in this case a -2 is returned More...
 
int weed_add_effectkey (int key, const char *hashname, boolean fullname)
 bind a filter_class to key/mode using its hashname More...
 
int rte_switch_keymode (int key, int mode, const char *hashname)
 
void rte_swap_fg_bg (void)
 
LIVES_GLOBAL_INLINE int weed_get_sorted_filter (int i)
 
LiVESList * weed_get_all_names (lives_fx_list_t list_type)
 
int rte_get_numfilters (void)
 
void fill_param_vals_to (weed_plant_t *param, weed_plant_t *paramtmpl, int index)
 for a multi valued parameter or pchange, we will fill WEED_LEAF_VALUE up to element index with WEED_LEAF_NEW_DEFAULT we will also create the ignore array if there is not one. More...
 
boolean interpolate_param (weed_plant_t *param, void *pchain, weed_timecode_t tc)
 
boolean interpolate_params (weed_plant_t *inst, void **pchains, weed_timecode_t tc)
 interpolate all in_parameters for filter_instance inst, using void **pchain, which is an array of param_change events in temporal order values are calculated for timecode tc. More...
 
char * make_weed_hashname (int filter_idx, boolean fullname, boolean use_extra_authors, char sep, boolean subs)
 return value should be freed after use More...
 
int weed_get_idx_for_hashname (const char *hashname, boolean fullname)
 fullname includes author and version More...
 
int * weed_get_indices_from_template (const char *pkg, const char *fxname, const char *auth, int version)
 generate a list of filter indices from a given template. More...
 
int weed_filter_highest_version (const char *pkg, const char *fxname, const char *auth, int *xversion)
 
weed_plant_t * get_weed_filter (int idx)
 
size_t weed_plant_serialise (int fd, weed_plant_t *plant, unsigned char **mem)
 
weed_plant_t * weed_plant_deserialise (int fd, unsigned char **mem, weed_plant_t *plant)
 
boolean write_filter_defaults (int fd, int idx)
 
boolean read_filter_defaults (int fd)
 
boolean write_generator_sizes (int fd, int idx)
 
boolean read_generator_sizes (int fd)
 
void reset_frame_and_clip_index (void)
 TODO: split into player, progress, dialogs. More...
 
boolean read_key_defaults (int fd, int nparams, int key, int mode, int ver)
 
void apply_key_defaults (weed_plant_t *inst, int key, int mode)
 
void write_key_defaults (int fd, int key, int mode)
 
void free_key_defaults (int key, int mode)
 
void set_key_defaults (weed_plant_t *inst, int key, int mode)
 
boolean has_key_defaults (void)
 

Variables

weed_plant_t *** key_defaults [FX_KEYS_MAX_VIRTUAL]
 

Macro Definition Documentation

◆ FX_WAIT_LIM

#define FX_WAIT_LIM   10000

◆ KEYSCALE

#define KEYSCALE   255.

Definition at line 9036 of file effects-weed.c.

◆ MAX_AUTHOR_LEN

#define MAX_AUTHOR_LEN   10

Definition at line 9473 of file effects-weed.c.

◆ MAX_CHAN_HEIGHT

#define MAX_CHAN_HEIGHT   16384

Definition at line 1029 of file effects-weed.c.

◆ MAX_CHAN_WIDTH

#define MAX_CHAN_WIDTH   16384

Definition at line 1028 of file effects-weed.c.

◆ MAX_FRAME_SIZE

#define MAX_FRAME_SIZE   MILLIONS(100)

Definition at line 11272 of file effects-weed.c.

◆ MAX_FRAME_SIZE64

#define MAX_FRAME_SIZE64   3019898880

Definition at line 11273 of file effects-weed.c.

◆ MAX_WEED_INSTANCES

#define MAX_WEED_INSTANCES   65536

Definition at line 349 of file effects-weed.c.

◆ MIN_CHAN_HEIGHT

#define MIN_CHAN_HEIGHT   4

Definition at line 1026 of file effects-weed.c.

◆ MIN_CHAN_WIDTH

#define MIN_CHAN_WIDTH   4

Definition at line 1025 of file effects-weed.c.

◆ NHASH_TYPES

#define NHASH_TYPES   8

Definition at line 388 of file effects-weed.c.

◆ REALIGN_MAX

#define REALIGN_MAX   (40 * 1024 * 1024)

Definition at line 11271 of file effects-weed.c.

◆ SLICE_ALIGN

#define SLICE_ALIGN   2

Definition at line 1331 of file effects-weed.c.

Typedef Documentation

◆ lives_hashjoint

typedef lives_hashentry lives_hashjoint[NHASH_TYPES]

Definition at line 390 of file effects-weed.c.

Function Documentation

◆ _weed_instance_obtain()

weed_plant_t* _weed_instance_obtain ( int  line,
char *  file,
int  key,
int  mode 
)

Definition at line 6212 of file effects-weed.c.

Referenced by weed_instance_obtain().

◆ _weed_instance_ref()

int _weed_instance_ref ( weed_plant_t *  inst)

Definition at line 6194 of file effects-weed.c.

Referenced by weed_instance_ref().

◆ _weed_instance_unref()

LIVES_GLOBAL_INLINE int _weed_instance_unref ( weed_plant_t *  inst)

Definition at line 6158 of file effects-weed.c.

Referenced by weed_instance_unref().

◆ add_filter_deinit_events()

weed_plant_t* add_filter_deinit_events ( weed_plant_t *  event_list)

add effect_deinit events to an event_list

during real time recording we use the "keys" 0 -> FX_KEYS_MAX_VIRTUAL here we add effect_deinit events to an event_list

See also
deinit_render_effects()

add an empty filter_map event (in case more frames are added)

< we create filter_map event_t * array with ordered effects

Definition at line 803 of file effects-weed.c.

Referenced by event_list_add_end_events().

◆ add_filter_init_events()

weed_plant_t* add_filter_init_events ( weed_plant_t *  event_list,
weed_timecode_t  tc 
)

add init events for every effect which is switched on

during rendering we use the "keys" FX_KEYS_MAX_VIRTUAL -> FX_KEYS_MAX here we are about to start playback, and we add init events for every effect which is switched on we add the init events with a timecode of 0

add an empty filter_map event (in case more frames are added)

we create filter_map event_t * array with ordered effects

Definition at line 839 of file effects-weed.c.

Referenced by load_frame_image().

◆ add_param_connections()

void add_param_connections ( weed_plant_t *  inst)

Definition at line 6431 of file effects-weed.c.

Referenced by rte_reset_defs_clicked().

◆ apply_key_defaults()

void apply_key_defaults ( weed_plant_t *  inst,
int  key,
int  mode 
)

Definition at line 12342 of file effects-weed.c.

◆ backup_weed_instances()

void backup_weed_instances ( void  )

for multitrack

Definition at line 410 of file effects-weed.c.

◆ best_palette_match()

int best_palette_match ( int *  palette_list,
int  num_palettes,
int  palette 
)

check palette vs.

palette list

check if palette is in the palette_list if not, return next best palette to use, using a heuristic method num_palettes is the size of the palette list

exact match - return it

Definition at line 868 of file effects-weed.c.

Referenced by cconx_convert_pixel_data(), and vpp_try_match_palette().

◆ cd_to_plugin_dir()

char* cd_to_plugin_dir ( weed_plant_t *  filter)

change directory to plugin installation dir so it can find any data files

returns copy of current directory (before directory change) which should be freed after use

Definition at line 1148 of file effects-weed.c.

Referenced by weed_call_deinit_func(), weed_call_init_func(), and weed_reinit_effect().

◆ check_filter_chain_palettes()

int check_filter_chain_palettes ( boolean  is_bg,
int *  palette_list,
int  npals 
)

Definition at line 7545 of file effects-weed.c.

◆ count_simple_params()

int count_simple_params ( weed_plant_t *  plant)

Definition at line 8892 of file effects-weed.c.

◆ deinit_easing_effects()

void deinit_easing_effects ( void  )

switch off effects in easing out state after playback ends during playback, some effects don't deinit right awy, instead they ease out if plyback ends while they are in the easing out state they won't get deinited, so we need to take care of that

See also
weed_deinit_all()

if recording, the deinit_event won't be recorded, since we are not playing now, this will be handled in deal_with_render_choice() so it need not concern us

Definition at line 7381 of file effects-weed.c.

◆ deinit_render_effects()

void deinit_render_effects ( void  )

switch off effects after render preview during rendering/render preview, we use the "keys" FX_KEYS_MAX_VIRTUAL -> FX_KEYS_MAX here we deinit all active ones, similar to weed_deinit_all, but we use higher keys

See also
weed_deinit_all()

Definition at line 7358 of file effects-weed.c.

Referenced by render_to_clip().

◆ enabled_in_channels()

int enabled_in_channels ( weed_plant_t *  plant,
boolean  count_repeats 
)

◆ enabled_out_channels()

int enabled_out_channels ( weed_plant_t *  plant,
boolean  count_repeats 
)

Definition at line 4043 of file effects-weed.c.

Referenced by append_filter_init_event().

◆ fill_param_vals_to()

void fill_param_vals_to ( weed_plant_t *  param,
weed_plant_t *  paramtmpl,
int  index 
)

for a multi valued parameter or pchange, we will fill WEED_LEAF_VALUE up to element index with WEED_LEAF_NEW_DEFAULT we will also create the ignore array if there is not one.

add default filler values to a parameter or pchange.

The values of this are set to WEED_TRUE if the user updates the values for that channel, so we know which values to set for interpolation later. paramtmpl must be supplied, since pchanges do not have one directly

Definition at line 9913 of file effects-weed.c.

Referenced by add_track_to_avol_init(), filter_init_add_pchanges(), on_del_node_clicked(), on_resetp_clicked(), set_copy_to(), update_visual_params(), and update_weed_color_value().

◆ filter_mutex_lock()

LIVES_GLOBAL_INLINE int filter_mutex_lock ( int  key)

attempted double locking is actually normal behaviour when we have both video and audio effects running

Definition at line 96 of file effects-weed.c.

Referenced by grabkeys_callback(), rte_key_setmode(), rte_on_off_callback(), rtemode_callback(), set_copy_to(), update_visual_params(), weed_reinit_effect(), and weed_set_blend_factor().

◆ filter_mutex_trylock()

LIVES_GLOBAL_INLINE int filter_mutex_trylock ( int  key)

Definition at line 74 of file effects-weed.c.

Referenced by filter_mutex_lock(), and run_process_func().

◆ filter_mutex_unlock()

LIVES_GLOBAL_INLINE int filter_mutex_unlock ( int  key)

◆ free_key_defaults()

void free_key_defaults ( int  key,
int  mode 
)

Definition at line 12396 of file effects-weed.c.

Referenced by set_key_defaults().

◆ get_audio_channel_in()

weed_plant_t* get_audio_channel_in ( weed_plant_t *  inst,
int  achnum 
)

Definition at line 595 of file effects-weed.c.

◆ get_enabled_audio_channel()

weed_plant_t* get_enabled_audio_channel ( weed_plant_t *  inst,
int  which,
boolean  is_in 
)

for FILTER_INST

Definition at line 542 of file effects-weed.c.

◆ get_enabled_channel()

weed_plant_t* get_enabled_channel ( weed_plant_t *  inst,
int  which,
boolean  is_in 
)

◆ get_mandatory_channel()

weed_plant_t* get_mandatory_channel ( weed_plant_t *  filter,
int  which,
boolean  is_in 
)

for FILTER_CLASS

Definition at line 548 of file effects-weed.c.

◆ get_master_vol_param()

int get_master_vol_param ( weed_plant_t *  filter,
boolean  skip_internal 
)

Definition at line 8673 of file effects-weed.c.

◆ get_new_inst_for_keymode()

weed_plant_t* get_new_inst_for_keymode ( int  key,
int  mode 
)

get new refcounted inst (during recording playback)

Definition at line 9225 of file effects-weed.c.

Referenced by cconx_chain_data().

◆ get_next_compound_inst()

LIVES_GLOBAL_INLINE weed_plant_t* get_next_compound_inst ( weed_plant_t *  inst)

Definition at line 1164 of file effects-weed.c.

Referenced by add_param_connections(), and num_in_params().

◆ get_next_free_key()

int get_next_free_key ( void  )

next free "key" for the multitrack system

Definition at line 9311 of file effects-weed.c.

◆ get_nth_simple_param()

int get_nth_simple_param ( weed_plant_t *  plant,
int  pnum 
)

Definition at line 8850 of file effects-weed.c.

◆ get_textparm()

weed_plant_t* get_textparm ( void  )

for rte textmode, get first string parameter for current key/mode instance we will then forward all keystrokes to this parm WEED_LEAF_VALUE until the exit key (TAB) is pressed

Definition at line 9579 of file effects-weed.c.

Referenced by textparm_callback().

◆ get_transition_param()

int get_transition_param ( weed_plant_t *  filter,
boolean  skip_internal 
)

◆ get_weed_filter()

weed_plant_t* get_weed_filter ( int  idx)

◆ has_alpha_palette()

boolean has_alpha_palette ( weed_plant_t *  ctmpl,
weed_plant_t *  filter 
)

Definition at line 162 of file effects-weed.c.

Referenced by cconx_check_connection().

◆ has_audio_chans_in()

boolean has_audio_chans_in ( weed_plant_t *  filter,
boolean  count_opt 
)

Definition at line 640 of file effects-weed.c.

Referenced by feeds_to_audio_filters(), and is_pure_audio().

◆ has_audio_chans_out()

boolean has_audio_chans_out ( weed_plant_t *  filter,
boolean  count_opt 
)

Definition at line 695 of file effects-weed.c.

Referenced by feeds_to_audio_filters(), is_pure_audio(), and push_audio_to_channel().

◆ has_audio_filters()

boolean has_audio_filters ( lives_af_t  af_type)

Definition at line 3859 of file effects-weed.c.

Referenced by add_rfx_effects2(), rte_on_off_callback(), and sensitize_rfx().

◆ has_key_defaults()

boolean has_key_defaults ( void  )

Definition at line 12450 of file effects-weed.c.

◆ has_non_alpha_palette()

boolean has_non_alpha_palette ( weed_plant_t *  ctmpl,
weed_plant_t *  filter 
)

< probably audio

Definition at line 143 of file effects-weed.c.

Referenced by enabled_in_channels(), and num_alpha_channels().

◆ has_perchannel_multiw()

boolean has_perchannel_multiw ( weed_plant_t *  filter)

Definition at line 8706 of file effects-weed.c.

◆ has_usable_palette()

boolean has_usable_palette ( weed_plant_t *  chantmpl)

◆ has_video_chans_in()

boolean has_video_chans_in ( weed_plant_t *  filter,
boolean  count_opt 
)

◆ has_video_chans_out()

boolean has_video_chans_out ( weed_plant_t *  filter,
boolean  count_opt 
)

Definition at line 676 of file effects-weed.c.

Referenced by feeds_to_video_filters(), and is_pure_audio().

◆ has_video_filters()

boolean has_video_filters ( boolean  analysers_only)

Definition at line 3886 of file effects-weed.c.

Referenced by add_rfx_effects2(), rte_on_off_callback(), and sensitize_rfx().

◆ host_info_cb()

weed_plant_t* host_info_cb ( weed_plant_t *  xhost_info,
void *  data 
)

Definition at line 4522 of file effects-weed.c.

Referenced by open_vid_playback_plugin().

◆ interpolate_param()

boolean interpolate_param ( weed_plant_t *  param,
void *  pchain,
weed_timecode_t  tc 
)

Definition at line 10187 of file effects-weed.c.

◆ interpolate_params()

boolean interpolate_params ( weed_plant_t *  inst,
void **  pchains,
weed_timecode_t  tc 
)

interpolate all in_parameters for filter_instance inst, using void **pchain, which is an array of param_change events in temporal order values are calculated for timecode tc.

We skip WEED_LEAF_HIDDEN parameters

Definition at line 10684 of file effects-weed.c.

Referenced by on_node_spin_value_changed().

◆ is_audio_channel_in()

boolean is_audio_channel_in ( weed_plant_t *  inst,
int  chnum 
)

Definition at line 577 of file effects-weed.c.

◆ is_audio_channel_out()

boolean is_audio_channel_out ( weed_plant_t *  inst,
int  chnum 
)

Definition at line 656 of file effects-weed.c.

◆ is_hidden_param()

boolean is_hidden_param ( weed_plant_t *  plant,
int  i 
)

returns the permanent (structural) state c.f check_hidden_gui() which sets flag values for params linked to an rfx extension

if we are to copy the values to another param, make sure it's possible (type, num values)

Definition at line 8587 of file effects-weed.c.

Referenced by apply_key_defaults(), count_simple_params(), get_nth_simple_param(), num_in_params(), update_visual_params(), weed_inst_in_param(), and weed_params_to_rfx().

◆ is_perchannel_multiw()

boolean is_perchannel_multiw ( weed_plant_t *  param)

◆ is_pure_audio()

boolean is_pure_audio ( weed_plant_t *  plant,
boolean  count_opt 
)

TRUE if audio in or out and no vid in/out.

Definition at line 714 of file effects-weed.c.

Referenced by get_audio_and_effects_state_at(), and on_realfx_activate().

◆ lives_monitor_free()

void lives_monitor_free ( void *  p)

Definition at line 4417 of file effects-weed.c.

◆ lives_monitor_malloc()

void* lives_monitor_malloc ( size_t  size)

Definition at line 4409 of file effects-weed.c.

◆ make_weed_hashname()

char* make_weed_hashname ( int  filter_idx,
boolean  fullname,
boolean  use_extra_authors,
char  sep,
boolean  subs 
)

return value should be freed after use

fullname includes author and version

make hashname from filter_idx

if fullname is FALSE, return filename, filtername concatenated if fullname is TRUE, return filename, filtername, author, version concatenated

if sep is not 0, we ignore the booleans and return filename, sep, filtername, sep, author concatenated (suitable to be fed into weed_filter_highest_version() later)

use_extra_authors is only for backwards compatibility

Definition at line 10730 of file effects-weed.c.

Referenced by append_filter_init_event(), and mt_set_autotrans().

◆ num_alpha_channels()

int num_alpha_channels ( weed_plant_t *  filter,
boolean  out 
)

Definition at line 321 of file effects-weed.c.

◆ num_compound_fx()

int num_compound_fx ( weed_plant_t *  plant)

return number of filters in a compound fx (1 if it is not compound) - works for filter or inst

Definition at line 132 of file effects-weed.c.

Referenced by get_external_window_hints(), and weed_instance_from_filter().

◆ num_in_params()

int num_in_params ( weed_plant_t *  plant,
boolean  skip_hidden,
boolean  skip_internal 
)

◆ num_out_params()

int num_out_params ( weed_plant_t *  plant)

Definition at line 3960 of file effects-weed.c.

Referenced by feeds_to_audio_filters(), and feeds_to_video_filters().

◆ read_filter_defaults()

boolean read_filter_defaults ( int  fd)

Definition at line 11921 of file effects-weed.c.

Referenced by load_rte_defs().

◆ read_generator_sizes()

boolean read_generator_sizes ( int  fd)

Definition at line 12092 of file effects-weed.c.

Referenced by load_rte_defs().

◆ read_key_defaults()

boolean read_key_defaults ( int  fd,
int  nparams,
int  key,
int  mode,
int  ver 
)

Definition at line 12232 of file effects-weed.c.

◆ rec_param_change()

void rec_param_change ( weed_plant_t *  inst,
int  pnum 
)

record a parameter value change in our event_list

< use the "thoretical" time

Definition at line 9000 of file effects-weed.c.

Referenced by pl_key_function().

◆ reset_frame_and_clip_index()

void reset_frame_and_clip_index ( void  )

TODO: split into player, progress, dialogs.

Definition at line 12219 of file effects-weed.c.

◆ restore_weed_instances()

void restore_weed_instances ( void  )

Definition at line 423 of file effects-weed.c.

◆ rte_bg_gen_key()

LIVES_GLOBAL_INLINE int rte_bg_gen_key ( void  )

Definition at line 9556 of file effects-weed.c.

◆ rte_bg_gen_mode()

LIVES_GLOBAL_INLINE int rte_bg_gen_mode ( void  )

Definition at line 9564 of file effects-weed.c.

◆ rte_fg_gen_key()

LIVES_GLOBAL_INLINE int rte_fg_gen_key ( void  )

Definition at line 9560 of file effects-weed.c.

◆ rte_fg_gen_mode()

LIVES_GLOBAL_INLINE int rte_fg_gen_mode ( void  )

Definition at line 9568 of file effects-weed.c.

◆ rte_get_numfilters()

int rte_get_numfilters ( void  )

Definition at line 9899 of file effects-weed.c.

Referenced by on_save_rte_defs_activate().

◆ rte_key_getmaxmode()

int rte_key_getmaxmode ( int  key)

returns highest mode which is set

Definition at line 9433 of file effects-weed.c.

Referenced by _weed_instance_obtain(), and get_num_mapped_modes_for_key().

◆ rte_key_getmode()

int rte_key_getmode ( int  key)

◆ rte_key_setmode()

boolean rte_key_setmode ( int  key,
int  newmode 
)

newmode has two special values, -1 = cycle forwards, -2 = cycle backwards key is 1 based, but may be 0 to use the current mainw->rte_keys special handling ensures that if we switch transitions, any background generators survive the switchover call with filter mutex unlocked

set mode for a given key; if key==0 then the active key is used

Definition at line 9626 of file effects-weed.c.

Referenced by rtemode_callback(), and rtemode_callback_hook().

◆ rte_key_valid()

boolean rte_key_valid ( int  key,
boolean  is_userkey 
)

returns TRUE if there is a filter bound to active mode of hotkey

Definition at line 9397 of file effects-weed.c.

Referenced by has_audio_filters(), has_video_filters(), on_realfx_activate(), rte_on_off_callback(), weed_apply_audio_effects_rt(), weed_apply_audio_instance(), and weed_reinit_all().

◆ rte_keymode_get_category()

lives_fx_cat_t rte_keymode_get_category ( int  key,
int  mode 
)

Definition at line 9290 of file effects-weed.c.

◆ rte_keymode_get_filter()

weed_plant_t* rte_keymode_get_filter ( int  key,
int  mode 
)

returns filter_class bound to key/mode (or NULL)

Definition at line 9465 of file effects-weed.c.

Referenced by feeds_to_audio_filters(), feeds_to_video_filters(), make_datacon_window(), on_realfx_activate(), and on_rte_info_clicked().

◆ rte_keymode_get_filter_idx()

int rte_keymode_get_filter_idx ( int  key,
int  mode 
)

returns filter_class index of key/mode (or -1 if no filter bound)

Definition at line 9416 of file effects-weed.c.

Referenced by cconx_check_connection(), and on_clear_clicked().

◆ rte_keymode_get_filter_name()

char* rte_keymode_get_filter_name ( int  key,
int  mode,
boolean  add_notes 
)

returns name of filter_class bound to key/mode (or "")

Definition at line 9531 of file effects-weed.c.

◆ rte_keymode_get_instance()

weed_plant_t* rte_keymode_get_instance ( int  key,
int  mode 
)

returns refcounted filter_instance bound to key/mode (or NULL)

Definition at line 9450 of file effects-weed.c.

Referenced by cconx_chain_data(), get_audio_and_effects_state_at(), get_audio_from_plugin(), and reinit_audio_gen().

◆ rte_keymode_get_plugin_name()

char* rte_keymode_get_plugin_name ( int  key,
int  mode 
)

returns name of plugin package containing filter_class (or "")

Definition at line 9540 of file effects-weed.c.

Referenced by on_rte_info_clicked().

◆ rte_keymode_get_type()

char* rte_keymode_get_type ( int  key,
int  mode 
)

returns a string filter/instance type (or "")

Definition at line 9264 of file effects-weed.c.

Referenced by on_rte_info_clicked(), and type_label_set_text().

◆ rte_keymode_valid()

boolean rte_keymode_valid ( int  key,
int  mode,
boolean  is_userkey 
)

returns TRUE if a filter_class is bound to key/mode, is_userkey should be set to TRUE

Definition at line 9407 of file effects-weed.c.

Referenced by idle_unmap_fx(), on_rte_info_clicked(), rte_keymode_get_category(), rte_keymode_get_filter(), rte_keymode_get_filter_name(), rte_keymode_get_instance(), rte_keymode_get_plugin_name(), and rte_keymode_get_type().

◆ rte_swap_fg_bg()

void rte_swap_fg_bg ( void  )

Definition at line 9844 of file effects-weed.c.

Referenced by do_quick_switch().

◆ rte_switch_keymode()

int rte_switch_keymode ( int  key,
int  mode,
const char *  hashname 
)

Definition at line 9791 of file effects-weed.c.

◆ run_process_func()

lives_filter_error_t run_process_func ( weed_plant_t *  instance,
weed_timecode_t  tc,
int  key 
)

Definition at line 2799 of file effects-weed.c.

Referenced by get_audio_from_plugin(), and weed_apply_audio_instance().

◆ set_copy_to()

int set_copy_to ( weed_plant_t *  inst,
int  pnum,
lives_rfx_t rfx,
boolean  update 
)

< prevent loops

check for compatibility nvalues

Definition at line 8918 of file effects-weed.c.

◆ set_key_defaults()

void set_key_defaults ( weed_plant_t *  inst,
int  key,
int  mode 
)

Definition at line 12418 of file effects-weed.c.

Referenced by rte_reset_defs_clicked(), and rte_set_key_defs().

◆ show_weed_stats()

void show_weed_stats ( weed_plant_t *  statsplant)

sort in descending order

Definition at line 4476 of file effects-weed.c.

◆ update_all_host_info()

void update_all_host_info ( void  )

Definition at line 478 of file effects-weed.c.

Referenced by pref_factory_string().

◆ update_host_info()

void update_host_info ( weed_plant_t *  hinfo)

Definition at line 459 of file effects-weed.c.

◆ weed_add_effectkey()

int weed_add_effectkey ( int  key,
const char *  hashname,
boolean  fullname 
)

bind a filter_class to key/mode using its hashname

Definition at line 9784 of file effects-weed.c.

◆ weed_add_effectkey_by_idx()

int weed_add_effectkey_by_idx ( int  key,
int  idx 
)

we will add a filter_class at the next free slot for key, and return the slot number if idx is -1 (probably meaning the filter was not found), we return -1 if all slots are full, we return -3 currently, generators and non-generators cannot be mixed on the same key (causes problems if the mode is switched) in this case a -2 is returned

see description

Definition at line 9747 of file effects-weed.c.

Referenced by weed_add_effectkey().

◆ weed_apply_audio_effects()

void weed_apply_audio_effects ( weed_plant_t *  filter_map,
weed_layer_t **  layers,
int  nbtracks,
int  nchans,
int64_t  nsamps,
double  arate,
weed_timecode_t  tc,
double *  vis 
)

Definition at line 3709 of file effects-weed.c.

◆ weed_apply_audio_effects_rt()

void weed_apply_audio_effects_rt ( weed_layer_t alayer,
weed_timecode_t  tc,
boolean  analysers_only,
boolean  is_audio_thread 
)

Definition at line 3743 of file effects-weed.c.

◆ weed_apply_audio_instance()

lives_filter_error_t weed_apply_audio_instance ( weed_plant_t *  init_event,
weed_layer_t **  layers,
int  nbtracks,
int  nchans,
int64_t  nsamps,
double  arate,
weed_timecode_t  tc,
double *  vis 
)

apply an audio filter to a stack of audio tracks

init_event may contain a pointer to the init_event in the event_list (if any) this is used to map tracks to the in and out channels of the filter indtance

if NULL (e.g. during free playback) we create a fake channel map mapping layer 0 -> in, layer 0 -> out.

abuf is a float ** array of audio, with each element being 1 audio channel (as in left/ right) grouped by track number nchans is number of audio channels (1 or 2 currently) in each track nbtracks is the number of backing tracks; track number will be -nbtracks <= track <= n track no. >= 0 is audio from a video track in multitrack, < 0 is a backing audio track (audio only, no video) nsamps is the sample size, arate the audio rate, tc the current timecode of the event_list or player and vis is a matrix of "visibility": 1 = front layer, full volume, 0 - rear layer, no volume, and a value in between can result from a transition.

During rendering the audio render process feeds small chunks at a time to be processed, with the final result passing into the channel mixer (volume and pan)

We set the values for the in and out channels, possibly disabling or enabling some. IF the instance needs reiniting (because od our changes and its filter / chantmpl flags) then we reinit it

we runi the process_func and the output is returned to abuf, using the out_tracks to map the out channels

interpolate the params, if we can get a mutex lock on the inst

first layer comes from ascrap file; do not apply any effects except the final audio mixer

Definition at line 3031 of file effects-weed.c.

◆ weed_apply_effects()

weed_plant_t* weed_apply_effects ( weed_plant_t **  layers,
weed_plant_t *  filter_map,
weed_timecode_t  tc,
int  opwidth,
int  opheight,
void ***  pchains 
)

Definition at line 3484 of file effects-weed.c.

Referenced by load_frame_image(), and render_events().

◆ weed_apply_instance()

lives_filter_error_t weed_apply_instance ( weed_plant_t *  inst,
weed_plant_t *  init_event,
weed_plant_t **  layers,
int  opwidth,
int  opheight,
weed_timecode_t  tc 
)

process a single video filter instance

get in_tracks and out_tracks from the init_event; these map filter_instance channels to layers

clear WEED_LEAF_DISABLED if we have non-zero frame and there is no WEED_LEAF_DISABLED in template if we have a zero (NULL) frame, set WEED_LEAF_DISABLED if WEED_LEAF_OPTIONAL, otherwise we cannot apply the filter

set channel timecodes

set the fps (data) in the instance

pull pixel_data or wait for threads to complete for all input layers (unless it is there already)

set each channel width, height to match largest (or smallest depending on quality level - TODO) of in layers (unless the plugin allows differing sizes)

if width and height are wrong, resize in the layer

if palette is wrong, first we try to change the plugin channel palette, if not possible we convert palette in the layer

apply the effect, put result in output layer, set layer palette, width, height, rowstrides

if filter does not support inplace, we must create a new pixel_data; this will then replace the original layer (this is passed to the plugin as the output, so we just copy by reference)

for in/out alpha channels, there is no matching layer. These channels are passed around like data using mainw->cconx as a guide. We will simply free any in alpha channels after processing (unless inplace was used)

WARNING: output layer may need resizing, and its palette may need adjusting - should be checked by the caller

opwidth and opheight limit the maximum frame size, they can either be set to 0,0 or to max display size; however if all sources are smaller than this then the output will be smaller also and need resizing by the caller

for purely audio filters, these are handled in weed_apply_audio_instance()

for filters with mixed video / audio inputs (currently only generators) audio is added

pb_quality: HIGH == use MAX(in sizes, out size); MED == use MIN( MAX in sizes, output_size), LOW == use MIN(in sizes, out size

skip filters with no output channels (we'll deal with them elsewhere)

we process audio effects elsewhere

if alpha out(s) we need to construct the output frames

run it only if it outputs into effects which have video chans if (!feeds_to_video_filters(key,rte_key_getmode(key+1))) return FILTER_ERROR_NO_IN_CHANNELS;

we process generators elsewhere

handle case where in_tracks[i] > than num layers either we temporarily disable the channel, or we can't apply the filter

if we have more in_channels in the effect than in_tracks, we MUST (temp) disable the extra in_channels

here we have more in_tracks than actual layers (this can happen if we have blank frames) disable some optional channels if we can

wait for thread to pull layer pixel_data

temp disable channels if we can

ensure all chantmpls NOT marked "optional" have at least one corresponding enabled channel e.g. we could have disabled all channels from a template with "max_repeats" that is not optional

skip disabled in channels

mark the non disabled in channels

quit if a mandatory channel has been disabled

that is it for in_channels, now we move on to out_channels

occasionally during recording we get an init_event with no WEED_LEAF_OUT_TRACKS (probably when an audio effect inits/deinits a video effect)

manual adjustment for letterboxing. We want to avoid the situation where some layers are letterboxing in one dimension and others are letterboxing in the other, however this is unavoidable with frames of different sizes. the best we can do is to make sure that one layer sets the collective size and the others will get letterboxed to that size. thus - if this layer is the first, or it engulfs all of the previous layers, then we let it set the width and height

pass 1, we try to set channel sizes to opwidth X opheight channel may have restrictions (e.g fixed size or step values) so we will set it as near as we can we won't resize next as we will try to palette convert and resize in one go

currently, alpha channels don't come in layers, we add them like data directly to the channel plus, we ignore the display size (it doesn't make sense to resize an alpha channel) so if the filter allows varying channel sizes we are OK else if its not the first channel and the size differs and the filter doesnt allow varying sizes then we're in trouble !

if sizes can vary then we must set the first in channel to op size, because we'll want the first out channel at that size otherwise (or if it's a converter) then we can use layer size

check if the plugin needs reinit

now we do a second pass, and we set up the palettes on the in channels if it's the first channel, we try to change the channel palette to the layer palette* if that is not possible then we set it to the nearest alternative if it's not the first channel, we must use the palette from the first chan, unless the filter has WEED_FILTER_PALETTES_MAY_VARY.

  • if the channel template flags have WEED_FILTER_REINIT_ON_PALETTE_CHANGE, then we want to minimise palette changes, else we may be reiniting the filter instance a lot. If the clip type is CLIP_TYPE_FILE then we actually have 2 alternatives: the decoder palette, which will be used for unchanged frames pulled from the clip, + RGB24 which will be the case for altered frames loaded from png / jpeg. We want to avoid the worst case where we are reiniting on each alternate frame. so we'll pick in order of preference: RGB24, BGR24 (if the layer has no alpha), then RGBA32, BGRA32, ARGB32 (if it has alpha) (if the layer is already RGB we'll try that first). If no RGB palettes are available then we'll pick: YUV444P / YUVA4444P, YUV888 / YUVA8888, 422, 420 / UYVY / YUYV, 411

There are two points where we can alter the palette: when the instance has just been inited (we can reinit with near zero cost) and if we are going to reinit anyway due to some other factor (e.g size change).

IF the template has WEED_FILTER_REINIT_ON_ROWSTRIDES_CHANGE then similar rules apply excpet we will look at the macropixel sizes.

Once the channel palette is set then we'll do a palette conversion / resize of the layer.

TODO: we should be smarter here and figure out the best palette when forced to change, given the input palettes and output palettes of the entire filter chain from sources to output, since each change has a cost in terms of time and possibly quality.

once the channel palette is set, then we may need to change the size and palette of the layer feeding in to it we do the resize first, since it may be possible to resize and palette convert all in one go after resizing we convert the palette if necessary

use channel palette to avoid a reinit

check which of the plugin's allowed palettes is closest to our target palette

set up clamping, sampling and subspace for YUV palettes

avoid a reinit if we can

check which of the plugin's allowed palettes is closest to our target palette

for an analyser (no out channels, or only alpha outs) we copy the layer if it needs lower quality since won't need to pass the output to anything else, we'll just destroy the copy after

we'll resize first, since we may be able to change the palette at the same time

check if we need to resize the layer get the pixel widths to compare the channel has the sizes we set in pass1

but the player size would have been adjusted to the letterboxed size in any case). However, when mixing channels, all will have

check if the plugin needs reinit

since layers and channels are interchangeable, we just call weed_layer_copy(channel, layer) the cast to weed_layer_t * is unnecessary, but added for clarity

weed_layer_copy() will adjust all the important leaves in the channel:

That's it for in channels, now we move on to out channels now we don't need to resize / convert palette because we simply create new pixel_data for the channel

for the time being we only have a single out channel, so it simplifes things greatly

store values to see if they changed

set the timecode for the channel (this is optional, but its good to do to timestamp the output)

INPLACE

try to match palettes with first enabled in channel According to the spec, if the plugin permits we can match out channel n with in channel n but we'll skip that for now

resizing - use the value we set in channel template this allows us to, for example, resize the same in_channel to multiple out_channels at various sizes

check whether the filter needs a reinit

all channels now set up

do gamma correction of any integer RGB(A) parameters convert in and out parameters to SRGB TODO: store / restore old vals

Definition at line 1585 of file effects-weed.c.

Referenced by deinterlace_frame().

◆ weed_bg_generator_end()

void weed_bg_generator_end ( weed_plant_t *  inst)

ref the isntance so it isn't deleted

Definition at line 8318 of file effects-weed.c.

◆ weed_call_deinit_func()

weed_error_t weed_call_deinit_func ( weed_plant_t *  instance)

Definition at line 7067 of file effects-weed.c.

Referenced by deinterlace_frame(), and weed_reinit_effect().

◆ weed_call_init_func()

weed_error_t weed_call_init_func ( weed_plant_t *  inst)

Definition at line 7044 of file effects-weed.c.

◆ weed_deinit_all()

void weed_deinit_all ( boolean  shutdown)

deinit all effects (except generators* during playback) this is called on ctrl-0 or on shutdown background generators will be killed because their transition will be deinited

deinit all active effects

Definition at line 7404 of file effects-weed.c.

Referenced by rte_on_off_callback().

◆ weed_deinit_effect()

boolean weed_deinit_effect ( int  hotkey)

hotkey starts at 1

< use the "thoretical" time

Definition at line 7094 of file effects-weed.c.

Referenced by rte_on_off_callback(), and weed_reinit_effect().

◆ weed_delete_effectkey()

boolean weed_delete_effectkey ( int  key,
int  mode 
)

unbinds a filter_class from a key/mode

Definition at line 9326 of file effects-weed.c.

Referenced by on_clear_clicked().

◆ weed_filter_categorise()

lives_fx_cat_t weed_filter_categorise ( weed_plant_t *  pl,
int  in_channels,
int  out_channels 
)

Definition at line 243 of file effects-weed.c.

◆ weed_filter_highest_version()

int weed_filter_highest_version ( const char *  pkg,
const char *  fxname,
const char *  auth,
int *  xversion 
)

Definition at line 10994 of file effects-weed.c.

◆ weed_filter_idx_get_name()

char* weed_filter_idx_get_name ( int  idx,
boolean  add_subcats,
boolean  add_notes 
)

◆ weed_filter_idx_get_package_name()

char* weed_filter_idx_get_package_name ( int  idx)

Definition at line 9510 of file effects-weed.c.

◆ weed_filter_in_paramtmpl()

weed_plant_t* weed_filter_in_paramtmpl ( weed_plant_t *  filter,
int  param_num,
boolean  skip_internal 
)

Definition at line 8795 of file effects-weed.c.

Referenced by rte_set_defs_ok(), and update_weed_color_value().

◆ weed_filter_out_paramtmpl()

weed_plant_t* weed_filter_out_paramtmpl ( weed_plant_t *  filter,
int  param_num 
)

Definition at line 8831 of file effects-weed.c.

◆ weed_filter_subcategorise()

lives_fx_cat_t weed_filter_subcategorise ( weed_plant_t *  pl,
lives_fx_cat_t  category,
boolean  count_opt 
)

Definition at line 290 of file effects-weed.c.

◆ weed_flagset_array_count()

int weed_flagset_array_count ( weed_plant_t **  array,
boolean  set_readonly 
)

Definition at line 1136 of file effects-weed.c.

Referenced by rte_reset_defs_clicked().

◆ weed_generator_end()

void weed_generator_end ( weed_plant_t *  inst)

TODO: do we want to do this if switching from one gen to another ?

here we must be very careful, because we are about to close the clip which is either playing as fg or bg in the case of background, we just switch to it very briefly to close it, then back to the fg clip in case the generator was ended by a change of bg clip, we restore the new bg clip

in the case of the fg clip we close it and try to switch to another valid clip we switch back to the old (invalid) clip after this, while setting mainw->new_clip to the new one the player will detect the invalid clip and jump to the switch point to handle the changeover cleanly

Definition at line 8176 of file effects-weed.c.

Referenced by do_quick_switch(), on_multitrack_activate(), and weed_generator_start().

◆ weed_generator_start()

int weed_generator_start ( weed_plant_t *  inst,
int  key 
)

Definition at line 7911 of file effects-weed.c.

◆ weed_get_all_names()

LiVESList* weed_get_all_names ( lives_fx_list_t  list_type)

Definition at line 9865 of file effects-weed.c.

◆ weed_get_blend_factor()

int weed_get_blend_factor ( int  hotkey)

Definition at line 9169 of file effects-weed.c.

Referenced by grabkeys_callback(), and rtemode_callback().

◆ weed_get_idx_for_hashname()

int weed_get_idx_for_hashname ( const char *  hashname,
boolean  fullname 
)

◆ weed_get_indices_from_template()

int* weed_get_indices_from_template ( const char *  pkg,
const char *  fxname,
const char *  auth,
int  version 
)

generate a list of filter indices from a given template.

Char values may be NULL or "" to signify match-any. version may be 0 to signify match-any otherwise values must match those specified

returns: a list of int indices, with the last value == -1 return value should be freed after use

Definition at line 10958 of file effects-weed.c.

◆ weed_get_sorted_filter()

LIVES_GLOBAL_INLINE int weed_get_sorted_filter ( int  i)

Definition at line 9862 of file effects-weed.c.

◆ weed_in_parameters_free()

void weed_in_parameters_free ( weed_plant_t *  inst)

Definition at line 6121 of file effects-weed.c.

Referenced by rte_reset_defs_clicked().

◆ weed_in_params_free()

void weed_in_params_free ( weed_plant_t **  parameters,
int  num_parameters 
)

Definition at line 6110 of file effects-weed.c.

Referenced by filter_init_add_pchanges(), and weed_in_parameters_free().

◆ weed_init_effect()

boolean weed_init_effect ( int  hotkey)

hotkey starts at 1

< use the "thoretical" time

Definition at line 6596 of file effects-weed.c.

Referenced by rte_on_off_callback().

◆ weed_inst_in_param()

weed_plant_t* weed_inst_in_param ( weed_plant_t *  inst,
int  param_num,
boolean  skip_hidden,
boolean  skip_internal 
)

◆ weed_inst_out_param()

weed_plant_t* weed_inst_out_param ( weed_plant_t *  inst,
int  param_num 
)

Definition at line 8771 of file effects-weed.c.

Referenced by pconx_chain_data_omc().

◆ weed_instance_from_filter()

weed_plant_t* weed_instance_from_filter ( weed_plant_t *  filter)

Definition at line 6469 of file effects-weed.c.

Referenced by deinterlace_frame(), get_track_visibility_at_tc(), and weed_to_rfx().

◆ weed_instance_get_filter()

weed_plant_t* weed_instance_get_filter ( weed_plant_t *  inst,
boolean  get_compound_parent 
)

◆ weed_instance_get_filter_name()

char* weed_instance_get_filter_name ( weed_plant_t *  inst,
boolean  get_compound_parent 
)

Definition at line 9519 of file effects-weed.c.

◆ weed_instance_get_type()

LIVES_INLINE char* weed_instance_get_type ( weed_plant_t *  inst,
boolean  getsub 
)

Definition at line 9257 of file effects-weed.c.

◆ weed_instance_is_resizer()

LIVES_GLOBAL_INLINE boolean weed_instance_is_resizer ( weed_plant_t *  inst)

Definition at line 571 of file effects-weed.c.

◆ weed_instance_obtain()

LIVES_GLOBAL_INLINE weed_plant_t* weed_instance_obtain ( int  key,
int  mode 
)

◆ weed_instance_ref()

LIVES_GLOBAL_INLINE int weed_instance_ref ( weed_plant_t *  inst)

◆ weed_instance_unref()

LIVES_GLOBAL_INLINE int weed_instance_unref ( weed_plant_t *  inst)

◆ weed_layer_create_from_generator()

weed_plant_t* weed_layer_create_from_generator ( weed_plant_t *  inst,
weed_timecode_t  tc,
int  clipno 
)

if we have a choice of palettes, try to match with the first filter, if not, with the player

store original values (width / height)

store original values (width / height)

Definition at line 7607 of file effects-weed.c.

◆ weed_leaf_copy_or_delete()

LIVES_GLOBAL_INLINE weed_error_t weed_leaf_copy_or_delete ( weed_layer_t dlayer,
const char *  key,
weed_layer_t slayer 
)

Definition at line 68 of file effects-weed.c.

◆ weed_leaf_delete_host()

weed_error_t weed_leaf_delete_host ( weed_plant_t *  plant,
const char *  key 
)

Definition at line 4357 of file effects-weed.c.

◆ weed_leaf_get_monitor()

weed_error_t weed_leaf_get_monitor ( weed_plant_t *  plant,
const char *  key,
int32_t  idx,
void *  value 
)

Definition at line 4433 of file effects-weed.c.

◆ weed_leaf_num_elements_monitor()

weed_size_t weed_leaf_num_elements_monitor ( weed_plant_t *  plant,
const char *  key 
)

Definition at line 4470 of file effects-weed.c.

◆ weed_leaf_set_host()

weed_error_t weed_leaf_set_host ( weed_plant_t *  plant,
const char *  key,
uint32_t  seed_type,
weed_size_t  num_elems,
void *  values 
)

Definition at line 4371 of file effects-weed.c.

◆ weed_leaf_set_monitor()

weed_error_t weed_leaf_set_monitor ( weed_plant_t *  plant,
const char *  key,
uint32_t  seed_type,
weed_size_t  num_elems,
void *  values 
)

Definition at line 4422 of file effects-weed.c.

◆ weed_load_all()

void weed_load_all ( void  )

load effects

Definition at line 5119 of file effects-weed.c.

◆ weed_parameter_has_variable_elements_strict()

boolean weed_parameter_has_variable_elements_strict ( weed_plant_t *  inst,
weed_plant_t *  ptmpl 
)

see if param has variable elements, using the strictest check

Definition at line 724 of file effects-weed.c.

◆ weed_params_create()

weed_plant_t** weed_params_create ( weed_plant_t *  filter,
boolean  in 
)

◆ weed_plant_deserialise()

weed_plant_t* weed_plant_deserialise ( int  fd,
unsigned char **  mem,
weed_plant_t *  plant 
)

if key is NULL and check_key is TRUE, we will limit whay voidptr leaves can be added. This is necessary for layers since voidptrs which may be loaded can mess up the layer handling

Definition at line 11770 of file effects-weed.c.

Referenced by load_from_scrap_file().

◆ weed_plant_free_host()

weed_error_t weed_plant_free_host ( weed_plant_t *  plant)

Definition at line 4339 of file effects-weed.c.

◆ weed_plant_serialise()

size_t weed_plant_serialise ( int  fd,
weed_plant_t *  plant,
unsigned char **  mem 
)

Definition at line 11198 of file effects-weed.c.

Referenced by save_event_list_inner().

◆ weed_playback_gen_start()

boolean weed_playback_gen_start ( void  )

Definition at line 8332 of file effects-weed.c.

◆ weed_reinit_all()

void weed_reinit_all ( void  )

Definition at line 1288 of file effects-weed.c.

Referenced by play_file().

◆ weed_reinit_effect()

lives_filter_error_t weed_reinit_effect ( weed_plant_t *  inst,
boolean  reinit_compound 
)

Definition at line 1169 of file effects-weed.c.

Referenced by on_resetp_clicked(), reinit_audio_gen(), and weed_to_rfx().

◆ weed_set_blend_factor()

void weed_set_blend_factor ( int  hotkey)

Definition at line 9039 of file effects-weed.c.

Referenced by on_less_pressed(), and on_more_pressed().

◆ weed_unload_all()

void weed_unload_all ( void  )

unload all effects

Definition at line 5966 of file effects-weed.c.

◆ wge_inner()

void wge_inner ( weed_plant_t *  inst)

deinit and instance(s) for generator, reset instance mapping

Definition at line 8154 of file effects-weed.c.

◆ write_filter_defaults()

boolean write_filter_defaults ( int  fd,
int  idx 
)

Definition at line 11874 of file effects-weed.c.

Referenced by on_save_rte_defs_activate().

◆ write_generator_sizes()

boolean write_generator_sizes ( int  fd,
int  idx 
)

Definition at line 12038 of file effects-weed.c.

Referenced by on_save_rte_defs_activate().

◆ write_key_defaults()

void write_key_defaults ( int  fd,
int  key,
int  mode 
)

Definition at line 12369 of file effects-weed.c.

Variable Documentation

◆ key_defaults

weed_plant_t*** key_defaults[FX_KEYS_MAX_VIRTUAL]