Skip to content

Commit

Permalink
Merge pull request #165 from OpenShot/release
Browse files Browse the repository at this point in the history
Releasing version to 0.2.1 (SO: 16)
  • Loading branch information
jonoomph authored Sep 19, 2018
2 parents 9972600 + b63a63c commit 6c4c9cc
Show file tree
Hide file tree
Showing 33 changed files with 775 additions and 493 deletions.
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
dist: trusty

matrix:
include:
- language: cpp
name: "FFmpeg 2"
before_script:
- sudo add-apt-repository ppa:openshot.developers/libopenshot-daily -y
- sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y
- sudo apt-get update -qq
- sudo apt-get install gcc-4.8 cmake libavcodec-dev libavformat-dev libswscale-dev libavresample-dev libavutil-dev libopenshot-audio-dev libopenshot-dev libfdk-aac-dev libfdk-aac-dev libjsoncpp-dev libmagick++-dev libopenshot-audio-dev libunittest++-dev libzmq3-dev pkg-config python3-dev qtbase5-dev qtmultimedia5-dev swig -y
- sudo apt autoremove -y
script:
- mkdir -p build; cd build;
- cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../
- make VERBOSE=1
- make test

- language: cpp
name: "FFmpeg 3"
before_script:
- sudo add-apt-repository ppa:openshot.developers/libopenshot-daily -y
- sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y
- sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
- sudo apt-get update -qq
- sudo apt-get install gcc-4.8 cmake libavcodec-dev libavformat-dev libswscale-dev libavresample-dev libavutil-dev libopenshot-audio-dev libopenshot-dev libfdk-aac-dev libfdk-aac-dev libjsoncpp-dev libmagick++-dev libopenshot-audio-dev libunittest++-dev libzmq3-dev pkg-config python3-dev qtbase5-dev qtmultimedia5-dev swig -y
- sudo apt autoremove -y
script:
- mkdir -p build; cd build;
- cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../
- make VERBOSE=1
- make test

- language: cpp
name: "FFmpeg 4"
before_script:
- sudo add-apt-repository ppa:openshot.developers/libopenshot-daily -y
- sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y
- sudo add-apt-repository ppa:jonathonf/ffmpeg -y
- sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -y
- sudo add-apt-repository ppa:jonathonf/backports -y
- sudo apt-get update -qq
- sudo apt-get install gcc-4.8 cmake libavcodec58 libavformat58 libavcodec-dev libavformat-dev libswscale-dev libavresample-dev libavutil-dev libopenshot-audio-dev libopenshot-dev libfdk-aac-dev libfdk-aac-dev libjsoncpp-dev libmagick++-dev libopenshot-audio-dev libunittest++-dev libzmq3-dev pkg-config python3-dev qtbase5-dev qtmultimedia5-dev swig -y
- sudo apt autoremove -y
script:
- mkdir -p build; cd build;
- cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../
- make VERBOSE=1
- make test
306 changes: 158 additions & 148 deletions cmake/Modules/FindFFmpeg.cmake
Original file line number Diff line number Diff line change
@@ -1,151 +1,161 @@
# - Try to find FFMPEG
# vim: ts=2 sw=2
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
#
# Once done this will define
#
# FFMPEG_FOUND - system has FFMPEG
# FFMPEG_INCLUDE_DIR - the include directory
# FFMPEG_LIBRARY_DIR - the directory containing the libraries
# FFMPEG_LIBRARIES - Link these to use FFMPEG
#

# FindAvformat
FIND_PATH( AVFORMAT_INCLUDE_DIR libavformat/avformat.h
PATHS /usr/include/
/usr/include/ffmpeg/
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/ )

FIND_LIBRARY( AVFORMAT_LIBRARY avformat avformat-55 avformat-57
PATHS /usr/lib/
/usr/lib/ffmpeg/
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/ )

#FindAvcodec
FIND_PATH( AVCODEC_INCLUDE_DIR libavcodec/avcodec.h
PATHS /usr/include/
/usr/include/ffmpeg/
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/ )

FIND_LIBRARY( AVCODEC_LIBRARY avcodec avcodec-55 avcodec-57
PATHS /usr/lib/
/usr/lib/ffmpeg/
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/ )

#FindAvutil
FIND_PATH( AVUTIL_INCLUDE_DIR libavutil/avutil.h
PATHS /usr/include/
/usr/include/ffmpeg/
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/ )

FIND_LIBRARY( AVUTIL_LIBRARY avutil avutil-52 avutil-55
PATHS /usr/lib/
/usr/lib/ffmpeg/
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/ )

#FindAvdevice
FIND_PATH( AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h
PATHS /usr/include/
/usr/include/ffmpeg/
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/ )

FIND_LIBRARY( AVDEVICE_LIBRARY avdevice avdevice-55 avdevice-56
PATHS /usr/lib/
/usr/lib/ffmpeg/
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/ )

#FindSwscale
FIND_PATH( SWSCALE_INCLUDE_DIR libswscale/swscale.h
PATHS /usr/include/
/usr/include/ffmpeg/
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/ )

FIND_LIBRARY( SWSCALE_LIBRARY swscale swscale-2 swscale-4
PATHS /usr/lib/
/usr/lib/ffmpeg/
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/ )

#FindAvresample
FIND_PATH( AVRESAMPLE_INCLUDE_DIR libavresample/avresample.h
PATHS /usr/include/
/usr/include/ffmpeg/
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/ )

FIND_LIBRARY( AVRESAMPLE_LIBRARY avresample avresample-2 avresample-3
PATHS /usr/lib/
/usr/lib/ffmpeg/
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/ )

SET( FFMPEG_FOUND FALSE )

IF ( AVFORMAT_INCLUDE_DIR AND AVFORMAT_LIBRARY )
SET ( AVFORMAT_FOUND TRUE )
ENDIF ( AVFORMAT_INCLUDE_DIR AND AVFORMAT_LIBRARY )

IF ( AVCODEC_INCLUDE_DIR AND AVCODEC_LIBRARY )
SET ( AVCODEC_FOUND TRUE)
ENDIF ( AVCODEC_INCLUDE_DIR AND AVCODEC_LIBRARY )

IF ( AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY )
SET ( AVUTIL_FOUND TRUE )
ENDIF ( AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY )

IF ( AVDEVICE_INCLUDE_DIR AND AVDEVICE_LIBRARY )
SET ( AVDEVICE_FOUND TRUE )
ENDIF ( AVDEVICE_INCLUDE_DIR AND AVDEVICE_LIBRARY )

IF ( SWSCALE_INCLUDE_DIR AND SWSCALE_LIBRARY )
SET ( SWSCALE_FOUND TRUE )
ENDIF ( SWSCALE_INCLUDE_DIR AND SWSCALE_LIBRARY )

IF ( AVRESAMPLE_INCLUDE_DIR AND AVRESAMPLE_LIBRARY )
SET ( AVRESAMPLE_FOUND TRUE )
ENDIF ( AVRESAMPLE_INCLUDE_DIR AND AVRESAMPLE_LIBRARY )

IF ( AVFORMAT_INCLUDE_DIR OR AVCODEC_INCLUDE_DIR OR AVUTIL_INCLUDE_DIR OR AVDEVICE_FOUND OR SWSCALE_FOUND OR AVRESAMPLE_FOUND )

SET ( FFMPEG_FOUND TRUE )

SET ( FFMPEG_INCLUDE_DIR
${AVFORMAT_INCLUDE_DIR}
${AVCODEC_INCLUDE_DIR}
${AVUTIL_INCLUDE_DIR}
${AVDEVICE_INCLUDE_DIR}
${SWSCALE_INCLUDE_DIR}
${AVRESAMPLE_INCLUDE_DIR} )

SET ( FFMPEG_LIBRARIES
${AVFORMAT_LIBRARY}
${AVCODEC_LIBRARY}
${AVUTIL_LIBRARY}
${AVDEVICE_LIBRARY}
${SWSCALE_LIBRARY}
${AVRESAMPLE_LIBRARY} )

ENDIF ( AVFORMAT_INCLUDE_DIR OR AVCODEC_INCLUDE_DIR OR AVUTIL_INCLUDE_DIR OR AVDEVICE_FOUND OR SWSCALE_FOUND OR AVRESAMPLE_FOUND )

MARK_AS_ADVANCED(
FFMPEG_LIBRARY_DIR
FFMPEG_INCLUDE_DIR
)
# FFMPEG_FOUND - System has the all required components.
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
#
# For each of the components it will additionally set.
# - AVCODEC
# - AVDEVICE
# - AVFORMAT
# - AVFILTER
# - AVUTIL
# - POSTPROC
# - SWSCALE
# - SWRESAMPLE
# - AVRESAMPLE
# the following variables will be defined
# <component>_FOUND - System has <component>
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
# <component>_LIBRARIES - Link these to use <component>
# <component>_DEFINITIONS - Compiler switches required for using <component>
# <component>_VERSION - The components version
#
# Copyright (c) 2006, Matthias Kretz, <[email protected]>
# Copyright (c) 2008, Alexander Neundorf, <[email protected]>
# Copyright (c) 2011, Michael Jansen, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(FFMPEG DEFAULT_MSG
FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIR)

# The default components were taken from a survey over other FindFFMPEG.cmake files
if (NOT FFmpeg_FIND_COMPONENTS)
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
endif ()

#
### Macro: set_component_found
#
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
#
macro(set_component_found _component )
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
# message(STATUS " - ${_component} found.")
set(${_component}_FOUND TRUE)
else ()
# message(STATUS " - ${_component} not found.")
endif ()
endmacro()

#
### Macro: find_component
#
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
# include directories.
#
macro(find_component _component _pkgconfig _library _header)

if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_${_component} ${_pkgconfig})
endif ()
endif (NOT WIN32)

find_path(${_component}_INCLUDE_DIRS ${_header}
HINTS
/opt/
/opt/include/
${PC_LIB${_component}_INCLUDEDIR}
${PC_LIB${_component}_INCLUDE_DIRS}
$ENV{FFMPEGDIR}/include/
$ENV{FFMPEGDIR}/include/ffmpeg/
PATH_SUFFIXES
ffmpeg
)

find_library(${_component}_LIBRARIES NAMES ${_library}
HINTS
${PC_LIB${_component}_LIBDIR}
${PC_LIB${_component}_LIBRARY_DIRS}
$ENV{FFMPEGDIR}/lib/
$ENV{FFMPEGDIR}/lib/ffmpeg/
$ENV{FFMPEGDIR}/bin/
)

set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")

set_component_found(${_component})

mark_as_advanced(
${_component}_INCLUDE_DIRS
${_component}_LIBRARIES
${_component}_DEFINITIONS
${_component}_VERSION)

endmacro()


# Check for cached results. If there are skip the costly part.
if (NOT FFMPEG_LIBRARIES)

# Check for all possible component.
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
find_component(AVRESAMPLE libavresample avresample libavresample/avresample.h)

# Check if the required components were found and add their stuff to the FFMPEG_* vars.
foreach (_component ${FFmpeg_FIND_COMPONENTS})
if (${_component}_FOUND)
# message(STATUS "Required component ${_component} present.")
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
else ()
# message(STATUS "Required component ${_component} missing.")
endif ()
endforeach ()

# Build the include path with duplicates removed.
if (FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
endif ()

# cache the vars.
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)

mark_as_advanced(FFMPEG_INCLUDE_DIRS
FFMPEG_LIBRARIES
FFMPEG_DEFINITIONS)

endif ()

# Now set the noncached _FOUND vars for the components.
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE SWRESAMPLE AVRESAMPLE)
set_component_found(${_component})
endforeach ()

# Compile the list of required vars
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
foreach (_component ${FFmpeg_FIND_COMPONENTS})
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
endforeach ()

# Give a nice error message if some of the required vars are missing.
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
8 changes: 5 additions & 3 deletions include/CrashHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ namespace openshot {
class CrashHandler {
private:
/// Default constructor
CrashHandler(){}; // Don't allow user to create an instance of this singleton
CrashHandler(){return;}; // Don't allow user to create an instance of this singleton

/// Default copy method
CrashHandler(CrashHandler const&){}; // Don't allow the user to copy this instance
//CrashHandler(CrashHandler const&){}; // Don't allow the user to copy this instance
CrashHandler(CrashHandler const&) = delete; // Don't allow the user to copy this instance

/// Default assignment operator
CrashHandler & operator=(CrashHandler const&){}; // Don't allow the user to assign this instance
//CrashHandler & operator=(CrashHandler const&){}; // Don't allow the user to assign this instance
CrashHandler & operator=(CrashHandler const&) = delete; // Don't allow the user to assign this instance

/// Private variable to keep track of singleton instance
static CrashHandler *m_pInstance;
Expand Down
4 changes: 2 additions & 2 deletions include/DecklinkInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
#include <fcntl.h>

#include "DeckLinkAPI.h"
#include "../include/Frame.h"
#include "Frame.h"
#include "CacheMemory.h"
#include "../include/OpenMPUtilities.h"
#include "OpenMPUtilities.h"

/// Implementation of the Blackmagic Decklink API (used by the DecklinkReader)
class DeckLinkInputDelegate : public IDeckLinkInputCallback
Expand Down
Loading

0 comments on commit 6c4c9cc

Please sign in to comment.