Adding python bindings to GitLab build artifacts (to prevent install target on build server) (#120)

* Prevent a negative starting sample when adding audio to a frame

* Move critical sections to prevent crash on Windows

* Integrate custom libopenshot branches into GitLab build pipeline. Also, download previous artifacts from same branch name, and default to develop if not found.

* Adding conditional download of artifacts... use current branch name first, and then fallback to develop artifacts. This is to help the build pipeline support all branches.

* Re-adding master to gitlab pipeline

* Update Frame.cpp

Fixing merge error

* Update Version.h

Reverting version for develop branch

* Make python install target overridable via env variable

* Fixing audio unit tests

* Making linux builds automatic again

* Another attempt to collect python installed files as artifacts

* Changing python windows powershell syntax

* Testing new powershell syntax
This commit is contained in:
Jonathan Thomas
2018-06-17 10:53:50 -07:00
committed by GitHub
parent 785f6c6961
commit 8b4126e360
4 changed files with 29 additions and 19 deletions

View File

@@ -16,12 +16,13 @@ linux-builder:
- unzip artifacts.zip
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
- mkdir -p build; cd build;
- mkdir -p install-x64/python;
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
- make
- make install
- cp src/bindings/python/*openshot* install-x64/lib
- mv /usr/local/lib/python3.4/dist-packages/*openshot* install-x64/python
- 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"
when: manual
when: always
tags:
- linux
@@ -39,10 +40,11 @@ mac-builder:
- unzip artifacts.zip
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
- mkdir -p build; cd build;
- mkdir -p install-x64/python;
- cmake -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_FRAMEWORKS=/Library/Frameworks/Python.framework/ -D"CMAKE_BUILD_TYPE:STRING=Debug" -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" ../
- make
- make install
- cp src/bindings/python/*openshot* install-x64/lib
- mv /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/*openshot* install-x64/python
- 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"
when: always
tags:
@@ -63,10 +65,11 @@ windows-builder-x86:
- $env:ZMQDIR = "C:\msys32\usr"
- $env:Path = "C:\msys32\mingw32\bin;C:\msys32\mingw32\lib;C:\msys32\usr\lib\cmake\UnitTest++;C:\msys32\home\jonathan\depot_tools;C:\msys32\usr;C:\msys32\usr\lib;" + $env:Path;
- New-Item -ItemType Directory -Force -Path build
- New-Item -ItemType Directory -Force -Path build\install-x86\python
- cd build
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x86" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
- mingw32-make install
- cp src\bindings\python\*openshot* install-x86\lib
- Move-Item -Force -path "C:\msys32\mingw32\lib\python3.6\site-packages\*openshot*" -destination "install-x86\python\"
- cp src\libopenshot.dll install-x86\lib
- New-Item -path "install-x86/share/" -Name "$CI_PROJECT_NAME" -Value "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" -ItemType file -force
when: always
@@ -88,10 +91,11 @@ windows-builder-x64:
- $env:ZMQDIR = "C:\msys64\usr"
- $env:Path = "C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\usr\lib\cmake\UnitTest++;C:\msys64\home\jonathan\depot_tools;C:\msys64\usr;C:\msys64\usr\lib;" + $env:Path;
- New-Item -ItemType Directory -Force -Path build
- New-Item -ItemType Directory -Force -Path build\install-x64\python
- cd build
- cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x64" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
- mingw32-make install
- cp src\bindings\python\*openshot* install-x64\lib
- Move-Item -Force -path "C:\msys64\mingw64\lib\python3.6\site-packages\*openshot*" -destination "install-x64\python\"
- cp src\libopenshot.dll install-x64\lib
- New-Item -path "install-x64/share/" -Name "$CI_PROJECT_NAME" -Value "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" -ItemType file -force
when: always
@@ -105,4 +109,4 @@ trigger-pipeline:
when: always
dependencies: []
tags:
- gitlab
- gitlab

View File

@@ -63,4 +63,4 @@ IF (PYTHONLIBS_FOUND)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/openshot.py DESTINATION ${PYTHON_MODULE_PATH} )
ENDIF(PYTHONINTERP_FOUND)
ENDIF (PYTHONLIBS_FOUND)
ENDIF (PYTHONLIBS_FOUND)

View File

@@ -59,29 +59,35 @@ void Mask::init_effect_details()
// This method is required for all derived classes of EffectBase, and returns a
// modified openshot::Frame object
std::shared_ptr<Frame> Mask::GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number)
{
std::shared_ptr<Frame> Mask::GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) {
// Get the mask image (from the mask reader)
std::shared_ptr<QImage> frame_image = frame->GetImage();
// Check if mask reader is open
if (reader && !reader->IsOpen())
#pragma omp critical (open_mask_reader)
reader->Open();
#pragma omp critical (open_mask_reader)
{
if (reader && !reader->IsOpen())
reader->Open();
}
// No reader (bail on applying the mask)
if (!reader)
return frame;
// Get mask image (if missing or different size than frame image)
if (!original_mask || !reader->info.has_single_image || (original_mask && original_mask->size() != frame_image->size())) {
#pragma omp critical (open_mask_reader)
{
#pragma omp critical (open_mask_reader)
{
if (!original_mask || !reader->info.has_single_image ||
(original_mask && original_mask->size() != frame_image->size())) {
// Only get mask if needed
std::shared_ptr<QImage> mask_without_sizing = std::shared_ptr<QImage>(new QImage(*reader->GetFrame(frame_number)->GetImage()));
std::shared_ptr<QImage> mask_without_sizing = std::shared_ptr<QImage>(
new QImage(*reader->GetFrame(frame_number)->GetImage()));
// Resize mask image to match frame size
original_mask = std::shared_ptr<QImage>(new QImage(mask_without_sizing->scaled(frame_image->width(), frame_image->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
original_mask = std::shared_ptr<QImage>(new QImage(
mask_without_sizing->scaled(frame_image->width(), frame_image->height(), Qt::IgnoreAspectRatio,
Qt::SmoothTransformation)));
}
}

View File

@@ -72,8 +72,8 @@ TEST(FFmpegReader_Check_Audio_File)
CHECK_CLOSE(0.0f, samples[50], 0.00001);
CHECK_CLOSE(0.0f, samples[100], 0.00001);
CHECK_CLOSE(0.0f, samples[200], 0.00001);
CHECK_CLOSE(0.157566f, samples[230], 0.00001);
CHECK_CLOSE(-0.060025f, samples[300], 0.00001);
CHECK_CLOSE(0.160781f, samples[230], 0.00001);
CHECK_CLOSE(-0.06125f, samples[300], 0.00001);
// Close reader
r.Close();