Commit Graph
234 Commits
Author SHA1 Message Date
itsmattkc fceb1e8d3e viewer: re-render both video and audio if parameters change 2020-02-24 11:57:39 +11:00
itsmattkc 08ed766771 audiorenderworker: fixed potential false positive in assert 2020-02-24 02:02:08 +11:00
itsmattkc ff516b6202 audiorenderworker: added assert for problematic audio behavior that could
corrupt the heap
2020-02-23 22:20:01 +11:00
itsmattkc 48cdb3a6dd memorymanager: rewrote entire memory management system 2020-02-23 20:29:51 +11:00
itsmattkc c2d518c681 audiorenderworker: fixed bad memcpy that would corrupt the heap 2020-02-23 13:46:28 +11:00
itsmattkc 813c2e411a rendercache/decodercache: moved qmutex that was only used by decodercache into
decodercache's derived class
2020-02-23 11:46:30 +11:00
itsmattkc 65db108be2 openglcolorprocessor: renamed CreateOpenGL() to Create()
We hide ColorProcessor::Create() to create a derived class rather than the
base class and clear up confusion over the two functions existing.
2020-02-22 00:34:55 +11:00
itsmattkc acb107bd92 Merge branch 'master' of https://github.com/olive-editor/olive 2020-02-22 00:14:20 +11:00
itsmattkc 77c0c9d95a viewer: ported to openglcolorprocessor for simpler code and fixed bug that
snuck in breaking color managed display
2020-02-22 00:13:28 +11:00
itsmattkc 547990b920 ffmpegdecoder/memorymanager: fixed race condition in garbage collection 2020-02-21 23:15:09 +11:00
itsmattkc e149fc0117 memorymanager: updated system calls for linux 2020-02-21 14:51:47 +11:00
itsmattkc e74c4c2d1c global: implemented rudimentary memory manager to use available system memory
without forcing the OS to page swap
2020-02-21 14:20:57 +11:00
itsmattkc 2e38e7e3fb indexmanager: moved files 2020-02-21 10:47:41 +11:00
itsmattkc be6fbfecdb videorenderworker: fixed improper QString::arg() usage 2020-02-20 19:44:48 +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 054281596e videorenderer: use qmutexlocker in more cases
Minor code cleanup.
2020-02-20 17:48:28 +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 71048f40a8 ffmpegdecoder: removed all old code to clean up 2020-02-20 02:22:59 +11:00
itsmattkc d1a9a29c5e indexmanager: removed some unused debugging code 2020-02-20 02:22:15 +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 139127ed3c Merge branch 'master' of https://github.com/olive-editor/olive 2020-02-17 13:06:09 +11:00
itsmattkc 33a85aa059 audiobackend: fixed issue where audio would be appended rather
than overwritten on some platforms

Despite the fact we don't actually do any reading here, using
QFile::WriteOnly on its own will truncate the file to 0 bytes which is
undesirable. The documentation says QFile::ReadOnly, Append or NewOnly
will prevent this. NewOnly won't work and reads are unnecessary, so
Append was used initially. However on some platforms, Append will _only_
allow writing at the end of the file (ignoring the seek() function)
meaning bytes won't be written where they're meant to be (this behavior
happens on Linux and not on Windows, the platform discrepancy is likely
a Qt bug). Using ReadWrite instead, despite not reading anything,
prevents truncation and allows for writing not at the end of the file.
2020-02-17 11:17:21 +11:00
itsmattkc 21affd4e58 renderers: add early functions for cancelling long render processes 2020-02-17 02:15:28 +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 24c926e769 renderer: use ocio config in hash as well
Fixes potential bug where the same named colorspace in a different config
would pull old/likely inaccurate cached frames.
2020-02-16 00:14:46 +11:00
itsmattkc 53106e1847 opengl: remove locks from texture
These are not used anymore and are therefore unnecessary.
2020-02-15 14:02:00 +11:00
itsmattkc b0e7ae34ba videorenderworker: improve download code 2020-02-14 14:51:40 +11:00
itsmattkc f36c635b05 openglbackend: call base function in CloseInternal() 2020-02-14 14:51:11 +11:00
itsmattkc d66425c324 prepared gl improvements for merge 2020-02-14 02:35:10 +11:00
itsmattkc 6a47b05ab8 work on oslworker 2020-02-14 02:13:38 +11:00
itsmattkc 422e447f13 oslworker: comment accelerated node function to allow compiling for now 2020-02-13 15:38:54 +11:00
itsmattkc 888e688385 work towards implementing osl as a renderer 2020-02-12 15:13:51 +11:00
itsmattkc 5e5be50959 cmake: find OSL 2020-02-08 00:14:13 +11:00
itsmattkc 1e71c0e7f5 oslbackend: began new backend classes 2020-02-05 14:49:55 +11:00
itsmattkc 91f1be90a9 opengl: isolate all functions to one thread 2020-02-03 18:14:58 +11:00
itsmattkc 776cfd87c8 renderer: minor code improvements 2020-02-03 12:41:20 +11:00
itsmattkc 0c46b0c471 decodercache: don't need thread-safe functions anymore 2020-02-03 01:29:29 +11:00
itsmattkc caf0d3d42a renderer: minor code improvements 2020-02-03 01:29:03 +11:00
itsmattkc 17c1493aa7 all time-based panels are now derived from a common base class
Cuts down on a lot of duplicate code between
TimelineWidget/ViewerWidget/CurveWidget/NodeParamView
and TimelinePanel/ViewerPanel/CurvePanel/ParamPanel since they all use similar
time functions.
2020-02-01 19:39:43 +11:00
itsmattkc 8b0c7edfec OIIO: added support for OIIO 1.x
OIIO 2.x uses std::unique_ptr while 1.x uses raw pointers. Olive can now handle
both, manually destroying the raw pointers when necessary if running on OIIO
1.x.
2020-01-26 11:33:45 +11:00
itsmattkc 3f85ce8a7a diskmanager: clearing disk cache at runtime will correctly signal renderers
Clearing the disk cache in the preferences will correctly communicate to
renderers that those frames are now deleted.
2020-01-25 12:18:46 +11:00
itsmattkc 149d125e39 msvc: updated code for higher warning level 2020-01-24 12:00:55 +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 28d0aecd0e openglcolorprocessor: delete texture when context is about to be destroyed 2020-01-20 16:09:29 +11:00
itsmattkc 562891c391 renderer: handle ffmpeg returning a zero aspect ratio
We try to handle aspect ratios in metadata (e.g. stretching 1440x1080 videos
out to 1920x1080 when requested), and FFmpeg will usually return a 1/1
aspect ratio even if it can't determine an aspect ratio. However, as mentioned
in the documentation, sometimes it returns a 0/0 aspect ratio when it can't
determine an aspect ratio, which we didn't handle and would lead to the code
allocating a buffer with a 0px height. This commit handles both 1/1 and 0/0
aspect ratios in accordance with the FFmpeg documentation.

Reference: https://www.ffmpeg.org/doxygen/4.0/structAVFrame.html#a62f9c20541a83d37db7072126ff0060d
2020-01-20 04:07:42 +11:00
itsmattkc 4697b98980 fixed gcc compile issues 2020-01-19 20:39:48 +11:00
itsmattkc 1101b58ee8 allow setting of pixel format/ocio method/sample format in preferences
Implementation isn't perfect yet, viewer/renderer doesn't update yet when
the preference is changed so a sequence needs to be re-opened for the change to
take effect.
2020-01-18 03:37:36 +11:00