diff --git a/DOCS/man/stats.rst b/DOCS/man/stats.rst index 80718e53ef..e354367d0f 100644 --- a/DOCS/man/stats.rst +++ b/DOCS/man/stats.rst @@ -97,6 +97,11 @@ Configurable Options Show graphs for vsync and jitter values (page 1). Only when toggled. +``plot_tonemapping_lut`` + Default: yes + + Enable tone-mapping LUT visualization automatically. Only when toggled. + ``flush_graph_data`` Default: yes diff --git a/player/lua/stats.lua b/player/lua/stats.lua index a003b1af0c..acb67abfe0 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -35,6 +35,7 @@ local o = { plot_perfdata = true, plot_vsync_ratio = true, plot_vsync_jitter = true, + plot_tonemapping_lut = true, -- also enable tone-mapping-visualize skip_frames = 5, global_max = true, flush_graph_data = true, -- clear data buffers when toggling @@ -95,6 +96,7 @@ local cache_recorder_timer = nil local curr_page = o.key_page_1 local pages = {} local scroll_bound = false +local tm_viz_prev = nil -- Save these sequences locally as we'll need them a lot local ass_start = mp.get_property_osd("osd-ass-cc/0") local ass_stop = mp.get_property_osd("osd-ass-cc/1") @@ -1209,6 +1211,10 @@ local function process_key_binding(oneshot) elseif not display_timer.oneshot and not oneshot then display_timer:kill() cache_recorder_timer:stop() + if tm_viz_prev ~= nil then + mp.set_property_native("tone-mapping-visualize", tm_viz_prev) + tm_viz_prev = nil + end clear_screen() remove_page_bindings() if recorder then @@ -1226,6 +1232,10 @@ local function process_key_binding(oneshot) -- changes, but it's fine for an internal script. mp.observe_property("vsync-jitter", "none", recorder) end + if not oneshot and o.plot_tonemapping_lut then + tm_viz_prev = mp.get_property_native("tone-mapping-visualize") + mp.set_property_native("tone-mapping-visualize", true) + end if not oneshot then cache_ahead_buf = {0, pos = 1, len = 50, max = 0} cache_speed_buf = {0, pos = 1, len = 50, max = 0}