Skip to content

Commit

Permalink
Merge branch 'develop' into debug-to-stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Sep 18, 2020
2 parents b3e5eec + 66121bf commit e5e7b27
Show file tree
Hide file tree
Showing 45 changed files with 841 additions and 436 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Expand Up @@ -16,7 +16,7 @@ linux-builder:
- unzip artifacts.zip
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
- mkdir -p build; cd build;
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"PYTHON_MODULE_PATH=python" -D"RUBY_MODULE_PATH=ruby" -DCMAKE_BUILD_TYPE:STRING=Release -DUSE_SYSTEM_JSONCPP=0 ../
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"PYTHON_MODULE_PATH=python" -D"RUBY_MODULE_PATH=ruby" -DCMAKE_BUILD_TYPE:STRING=Release -DAPPIMAGE_BUILD=1 -DUSE_SYSTEM_JSONCPP=0 ../
- make
- make install
- make doc
Expand All @@ -27,7 +27,7 @@ linux-builder:
except:
- tags
tags:
- linux
- linux-bionic

mac-builder:
stage: build-libopenshot
Expand All @@ -43,7 +43,7 @@ mac-builder:
- unzip artifacts.zip
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
- mkdir -p build; cd build;
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_PREFIX_PATH=/usr/local/qt5/5.5/clang_64 -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib -DPYTHON_MODULE_PATH=python -DPython_FRAMEWORKS=/Library/Frameworks/Python.framework/ -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" -D"CMAKE_OSX_DEPLOYMENT_TARGET=10.9" -D"CMAKE_INSTALL_RPATH_USE_LINK_PATH=1" -D"ENABLE_RUBY=0" ../
- cmake -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" -DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_PREFIX_PATH=/usr/local/qt5.15.X/qt5.15/5.15.0/clang_64/ -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib -DPYTHON_MODULE_PATH=python -DPython_FRAMEWORKS=/Library/Frameworks/Python.framework/ -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" -D"CMAKE_OSX_DEPLOYMENT_TARGET=10.9" -D"CMAKE_INSTALL_RPATH_USE_LINK_PATH=1" -D"ENABLE_RUBY=0" ../
- make
- make install
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID" > "install-x64/share/$CI_PROJECT_NAME"
Expand Down
30 changes: 0 additions & 30 deletions .travis.yml
Expand Up @@ -32,11 +32,6 @@ addons:
- curl

jobs:

# The FFmpeg 3.2 backport PPA has gone missing
allow_failures:
- name: "FFmpeg 3.2 GCC (Ubuntu 16.04 Xenial)"

include:
- name: "Coverage + FFmpeg 3.4 GCC (Ubuntu 18.04 Bionic)"
env:
Expand Down Expand Up @@ -99,31 +94,6 @@ jobs:
- libavresample-dev
- libomp-dev

- name: "FFmpeg 3.2 GCC (Ubuntu 16.04 Xenial)"
env:
- BUILD_VERSION=ffmpeg32
- CMAKE_EXTRA_ARGS=""
- TEST_TARGET="os_test"
os: linux
dist: xenial
addons:
apt:
sources:
- sourceline: 'ppa:openshot.developers/libopenshot-daily'
- sourceline: 'ppa:jon-hedgerows/ffmpeg-backports'
packages:
- *p_common
- libavresample-dev
- libavcodec57
- libavdevice57
- libavfilter6
- libavformat57
- libavresample3
- libavutil55
- libpostproc54
- libswresample2
- libswscale4

- name: "FFmpeg 2 GCC (Ubuntu 16.04 Xenial)"
env:
- BUILD_VERSION=ffmpeg2
Expand Down
13 changes: 7 additions & 6 deletions CMakeLists.txt
Expand Up @@ -76,6 +76,7 @@ option(DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF)
option(ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+)" OFF)
option(ENABLE_TESTS "Build unit tests (requires UnitTest++)" ON)
option(ENABLE_DOCS "Build API documentation (requires Doxygen)" ON)
option(APPIMAGE_BUILD "Build to install in an AppImage (Linux only)" OFF)

# Legacy commandline override
if (DISABLE_TESTS)
Expand All @@ -91,12 +92,6 @@ if(DEFINED ENABLE_TESTS)
set(ENABLE_TESTS ${ENABLE_TESTS} CACHE BOOL "Build unit tests (requires UnitTest++)" FORCE)
endif()

########## Configure Version.h header ##############
configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY)
# We'll want that installed later
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/OpenShotVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot)

#### Work around a GCC < 9 bug with handling of _Pragma() in macros
#### See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND
Expand Down Expand Up @@ -142,6 +137,12 @@ endif()
############## PROCESS src/ DIRECTORIES ##############
add_subdirectory(src)

########## Configure Version.h header ##############
configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY)
# We'll want that installed later
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/OpenShotVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot)

################### DOCUMENTATION ###################
# Find Doxygen (used for documentation)
set(DOCS_ENABLED FALSE) # Only set true if Doxygen is found and configured
Expand Down
34 changes: 19 additions & 15 deletions README.md
@@ -1,6 +1,6 @@
OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to
delivering high quality video editing, animation, and playback solutions to the
world.
OpenShot Video Library (libopenshot) is a free, open-source C++ library
dedicated to delivering high quality video editing, animation, and playback
solutions to the world.

## Build Status

Expand All @@ -15,7 +15,8 @@ world.
* Time Mapping (Curve-based Slow Down, Speed Up, Reverse)
* Audio Mixing & Resampling (Curve-based)
* Audio Plug-ins (VST & AU)
* Audio Drivers (ASIO, WASAPI, DirectSound, CoreAudio, iPhone Audio, ALSA, JACK, and Android)
* Audio Drivers (ASIO, WASAPI, DirectSound, CoreAudio, iPhone Audio,
ALSA, JACK, and Android)
* Telecine and Inverse Telecine (Film to TV, TV to Film)
* Frame Rate Conversions
* Multi-Processor Support (Performance)
Expand All @@ -27,19 +28,21 @@ world.

## Install

Detailed instructions for building libopenshot and libopenshot-audio for each OS. These instructions
are also available in the /docs/ source folder.
Detailed instructions for building libopenshot and libopenshot-audio for
each OS. These instructions are also available in the `/docs/` source folder.

* [Linux](https://github.com/OpenShot/libopenshot/wiki/Linux-Build-Instructions)
* [Mac](https://github.com/OpenShot/libopenshot/wiki/Mac-Build-Instructions)
* [Windows](https://github.com/OpenShot/libopenshot/wiki/Windows-Build-Instructions)

## Hardware Acceleration

OpenShot now supports experimental hardware acceleration, both for encoding and
decoding videos. When enabled, this can either speed up those operations or slow
them down, depending on the power and features supported by your graphics card.
Please see [doc/HW-ACCELL.md](doc/HW-ACCEL.md) for more information.
OpenShot now supports experimental hardware acceleration, both for encoding
and decoding videos. When enabled, this can either speed up those operations
or slow them down, depending on the power and features supported by your
graphics card.

Please see [`doc/HW-ACCEL.md`](doc/HW-ACCEL.md) for more information.

## Documentation

Expand All @@ -51,10 +54,11 @@ make doc

## Developers

Are you interested in becoming more involved in the development of
OpenShot? Build exciting new features, fix bugs, make friends, and become a hero!
Please read the [step-by-step](https://github.com/OpenShot/openshot-qt/wiki/Become-a-Developer)
instructions for getting source code, configuring dependencies, and building OpenShot.
Are you interested in becoming more involved in the development of OpenShot?
Build exciting new features, fix bugs, make friends, and become a hero!
Please read the [step-by-step](https://github.com/OpenShot/openshot-qt/wiki/Become-a-Developer)
instructions for getting source code, configuring dependencies, and building
OpenShot.

## Report a bug

Expand All @@ -72,7 +76,7 @@ https://github.com/OpenShot/libopenshot/issues

### License

Copyright (c) 2008-2019 OpenShot Studios, LLC.
Copyright (c) 2008-2020 OpenShot Studios, LLC.

OpenShot Library (libopenshot) is free software: you can redistribute it
and/or modify it under the terms of the GNU Lesser General Public License
Expand Down
2 changes: 0 additions & 2 deletions include/CacheDisk.h
Expand Up @@ -38,8 +38,6 @@
#include "Frame.h"
#include "Exceptions.h"
#include <QDir>
#include <QString>
#include <QTextStream>

namespace openshot {

Expand Down
4 changes: 2 additions & 2 deletions include/ChunkReader.h
Expand Up @@ -37,10 +37,10 @@
#include <iostream>
#include <fstream>
#include <omp.h>
#include <QtCore/qdir.h>
#include <stdio.h>
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <QtCore/QDir>
#include "Json.h"
#include "CacheMemory.h"
#include "Exceptions.h"
Expand Down
12 changes: 6 additions & 6 deletions include/ChunkWriter.h
Expand Up @@ -34,19 +34,19 @@
#include "ReaderBase.h"
#include "WriterBase.h"
#include "FFmpegWriter.h"
#include "CacheMemory.h"
#include "Exceptions.h"
#include "Json.h"

#include <cmath>
#include <ctime>
#include <iostream>
#include <fstream>
#include <omp.h>
#include <QtCore/qdir.h>
#include <stdio.h>
#include <cstdio>
#include <sstream>
#include <unistd.h>
#include "CacheMemory.h"
#include "Exceptions.h"
#include "Json.h"
#include <omp.h>
#include <QtCore/QDir>


namespace openshot
Expand Down
9 changes: 5 additions & 4 deletions include/Clip.h
Expand Up @@ -169,6 +169,9 @@ namespace openshot {
/// Return the list of effects on the timeline
std::list<openshot::EffectBase*> Effects() { return effects; };

/// Look up an effect by ID
openshot::EffectBase* GetEffect(const std::string& id);

/// @brief Get an openshot::Frame object for a specific frame number of this timeline.
///
/// @returns The requested frame (containing the image)
Expand Down Expand Up @@ -253,8 +256,6 @@ namespace openshot {
openshot::Keyframe has_audio; ///< An optional override to determine if this clip has audio (-1=undefined, 0=no, 1=yes)
openshot::Keyframe has_video; ///< An optional override to determine if this clip has video (-1=undefined, 0=no, 1=yes)
};
} // namespace


}

#endif
#endif // OPENSHOT_CLIP_H
6 changes: 6 additions & 0 deletions include/DummyReader.h
Expand Up @@ -53,6 +53,12 @@ namespace openshot
* A dummy reader can be created with any framerate or samplerate. This is useful in unit
* tests that need to test different framerates or samplerates.
*
* @note Timeline does buffering by requesting more frames than it
* strictly needs. Thus if you use this DummyReader with a custom
* cache in a Timeline, make sure it has enough
* frames. Specifically you need some frames after the last frame
* you plan to access through the Timeline.
*
* @code
* // Create cache object to store fake Frame objects
* CacheMemory cache;
Expand Down
11 changes: 7 additions & 4 deletions include/FFmpegUtilities.h
Expand Up @@ -40,7 +40,7 @@
#ifndef IS_FFMPEG_3_2
#define IS_FFMPEG_3_2 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 64, 101))
#endif

#ifndef HAVE_HW_ACCEL
#define HAVE_HW_ACCEL (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 107, 100))
#endif
Expand Down Expand Up @@ -122,6 +122,9 @@
#ifndef PIX_FMT_YUV420P
#define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
#endif
#ifndef PIX_FMT_YUV444P
#define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P
#endif

// FFmpeg's libavutil/common.h defines an RSHIFT incompatible with Ruby's
// definition in ruby/config.h, so we move it to FF_RSHIFT
Expand Down Expand Up @@ -177,13 +180,13 @@
#define AV_OUTPUT_CONTEXT(output_context, path) avformat_alloc_output_context2( output_context, NULL, NULL, path)
#define AV_OPTION_FIND(priv_data, name) av_opt_find(priv_data, name, NULL, 0, 0)
#define AV_OPTION_SET( av_stream, priv_data, name, value, avcodec) av_opt_set(priv_data, name, value, 0); avcodec_parameters_from_context(av_stream->codecpar, avcodec);
#define AV_FORMAT_NEW_STREAM(oc, st_codec, av_codec, av_st) av_st = avformat_new_stream(oc, NULL);\
#define AV_FORMAT_NEW_STREAM(oc, st_codec_ctx, av_codec, av_st) av_st = avformat_new_stream(oc, NULL);\
if (!av_st) \
throw OutOfMemory("Could not allocate memory for the video stream.", path); \
c = avcodec_alloc_context3(av_codec); \
st_codec = c; \
st_codec_ctx = c; \
av_st->codecpar->codec_id = av_codec->id;
#define AV_COPY_PARAMS_FROM_CONTEXT(av_stream, av_codec) avcodec_parameters_from_context(av_stream->codecpar, av_codec);
#define AV_COPY_PARAMS_FROM_CONTEXT(av_stream, av_codec_ctx) avcodec_parameters_from_context(av_stream->codecpar, av_codec_ctx);
#elif IS_FFMPEG_3_2
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
Expand Down
4 changes: 2 additions & 2 deletions include/FFmpegWriter.h
Expand Up @@ -164,8 +164,8 @@ namespace openshot {
AVOutputFormat *fmt;
AVFormatContext *oc;
AVStream *audio_st, *video_st;
AVCodecContext *video_codec;
AVCodecContext *audio_codec;
AVCodecContext *video_codec_ctx;
AVCodecContext *audio_codec_ctx;
SwsContext *img_convert_ctx;
int16_t *samples;
uint8_t *audio_outbuf;
Expand Down
2 changes: 1 addition & 1 deletion include/Fraction.h
Expand Up @@ -31,7 +31,7 @@
#ifndef OPENSHOT_FRACTION_H
#define OPENSHOT_FRACTION_H

#include <math.h>
#include <cmath>

namespace openshot {

Expand Down
3 changes: 1 addition & 2 deletions include/FrameMapper.h
Expand Up @@ -33,7 +33,7 @@

#include <assert.h>
#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <memory>
#include "CacheMemory.h"
Expand Down Expand Up @@ -138,7 +138,6 @@ namespace openshot
*/
class FrameMapper : public ReaderBase {
private:
bool is_open;
bool field_toggle; // Internal odd / even toggle (used when building the mapping)
Fraction original; // The original frame rate
Fraction target; // The target frame rate
Expand Down
2 changes: 1 addition & 1 deletion include/KeyFrame.h
Expand Up @@ -33,7 +33,7 @@

#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <assert.h>
#include <vector>
#include "Exceptions.h"
Expand Down
4 changes: 4 additions & 0 deletions include/MagickUtilities.h
Expand Up @@ -32,7 +32,11 @@

#ifdef USE_IMAGEMAGICK

// Exclude a warning message with IM6 headers
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#include "Magick++.h"
#pragma GCC diagnostic pop

// Determine ImageMagick version, as IM7 isn't fully
// backwards compatible
Expand Down
4 changes: 2 additions & 2 deletions include/OpenMPUtilities.h
Expand Up @@ -32,8 +32,8 @@
#define OPENSHOT_OPENMP_UTILITIES_H

#include <omp.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <string>

#include "Settings.h"

Expand Down
11 changes: 10 additions & 1 deletion include/OpenShotVersion.h.in
Expand Up @@ -42,6 +42,15 @@

#define OPENSHOT_VERSION_SO @PROJECT_SO_VERSION@ /// Shared object version number. This increments any time the API and ABI changes (so old apps will no longer link)

// Useful dependency versioning / feature availability
#cmakedefine QT_VERSION_STR "@QT_VERSION_STR@"
#cmakedefine AVCODEC_VERSION_STR "@AVCODEC_VERSION_STR@"
#cmakedefine AVFORMAT_VERSION_STR "@AVFORMAT_VERSION_STR@"
#cmakedefine AVUTIL_VERSION_STR "@AVUTIL_VERSION_STR@"
#cmakedefine01 HAVE_IMAGEMAGICK
#cmakedefine01 HAVE_RESVG
#cmakedefine01 APPIMAGE_BUILD

#include <sstream>

namespace openshot
Expand All @@ -67,4 +76,4 @@ namespace openshot
openshot::OpenShotVersion GetVersion();
}

#endif // OPENSHOT_VERSION_H
#endif // OPENSHOT_VERSION_H

0 comments on commit e5e7b27

Please sign in to comment.