local input0 = make_fade_input(chain, INPUT0_SIGNAL_NUM, input0_live, input0_deint, input0_scale)
local input1 = make_fade_input(chain, INPUT1_SIGNAL_NUM, input1_live, input1_deint, input1_scale)
+ -- If fading between two live inputs, the overlay is put on top.
+ -- If fading between the static picture and a live input,
+ -- the overlay is put on the live input.
+ local overlay = nil
+ if input0_live and not input1_live then
+ overlay = possibly_make_overlay(has_overlay, chain, input0.last)
+ if overlay then
+ input0.last = overlay.overlay_effect
+ end
+ elseif input1_live and not input0_live then
+ overlay = possibly_make_overlay(has_overlay, chain, input1.last)
+ if overlay then
+ input1.last = overlay.overlay_effect
+ end
+ end
+
local mix_effect = chain:add_effect(MixEffect.new(), input0.last, input1.last)
- local overlay = possibly_make_overlay(has_overlay, chain, mix_effect)
+ if input0_live and input1_live then
+ overlay = possibly_make_overlay(has_overlay, chain, mix_effect)
+ end
chain:finalize(hq)
return make_simple_chain(input_deint, input_scale, has_overlay, hq)
end)
--- A chain to show a single static picture on screen.
+-- A chain to show a single static picture on screen. Never with CasparCG overlay.
local static_chains = make_cartesian_product({
- {true, false}, -- has_overlay
{true, false} -- hq
-}, function(has_overlay, hq)
+}, function(hq)
local chain = EffectChain.new(16, 9)
local chain_input = chain:add_effect(ImageInput.new("tfk_pause.png"))
- local overlay = possibly_make_overlay(has_overlay, chain, chain_input)
chain:finalize(hq)
return {
- chain = chain,
- overlay = overlay
+ chain = chain
}
end)
end
return chain.chain, prepare
elseif live_signal_num == STATIC_SIGNAL_NUM then -- Static picture.
- local chain = static_chains[overlay_enabled][true]
+ local chain = static_chains[true]
prepare = function()
prepare_overlay_live(chain, t)
end
return chain.chain, prepare
end
if num == STATIC_SIGNAL_NUM + 2 then
- local chain = static_chains[show_overlay][false]
+ local chain = static_chains[false]
prepare = function()
prepare_overlay_static(chain, t)
end