Commit Graph
41 Commits
Author SHA1 Message Date
luz.paz 321e7d1606 Fix doxygen and misc. typos
Found via `codespell -q 3 -L ba,keypair,numer,uint`
2020-03-10 15:00:56 -04:00
itsmattkc 0f5cd40c45 exporter: add ability to cancel exports (including a confirm to cancel if the
user closes the dialog mid-export)
2020-03-03 02:37:18 +11:00
itsmattkc 2e38e7e3fb indexmanager: moved files 2020-02-21 10:47:41 +11:00
itsmattkc 5a070f14de general: use IdlePriority rather than LowPriority
Fixes a number of playback stuttering and general UI lag issues by setting all
background tasks to IdlePriority rather than LowPriority. While it was assumed
LowPriority tasks would always get scheduled below NormalPriority (e.g. main
thread) tasks, it turns out this is not always the case. If the background tasks
start consuming a lot of CPU cycles, the scheduler may use "dynamic scheduling"
to schedule them above the main thread regardless leading to UI lag. This is
apparently the case for all thread priorities apart from IdlePriority, which
is allegedly a special case where threads are *only* scheduled when other
threads aren't busy ensuring the main thread stays responsive.
2020-02-20 17:48:50 +11:00
itsmattkc 2145efa2a0 decoder/renderer: use memory cache and single decoder to optimize frames for
cycles
2020-02-20 15:32:12 +11:00
itsmattkc e68e89c40b renderer/decoder: use same background mechanism to conform audio as well 2020-02-19 16:45:34 +11:00
itsmattkc 03bdf01357 decoder/renderer: no longer index automatically as part of the retrieve
functions

Indexing is a lengthy process and had a high chance of getting RenderWorkers
stuck doing it rather than being responsive to cache requests. This commit
introduces a system where workers never index media, but instead signal that
media is not ready to their RenderBackends which ensure that the media gets
indexed and re-queues the affected frames when those indexes are ready.
2020-02-19 11:44:29 +11:00
itsmattkc ceb70a1870 viewer: use internal texture to allow viewer to control texture as part of its
context

More intuitive code flow and allows the user to undock the viewer (which
forcibly destroys and recreates the context) and the viewer will handle
creation of the new texture in said new context.
2020-02-16 18:24:49 +11:00
itsmattkc caf0d3d42a renderer: minor code improvements 2020-02-03 01:29:03 +11:00
itsmattkc a3c932693a exportdialog: use wait for close code from previous commit when closing the
export dialog
2020-01-22 19:51:57 +11:00
itsmattkc 24f7eeb210 renderer: implemented function to wait for workers in the main thread
The workers run in separate threads meaning if any significant change is made
(e.g. parameters changing, or even closing the program), these workers may still
be mid-render. This is particularly problematic when closing since the nodes a
worker is rendering may be deleted mid-render. Render backends now have a
function that pauses the main thread (but starts a second event loop so the UI
isn't frozen) until the worker threads are all finished. This way, massive
changes can be made safely without race conditions.
2020-01-22 17:11:17 +11:00
itsmattkc fdbaa75dff renderer: allow parameters to be changed mid-session 2020-01-22 14:05:37 +11:00
itsmattkc 0bc176fd62 use less threads on cache
By using one thread per logical CPU thread, we seemed to completely saturate
the CPU which would kill the performance of the main/GUI thread (despite the
other threads being low priority). We now use half of the logical threads, which
still sees good CPU usage and minimal performance impact while allowing the
main thread to respond to user actions.
2020-01-17 04:37:47 +11:00
itsmattkc d32306f88b only disk cache around the playhead 2020-01-10 20:35:48 +11:00
itsmattkc b8aabb7e01 updated exporter to work with new frame flow 2020-01-08 02:27:47 +11:00
itsmattkc 7f796bd99f revised video renderer's invalidate cache to use ranges rather than discrete
frames

Previously, when the video renderer received a dirty cache signal, it would
proceed to extract all frames from the range and queue them. However, this could
be extremely slow for long ranges since it had to iterate through the entire
range and calculate the individual frames it contained. Now, we use the same
range combining system as audio and automatically calculate the next frame
within the range only when necessary. Essentially the same work, but split up
over time and done only when needed leading to no discernible UI pause when
invalidating cache.
2020-01-03 15:50:43 +11:00
itsmattkc e8fddc2d5b improved renderer reliability
The renderer backend can now distinguish between jobs. Previously if two jobs
of the same frame were started (which is legal if the user made a change while
frames were still being rendered), an earlier job in some situations could
finish AFTER a later job, and the backend would have no way of distinguishing
between them. This meant a frame could be erroneously set to an old value
rather than the newest. This commit introduces job identification so that old
jobs are automatically discarded.
2020-01-02 03:21:38 +11:00
itsmattkc 3a7b3ffac6 implemented audio exporting
The encoder was moved to its own thread and will transcode the PCM from the
audio renderer into the chosen codec while the video frames are still
received. The implementation isn't perfect and could use some cleaning up, but
it is functional at the moment.
2019-12-23 01:45:27 +11:00
itsmattkc 8ace197d66 improved backend encapsulation
Various backend improvements are included in this commit, mostly for the
benefit of exporting. These include:
- Moving more non-GL code from OpenGL derivatives into base classes
- An "export mode" that changes the cache behavior of video backends
- Using the Viewer's UUID introduced a few commits ago
- No longer hardcoding the pixel format/render mode in the backend (since
  they'll inevitably differ when exporting vs previewing)
- Improved signalling for frames that are completed
2019-12-20 04:35:31 +11:00
itsmattkc 3d3e40d431 minor code cleanup and fixed opengl thread desync issue 2019-12-11 03:20:23 +11:00
itsmattkc f5d66436fa attempt to use fbo clear function 2019-12-10 21:32:21 +11:00
itsmattkc c35a6d009d removed unnecessary debug messages 2019-12-10 00:57:28 +11:00
itsmattkc 26b3993b9d made vast improvements to rendering engine and node structure
This was many changes that were largely fundamentally related. They included:
- More const modifiers to enforce read only node graphs
- Support for fragment and vertex shaders from the nodes
- Support for node code loaded externally (embedded into the binary)
- Fixed issue preventing two textures from being used in a shader
- Removed several unused functions and cleaned up code
- Fixed video media node misreading its matrix input
2019-12-09 23:50:52 +11:00
itsmattkc f6064b40df hold worker busy state in renderbackend rather than in renderworker
Workers run in different threads and the backends can poll whether the worker
is currently busy or not. However the previous iteration has the worker (and an
atomic int) provide the busy state which could easily desync with the main
thread (since all workers run in different threads). By holding the busy states
in the main thread, the main thread will always be able to poll the busy state
accurately.
2019-12-06 19:38:57 +11:00
itsmattkc 5227e10f39 render one frame per thread for increased parallelism
If the nodes are now stateless, there's nothing stopping the renderer from
rendering multiple frames at once. Earlier since the nodes held some of their
input/output data (and that data could change per frame), it was not possible
to render multiple frames at once without conflicts. Now that the node state is
held in render threads, they can do whatever they want at any time.
2019-12-06 15:37:31 +11:00
itsmattkc 694f424627 finished conforming renderers to new node structure
Stateless node system is done! Functionality is about equal to the functionality
in master meaning this is ready for merging.
2019-12-06 03:43:24 +11:00
itsmattkc d25dda5275 removed all dependence on NodeOutputs
If Nodes only have the one output, we don't need to do so much differentiation
between them. Previous iteration used outputs as like a distinct function
within a Node (e.g. length output would return one result, buffer output would
produce a different result - each run different code to produce their results).
Now in this iteration, it's more accurate to say a Node is just one function
(which seems more appropriate for a node system anyway).
2019-12-06 00:23:26 +11:00
itsmattkc 88c3bd44a5 rewrote node data types as or flags
The data types can now be or'd to match broader data types.
2019-12-04 20:26:43 +11:00
itsmattkc 44d649903c copy values whenever the cache is invalidated
Since we're now working with a separate proxy copy of the original node graph,
if the user changes a parameter in one of those nodes (triggering an
InvalidateCache signal), the values in our copied graph need to be updated
with these new values too.
2019-11-23 17:06:49 +09:00
itsmattkc 2cfccbfbef copy node graph before rendering
Previous iterations would use mutexes to prevent changing of the graph
mid-render, however several user actions would need to capture these mutexes
causing the main thread to hang until the current render job (frame/range of
samples) was complete. We now copy the nodes necessary as part of the "compile"
process so that the main thread shouldn't need nearly as much blocking while
caching occurs.
2019-11-23 08:53:52 +09:00
itsmattkc 8e6c23ffc1 fixed bug that caused some frames to never render indefinitely
Frames should no longer get stuck unrendered.
2019-11-17 17:14:08 +09:00
itsmattkc 9d154e1909 use different signals when the audio invalidates vs the video
Both audio and video renderers were working off the same invalidation signal
(i.e. changing audio would also trigger a re-render of the video). This is
obviously suboptimal and now they are separate.
2019-11-17 13:44:50 +09:00
itsmattkc 40b3879440 overhauled render classes to support video AND audio
Major refactoring work to try sharing as much code as possible between the
video renderers and audio renderers, as well as make them as
platform-independent as possible.
2019-11-15 13:50:58 +09:00
itsmattkc 7a6dd02e5b furthered development of audio renderers
Mostly reimplementing functions from other workers to produce audio samples
2019-11-11 11:35:01 +09:00
itsmattkc 1206eb73b9 moved frame cache to external class that's easier to pass around 2019-11-06 23:46:44 +11:00
itsmattkc 97a4294bb3 refactoring work to improve issues with new rendering pipeline 2019-11-04 11:34:43 +11:00
itsmattkc c14125e640 work towards rewriting the render infrastructure
Mostly foundational work and re-implementing older code in a smarter way
(i.e. context creation code should be slightly faster than it was before)
2019-11-01 22:58:02 +11:00
itsmattkc b56fbaae51 began port of previous renderer iteration to new iteration
This will essentially be a full rewrite, but very incrementally to save time
and energy.
2019-10-31 21:59:20 +11:00
itsmattkc 55f7d6aa8a restored previous renderer iteration for porting 2019-10-31 20:06:11 +11:00
itsmattkc 77bcb70dac started porting renderer to new portable form 2019-10-31 19:14:58 +11:00
itsmattkc 401aff52a8 attempts at folding opencl support in 2019-10-28 18:21:20 +11:00