Commit Graph

176 Commits

Author SHA1 Message Date
Frank Dana
3d18347e71 Protect values against integer overflow (#743)
When the code multiplies integer values in an rvalue context before
it's stored in a larger type, the on-the-fly math is stored as int.
The value can overflow before it reaches the wider memory space.

To prevent this, we explicitly cast the result of the arithmetic
to the destination type.

Issues flagged by GitHub CodeQL.
2021-09-27 20:36:56 -04:00
FeRD (Frank Dana)
369555b4b0 Fix pedantic warnings (unnecessary ;s) 2021-08-10 23:47:18 -04:00
Frank Dana
4e4a95c648 Gitlab-CI: Update Windows builder configs, OpenShotAudio linking; enable Windows unit tests (#657)
* Remove no-longer-used cmake Modules

* Don't use OpenShot.h in ExampleHtml.cpp

When `#include`-ing the whole mess, building the file was leading
to what looked like out-of-memory errors. Replacing the monolithic
header with just the necessary ones cleared it up.

* .gitlab-ci.yml: Update for new Windows setup

* Make unit tests work under Windows

- Copying the built and depended (libopenshot-audio) DLLs into
  the unit test dir before building the tests ensures that when
  the test executables are run by the Catch.cmake module to
  discover their contents, the executables will find the DLLs
  they need in order to run.

* Gitlab-ci: Run unit tests on Windows

* Rename openshot-html-example

(The former name, openshot-html-test, was too close to the new
name format for all of our unit test executables, making things
unnecessarily confusing.)

* Rename JuceHeader.h to OpenShotAudio.h

* Github Actions: Install ALSA libs

With the switch to an EXPORTED CMake configuration for
libopenshot-audio, its dependencies become our dependencies.
Which means that CMake now correctly requires that the ALSA
libs be installed.
2021-04-19 15:59:52 -04:00
Jonathan Thomas
563c8fd5da Fixing regression with Waveform generation. 2021-02-18 16:05:08 -06:00
Jonathan Thomas
66eb3d5ed6 Disabling Clip caching and fixing a bug with waveform() 2021-02-17 20:40:32 -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
Brenno
f6de53350f Minor fixes
- Moved TimeUtil from header to src
- Fixed issue with Qimage -> Mat conversion
2021-01-13 20:22:17 -03:00
Brenno A. C. Caldato
73bf7390e9 Apply suggestions from code review
Co-authored-by: Frank Dana <ferdnyc@gmail.com>
2021-01-13 19:30:46 -03:00
Jonathan Thomas
df154c3844 Fixing color format for opencv conversion 2020-10-30 18:23:45 -05:00
Brenno
b48025cd1f Apply suggestions from code review
Applying suggestions from @jonoomph
2020-10-29 00:21:28 -03:00
Brenno
a9274df96b Resolving conflicts 2020-10-20 01:04:59 -03:00
Brenno
1626e1eeba Merge branch 'clip-refactor-keyframes' into opencv 2020-10-19 22:29:48 -03:00
FeRD (Frank Dana)
a1e44edad4 Merge branch 'develop' into clip-refactor-keyframes 2020-10-19 16:28:49 -04:00
FeRD (Frank Dana)
aa40ea29e0 Update include paths in all source/header files 2020-10-18 07:43:37 -04:00
Jonathan Thomas
1dfbb0e771 Merge branch 'develop' into clip-refactor-keyframes
# Conflicts:
#	src/CacheDisk.cpp
#	src/Clip.cpp
#	src/Frame.cpp
#	src/QtHtmlReader.cpp
#	src/QtImageReader.cpp
#	src/QtTextReader.cpp
#	src/effects/Bars.cpp
#	src/effects/Crop.cpp
2020-10-16 15:32:43 -05:00
Jonathan Thomas
8f6c64215e Merge pull request #556 from ferdnyc/use-make-shared
Use std::make_shared to allocate shared ptrs, instead of std::shared_ptr constructors
2020-10-16 14:48:14 -05:00
Jonathan Thomas
6bd7fb7235 Replacing ARGB32_Premultiplied with Format_RGBA8888_Premultiplied, which still seems to benefit from performance, but keeps the byte order the same as before. win win 2020-10-14 03:06:30 -05:00
Jonathan Thomas
94059828d5 Converting RGB8888 to ARGB32_Premultiplied (for performance reasons) 2020-10-13 18:18:10 -05:00
Jonathan Thomas
04960cb2c2 Merge branch 'develop' into opencv 2020-09-23 14:44:53 -05:00
FeRD (Frank Dana)
0bcf1e4924 Frame: Reduce code duplication 2020-09-13 19:56:40 -04:00
FeRD (Frank Dana)
9c83429ab1 Frame: Use delegating constructors 2020-09-13 16:35:35 -04:00
FeRD (Frank Dana)
1c8aea94d0 Frame: Put Qt includes where they're used 2020-09-13 16:28:31 -04:00
Frank Dana
e500cae9f5 Replace sleep()/usleep() with std::chrono calls (#473) 2020-09-02 02:07:54 -04:00
FeRD (Frank Dana)
c14922d57e Frame.cpp/h: Fix a bunch of wrong comments
Best reason not to narrate the code in the comments: The code gets
changed, but the documentation doesn't.
2020-08-20 20:40:55 -04:00
FeRD (Frank Dana)
3c2532b4de Use std::make_shared to allocate shared ptrs
std::make_shared does in a single allocation what the constructors
for std::shared_ptr usually take at least 2 allocations to do.
May give us an infinitesimal performance/memory improvement.

https://www.modernescpp.com/index.php/memory-and-performance-overhead-of-smart-pointer
2020-08-20 16:50:12 -04:00