+function get_fade_chain(state, signals, t, width, height, input_resolution)
+ local input0_type = get_input_type(signals, state.transition_src_signal)
+ local input0_scale = needs_scale(signals, state.transition_src_signal, width, height)
+ local input1_type = get_input_type(signals, state.transition_dst_signal)
+ local input1_scale = needs_scale(signals, state.transition_dst_signal, width, height)
+ local chain = fade_chains[input0_type][input0_scale][input1_type][input1_scale][true]
+ local prepare = function()
+ if input0_type == "live" or input0_type == "livedeint" then
+ chain.input0.input:connect_signal(state.transition_src_signal)
+ set_neutral_color_from_signal(state, chain.input0.wb_effect, state.transition_src_signal)
+ end
+ set_scale_parameters_if_needed(chain.input0, width, height)
+ if input1_type == "live" or input1_type == "livedeint" then
+ chain.input1.input:connect_signal(state.transition_dst_signal)
+ set_neutral_color_from_signal(state, chain.input1.wb_effect, state.transition_dst_signal)
+ end
+ set_scale_parameters_if_needed(chain.input1, width, height)
+ local tt = calc_fade_progress(t, state.transition_start, state.transition_end)
+
+ chain.mix_effect:set_float("strength_first", 1.0 - tt)
+ chain.mix_effect:set_float("strength_second", tt)
+ end
+ return chain.chain, prepare
+end
+
+-- SBS code (live_signal_num == SBS_SIGNAL_NUM, or in a transition to/from it).
+function get_sbs_chain(signals, t, width, height, input_resolution)
+ local input0_type = get_input_type(signals, INPUT0_SIGNAL_NUM)
+ local input1_type = get_input_type(signals, INPUT1_SIGNAL_NUM)
+ return sbs_chains[input0_type][input1_type][true]
+end
+
+-- API ENTRY POINT