Commit Graph

208 Commits

Author SHA1 Message Date
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
FeRD (Frank Dana)
8227a91502 Timeline: Add constructor accepting ReaderInfo 2021-03-31 20:20:16 -04: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
FeRD (Frank Dana)
2f3615f706 Move Exceptions.h includes to .cpp files 2021-01-26 10:52:04 -05:00
Frank Dana
6009a26e4c Eliminate TooManySeeks exception (#611)
Since commit bfa050409c (2015-08-24),
there is no code in libopenshot which ever throws TooManySeeks.

- Removed catch() statements for TooManySeeks from multiple functions
- Removed the exception from Exceptions.h
- in Qt/AudioPlaybackThread.h:
  - Removed the "SafeTimeSliceThread" class definition, as it only
    existed to catch TooManySeeks.
  - Replaced SafeTimeSliceThread with a standard juce::TimeSliceThread
2021-01-01 05:24:48 -05:00
Jonathan Thomas
f5d6ee22e7 Reverting 'clear the cache when the user seeks' experiment. It was a failed experiement, not to mention that it destroys performance on the "Transform" tool. 2020-12-31 18:09:39 -06:00
Jonathan Thomas
ac73bd965d Fixing an issue caused by timeline::GetClip returning a ClipBase instead of a Clip (broke waveform generation).
Also adding a swig definition for the Caption effect.
2020-12-03 10:52:27 -06:00
Jonathan Thomas
172348417c Improvement to video caching thread, to recover from the separation of cache vs display frame #. Also found a mutex that was needed, to prevent crashing when the video thread calls timeline::GetFrame at certain times... colliding with another thread (and independent of OpenMP). 2020-10-23 17:52:20 -05:00
Jonathan Thomas
e556d0fded Added 2 new unit tests for Clip's with a Timeline associated with them, and FFmpegReaders with a Clip/Timeline associated with them. 2020-10-23 01:35:46 -05:00
FeRD (Frank Dana)
a1e44edad4 Merge branch 'develop' into clip-refactor-keyframes 2020-10-19 16:28:49 -04:00
Jonathan Thomas
d2521bcbff Fixing some additional cpp_test complaints 2020-10-19 16:22:27 -04:00
Jonathan Thomas
ab4916247b Replacing audio fix implementation with ParentClip(), to access clip start and position (if any) 2020-10-19 16:05:01 -04:00
Brenno
a4109419ac Implemented position remapper inside FrameMapper to fix audio noise when exporting to different fps
The FrameMapper class now receives the updated clip position and returns the correct amount of samples for a given frame number
2020-10-19 16:05:01 -04:00
Jonathan Thomas
b3ad76ddf7 Fixing some regressions on image merging 2020-10-19 16:05:01 -04:00
Jonathan Thomas
8387b124ad Large refactor of Timeline, TimelineBase, ClipBase, and Clip, to allow a Clip access to the parent timeline instance (if available), and thus, certain properties (preview size, timeline FPS, etc...). This allows for a simpler rendering of Clip keyframes (during the Clip::GetFrame method), and a simpler Timeline class, that can change the preview window size dynamically and no longer requires a Singleton Settings class.
- Also removed "crop" from Clip class, as it was never implmeneted correctly, and we have a fully functional "crop" effect when needed
 - Added caching to Clip class, to optimize previewing of cached frames (much faster than previous)
2020-10-19 16:05:01 -04:00
Jonathan Thomas
6da4e8fded Fixed a bug with cropping logic on Clip (disabled it temporarily). I need to replace the Crop functionality with a more robust cropping tool. Also, updated Timeline to use the MaxWidth/MaxHeight settings when calling the clip (since those are set when the screen is resized). 2020-10-19 15:46:43 -04:00
Jonathan Thomas
eb328f1190 Refactored the Settings::Instance()->MAX_WIDTH and Settings::Instance()->MAX_HEIGHT out of the Cilp class. GetFrame() now has an overload which specifies the width, height, and samples needed. Otherwise, it returns the Clip image based on the source reader (width, height, num samples). 2020-10-19 15:46:42 -04:00
Jonathan Thomas
000c9d6d4c - Refactoring all Timeline drawing code into the Clip class
- Making Clip a proper Reader (so it can be used directly, instead of a Timeline)
2020-10-19 15:45:37 -04:00
FeRD (Frank Dana)
aa40ea29e0 Update include paths in all source/header files 2020-10-18 07:43:37 -04:00
Jonathan Thomas
ef80439b62 Merge pull request #530 from ferdnyc/omp-and-ffmpeg-classes
Move off deprecated OpenMP API, fix FFmpeg code paths
2020-10-16 14:45:20 -05:00
Frank Dana
20c75ff227 Const temporary variable 2020-09-10 18:39:24 -04:00