Commit Graph

234 Commits

Author SHA1 Message Date
Jonathan Thomas
35d4629df6 Large refactor to caching and playback timing:
- Support different speeds (-1X, 2X, 4X, etc...)
 - Clamp getFrame between 1 and timeline length
 - Support rewind using new timing code
 - Caching in both directions (based on previous speed)
 - Removing mutex from Timeline::GetFrame (cached path)
 - Caching supports actual speed now
 - Bust cache and trigger pre-roll if we encounter too many uncached frames. This will re-sync the video + audio threads.
 - Sleep less in cache loop / Adjusting min frames to 24 (trial and error). Too few and backwards playback suffers. Too many and all playback waits.
2022-02-09 17:29:04 -06:00
Jonathan Thomas
133bae40c3 Adding pre-roll to VideoCacheThread, and making video & audio threads wait for the isReady() method before playing. Also fixed an audio bug where our internal buffer was not being cleared on seek. Removed some unused caching from Clip, and did some minor refactor on FrameMapper/Clip cache clearing. 2022-01-26 17:56:33 -06:00
Jonathan Thomas
a5f35fb42a Refactoring the VideoCacheThread to check every frame before requesting it. Adding a new method: Contains() to our cache objects, to facilitate this. Removing cache clearning experimental code from Timeline (causing playback issues). Refactoring PrivatePlayer playback timing code, to calculate an average # of frame difference between audio and video threads, and slowly adjust back towards zero when needed. 2022-01-14 15:16:04 -06:00
FeRD (Frank Dana)
59108504e3 Code changes for compatibility with JUCE 6.x
- Replace all juce::CriticalSection with std::recursive_mutex
- Replace all juce::AudioSampleBuffer with juce::AudioBuffer<float>
- Eliminate implicit reliance on 'using namespace juce;'
- Replace OpenShotAudio.h includes with targeted juce modules
2021-11-09 06:22:25 -05:00
Jonathan Thomas
eae3fb130d Adding in a limit on video playback sleep, so we don't get a huge, runaway wait time. Also adding in a kill time when shutdown threads (so we don't wait indefinitely for them to stop) 2021-11-04 17:33:14 -05:00
Frank Dana
b9833b71ab Merge pull request #687 from ferdnyc/timeline-inheritance
Fix inheritance of TimelineBase::Clips(), and add unit test
2021-10-24 02:19:19 -04:00
Frank Dana
59138ea3e4 Adopt license management via Reuse project/tool (#711)
* reuse-managed license/copyright headers

reuse is a tool for compliance with the REUSE recommendations. See
<https://reuse.software/> for more information, and
<https://reuse.readthedocs.io/> for the online documentation.

* Set jsoncpp license
* Add MIT license for Decklink sources
* Explicitly license examples/
  - Add headers to source files
  - Change blanket licensing in .reuse/dep5 to only cover binary media
  - Import CC-BY-3.0 license and assign to sintel_trailer
2021-10-16 01:26:26 -04:00
Jonathan Thomas
15e5285206 Support for anamorphic profiles, i.e. non-square pixels. Fixes include Frame::Display, Frame::Save, and Timeline::SetMaxSize, all which had various issues. Added sample_aspect_ratio to FFmpegWriter, so the exported videos will continue to be anamorphic.
Also fixed some waveform issues, which were not appearing, or appearing squished, and sometimes containing gaps.
2021-10-07 13:45:16 -05:00
Frank Dana
2b2cf3fd94 Merge branch 'develop' into timeline-inheritance 2021-09-27 10:56:21 -04:00
FeRD (Frank Dana)
e45d798c90 Revert final_cache size breakage
Reverting the "Adjusting Timeline final_cache to match the video
caching thread max_frames, so one doesn't clobber the other." part of
a previous commit.

Setting the cache size in SetMaxSize() ignores OpenShot's cache
preferences. It prevents using a cache larger than the preview
buffer, which is often a desirable thing.

This partially reverts commit 0c4e1bcce4.
2021-09-20 09:20:48 -04:00
FeRD (Frank Dana)
2257aec524 Timeline/Base: Fix Clips() inheritance 2021-06-10 08:17:26 -04:00
Brenno
cd7d6fe00c Merge remote-tracking branch 'origin/develop' into effect-parenting 2021-05-24 11:01:28 -03:00
Jonathan Thomas
a505f875d1 Refactoring timeline_frame_number out of apply_layer() and TimelineInfoStruct, we already have this data in scope (on the background frame instance) 2021-05-20 13:15:13 -05:00
Jonathan Thomas
441cb186f6 Refactor of global timeline effects, to address a regression with global/timeline Mask/Transitions no longer working correctly. This was caused by an optimization that broke the general behavior of the global transitions. 2021-05-18 14:25:36 -05:00
Brenno
2c9d2f2a32 OpenCV is again an optional dependency 2021-04-15 22:05:35 -03:00
Brenno
99b5d1e7ab Fixed variable names and comments
thanks to Frank Dana
2021-04-12 21:18:21 -03:00
FeRD (Frank Dana)
c8c92b5c5d Merge branch 'develop' into effect-parenting 2021-04-10 19:26:22 -04:00
FeRD (Frank Dana)
8227a91502 Timeline: Add constructor accepting ReaderInfo 2021-03-31 20:20:16 -04:00
Brenno
8b861f0ff3 Merge remote-tracking branch 'origin/develop' into effect-parenting 2021-03-02 20:35:25 -03:00
Jonathan Thomas
0e30ecccfd Removing caching from Clip object. Causes too many issues and does not add any performance (in my tests) 2021-02-18 16:14:14 -06:00
Jonathan Thomas
3daa5bdb7b Large refactor of OpenMP integration (or rather the removal of OpenMP on the Timeline and FFmpeg-related classes). The logic behind this decision, was based on profiling libopenshot and the amount of wasted CPU idle time on all the various threads. The slow code is still synchronous, and all the threads must wait on each other, adding additional overhead. So, removing lots of unneeded threads, and simplifying the underlying Timeline->Clip->FFmpegReader flow. Also, removed 2 calls to QPainter::drawImage, by improving the flexibility of Clip->GetFrame. 2021-02-17 19:44:44 -06:00
Jonathan Thomas
15695e3c0c Reducing the # of threads on the Timeline in half, with a minimum of 4. Trying to experiment and reduce stuttering. 2021-02-05 18:18:31 -06:00
Jonathan Thomas
0c4e1bcce4 Improving performance after working with google-prof, to profile CPU. Calling OMP_MP_NUM_PROCESSORS less often, since it's quite expensive according to profiling. Adjusting Timeline final_cache to match the video caching thread max_frames, so one doesn't clobber the other. Also, fixing an issue with openshot-player, where a video file with no audio skips horribly. 2021-02-04 17:28:07 -06:00
Brenno
67895f7c23 Added support to set an effect's properties by it's parent effect 2021-02-04 16:11:27 -03:00
Brenno
c0c2a82336 Merge branch 'develop' into keyframe-refactor 2021-02-01 14:22:41 -03:00