Commit Graph

351 Commits

Author SHA1 Message Date
Jonathan Thomas
01d16fe04a Experimental: Adding more QImage clean-up logging, to track buffer addresses 2022-07-26 21:40:28 -05:00
Jonathan Thomas
0164bd28be Experimental: Change method of copying QImage from previous frames to use qimage.copy method. 2022-07-26 15:40:57 -05:00
Jonathan Thomas
f2852e8c34 Experimental: additional logging around AddImage() calls 2022-07-26 15:21:25 -05:00
Jonathan Thomas
89321d3bae Experimental: adding debug logging to Frame destructor and QImage cleanup. Also, preventing processing of empty samples 2022-07-26 15:09:57 -05:00
Jonathan Thomas
297349033e Experimental FFmpegReader::Close changes, adding new drain decoder logic on Close 2022-07-25 16:27:31 -05:00
Jonathan Thomas
68f273d9d1 Experimental FFmpegReader::Close changes 2022-07-23 19:44:01 -05:00
Jonathan Thomas
3883d2d8aa Experimental FFmpegReader::Close changes 2022-07-23 18:47:42 -05:00
Jonathan Thomas
70bf0ade98 Refactoring FFmpegReader::Close, trying to prevent a crash on Windows 2022-07-22 18:00:28 -05:00
Jonathan Thomas
54971bac84 Removing some logic in FFmpegReader::Close which clears the video and audio stream - which can cause a crash if the decoder is still working on a packet. Reverting this code. 2022-07-22 17:04:52 -05:00
Jonathan Thomas
156fed2f49 Adding debugging to FFmpegReader::Close and removing a discard property that is probably unneeded 2022-07-22 16:50:02 -05:00
Jonathan Thomas
671e8ce455 Clean up of whitespace, and removal of unneeded logic on CheckWorkingFrames() method. It is okay to finalize a frame from a stream that has not decoded a packet yet... although it would be unlikely. 2022-07-21 16:50:23 -05:00
Jonathan Thomas
9202d94ee6 Fixing whitespace issues (converting spaces back to tabs... for now) 2022-07-21 15:00:08 -05:00
Jonathan Thomas
f200c00e4c Fixing Codacy issues 2022-07-21 14:21:44 -05:00
Jonathan Thomas
f4966b2567 Large refactor of timestamps on FFmpegReader (PTS / presentation time stamps):
- Improved PTS offset logic (to offset our streams so that at least one of them starts at position 0.0)
- Removed missing frame detection (no needed anymore)
- Use timestamps to reason about missing frames
- Fixed many async decoding issues (jumbled frames, missing beginning or ending frames)
- Much improved support for video/audio files with missing chunks/gaps (i.e. missing timestamps)
- Improved CheckWorkingFrames() method, to determine when working frames are ready to be finalized
- Improved FPS detection for invalid or missing FPS
2022-07-21 13:56:29 -05:00
nick black
99034feb4e constify some AVCodecIDs, necessary for new ffmpeg
Signed-off-by: nick black <dankamongmen@gmail.com>
2021-11-22 00:09:08 -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
311d86957e Include FFmpegUtilities.h earlier (#764) 2021-10-27 06:49:27 -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
9c668e4de9 Merge pull request #752 from OpenShot/duration-detection-improvements
Better detection of duration, especially for audio-only files
2021-10-08 16:08:08 -05:00
Jonathan Thomas
7fa3782bdb Better detection of duration, especially for audio-only files. Improved PTS offset detection (for when start_time is used), mainly things recorded from streams. Better bitrate detection as well. 2021-10-07 13:40:31 -05:00
Frank Dana
d78ac099d6 CodeQL fixes, take 2 (#745)
* Protect values against integer overflow

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.

* Apply these fixes correctly
2021-10-03 07:01:56 -04:00
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
Jonathan Thomas
1c2786de35 SCALE_NONE was incorrectly sizing SVG, Image, and Video files. Since OpenShot changes the preview window size during editing, the SCALE_NONE clips should always be scaled to the ratio: preview / timeline... so they stay relative sized to the timeline size.
For example, if an SVG is 500px wide, and the project is 1000px wide... the SVG in SCALE_NONE mode should always be 50% with width of the video, regardless of how small you make the preview window.
2021-08-11 12:10:46 -05:00
Jonathan Thomas
9ca63b321a Reverting video_timestamp increment logic which used pkt.duration. In some codecs (such as vp8), this approach breaks due to differences in the timebase vs the framerate. For example, if the timebase is an inverse of the FPS, everything works. But if the timebase is not, for example 1/1000000, this approach breaks. 2021-07-03 17:01:55 -05:00