Commit Graph

282 Commits

Author SHA1 Message Date
Jonathan Thomas 83d4d1f8ea Improving cache invalidation during playback, to add an epoch counter to Timeline, so we know when an update took place outside of timeline (i.e. in our video cache thread) and can rescan our entire cache range for potentially missing frames after cache invalidation). 2026-03-01 17:45:02 -06:00
Jonathan Thomas 90d0710d78 Fixing some regressions in performance of Mask effect, and flickering cached frames during updates (i.e. property slider updates) 2026-03-01 16:56:42 -06:00
Jonathan Thomas 4387f8b394 - Timeline composition no longer mutates cached clip frames (fixes trails/ghosting).
- Clip updates via ApplyJsonDiff now also clear clip cache (not just timeline/reader ranges).
- Added regressions for cache invalidation + no cached-frame mutation; kept paused preroll/cache-bar behavior intact.
2026-03-01 14:19:27 -06:00
Jonathan Thomas 1ad401c66d - Added a new common mask_reader feature at EffectBase, so all video effects can be mask-limited automatically (audio effects ignore it).
- Added optional Mask Mode overrides for Blur, Saturation, Brightness, Hue, Pixelate, and Sharpen (Limit to Mask, Vary Strength).
- Kept unified mask property naming (mask_reader) with legacy JSON compatibility where needed.
- Added/updated unit tests for base mask behavior, per-effect mode behavior, and JSON round-trips.
- Fixed profile tests to write generated files into the build/test directory instead of the source examples/ folder.
2026-02-23 00:00:33 -06:00
Jonathan Thomas 16f791a55a Adding missing <sstream> includes for older compilers, and because it should be included anyway 2025-12-16 18:23:57 -06:00
Jonathan Thomas 355bea44d9 Fixing small regression on initial rotation keyframes from our previous commit. 2025-11-18 13:43:40 -06:00
Jonathan Thomas a7dfc596ca Fixing regression in Clip::init_reader_rotation() function, which could sometimes override scale_x and scale_y, when a rotation keyframe contained more than 1 point. 2025-11-13 16:18:18 -06:00
Jonathan Thomas 7e29fc0935 Improving audio directionality, with new function: SetAudioDirection(), so we can safely flip audio buffer direction when needed (i.e. time curves, reversed time). Also adding a new SetDirectionHint function to FrameMapper class - so our Clip class can inform the FrameMapper of its direction at any given moment. Also, clear resampler when changing directions inside a Time curve (since the audio buffer will be flipped - the resampler internal cache must be cleared). 2025-10-11 16:29:11 -05:00
Jonathan Thomas fd2952752d Improving audio directionality, with new function: SetAudioDirection(), so we can safely flip audio buffer direction when needed (i.e. time curves, reversed time). Also adding a new SetDirectionHint function to FrameMapper class - so our Clip class can inform the FrameMapper of its direction at any given moment. Also, clear resampler when changing directions inside a Time curve (since the audio buffer will be flipped - the resampler internal cache must be cleared). 2025-10-11 13:43:15 -05:00
Jonathan Thomas c165eca5d8 Improving AudioWaveformer to be able to correctly generate waveforms for time-curved clips that have a modified duration/video_length (i.e. repeated clips, slowled down clips, etc...). Adding a new ReaderBase.h VideoLength() that can be overridden in Clip.cpp when time curves are involved. 2025-09-22 12:28:12 -05:00
Jonathan Thomas 523ef17aa4 Adding composite/blend modes to libopenshot:
-Normal
-Darken
-Multiply
-Color Burn
-Lighten
-Screen
-Color Dodge
-Add
-Overlay
-Soft Light
-Hard Light
-Difference
-Exclusion
2025-09-12 17:47:41 -05:00
Jonathan Thomas d77f3e5338 Improving performance on Clip class:
- Replacing alpha with QPainter SetOpactity (much faster)
- Fixing get_file_extension to not crash with filepaths that do no contain a "."
- Removing render hints from apply_background (since no transform or text rendering), making compositing (faster in certain cases)
- Optionally adding SmoothPixmapTransform based on a valid transform (faster in certain cases)
- Skip Opacity for fully opaque clips
- New Clip unit tests to validate new functionality
2025-09-12 14:54:46 -05:00
Jonathan Thomas dd62f5b49e Protecting clip GetFrame from crash due to null frame, then setting the ->number property of a null frame. 2025-09-05 14:48:35 -05:00
Jonathan Thomas 37bdcacddf Add initial rotation and scale_x, scale_y keyframes when adding a new clip for a file with "rotate" metadata. 2025-03-11 18:28:28 -05:00
Jonathan Thomas e81e7922b2 Adding alpha to JSON properties of wave_color (for the clip class). 2025-03-10 17:43:31 -05:00
Jonathan Thomas ace980eb67 Import GIF formatted images using FFmpeg, to allow for animation and alpha channels. 2025-03-01 17:12:55 -06:00
Jonathan Thomas ffb63f55fa Fixing aspect ratio of tracked objects, since the tracked object often is of varying aspect ratios (since the parent clip and tracked object can change over time). Clips which are parented to tracked objects now respect the scale_type (i.e. best fit, stretch, etc...). 2024-03-03 16:49:26 -06:00
Jonathan Thomas 8b47373c1e Fix race condition causing clip to clip parents not to work. Adding a late-bound check, to ensure we have attached the clip on first call. 2024-03-01 21:40:55 -06:00
Jonathan Thomas 620e894409 Fixing parentClipObject and parentTrackedObject transform, so the parent clip can be scaled and moved without breaking the tracking. Also refactoring out unneeded complex code left over. 2024-03-01 16:47:52 -06:00
Jonathan Thomas 3351b52e77 Clear previous parent selection, when switching between Clip and Tracked object 2024-02-28 15:29:35 -06:00
Jonathan Thomas 15be792564 Refactor of clip caching, to prevent caching flattened images with previous layers, replace std::shared_ptr<openshot::Frame> with QSize for a few arguments to make it much more clear what is happening. 2024-02-25 23:38:57 -06:00
Jonathan Thomas 4af80925b2 Ignore NULL nodes in JSON arrays (clips, effects). This can happen sometimes (for an unknown reason), and it currently crashes OpenShot when attempting to Export a video. 2023-10-07 15:19:36 -05:00
Jonathan Thomas 26c18fd76c Refactor of effect handling, to allow effects to be applied BEFORE or AFTER a clip's keyframes are applied. For example, this allows for a mask to apply after an animation/movement is applied to the clip image, like an animated scrolling credits to be masked/faded in a static location. 2023-05-24 17:12:15 -05:00
Jonathan Thomas f544d84f48 Fixing memory leak on Clips, where we were not clearing cache on Close, or forcing Close on destruction. Especially noticeable on projects with a ton of clips. Tweaking unit tests to prevent crash due to new Clip destructor behavior when using stack variables. 2023-04-19 16:08:36 -05:00
Jonathan Thomas 96650934fb Merge pull request #915 from OpenShot/sentry-invalid-property-data
Prevent crash in ObjectDetection (due to NULL parentClip)
2023-04-16 16:12:16 -05:00