Skip to content

Commit

Permalink
Merge branch 'develop' into frac-python-types
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Jan 4, 2021
2 parents 1b82a3c + 6009a26 commit 5d00bb1
Show file tree
Hide file tree
Showing 34 changed files with 214 additions and 247 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,9 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,60 @@
name: CI Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
compiler: [gcc, clang]
env:
CC: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v2

- uses: haya14busa/action-cond@v1
id: coverage
with:
cond: ${{ matrix.compiler == 'clang' }}
if_true: "-DENABLE_COVERAGE:BOOL=1"
if_false: "-DENABLE_COVERAGE:BOOL=0"

- name: Install dependencies
shell: bash
run: |
sudo add-apt-repository ppa:openshot.developers/libopenshot-daily
sudo apt update
sudo apt install cmake swig doxygen graphviz curl lcov
sudo apt install libopenshot-audio-dev
sudo apt install qtbase5-dev qtbase5-dev-tools
sudo apt install libfdk-aac-dev libavcodec-dev libavformat-dev libavdevice-dev libavutil-dev libavfilter-dev libswscale-dev libpostproc-dev libswresample-dev
sudo apt install libzmq3-dev libmagick++-dev libunittest++-dev
- name: Build libopenshot
shell: bash
run: |
mkdir build
pushd build
cmake -B . -S .. -DCMAKE_INSTALL_PREFIX:PATH="dist" -DCMAKE_BUILD_TYPE="Debug" "${{ steps.coverage.outputs.value }}"
cmake --build . -- VERBOSE=1
popd
- name: Test libopenshot
shell: bash
run: |
pushd build
cmake --build . --target os_test -- VERBOSE=1
popd
- name: Install libopenshot
shell: bash
run: |
pushd build
cmake --build . --target install -- VERBOSE=1
popd
- uses: codecov/codecov-action@v1
if: ${{ matrix.compiler == 'clang' }}
with:
file: build/coverage.info

12 changes: 4 additions & 8 deletions .github/workflows/label-merge-conflicts.yml
@@ -1,14 +1,10 @@

name: Label merge conflicts

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
types: [opened, synchronize, reopened]
# Controls when the action will run. Triggers the workflow on push to repo branches
# (It shouldn't run on pull requests, as it won't have the right credentials to
# edit labels on other PRs.)
on: push

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/label.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Expand Up @@ -46,7 +46,7 @@ mac-builder:
- unzip artifacts.zip
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
- mkdir -p build; cd build;
- 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" ../
- 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 -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" -DCMAKE_PREFIX_PATH=/usr/local/qt5.15.X/qt5.15/5.15.0/clang_64/ -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
122 changes: 0 additions & 122 deletions .travis.yml

This file was deleted.

38 changes: 32 additions & 6 deletions CMakeLists.txt
Expand Up @@ -180,14 +180,40 @@ if (ENABLE_COVERAGE)
NAME coverage
LCOV_ARGS "--no-external"
EXECUTABLE openshot-test
DEPENDENCIES openshot-test
EXCLUDE "bindings" "examples" "${CMAKE_CURRENT_BINARY_DIR}/bindings"
DEPENDENCIES openshot openshot-test
EXCLUDE
"bindings/*"
"examples/*"
"${CMAKE_CURRENT_BINARY_DIR}/bindings/*"
"${CMAKE_CURRENT_BINARY_DIR}/src/*_autogen/*"
)
message("Generate coverage report with 'make coverage'")
if(NOT TARGET os_test)
add_custom_target(os_test)
add_dependencies(os_test coverage)
endif()
endif()

# Also hook up 'test' as an alias for the 'os_test' target, if possible
# This requires CMake 3.11+, where the CMP0037 policy
# configured to 'NEW' mode will not reserve target names
# unless the corresponding feature is actually used
if (POLICY CMP0037)
cmake_policy(SET CMP0037 NEW)
endif()
if(TARGET os_test)
if (CMAKE_VERSION VERSION_GREATER 3.11)
message(STATUS "Cmake 3.11+ detected, enabling 'test' target")
add_custom_target(test)
add_dependencies(test os_test)
set(TEST_TARGET_NAME "test")
else()
set(TEST_TARGET_NAME "os_test")
endif()
add_feature_info("Testrunner" ENABLE_TESTS "Run unit tests with 'make ${TEST_TARGET_NAME}'")
endif()

########### PRINT FEATURE SUMMARY ##############
feature_summary(WHAT ALL
INCLUDE_QUIET_PACKAGES
FATAL_ON_MISSING_REQUIRED_PACKAGES
DESCRIPTION "Displaying feature summary\n\nBuild configuration:")
INCLUDE_QUIET_PACKAGES
FATAL_ON_MISSING_REQUIRED_PACKAGES
DESCRIPTION "Displaying feature summary\n\nBuild configuration:")
4 changes: 1 addition & 3 deletions codecov.yml
@@ -1,10 +1,8 @@
codecov:
branch: default
coverage:
status:
project:
default:
base: pr # Only post a status to pull requests
only_pulls: true # Only post a status to pull requests
informational: true # Don't block PRs based on coverage stats (yet?)
ignore:
- "examples"
Expand Down
2 changes: 0 additions & 2 deletions src/AudioReaderSource.cpp
Expand Up @@ -97,8 +97,6 @@ void AudioReaderSource::GetMoreSamplesFromReader()

} catch (const ReaderClosed & e) {
break;
} catch (const TooManySeeks & e) {
break;
} catch (const OutOfBoundsFrame & e) {
break;
}
Expand Down
2 changes: 0 additions & 2 deletions src/Clip.cpp
Expand Up @@ -717,8 +717,6 @@ std::shared_ptr<Frame> Clip::GetOrCreateFrame(int64_t number)

} catch (const ReaderClosed & e) {
// ...
} catch (const TooManySeeks & e) {
// ...
} catch (const OutOfBoundsFrame & e) {
// ...
}
Expand Down
16 changes: 0 additions & 16 deletions src/Exceptions.h
Expand Up @@ -365,22 +365,6 @@ namespace openshot {
virtual ~ResampleError() noexcept {}
};

/// Exception when too many seek attempts happen
class TooManySeeks : public ExceptionBase
{
public:
std::string file_path;
/**
* @brief Constructor
*
* @param message A message to accompany the exception
* @param file_path (optional) The input file being processed
*/
TooManySeeks(std::string message, std::string file_path="")
: ExceptionBase(message), file_path(file_path) { }
virtual ~TooManySeeks() noexcept {}
};

/// Exception when a writer is closed, and a frame is requested
class WriterClosed : public ExceptionBase
{
Expand Down
8 changes: 7 additions & 1 deletion src/FFmpegReader.cpp
Expand Up @@ -1352,7 +1352,13 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) {
std::shared_ptr<Frame> f = CreateFrame(current_frame);

// Add Image data to frame
f->AddImage(width, height, 4, QImage::Format_RGBA8888_Premultiplied, buffer);
if (!ffmpeg_has_alpha(AV_GET_CODEC_PIXEL_FORMAT(pStream, pCodecCtx))) {
// Add image with no alpha channel, Speed optimization
f->AddImage(width, height, 4, QImage::Format_RGBA8888_Premultiplied, buffer);
} else {
// Add image with alpha channel (this will be converted to premultipled when needed, but is slower)
f->AddImage(width, height, 4, QImage::Format_RGBA8888, buffer);
}

// Update working cache
working_cache.Add(f);
Expand Down
10 changes: 10 additions & 0 deletions src/FFmpegUtilities.h
Expand Up @@ -126,6 +126,16 @@
#define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P
#endif

// Does ffmpeg pixel format contain an alpha channel?
inline static const bool ffmpeg_has_alpha(PixelFormat pix_fmt)
{
if (pix_fmt == AV_PIX_FMT_ARGB || pix_fmt == AV_PIX_FMT_RGBA || pix_fmt == AV_PIX_FMT_ABGR || pix_fmt == AV_PIX_FMT_BGRA || pix_fmt == AV_PIX_FMT_YUVA420P) {
return true;
} else {
return false;
}
}

// FFmpeg's libavutil/common.h defines an RSHIFT incompatible with Ruby's
// definition in ruby/config.h, so we move it to FF_RSHIFT
#ifdef RSHIFT
Expand Down
2 changes: 0 additions & 2 deletions src/FrameMapper.cpp
Expand Up @@ -369,8 +369,6 @@ std::shared_ptr<Frame> FrameMapper::GetOrCreateFrame(int64_t number)

} catch (const ReaderClosed & e) {
// ...
} catch (const TooManySeeks & e) {
// ...
} catch (const OutOfBoundsFrame & e) {
// ...
}
Expand Down
2 changes: 1 addition & 1 deletion src/OpenMPUtilities.h
Expand Up @@ -44,7 +44,7 @@
// Set max-active-levels to the max supported, if possible
// (supported_active_levels is OpenMP 5.0 (November 2018) or later, only.)
#if (_OPENMP >= 201811)
#define OPEN_MP_MAX_ACTIVE openmp_get_supported_active_levels()
#define OPEN_MP_MAX_ACTIVE omp_get_supported_active_levels()
#else
#define OPEN_MP_MAX_ACTIVE OPEN_MP_NUM_PROCESSORS
#endif
Expand Down

0 comments on commit 5d00bb1

Please sign in to comment.