local cef_input = HTMLInput.new("file://" .. cef_path .. "/score.html")
cef_input:execute_javascript_async("play()")
+local bg_video = VideoInput.new(cef_path .. "/flow-1080.mp4", Nageru.VIDEO_FORMAT_YCBCR)
+
function reload_cef()
cef_input:reload()
cef_input:execute_javascript_async("play()")
input:connect_signal(signal)
last = input
else
- input = chain:add_effect(ImageInput.new("tfk_pause.png"))
+ input = chain:add_effect(ImageInput.new(cef_path .. "/nageru/dsn-bg-1080.png"))
last = input
end
function make_sbs_chain(input0_type, input0_overlay, input1_type, hq)
local chain = EffectChain.new(16, 9)
+ local bg = chain:add_video_input(bg_video, false)
+
local input0 = make_sbs_input(chain, INPUT0_SIGNAL_NUM, input0_type == "livedeint", input0_overlay, hq)
local input1 = make_sbs_input(chain, INPUT4_SIGNAL_NUM, input1_type == "livedeint", false, hq)
- input0.padding_effect:set_vec4("border_color", 0.0, 0.0, 0.0, 1.0)
+ input0.padding_effect:set_vec4("border_color", 0.0, 0.0, 0.0, 0.0)
input1.padding_effect:set_vec4("border_color", 0.0, 0.0, 0.0, 0.0)
- chain:add_effect(OverlayEffect.new(), input0.padding_effect, input1.padding_effect)
+ local i0 = chain:add_effect(OverlayEffect.new(), bg, input0.padding_effect)
+ chain:add_effect(OverlayEffect.new(), i0, input1.padding_effect)
chain:finalize(hq)
return {
return make_simple_chain(input_deint, input_scale, has_overlay, hq)
end)
--- A chain to show a single static picture on screen. Never with CasparCG overlay.
+-- A chain to show a single static picture on screen. Never with HTML overlay.
local static_chains = make_cartesian_product({
{true, false} -- hq
}, function(hq)
local chain = EffectChain.new(16, 9)
- local chain_input = chain:add_effect(ImageInput.new("tfk_pause.png"))
+ local chain_input = chain:add_effect(ImageInput.new(cef_path .. "/nageru/dsn-bg.png"))
chain:finalize(hq)
return {
return sbs_chains[input0_type][overlay_enabled][input1_type][true]
end
+local last_rate = 0.0
+
-- API ENTRY POINT
-- Called every frame. Get the chain for displaying at input <num>,
-- where 0 is live, 1 is preview, 2 is the first channel to display
end
last_resolution = input_resolution
+ -- Save some CPU time if we're not having SBS on live.
+ local new_rate
+ if live_signal_num == SBS_SIGNAL_NUM or
+ preview_signal_num == SBS_SIGNAL_NUM or
+ transition_type == ZOOM_TRANSITION then
+ new_rate = 1.0
+ else
+ new_rate = 0.0001
+ end
+ if new_rate ~= last_rate then
+ -- Avoid waking up the video thread (which may be sleeping) if the rate is the same.
+ bg_video:change_rate(new_rate)
+ last_rate = new_rate
+ end
+
if num == 0 then -- Live.
-- See if we're in a transition.
finish_transitions(t)
set_neutral_color(chain.input0.wb_effect, neutral_colors[1])
set_neutral_color(chain.input1.wb_effect, neutral_colors[5])
- -- First input is positioned (16,48) from top-left.
- -- Second input is positioned (16,48) from the bottom-right.
- local pos0 = pos_from_top_left(16, 48, 848, 477, screen_width, screen_height)
- local pos1 = pos_from_top_left(1280 - 384 - 16, 720 - 216 - 48, 384, 216, screen_width, screen_height)
+ -- Both inputs are the same size (true side-by-side).
+ local pos0 = pos_from_top_left(1280 - 616 - 16, 186, 616, 347, screen_width, screen_height)
+ local pos1 = pos_from_top_left(16, 186, 616, 347, screen_width, screen_height)
local pos_fs = { x0 = 0, y0 = 0, x1 = screen_width, y1 = screen_height }
local affine_param