Skip to content

Commit

Permalink
Merge branch 'develop' into coverage-build
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Jan 12, 2020
2 parents c83c098 + 0bc87c0 commit 585774b
Show file tree
Hide file tree
Showing 33 changed files with 467 additions and 337 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Expand Up @@ -46,7 +46,7 @@ mac-builder:
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
- mkdir -p build; cd build;
- mkdir -p install-x64/python;
- 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_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" ../
- 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_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" ../
- make
- make install
- mv install-x64/lib/python3.6/site-packages/*openshot* install-x64/python
Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Expand Up @@ -33,6 +33,7 @@ addons:
- libswresample-dev

matrix:

include:
- name: "FFmpeg 2 GCC (Ubuntu 16.04 Xenial)"
env:
Expand Down Expand Up @@ -64,6 +65,7 @@ matrix:
packages:
- *ff_common
- qt5-default
- libjsoncpp-dev

- name: "FFmpeg 4 GCC (Ubuntu 18.04 Bionic)"
env:
Expand All @@ -81,6 +83,7 @@ matrix:
packages:
- *ff_common
- qt5-default
- libjsoncpp-dev
- libavcodec58
- libavformat58
- libavdevice58
Expand Down Expand Up @@ -129,7 +132,7 @@ matrix:

script:
- mkdir -p build; cd build;
- cmake -DCMAKE_BUILD_TYPE:STRING="Debug" ../
- cmake -DCMAKE_BUILD_TYPE:STRING="Debug" ${CMAKE_EXTRA_ARGS} ../
- make VERBOSE=1
- make ${TEST_TARGET}
- make install DESTDIR="$BUILD_VERSION"
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -40,8 +40,8 @@ For more information, please visit <http://www.openshot.org/>.
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")

################ PROJECT VERSION ####################
set(PROJECT_VERSION_FULL "0.2.3-dev1")
set(PROJECT_SO_VERSION 17)
set(PROJECT_VERSION_FULL "0.2.4-dev1")
set(PROJECT_SO_VERSION 18)

# Remove the dash and anything following, to get the #.#.# version for project()
STRING(REGEX REPLACE "\-.*$" "" VERSION_NUM "${PROJECT_VERSION_FULL}")
Expand Down
143 changes: 115 additions & 28 deletions cmake/Modules/FindRESVG.cmake
@@ -1,28 +1,115 @@
# - Try to find RESVG
# Once done this will define
# RESVG_FOUND - System has RESVG
# RESVG_INCLUDE_DIRS - The RESVG include directories
# RESVG_LIBRARIES - The libraries needed to use RESVG
find_path ( RESVG_INCLUDE_DIR ResvgQt.h
PATHS ${RESVGDIR}/include/resvg
$ENV{RESVGDIR}/include/resvg
$ENV{RESVGDIR}/include
/usr/include/resvg
/usr/include
/usr/local/include/resvg
/usr/local/include )

find_library ( RESVG_LIBRARY NAMES resvg
PATHS /usr/lib
/usr/local/lib
$ENV{RESVGDIR}
$ENV{RESVGDIR}/lib )

set ( RESVG_LIBRARIES ${RESVG_LIBRARY} )
set ( RESVG_INCLUDE_DIRS ${RESVG_INCLUDE_DIR} )

include ( FindPackageHandleStandardArgs )
# handle the QUIETLY and REQUIRED arguments and set RESVG_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args ( RESVG "Could NOT find RESVG, using Qt SVG parsing instead" RESVG_LIBRARY RESVG_INCLUDE_DIR )
mark_as_advanced( RESVG_LIBRARY RESVG_INCLUDE_DIR )
# vim: ts=2 sw=2
#[=======================================================================[.rst:
FindRESVG
---------
Try to find the shared-library build of resvg, the Rust SVG library

IMPORTED targets
^^^^^^^^^^^^^^^^

This module defines :prop_tgt:`IMPORTED` target ``RESVG::resvg`` when
the library and headers are found.

Result Variables
^^^^^^^^^^^^^^^^

This module defines the following variables:

::

RESVG_FOUND - Library and header files found
RESVG_INCLUDE_DIRS - Include directory path
RESVG_LIBRARIES - Link path to the library
RESVG_DEFINITIONS - Compiler switches (currently unused)

Backwards compatibility
^^^^^^^^^^^^^^^^^^^^^^^

For compatibility with previous versions of this module, uppercase names
for FFmpeg and for all components are also recognized, and all-uppercase
versions of the cache variables are also created.

Control variables
^^^^^^^^^^^^^^^^^

The following variables can be used to provide path hints to the module:

RESVGDIR - Set in the calling CMakeLists.txt or on the command line
ENV{RESVGDIR} - An environment variable in the cmake process context

Copyright (c) 2020, FeRD (Frank Dana) <ferdnyc@gmail.com>
#]=======================================================================]
include(FindPackageHandleStandardArgs)

# CMake 3.4+ only: Convert relative paths to absolute
if(DEFINED RESVGDIR AND CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(RESVGDIR "${RESVGDIR}" ABSOLUTE
BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif()

find_path(RESVG_INCLUDE_DIRS
ResvgQt.h
PATHS
${RESVGDIR}
${RESVGDIR}/include
$ENV{RESVGDIR}
$ENV{RESVGDIR}/include
/usr/include
/usr/local/include
PATH_SUFFIXES
resvg
capi/include
resvg/capi/include
)

find_library(RESVG_LIBRARIES
NAMES resvg
PATHS
${RESVGDIR}
${RESVGDIR}/lib
$ENV{RESVGDIR}
$ENV{RESVGDIR}/lib
/usr/lib
/usr/local/lib
PATH_SUFFIXES
resvg
target/release
resvg/target/release
)

if (RESVG_INCLUDE_DIRS AND RESVG_LIBRARIES)
set(RESVG_FOUND TRUE)
endif()
set(RESVG_LIBRARIES ${RESVG_LIBRARIES} CACHE STRING "The Resvg library link path")
set(RESVG_INCLUDE_DIRS ${RESVG_INCLUDE_DIRS} CACHE STRING "The Resvg include directories")
set(RESVG_DEFINITIONS "" CACHE STRING "The Resvg CFLAGS")

mark_as_advanced(RESVG_LIBRARIES RESVG_INCLUDE_DIRS RESVG_DEFINITIONS)

# Give a nice error message if some of the required vars are missing.
find_package_handle_standard_args(RESVG
"Could NOT find RESVG, using Qt SVG parsing instead"
RESVG_LIBRARIES RESVG_INCLUDE_DIRS )

# Export target
if(RESVG_FOUND AND NOT TARGET RESVG::resvg)
message(STATUS "Creating IMPORTED target RESVG::resvg")
if (WIN32)
# Windows mis-links SHARED library targets
add_library(RESVG::resvg UNKNOWN IMPORTED)
else()
# Linux needs SHARED to link because libresvg has no SONAME
add_library(RESVG::resvg SHARED IMPORTED)
set_property(TARGET RESVG::resvg APPEND PROPERTY
IMPORTED_NO_SONAME TRUE)
endif()

set_property(TARGET RESVG::resvg APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${RESVG_INCLUDE_DIRS}")

set_property(TARGET RESVG::resvg APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "${RESVG_DEFINITIONS}")

set_property(TARGET RESVG::resvg APPEND PROPERTY
IMPORTED_LOCATION "${RESVG_LIBRARIES}")
endif()
8 changes: 0 additions & 8 deletions include/AudioBufferSource.h
Expand Up @@ -31,14 +31,6 @@
#ifndef OPENSHOT_AUDIOBUFFERSOURCE_H
#define OPENSHOT_AUDIOBUFFERSOURCE_H

/// Do not include the juce unittest headers, because it collides with unittest++
#define __JUCE_UNITTEST_JUCEHEADER__

#ifndef _NDEBUG
/// Define NO debug for JUCE on mac os
#define _NDEBUG
#endif

#include <iomanip>
#include "JuceHeader.h"

Expand Down
8 changes: 0 additions & 8 deletions include/AudioReaderSource.h
Expand Up @@ -31,14 +31,6 @@
#ifndef OPENSHOT_AUDIOREADERSOURCE_H
#define OPENSHOT_AUDIOREADERSOURCE_H

/// Do not include the juce unittest headers, because it collides with unittest++
#define __JUCE_UNITTEST_JUCEHEADER__

#ifndef _NDEBUG
/// Define NO debug for JUCE on mac os
#define _NDEBUG
#endif

#include <iomanip>
#include "ReaderBase.h"
#include "JuceHeader.h"
Expand Down
10 changes: 0 additions & 10 deletions include/AudioResampler.h
Expand Up @@ -31,16 +31,6 @@
#ifndef OPENSHOT_RESAMPLER_H
#define OPENSHOT_RESAMPLER_H

/// Do not include the juce unittest headers, because it collides with unittest++
#ifndef __JUCE_UNITTEST_JUCEHEADER__
#define __JUCE_UNITTEST_JUCEHEADER__
#endif

#ifndef _NDEBUG
// Define NO debug for JUCE on mac os
#define _NDEBUG
#endif

#include "AudioBufferSource.h"
#include "Exceptions.h"
#include "JuceHeader.h"
Expand Down
5 changes: 0 additions & 5 deletions include/Clip.h
Expand Up @@ -31,11 +31,6 @@
#ifndef OPENSHOT_CLIP_H
#define OPENSHOT_CLIP_H

/// Do not include the juce unittest headers, because it collides with unittest++
#ifndef __JUCE_UNITTEST_JUCEHEADER__
#define __JUCE_UNITTEST_JUCEHEADER__
#endif

#include <memory>
#include <string>
#include <QtGui/QImage>
Expand Down
5 changes: 0 additions & 5 deletions include/ClipBase.h
Expand Up @@ -31,11 +31,6 @@
#ifndef OPENSHOT_CLIPBASE_H
#define OPENSHOT_CLIPBASE_H

/// Do not include the juce unittest headers, because it collides with unittest++
#ifndef __JUCE_UNITTEST_JUCEHEADER__
#define __JUCE_UNITTEST_JUCEHEADER__
#endif

#include <memory>
#include <sstream>
#include "Exceptions.h"
Expand Down
1 change: 0 additions & 1 deletion include/EffectBase.h
Expand Up @@ -50,7 +50,6 @@ namespace openshot
struct EffectInfoStruct
{
std::string class_name; ///< The class name of the effect
std::string short_name; ///< A short name of the effect, commonly used for icon names, etc...
std::string name; ///< The name of the effect
std::string description; ///< The description of this effect and what it does
bool has_video; ///< Determines if this effect manipulates the image of a frame
Expand Down
9 changes: 0 additions & 9 deletions include/Frame.h
Expand Up @@ -31,15 +31,6 @@
#ifndef OPENSHOT_FRAME_H
#define OPENSHOT_FRAME_H

/// Do not include the juce unittest headers, because it collides with unittest++
#ifndef __JUCE_UNITTEST_JUCEHEADER__
#define __JUCE_UNITTEST_JUCEHEADER__
#endif
#ifndef _NDEBUG
// Define NO debug for JUCE on mac os
#define _NDEBUG
#endif

#include <iomanip>
#include <sstream>
#include <queue>
Expand Down
2 changes: 1 addition & 1 deletion src/AudioBufferSource.cpp
Expand Up @@ -43,7 +43,7 @@ AudioBufferSource::~AudioBufferSource()
{
// forget the AudioSampleBuffer. It still exists; we just don't know about it.
buffer = NULL;
};
}

// Get the next block of audio samples
void AudioBufferSource::getNextAudioBlock (const juce::AudioSourceChannelInfo& info)
Expand Down
2 changes: 1 addition & 1 deletion src/AudioReaderSource.cpp
Expand Up @@ -51,7 +51,7 @@ AudioReaderSource::~AudioReaderSource()
// Clear and delete the buffer
delete buffer;
buffer = NULL;
};
}

// Get more samples from the reader
void AudioReaderSource::GetMoreSamplesFromReader()
Expand Down
40 changes: 21 additions & 19 deletions src/CMakeLists.txt
Expand Up @@ -79,7 +79,7 @@ ENDIF (ImageMagick_FOUND)

################# LIBOPENSHOT-AUDIO ###################
# Find JUCE-based openshot Audio libraries
FIND_PACKAGE(OpenShotAudio 0.1.8 REQUIRED)
FIND_PACKAGE(OpenShotAudio 0.1.9 REQUIRED)

# Include Juce headers (needed for compile)
include_directories(${LIBOPENSHOT_AUDIO_INCLUDE_DIRS})
Expand All @@ -100,20 +100,6 @@ IF (ENABLE_BLACKMAGIC)
ENDIF (BLACKMAGIC_FOUND)
ENDIF (ENABLE_BLACKMAGIC)


################### RESVG #####################
# Find resvg library (used for rendering svg files)
FIND_PACKAGE(RESVG)

# Include resvg headers (optional SVG library)
if (RESVG_FOUND)
include_directories(${RESVG_INCLUDE_DIRS})

# define a global var (used in the C++)
add_definitions( -DUSE_RESVG=1 )
SET(CMAKE_SWIG_FLAGS "-DUSE_RESVG=1")
endif(RESVG_FOUND)

############### PROFILING #################
#set(PROFILER "/usr/lib/libprofiler.so.0.3.2")
#set(PROFILER "/usr/lib/libtcmalloc.so.4")
Expand Down Expand Up @@ -357,6 +343,26 @@ if (TARGET cppzmq)
target_link_libraries(openshot PUBLIC cppzmq)
endif()

################### RESVG #####################
# Migrate some legacy variable names
if(DEFINED RESVGDIR AND NOT DEFINED RESVG_ROOT)
set(RESVG_ROOT ${RESVGDIR})
endif()
if(DEFINED ENV{RESVGDIR} AND NOT DEFINED RESVG_ROOT)
set(RESVG_ROOT $ENV{RESVGDIR})
endif()

# Find resvg library (used for rendering svg files)
FIND_PACKAGE(RESVG)

# Include resvg headers (optional SVG library)
if (TARGET RESVG::resvg)
#include_directories(${RESVG_INCLUDE_DIRS})
target_link_libraries(openshot PUBLIC RESVG::resvg)

target_compile_definitions(openshot PUBLIC "-DUSE_RESVG=1")
set(CMAKE_SWIG_FLAGS "-DUSE_RESVG=1")
endif()

############### LINK LIBRARY #################
# Link remaining dependency libraries
Expand All @@ -368,10 +374,6 @@ if(ImageMagick_FOUND)
target_link_libraries(openshot PUBLIC ${ImageMagick_LIBRARIES})
endif()

if(RESVG_FOUND)
target_link_libraries(openshot PUBLIC ${RESVG_LIBRARIES})
endif()

if(BLACKMAGIC_FOUND)
target_link_libraries(openshot PUBLIC ${BLACKMAGIC_LIBRARY_DIR})
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/CacheBase.cpp
Expand Up @@ -37,13 +37,13 @@ using namespace openshot;
CacheBase::CacheBase() : max_bytes(0) {
// Init the critical section
cacheCriticalSection = new CriticalSection();
};
}

// Constructor that sets the max frames to cache
CacheBase::CacheBase(int64_t max_bytes) : max_bytes(max_bytes) {
// Init the critical section
cacheCriticalSection = new CriticalSection();
};
}

// Set maximum bytes to a different amount based on a ReaderInfo struct
void CacheBase::SetMaxBytesFromInfo(int64_t number_of_frames, int width, int height, int sample_rate, int channels)
Expand Down

0 comments on commit 585774b

Please sign in to comment.