Commit Graph

118 Commits

Author SHA1 Message Date
Jonathan Thomas
70e86ef044 Improved Profile Class (Helper methods, Sortable, Unit tests) (#895)
* Removing legacy profile property. Add new operators for Profile classes (for comparison). Also added new functions to generate different variations of the Profile data (key, short name, long name, long name w/description).

* Add empty constructor for Profile class, and new Profile unit tets

* Adding zero padding to profile Key function, for easier sorting: 01920x1080i2997_16:09

* Clear setfill flag after creating Key() output

* Updating example exe to load an *.osp project file via C++, which makes debugging complex broken projects much easier.

* - Add new unit test to FFmpegWriter to create an animated GIF and verify it can be wrapped with a FrameMapper (with no audio track)
- Improve FrameMapper to ignore missing audio data (i.e. when no audio samples present, don't try and find them or resample them)

* Fix some whitespace issues

* Fix inline documentation mistype

* Fixed missing reuse licensing on new example profile files

* Changing Profile::Key() format to exclude the : character, since Windows file names cannot contain that

* - Large memory leak fixed in FFmpegWriter when closing the video & audio contexts
- Reducing # of cached frames and rescalers to 1, since we no longer use OMP and this is unneeded - we need to refactor much of this code out eventually

* - Fixing whitespace issues
- Code clean-up / line wrapping / etc...
2023-02-02 16:29:38 -06:00
Jonathan Thomas
9eb5d6f903 Fixing more whitespace 2022-10-13 10:19:05 -05:00
Jonathan Thomas
5f9c4e06d8 Large performance regression fixed by moving mutex further into the Timeline::GetFrame method - only when generating a new frame (allowing cache to actually work freely). Adding mutex back to FFmpegReader::GetFrame. Removing redundant mutex from ReaderBase.h. Adding mutex to all methods that call shrink_to_fit(). 2022-10-11 18:14:36 -05:00
Jonathan Thomas
245186f2a0 Fixing some small memory related issues - uninitialized variable, RESVG initialization only for svg files, Close QtImageReader on destructor, erase allocated_effects and allocated_clips. 2022-10-10 11:17:53 -05:00
Jonathan Thomas
0419f2c2a7 Fixing some whitespace issues 2022-08-17 22:14:36 -05:00
Jonathan Thomas
02c256cda5 Fixed FrameMapper::info::video_length after calling FrameMapper::ChangeMapping(). Added some unit tests to verify. 2022-08-03 16:14:00 -05:00
Jonathan Thomas
cba676463d Fixing invalid frame mapping calculation (when using a linear algorithm to map framerates). We were accidentally adding +1 to the video_length, causing a slight rounding error, causing some random frames to be skipped.
For example, if a video with 100 frames was mapped to the same framerate, we would calculate the frame increment: 101 / 100 (instead of 100 / 100). In this simple example, the value increment should be 1.0, matching the source frames exactly.
2022-06-25 17:42:30 -05:00
Jonathan Thomas
fbd0ecfc83 Merge branch 'develop' into caching-timing-improvements 2022-02-13 10:59:27 -06:00
Jonathan Thomas
32347a4c60 Fixing memory issues with FrameMapper, Cache, and Keyframe objects (which use vectors that can hold tons of objects, and were not fully releasing the memory on the heap until the program terminates) 2022-02-02 18:32:47 -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
FeRD (Frank Dana)
8344e5c7a1 FrameMapper: Reformat logging calls 2022-01-12 11:02:52 -05: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
FeRD (Frank Dana)
fe58e8028d Move some headers around 2021-11-01 11:04:31 -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
Frank Dana
b8b55050dc Merge pull request #661 from ferdnyc/redirect-print-fxns
Make console-output functions redirectable; add operator<< for Fraction, Point, Coordinate; new KeyFrame::PrintPoints & PrintValues with unit tests
2021-09-26 23:16:49 -04:00
Frank Dana
fbe0242837 FFmpeg: Create, use av_err2string() (#689)
- Previously 'av_make_error_string' was defined in FFmpegUtilities.h
  for the sole purpose of redefining `av_err2str()` as a call to that
  function. `av_err2str()` was then used in our code, often in string
  contexts where its output was cast to `std::string`.
- Since that was excessively circular, instead the function is named
  `av_err2string()`, and it's used directly in contexts where a
  std::string is expected.
- `av_err2str()` is still #defined as `av_err2string(...).c_str()`
2021-08-11 03:58:45 -04:00
FeRD (Frank Dana)
528919027c Code formatting 2021-06-11 06:13:22 -04:00
FeRD (Frank Dana)
9d79b394c4 Make remaining print functions testable 2021-06-11 06:10:12 -04:00
Jonathan Thomas
1dba02f5b0 Added new unit test which distributes audio samples between many different framerates (30/1, 24/1, 30000/1001, 119/4), and fixes a huge issue with mapping frame numbers incorrectly causing audio crackles/pops. Also fixes a bug which causes crashes on NON-STEREO channel layouts. 2021-04-08 22:34:48 -05: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
e5d5d82050 - Simplifying the FrameMapper Clip::AdjustFrameNumber method
- Removing transformed == true boolean (Qt should be smart enough to optimize for blank transforms)
- Fixing regression from TimelineBase import
2020-10-20 13:03:10 -05:00
FeRD (Frank Dana)
a1e44edad4 Merge branch 'develop' into clip-refactor-keyframes 2020-10-19 16:28:49 -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