]> git.sesse.net Git - nageru/log
nageru
4 years agoAdd metrics for how many frames we are decoding, but did not have the time to display.
Steinar H. Gunderson [Sun, 8 Mar 2020 14:02:21 +0000 (15:02 +0100)]
Add metrics for how many frames we are decoding, but did not have the time to display.

4 years agoMove RefCountedTexture to shared.
Steinar H. Gunderson [Fri, 6 Mar 2020 21:18:41 +0000 (22:18 +0100)]
Move RefCountedTexture to shared.

4 years agoAdd a metric for general Futatabi player health (how much buffer there is left).
Steinar H. Gunderson [Wed, 4 Mar 2020 23:16:47 +0000 (00:16 +0100)]
Add a metric for general Futatabi player health (how much buffer there is left).

4 years agoFix MJPEG white balance information when VA-API is in use.
Steinar H. Gunderson [Wed, 4 Mar 2020 18:53:49 +0000 (19:53 +0100)]
Fix MJPEG white balance information when VA-API is in use.

The JPEG headers were cached (per resolution) and never invalidated,
causing wrong/outdated information to be sent.

I can't really remember why I wanted to cache these, but I suppose
I had a reason, so I'm a bit reluctant to just kill the cache.
Hopefully, the white balance won't change often enough, and these
objects are so small, that we won't need invalidation; we can just
let it grow until program exit.

4 years agoAdd summaries for tracking fade and interpolation latency across the GPU.
Steinar H. Gunderson [Sat, 29 Feb 2020 23:32:15 +0000 (00:32 +0100)]
Add summaries for tracking fade and interpolation latency across the GPU.

4 years agoAdd a Futatabi metric for JPEG decode times.
Steinar H. Gunderson [Sat, 29 Feb 2020 23:07:27 +0000 (00:07 +0100)]
Add a Futatabi metric for JPEG decode times.

4 years agoFix a deadlock in Futatabi when using MIDI devices.
Steinar H. Gunderson [Sat, 29 Feb 2020 22:25:11 +0000 (23:25 +0100)]
Fix a deadlock in Futatabi when using MIDI devices.

If something in the UI wanted to update a light on the MIDI device
at the exact same time the operator pressed a button on said device,
we could get a deadlock. The problem was that MIDIDevice::handle_event()
would lock the MIDIDevice and then go to tell MIDIMapper that the
note was coming (which needs a lock on the MIDIMapper), while in the
other thread, MIDIMapper::refresh_lights() would first lock the MIDIMapper
and then call MIDIDevice::update_lights() with the new set of lights
(which nedes a lock on the MIDIDevice). This is a classic lock ordering
issue.

The solution is to simply make MIDIDevice::handle_event() not lock the
MIDIDevice for anything that calls MIDIMapper; it doesn't actually modify
any state in MIDIDevice, except when we hotplug new devices (and that never
calls MIDIMapper).

4 years agoMake so that auto white balance is stored per (physical) card, not per signal.
Steinar H. Gunderson [Sat, 29 Feb 2020 21:44:07 +0000 (22:44 +0100)]
Make so that auto white balance is stored per (physical) card, not per signal.

This fixes an issue where auto white balance would be completely off if
any signals were remapped out of the default. It means you no longer can
duplicate a signal and have different white balance on it, but that seems
narrow enough that one could use manual white balance for that (I can't
really imagine what the use case would be).

4 years agoNomenclature cleanups around channels, signals and cards.
Steinar H. Gunderson [Sat, 29 Feb 2020 21:30:30 +0000 (22:30 +0100)]
Nomenclature cleanups around channels, signals and cards.

4 years agoMake it possible to get and set EQ parameters from the theme.
Steinar H. Gunderson [Wed, 26 Feb 2020 17:47:55 +0000 (18:47 +0100)]
Make it possible to get and set EQ parameters from the theme.

4 years agoFix an issue where a Kaeru connected to a nonfunctional input would get lots of socke...
Steinar H. Gunderson [Tue, 25 Feb 2020 23:00:07 +0000 (00:00 +0100)]
Fix an issue where a Kaeru connected to a nonfunctional input would get lots of sockets in CLOSE_WAIT (and useless threads).

It would actually eventually run out of sockets and go entirely zombie
if left for too long, which is obviously suboptimal.

4 years agoLog a warning when we kill a client that is not keeping up.
Steinar H. Gunderson [Tue, 25 Feb 2020 22:02:49 +0000 (23:02 +0100)]
Log a warning when we kill a client that is not keeping up.

4 years agoMake CHECK_VASTATUS error messages textual instead of numeric.
Steinar H. Gunderson [Fri, 21 Feb 2020 18:07:37 +0000 (19:07 +0100)]
Make CHECK_VASTATUS error messages textual instead of numeric.

4 years agoIn Futatabi, make it possible to set custom source labels.
Steinar H. Gunderson [Mon, 17 Feb 2020 22:13:29 +0000 (23:13 +0100)]
In Futatabi, make it possible to set custom source labels.

An operator was consistently confused by having 3 on a left camera
and 4 on a right camera, and wanted L3 and R4 labels, so here goes :-)
There's no auto-import from Nageru at this point; it needs to be set
using --source-label NUM:LABEL (or -l NUM:LABEL) from the command line.

4 years agoStop refreshing the Futatabi channel overlay every frame.
Steinar H. Gunderson [Mon, 17 Feb 2020 22:11:21 +0000 (23:11 +0100)]
Stop refreshing the Futatabi channel overlay every frame.

4 years agoEdit is normally to the left of View, so fix Futatabi.
Steinar H. Gunderson [Mon, 17 Feb 2020 21:21:59 +0000 (22:21 +0100)]
Edit is normally to the left of View, so fix Futatabi.

4 years agoUnbreak showing the first two channels in the tally JSON.
Steinar H. Gunderson [Mon, 17 Feb 2020 20:26:17 +0000 (21:26 +0100)]
Unbreak showing the first two channels in the tally JSON.

4 years agoRevert "Make for faster shutdown of DeckLink cards."
Steinar H. Gunderson [Sun, 31 Mar 2019 12:36:11 +0000 (14:36 +0200)]
Revert "Make for faster shutdown of DeckLink cards."

This breaks turning on HDMI/SDI output mode from the GUI.

This reverts commit be7ba768a138bea4543a712c8261b1bfdc6e1dd0.

4 years agoFix an assertion error when FFmpeg inputs were dropping frames.
Steinar H. Gunderson [Mon, 17 Feb 2020 19:00:50 +0000 (20:00 +0100)]
Fix an assertion error when FFmpeg inputs were dropping frames.

4 years agoGive the theme access to basic audio information.
Steinar H. Gunderson [Sun, 16 Feb 2020 23:59:14 +0000 (00:59 +0100)]
Give the theme access to basic audio information.

Currently, it can get (not set) number of buses and channel names,
get/set fader volume, and get/set mute. This should already be fairly
useful for most applications.

4 years agoMake it possible to siphon out a single MJPEG stream.
Steinar H. Gunderson [Sat, 15 Feb 2020 16:28:17 +0000 (17:28 +0100)]
Make it possible to siphon out a single MJPEG stream.

The URL for this is /feeds/N.mp4 (although the .mp4 suffix will be ignored
in practice), where N is the card index (starting from zero). You are allowed to
use a feed that is not part of the “regular” multicam MJPEG input.

This can be used for remote debugging, recording of a given card with wget,
streaming a specific card as an aux, and probably over things.

4 years agoFix compilation in debug mode.
Steinar H. Gunderson [Sat, 15 Feb 2020 14:21:01 +0000 (15:21 +0100)]
Fix compilation in debug mode.

4 years agoMake the MJPEG card-to-stream mapping invisible to outside callers.
Steinar H. Gunderson [Wed, 12 Feb 2020 23:39:52 +0000 (00:39 +0100)]
Make the MJPEG card-to-stream mapping invisible to outside callers.

As an important side effect, this allows should_encode_mjpeg_for_card()
to contain more complex policy in the future.

4 years agoSplit out some work from the MJPEG encoder constructor.
Steinar H. Gunderson [Wed, 12 Feb 2020 23:32:13 +0000 (00:32 +0100)]
Split out some work from the MJPEG encoder constructor.

4 years agoFix a comment typo.
Steinar H. Gunderson [Wed, 12 Feb 2020 21:41:08 +0000 (22:41 +0100)]
Fix a comment typo.

4 years agoMake it possible for auto white balance to be controlled by another input.
Steinar H. Gunderson [Wed, 12 Feb 2020 16:59:12 +0000 (17:59 +0100)]
Make it possible for auto white balance to be controlled by another input.

This is useful if you want to run white balance on something that could
e.g. have an overlay.

4 years agoFix invalid white balance from nonconnected FFmpeg inputs.
Steinar H. Gunderson [Wed, 12 Feb 2020 16:57:49 +0000 (17:57 +0100)]
Fix invalid white balance from nonconnected FFmpeg inputs.

4 years agoFix auto-WB of certain kinds of input.
Steinar H. Gunderson [Wed, 12 Feb 2020 16:54:57 +0000 (17:54 +0100)]
Fix auto-WB of certain kinds of input.

4 years agoMake Futatabi fades apply white balance.
Steinar H. Gunderson [Tue, 11 Feb 2020 21:42:53 +0000 (22:42 +0100)]
Make Futatabi fades apply white balance.

When there are two different video streams involved, they will often
have different white points, so we can't just echo the Exif data back;
we need to apply it when converting, and then get back a result in
standard sRGB. It's not entirely correct since we still run with
crushed whites/black, but it's good enough.

This completes Nageru/Futatabi white balance round trip support.

4 years agoMake Futatabi copy Exif data for interpolated frames.
Steinar H. Gunderson [Tue, 11 Feb 2020 17:15:24 +0000 (18:15 +0100)]
Make Futatabi copy Exif data for interpolated frames.

This means that interpolated frames also get the right white balance,
so now only faded frames get none.

4 years agoHeed the Exif white point when playing back (MJPEG) video.
Steinar H. Gunderson [Mon, 10 Feb 2020 23:18:38 +0000 (00:18 +0100)]
Heed the Exif white point when playing back (MJPEG) video.

4 years agoIn the MJPEG export, include white balance information.
Steinar H. Gunderson [Mon, 10 Feb 2020 17:52:49 +0000 (18:52 +0100)]
In the MJPEG export, include white balance information.

We do this by converting it to an x-y white point and storing it in Exif,
which is the closest thing I could find to a standard in this space.

4 years agoChange to using RGBTriplet for white balance.
Steinar H. Gunderson [Sun, 9 Feb 2020 22:48:57 +0000 (23:48 +0100)]
Change to using RGBTriplet for white balance.

4 years agoVarious fixes for non-VA-API MJPEG encoding.
Steinar H. Gunderson [Sun, 9 Feb 2020 18:10:31 +0000 (19:10 +0100)]
Various fixes for non-VA-API MJPEG encoding.

4 years agoSupport auto white balance (ie., not controlled by the theme).
Steinar H. Gunderson [Sun, 9 Feb 2020 13:43:17 +0000 (14:43 +0100)]
Support auto white balance (ie., not controlled by the theme).

This is added as a regular (optional) white balance effect, but it automatically
intercepts set_wb() calls and stores it locally. (You can still set neutral_color
manually, but it's probably sort of pointless.)

This simplifies the themes somewhat and allows in some cases for fewer different
scene instantiations (since image inputs don't get white balance), but more
importantly, it will allow exporting the white balance setting in the MJPEG
export.

4 years agoFactor out find_signal_to_connect().
Steinar H. Gunderson [Sun, 9 Feb 2020 13:41:43 +0000 (14:41 +0100)]
Factor out find_signal_to_connect().

4 years agoNeutral white balance is (1,1,1), not (0.5,0.5,0.5). Probably irrelevant in practice...
Steinar H. Gunderson [Sun, 9 Feb 2020 13:40:38 +0000 (14:40 +0100)]
Neutral white balance is (1,1,1), not (0.5,0.5,0.5). Probably irrelevant in practice currently, though.

4 years agoRelease Nageru and Futatabi 1.9.1. 1.9.1
Steinar H. Gunderson [Sun, 17 Nov 2019 19:08:09 +0000 (20:08 +0100)]
Release Nageru and Futatabi 1.9.1.

4 years agoFix an assertion failure when fading into a zero-length clip.
Steinar H. Gunderson [Wed, 30 Oct 2019 23:26:23 +0000 (00:26 +0100)]
Fix an assertion failure when fading into a zero-length clip.

4 years agoFix an issue where it was not possible to add new infinite clips to a playlist
Steinar H. Gunderson [Wed, 30 Oct 2019 23:14:55 +0000 (00:14 +0100)]
Fix an issue where it was not possible to add new infinite clips to a playlist
that was already playing.

Non-infinite clips were okay all along, but infinite clips would have zero
(well, negative) length.

4 years agoFix the previous fix for the infinite display; it was causing crashes and odd stuff...
Steinar H. Gunderson [Wed, 30 Oct 2019 22:55:17 +0000 (23:55 +0100)]
Fix the previous fix for the infinite display; it was causing crashes and odd stuff in the UI.

4 years agoShow preview display when using cue in or cue out, not just on scrubbing.
Steinar H. Gunderson [Wed, 30 Oct 2019 19:01:46 +0000 (20:01 +0100)]
Show preview display when using cue in or cue out, not just on scrubbing.

4 years agoFix the “time remaining” display when queueing infinite clips.
Steinar H. Gunderson [Wed, 30 Oct 2019 18:54:30 +0000 (19:54 +0100)]
Fix the “time remaining” display when queueing infinite clips.

4 years agoWhen starting a new clip, start at the correct master speed (it was always at 100%).
Steinar H. Gunderson [Wed, 30 Oct 2019 18:46:14 +0000 (19:46 +0100)]
When starting a new clip, start at the correct master speed (it was always at 100%).

4 years agoWhen exporting interpolated files, don't include the subtitles meant for Nageru inter...
Steinar H. Gunderson [Mon, 21 Oct 2019 19:43:07 +0000 (21:43 +0200)]
When exporting interpolated files, don't include the subtitles meant for Nageru internal consumption.

4 years agoFix some jerkiness when playing back with no interpolation.
Steinar H. Gunderson [Mon, 21 Oct 2019 19:32:34 +0000 (21:32 +0200)]
Fix some jerkiness when playing back with no interpolation.

When hitting a frame exactly, we'd choose [pts_of_previous_frame, pts]
as our candidate range, and always pick the lower. This would make us
jerk around a lot, which would be a particular problem with audio.

Fix by taking a two-pronged approach: First, if we hit a frame exactly,
just send [pts,pts]. Second, activate snapping even when interpolation
is off.

We still have a problem when playing back audio in the case of dropped
video frames (we'll output the same audio twice), but better audio
handling is somewhat outside the scope of this commit.

4 years agoAdd a missing dependency on -pthread.
Steinar H. Gunderson [Fri, 18 Oct 2019 20:52:16 +0000 (22:52 +0200)]
Add a missing dependency on -pthread.

Patch by Morten Linderud.

4 years agoAdd a mailmap file to change my personal email address in old commits.
Steinar H. Gunderson [Sun, 11 Aug 2019 08:47:42 +0000 (10:47 +0200)]
Add a mailmap file to change my personal email address in old commits.

sgunderson@bigfoot.com has been de facto dead for a year or two,
and is now definitely dead.

4 years agoFix the wording of a warning.
Steinar H. Gunderson [Wed, 31 Jul 2019 17:44:53 +0000 (19:44 +0200)]
Fix the wording of a warning.

4 years agoSupport disabling optional effects if a given other effect is _enabled_.
Steinar H. Gunderson [Sun, 28 Jul 2019 20:06:24 +0000 (22:06 +0200)]
Support disabling optional effects if a given other effect is _enabled_.

There are some restrictions (see the comments), but this is generally
useful if two effects are mutually exclusive, e.g., an overlay that can
be at one of many different points in the chain.

4 years agoMake it possible for the theme to override the status line.
Steinar H. Gunderson [Wed, 24 Jul 2019 13:06:29 +0000 (15:06 +0200)]
Make it possible for the theme to override the status line.

This is done by declaring a function format_status_line, which receives
the text that would normally be there (disk space left), as well as the
length of the current recording file in seconds. It can then return
whatever it would like.

My own code, but inspired by a C++ patch by Alex Thomazo in the Breizhcamp
repository (which did it by hardcoding a different status line in C++).

4 years agoRelease Nageru and Futatabi 1.9.0. 1.9.0
Steinar H. Gunderson [Sat, 20 Jul 2019 14:57:39 +0000 (16:57 +0200)]
Release Nageru and Futatabi 1.9.0.

4 years agoFix a typo in NEWS.
Steinar H. Gunderson [Sat, 20 Jul 2019 09:05:35 +0000 (11:05 +0200)]
Fix a typo in NEWS.

4 years agoMake it possible to call set_channel_name() for live and preview.
Steinar H. Gunderson [Fri, 19 Jul 2019 15:34:48 +0000 (17:34 +0200)]
Make it possible to call set_channel_name() for live and preview.

The use case for this is if you want to copy the channel name to
preview or similar. Does not affect the legacy channel_name()
callback (it is still guaranteed never to get 0 or 1).

Probably doesn't affect the analyzer; I haven't tested.

4 years agoClean some duplicate code from the default theme.
Steinar H. Gunderson [Fri, 19 Jul 2019 14:56:18 +0000 (16:56 +0200)]
Clean some duplicate code from the default theme.

4 years agoMake it possible to put checkboxes on theme menu entries.
Steinar H. Gunderson [Fri, 19 Jul 2019 11:54:17 +0000 (13:54 +0200)]
Make it possible to put checkboxes on theme menu entries.

4 years agoAdd get_frame_width() and get_frame_height() to the signals given to the theme, which...
Steinar H. Gunderson [Fri, 19 Jul 2019 11:24:03 +0000 (13:24 +0200)]
Add get_frame_width() and get_frame_height() to the signals given to the theme, which is usually what the user wants.

4 years agoFix a Lua crash on exit.
Steinar H. Gunderson [Fri, 19 Jul 2019 10:39:48 +0000 (12:39 +0200)]
Fix a Lua crash on exit.

4 years agoDeal better with the user forgetting to set width/height on effects that require...
Steinar H. Gunderson [Wed, 17 Jul 2019 13:46:40 +0000 (15:46 +0200)]
Deal better with the user forgetting to set width/height on effects that require them.

4 years agoFix an issue where we would show no signal even when there was a signal. Patch by...
Steinar H. Gunderson [Tue, 16 Jul 2019 11:40:02 +0000 (13:40 +0200)]
Fix an issue where we would show no signal even when there was a signal. Patch by Martin Sandsmark.

4 years agoRemove some leftover debugging code.
Steinar H. Gunderson [Tue, 25 Jun 2019 18:03:19 +0000 (20:03 +0200)]
Remove some leftover debugging code.

4 years agoAdd disable_if_always_disabled() to Block objects.
Steinar H. Gunderson [Sat, 22 Jun 2019 13:16:14 +0000 (15:16 +0200)]
Add disable_if_always_disabled() to Block objects.

This allows the theme to specify that a given effect only makes sense
if another effect is enabled; e.g. a crop that only makes sense if
immediately followed by a resize. This can cut down the number of
instantiations in some cases.

Also change so that 0 is no longer always the canonical choice;
if disabling a block is a possibility, that is. In situations with
things disabling each other transitively, this could reduce the
number of instantiations further.

4 years agoMore theme cleaning.
Steinar H. Gunderson [Fri, 21 Jun 2019 21:31:40 +0000 (23:31 +0200)]
More theme cleaning.

4 years agoFix cross-compilation.
Steinar H. Gunderson [Fri, 21 Jun 2019 20:11:39 +0000 (22:11 +0200)]
Fix cross-compilation.

Patch from Helmut Grohne.

4 years agoMove is_plain_signal(), which was now placed a bit confusingly.
Steinar H. Gunderson [Fri, 21 Jun 2019 18:16:57 +0000 (20:16 +0200)]
Move is_plain_signal(), which was now placed a bit confusingly.

4 years agoConvert channel_signal() and supports_set_wb() to imperative versions.
Steinar H. Gunderson [Fri, 21 Jun 2019 18:12:39 +0000 (20:12 +0200)]
Convert channel_signal() and supports_set_wb() to imperative versions.

This completes the theme conversion for all called-only-once functions.
As before, the old versions are supported for pre-1.9.0 compatibility.

4 years agoCorrect a comment.
Steinar H. Gunderson [Fri, 21 Jun 2019 18:05:55 +0000 (20:05 +0200)]
Correct a comment.

4 years agoAdd a missing hint.
Steinar H. Gunderson [Fri, 21 Jun 2019 18:04:22 +0000 (20:04 +0200)]
Add a missing hint.

4 years agoMake it possible to set number of channels imperatively instead of using a callback.
Steinar H. Gunderson [Fri, 21 Jun 2019 17:43:29 +0000 (19:43 +0200)]
Make it possible to set number of channels imperatively instead of using a callback.

num_channels() will still be used if it exists, for compatibility with older
themes.

4 years agoMake it possible to set channel names imperatively instead of using a callback.
Steinar H. Gunderson [Fri, 21 Jun 2019 17:31:28 +0000 (19:31 +0200)]
Make it possible to set channel names imperatively instead of using a callback.

channel_name() will still be used if it exists, for compatibility with older
themes.

4 years agoMove the handling of human-readable input resolution printing into C++; every theme...
Steinar H. Gunderson [Fri, 21 Jun 2019 16:22:28 +0000 (18:22 +0200)]
Move the handling of human-readable input resolution printing into C++; every theme should not need to care about this.

4 years agoSupport submenus within theme menus.
Steinar H. Gunderson [Fri, 21 Jun 2019 15:45:54 +0000 (17:45 +0200)]
Support submenus within theme menus.

4 years agoFix a possible deadlock in CEF.
Steinar H. Gunderson [Tue, 18 Jun 2019 20:47:08 +0000 (22:47 +0200)]
Fix a possible deadlock in CEF.

4 years agoSupport optional effects with multiple inputs.
Steinar H. Gunderson [Sun, 16 Jun 2019 17:14:24 +0000 (19:14 +0200)]
Support optional effects with multiple inputs.

This allows you to prune away entire sections of the chain; the typical
case is if you have an OverlayEffect(a, b) and want to disable that.
In the disabled versions of the chain, the OverlayEffect will be replaced
with an IdentityEffect that passes through a only and leaves the entire
subgraph under b noninstantiated.

4 years agoRefactor out find_inputs_for_block().
Steinar H. Gunderson [Sun, 16 Jun 2019 17:12:11 +0000 (19:12 +0200)]
Refactor out find_inputs_for_block().

4 years agoAdd an enable_if() to Block, for convenience.
Steinar H. Gunderson [Sun, 16 Jun 2019 09:02:11 +0000 (11:02 +0200)]
Add an enable_if() to Block, for convenience.

4 years agoSmall refactoring in Block.
Steinar H. Gunderson [Sun, 16 Jun 2019 08:38:03 +0000 (10:38 +0200)]
Small refactoring in Block.

4 years agoRename chain -> scene as appropriate.
Steinar H. Gunderson [Sun, 16 Jun 2019 08:30:38 +0000 (10:30 +0200)]
Rename chain -> scene as appropriate.

4 years agoMake Block.choose() return the effect that was chosen.
Steinar H. Gunderson [Sat, 15 Jun 2019 23:14:55 +0000 (01:14 +0200)]
Make Block.choose() return the effect that was chosen.

4 years agoFix so that parameters directly on effects actually override the ones on the block...
Steinar H. Gunderson [Sat, 15 Jun 2019 23:14:40 +0000 (01:14 +0200)]
Fix so that parameters directly on effects actually override the ones on the block, as was intended.

4 years agoRename choose_alternative() to choose().
Steinar H. Gunderson [Sat, 15 Jun 2019 22:31:20 +0000 (00:31 +0200)]
Rename choose_alternative() to choose().

4 years agoAllow calling disable() on everything that has an IdentityEffect as alternative.
Steinar H. Gunderson [Sat, 15 Jun 2019 22:02:56 +0000 (00:02 +0200)]
Allow calling disable() on everything that has an IdentityEffect as alternative.

4 years agoAllow giving class names to Block.choose_alternative.
Steinar H. Gunderson [Sat, 15 Jun 2019 22:01:05 +0000 (00:01 +0200)]
Allow giving class names to Block.choose_alternative.

4 years agoScene doesn't need theme->input_state to be set, as we never get Lua callacks from...
Steinar H. Gunderson [Sat, 15 Jun 2019 14:23:24 +0000 (16:23 +0200)]
Scene doesn't need theme->input_state to be set, as we never get Lua callacks from its setup_chain.

4 years agoGive a slightly friendlier error message if the user forgets to connect an input.
Steinar H. Gunderson [Sat, 15 Jun 2019 13:03:52 +0000 (15:03 +0200)]
Give a slightly friendlier error message if the user forgets to connect an input.

4 years agoRework the chain concept.
Steinar H. Gunderson [Thu, 13 Jun 2019 20:59:18 +0000 (22:59 +0200)]
Rework the chain concept.

For complex themes, building the multitude of chains one might need
has become very bothersome, with tricky Lua scripting and non-typesafe
multidimensional tables.

To alleviate this somewhat, we introduce a concept called Scenes.
A Scene is pretty much an EffectChain with a better name and significantly
more functionality. In particular, scenes don't consist of single Effects;
they consist of blocks, which can hold any number of alternatives for
Effects. On finalize, we will instantiate all possible variants of
EffectChains behind-the-scenes, like the Lua code used to have to do itself,
but this is transparent to the theme.

In particular, this means that inputs are much more flexible. Instead of
having to make separate chains for regular inputs, deinterlaced inputs,
video inputs and CEF inputs, you now just make an input, and can connect
any type to it runtime (or “display”, as it's now called). Output is also
flexible; by default, any scene will get both Y'CbCr and RGBA versions
compiled. (In both cases, you can make non-flexible versions to reduce
the number of different instantiations. This can be a good idea in
complex chains.)

This also does away with the concept of the prepare function for a chain;
any effect settings are snapshotted when you return from get_scene() (the new
name for get_chain(), obviously), so you don't need to worry about capturing
anything or get threading issues like you used to.

All existing themes will continue to work unmodified for the time being,
but it is strongly recommended to migrate from EffectChain to Scene.

4 years agoMove some Lua utility functions into a separate header file.
Steinar H. Gunderson [Tue, 11 Jun 2019 20:31:30 +0000 (22:31 +0200)]
Move some Lua utility functions into a separate header file.

4 years agoWork around a Mesa shader cache issue.
Steinar H. Gunderson [Sat, 25 May 2019 15:36:33 +0000 (17:36 +0200)]
Work around a Mesa shader cache issue.

4 years agoAdd a helper so that theme script warnings get line numbers.
Steinar H. Gunderson [Mon, 10 Jun 2019 10:07:49 +0000 (12:07 +0200)]
Add a helper so that theme script warnings get line numbers.

4 years agoDefer creation of effects until they are added to a chain.
Steinar H. Gunderson [Mon, 20 May 2019 16:41:12 +0000 (18:41 +0200)]
Defer creation of effects until they are added to a chain.

Right now, this is pretty much a no-op, but it is a necessary building
block for making auto-chains (chains that can specialize depending on
the conditions).

4 years agoFix ImageInput sRGB behavior.
Steinar H. Gunderson [Sun, 19 May 2019 08:37:18 +0000 (10:37 +0200)]
Fix ImageInput sRGB behavior.

After we made the different ImageInput instances share OpenGL textures,
some of them would assume they could output sRGB. Fix by the same way
we've done video textures, ie., use sRGBSwitchingInput.

4 years agoAlways require GL_EXT_texture_sRGB_decode.
Steinar H. Gunderson [Sun, 19 May 2019 08:34:24 +0000 (10:34 +0200)]
Always require GL_EXT_texture_sRGB_decode.

Keeping the pure OpenGL path does not seem to actually buy us any
compatibility, so we simplify things a bit for an upcoming fix.
Strangely enough, this does not seem to be in any OpenGL standard.
Sampler objects, which we also require, is, though.

4 years agoRemove a fixed FIXME.
Steinar H. Gunderson [Sat, 18 May 2019 18:45:41 +0000 (20:45 +0200)]
Remove a fixed FIXME.

4 years agoMake the ImageInput cache store textures, not images.
Steinar H. Gunderson [Sat, 18 May 2019 09:26:33 +0000 (11:26 +0200)]
Make the ImageInput cache store textures, not images.

This saves on a lot of texture memory when the same image is used
in multiple chains, but perhaps more importantly, will allow us to
decouple ImageInputs from which images they show later.

4 years agoRemove unused code.
Steinar H. Gunderson [Tue, 14 May 2019 22:14:46 +0000 (00:14 +0200)]
Remove unused code.

4 years agoIn ImageInput, make one global update thread instead of one per image.
Steinar H. Gunderson [Tue, 14 May 2019 16:12:20 +0000 (18:12 +0200)]
In ImageInput, make one global update thread instead of one per image.

Makes for fewer threads (obviously), and also probably makes it easier
to give it an OpenGL context later.

4 years agoRemove unused member in ImageInput.
Steinar H. Gunderson [Mon, 13 May 2019 22:55:09 +0000 (00:55 +0200)]
Remove unused member in ImageInput.

4 years agoFix another whitespace error.
Steinar H. Gunderson [Sun, 12 May 2019 10:23:18 +0000 (12:23 +0200)]
Fix another whitespace error.

4 years agoFix an indentation error.
Steinar H. Gunderson [Sat, 11 May 2019 16:44:28 +0000 (18:44 +0200)]
Fix an indentation error.

4 years agoRefactor out a function for adding the end of EffectChains.
Steinar H. Gunderson [Sat, 11 May 2019 14:47:33 +0000 (16:47 +0200)]
Refactor out a function for adding the end of EffectChains.