From 2e3bdf27ce785c1017e31ba9cd092917a07bb284 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 18 Feb 2020 00:46:55 +0100 Subject: [PATCH] Add a multiviewer output that may or may not be useful for debugging purposes. --- nageru/ultimate.lua | 43 +++++++++++++++++++++++++++++++++++++++++-- nageru/white.png | Bin 0 -> 4951 bytes 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 nageru/white.png diff --git a/nageru/ultimate.lua b/nageru/ultimate.lua index 4fff536..566b465 100644 --- a/nageru/ultimate.lua +++ b/nageru/ultimate.lua @@ -62,6 +62,7 @@ iptv_video:change_rate(10.0) local static_image = ImageInput.new(cef_path .. "/nageru/dsn-bg.png") local first_frame = true +local multiviewer_enabled = false function reload_cef() cef_input:reload() @@ -72,6 +73,10 @@ function disconnect_iptv() iptv_video:disconnect() end +function toggle_multiviewer() + multiviewer_enabled = not multiviewer_enabled +end + -- An overlay with variable alpha. function make_overlay(scene, base) local image = scene:add_input(cef_input) @@ -192,7 +197,6 @@ function make_simple_scene() scene.scene:finalize() return scene end - local simple_scene = make_simple_scene() -- Load all the stinger frames. @@ -223,6 +227,36 @@ local overlay_scene_lq = Scene.new(16, 9) local overlay_scene_lq_input = overlay_scene_lq:add_input(cef_input) overlay_scene_lq:finalize(false) +-- A debugging scene to show a simple multiviewer. HQ only, since there is no preview. +function make_multiview_scene() + local scene = Scene.new(16, 9) + local bg = scene:add_input(ImageInput.new(cef_path .. "/nageru/white.png")) + local mv_width = 1280 / 3 + local mv_height = 720 / 3 + local mv_offset = (720 - mv_height * 2) / 2 + + for input_idx=0,5 do + local input = scene:add_input(input_idx) + + local resize = scene:add_effect(ResizeEffect.new()) + resize:set_int("width", mv_width) + resize:set_int("height", mv_height) + + local padding = scene:add_effect(IntegralPaddingEffect.new()) + padding:set_int("width", 1280) + padding:set_int("height", 720) + padding:set_int("left", (input_idx % 3) * mv_width) + padding:set_int("top", math.floor(input_idx / 3) * mv_height + mv_offset) + + local overlay = scene:add_effect(OverlayEffect.new(), bg, padding) + bg = overlay + end + + scene:finalize(true) + return scene +end +local multiview_scene_hq = make_multiview_scene() + function needs_scale(signals, signal_num, width, height) if signal_num == STATIC_SIGNAL_NUM then -- We assume this is already correctly scaled at load time. @@ -754,6 +788,10 @@ function get_scene(num, t, width, height, signals) last_rate = new_rate end + if num == 0 and multiviewer_enabled then -- Live, with debugging on. + return multiview_scene_hq + end + if num == 0 then -- Live. -- See if we're in a transition. finish_transitions(t) @@ -1096,5 +1134,6 @@ end ThemeMenu.set( { "Reload overlay", reload_cef }, - { "Disconnect IPTV", disconnect_iptv } + { "Disconnect IPTV", disconnect_iptv }, + { "Toggle multiviewer", toggle_multiviewer } ) diff --git a/nageru/white.png b/nageru/white.png new file mode 100644 index 0000000000000000000000000000000000000000..b9621252a20b47770ea3a34281cc8dbe917ab8bb GIT binary patch literal 4951 zcmeAS@N?(olHy`uVBq!ia0y~yUNas3~8REN=%qw{HkoZ#N($bT^gGpBx?@$%h^pE|-e zUei>6%K3yz)c>FHP(NnL6sMriF-3hlf;?Nb#pK?vels!Y*5k*Ql55lXZQbr^w|N?z zu08z9Hn=tRzFftV1+Vwo{@8iAj>*<&e#0iC^&x+^dffQAE!e8@)DH2TJN8bix?6gz zOr~6O`SbR-Ki2I(yjoE**VZ4=kES2_w5H?!{T(XH{MQ%%nsfKL z%=g<@r!35{v(D=N8<1fcHzDR*vgFwdqS?3CE~s3yk+HI0H!h=>%W%aRhfb@|Stj4^ ztXO#DNHec-aq>+w@yCaFdmIW)XXOMf>26MZEO{CQ-0g2_dSzx>ADqg0kfZ-k zHuwM1&*f1wHtTj~bVlZ_4G>>n+iN7Y)ASHGM}}P9F4np&&G!3p)@%(GzBBDi-wxBb z@(%Bpx%nrb>3j%2W1h@)&7Z-eFK0R}~XEUcl$R>#!A}brFPD=V8QS@fvszsimn`c#BSY+z$7g>C6 z+I7WnU!9pzX2#o-t{$DdI^DcnKaN}cpyUcwaqT#-l~bKv7j;F5{u7;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