+-- A chain to show a single input on screen, with a stinger on top.
+function make_stinger_chain(input_deint, input_video, input_scale, has_overlay, stinger_frame, hq)
+ local chain = make_simple_chain_no_finalize(input_deint, input_video, input_scale, has_overlay, hq)
+ local filename = cef_path .. "/stinger/blur" .. string.rep("0", 3 - string.len(tostring(stinger_frame))) .. stinger_frame .. ".png"
+
+ local last
+ if has_overlay then
+ last = chain.overlay.overlay_effect
+ else
+ last = chain.wb_effect
+ end
+ local input = chain.chain:add_effect(ImageInput.new(filename))
+ chain.chain:add_effect(OverlayEffect.new(), last, input)
+ chain.chain:finalize(hq)
+ return chain
+end
+
+-- Single-input chains with various stinger frames on top.
+local stinger_chains = make_cartesian_product({
+ {"video", "live", "livedeint"}, -- input_type
+ {true, false}, -- input_scale
+ {true, false}, -- has_overlay
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, -- stinger_frame
+ {true, false} -- hq
+}, function(input_type, input_scale, has_overlay, stinger_frame, hq)
+ local input_deint = (input_type == "livedeint")
+ local input_video = (input_type == "video")
+ return make_stinger_chain(input_deint, input_video, input_scale, has_overlay, stinger_frame, hq)
+end)
+