]> git.sesse.net Git - ultimatescore/commitdiff
Allow setting white balance for the IPTV input.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 24 Apr 2018 19:31:05 +0000 (21:31 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 24 Apr 2018 19:31:05 +0000 (21:31 +0200)
nageru/ultimate.lua

index b2882f4271253d3301b38da3128508e5476d50e5..a9991d111d68f03333c96c4883454588b4080d5c 100644 (file)
@@ -13,6 +13,7 @@ local neutral_colors = {
        {0.5, 0.5, 0.5},  -- Input 3.
        {0.5, 0.5, 0.5},  -- Input 4.
        {0.5, 0.5, 0.5}   -- Input 5.
+       -- Will also be filled with VIDEO_SIGNAL_NUM below.
 }
 
 local overlay_transition_start = -2.0
@@ -36,6 +37,8 @@ local SBS_SIGNAL_NUM = NUM_CAMERAS
 local STATIC_SIGNAL_NUM = NUM_CAMERAS + 1
 local VIDEO_SIGNAL_NUM = NUM_CAMERAS + 2
 
+neutral_colors[VIDEO_SIGNAL_NUM - INPUT0_SIGNAL_NUM + 1] = {0.5, 0.5, 0.5};
+
 -- Preview-only signal showing the current signal with the overlay.
 -- Not valid for live_signal_num!
 local OVERLAY_SIGNAL_NUM = NUM_CAMERAS + 3
@@ -273,8 +276,8 @@ function make_simple_chain(input_deint, input_video, input_scale, has_overlay, h
                input = chain:add_video_input(iptv_video, false)
        else
                input = chain:add_live_input(false, input_deint)
+               input:connect_signal(0)  -- First input card. Can be changed whenever you want.
        end
-       input:connect_signal(0)  -- First input card. Can be changed whenever you want.
 
        local resample_effect, resize_effect
        if scale then
@@ -689,11 +692,15 @@ function get_fade_chain(signals, t, width, height, input_resolution)
        prepare = function()
                if input0_type == "live" or input0_type == "livedeint" then
                        chain.input0.input:connect_signal(transition_src_signal)
+               end
+               if input0_type ~= "static" then
                        set_neutral_color_from_signal(chain.input0.wb_effect, 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(transition_dst_signal)
+               end
+               if input1_type ~= "static" then
                        set_neutral_color_from_signal(chain.input1.wb_effect, transition_dst_signal)
                end
                set_scale_parameters_if_needed(chain.input1, width, height)
@@ -822,8 +829,8 @@ function get_chain(num, t, width, height, signals)
                        prepare = function()
                                if input_type ~= "video" then
                                        chain.input:connect_signal(live_signal_num)
-                                       set_neutral_color_from_signal(chain.wb_effect, live_signal_num)
                                end
+                               set_neutral_color_from_signal(chain.wb_effect, live_signal_num)
                                set_scale_parameters_if_needed(chain, width, height)
                                prepare_overlay_live(chain, t, 1.0)
                        end
@@ -865,8 +872,8 @@ function get_chain(num, t, width, height, signals)
                prepare = function()
                        if input_type ~= "video" then
                                chain.input:connect_signal(signal_num)
-                               set_neutral_color(chain.wb_effect, neutral_colors[signal_num + 1])
                        end
+                       set_neutral_color(chain.wb_effect, neutral_colors[signal_num + 1])
                        set_scale_parameters_if_needed(chain, width, height)
                        prepare_overlay_static(chain, t)
                end