diff --git a/.gitignore b/.gitignore
index a11656cf1..c02a2fb9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
-build/
-build/*
+/build*
*.DS_Store
.pydevproject
.settings
@@ -7,3 +6,4 @@ build/*
.project
.cproject
/.metadata/
+*~
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f8b139086..f998c3d45 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,12 +17,14 @@ linux-builder:
- 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" ../
+ - cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"CMAKE_BUILD_TYPE:STRING=Release" -D"USE_SYSTEM_JSONCPP=0" ../
- make
- make install
- - mv /usr/local/lib/python3.4/dist-packages/*openshot* install-x64/python
+ - make doc
+ - ~/auto-update-docs "$CI_PROJECT_DIR/build" "$CI_COMMIT_REF_NAME"
+ - mv install-x64/lib/python3.4/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"
- - git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
+ - git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
when: always
except:
- tags
@@ -44,73 +46,70 @@ mac-builder:
- 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" ../
+ - 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 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/*openshot* install-x64/python
+ - mv install-x64/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"
- - git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
+ - git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
when: always
except:
- tags
tags:
- mac
-windows-builder-x86:
+windows-builder-x64:
stage: build-libopenshot
artifacts:
expire_in: 6 months
paths:
- - build\install-x86\*
+ - build\install-x64\*
script:
- - try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
- - if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/develop/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
+ - try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
+ - if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/develop/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
- Expand-Archive -Path artifacts.zip -DestinationPath .
- - $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x86"
- - $env:UNITTEST_DIR = "C:\msys32\usr"
- - $env:RESVGDIR = "C:\msys32\usr\local"
- - $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;
+ - $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x64"
+ - $env:UNITTEST_DIR = "C:\msys64\usr"
+ - $env:RESVGDIR = "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-x86\python
+ - New-Item -ItemType Directory -Force -Path build\install-x64\python
- cd build
- - cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x86" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_CXX_FLAGS=-m32" -D"CMAKE_EXE_LINKER_FLAGS=-Wl,--large-address-aware" -D"CMAKE_C_FLAGS=-m32" ../
+ - cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x64" -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -D"CMAKE_BUILD_TYPE:STRING=Release" ../
- mingw32-make install
- - 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
- - $PREV_GIT_LABEL=(git describe --tags --abbrev=0)
- - git log "$PREV_GIT_LABEL..HEAD" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x86/share/$CI_PROJECT_NAME.log"
+ - Move-Item -Force -path "install-x64\lib\python3.7\site-packages\*openshot*" -destination "install-x64\python\"
+ - 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
+ - $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
+ - git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
when: always
except:
- tags
tags:
- windows
-windows-builder-x64:
+windows-builder-x86:
stage: build-libopenshot
artifacts:
expire_in: 6 months
paths:
- - build\install-x64\*
+ - build\install-x86\*
script:
- - try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
- - if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/develop/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
+ - try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
+ - if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/develop/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
- Expand-Archive -Path artifacts.zip -DestinationPath .
- - $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x64"
- - $env:UNITTEST_DIR = "C:\msys64\usr"
- - $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;
+ - $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x86"
+ - $env:UNITTEST_DIR = "C:\msys32\usr"
+ - $env:RESVGDIR = "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-x64\python
+ - New-Item -ItemType Directory -Force -Path build\install-x86\python
- cd build
- - cmake -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x64" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
+ - cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x86" -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_CXX_FLAGS=-m32" -D"CMAKE_EXE_LINKER_FLAGS=-Wl,--large-address-aware" -D"CMAKE_C_FLAGS=-m32" ../
- mingw32-make install
- - 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
- - $PREV_GIT_LABEL=(git describe --tags --abbrev=0)
- - git log "$PREV_GIT_LABEL..HEAD" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
+ - Move-Item -Force -path "install-x86\lib\python3.7\site-packages\*openshot*" -destination "install-x86\python\"
+ - 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
+ - $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
+ - git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x86/share/$CI_PROJECT_NAME.log"
when: always
except:
- tags
diff --git a/.travis.yml b/.travis.yml
index fa191b2b9..4635f86c3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,49 +1,146 @@
-dist: trusty
+language: cpp
+compiler: gcc
+
+# This section uses a rather esoteric (and tricky!) feature of YAML,
+# &aliases and *anchors, to build package lists out of sublists without
+# repeating their contents. Basically, '&name' creates an alias for the
+# given data, which can then be referenced using the anchor '*name'.
+addons:
+ apt:
+ packages: &p_common # Packages common to all Ubuntu builds
+ - cmake
+ - swig
+ - libopenshot-audio-dev
+ - libmagick++-dev
+ - libunittest++-dev
+ - libzmq3-dev
+ - qtbase5-dev
+ - qtmultimedia5-dev
+ - doxygen
+ - graphviz
+ - curl
+ - jq
+ packages: &ff_common # Common set of FFmpeg packages
+ - *p_common
+ - libfdk-aac-dev
+ - libavcodec-dev
+ - libavformat-dev
+ - libavdevice-dev
+ - libavutil-dev
+ - libavfilter-dev
+ - libswscale-dev
+ - libpostproc-dev
+ - libavresample-dev
+ - libswresample-dev
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
+ - name: "FFmpeg 2 GCC (Ubuntu 16.04 Xenial)"
+ env:
+ - BUILD_VERSION=ffmpeg2
+ - CMAKE_EXTRA_ARGS=""
+ - TEST_TARGET="os_test"
+ os: linux
+ dist: xenial
+ addons:
+ apt:
+ sources:
+ - sourceline: 'ppa:openshot.developers/libopenshot-daily'
+ - sourceline: 'ppa:beineri/opt-qt-5.10.0-xenial'
+ packages:
+ - *ff_common
+
+ - name: "FFmpeg 3 GCC (Ubuntu 18.04 Bionic)"
+ env:
+ - BUILD_VERSION=ffmpeg3
+ - CMAKE_EXTRA_ARGS=""
+ - TEST_TARGET=test
+ os: linux
+ dist: bionic
+ addons:
+ apt:
+ sources:
+ - sourceline: 'ppa:openshot.developers/libopenshot-daily'
+ - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
+ packages:
+ - *ff_common
+ - qt5-default
+
+ - name: "FFmpeg 4 GCC (Ubuntu 18.04 Bionic)"
+ env:
+ - BUILD_VERSION=ffmpeg4
+ - CMAKE_EXTRA_ARGS=""
+ - TEST_TARGET=test
+ os: linux
+ dist: bionic
+ addons:
+ apt:
+ sources:
+ - sourceline: 'ppa:openshot.developers/libopenshot-daily'
+ - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
+ - sourceline: 'ppa:jonathonf/ffmpeg-4'
+ packages:
+ - *ff_common
+ - qt5-default
+ - libavcodec58
+ - libavformat58
+ - libavdevice58
+ - libavutil56
+ - libavfilter7
+ - libswscale5
+ - libpostproc55
+ - libavresample4
+ - libswresample3
+
+ - name: "FFmpeg 3 Clang (Ubuntu 18.04 Bionic)"
+ env:
+ - BUILD_VERSION=clang_ffmpeg3
+ - CMAKE_EXTRA_ARGS=""
+ - TEST_TARGET=test
+ os: linux
+ dist: bionic
+ compiler: clang
+ addons:
+ apt:
+ sources:
+ - sourceline: 'ppa:openshot.developers/libopenshot-daily'
+ - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
+ packages:
+ - *ff_common
+ - qt5-default
+ - libomp-dev
+
+
+ - name: "Coverage (Ubuntu 18.04 Bionic)"
+ env:
+ - BUILD_VERSION=coverage_ffmpeg3
+ - CMAKE_EXTRA_ARGS="-DENABLE_COVERAGE=1"
+ - TEST_TARGET=coverage
+ os: linux
+ dist: bionic
+ addons:
+ apt:
+ sources:
+ - sourceline: 'ppa:openshot.developers/libopenshot-daily'
+ - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
+ packages:
+ - *ff_common
+ - qt5-default
+ - lcov
+ - binutils-common # For c++filt
+
+before_script:
+ - CODACY_VERSION="$(curl -Ls https://api.bintray.com/packages/codacy/Binaries/codacy-coverage-reporter/versions/_latest | jq -r .name)"
+ - if [ "x${TEST_TARGET}" = "xcoverage" ]; then curl -Ls -o codacy-coverage-reporter "https://dl.bintray.com/codacy/Binaries/${CODACY_VERSION}/codacy-coverage-reporter-linux"; chmod +x codacy-coverage-reporter; fi
+
+script:
+ - mkdir -p build; cd build;
+ - cmake -DCMAKE_BUILD_TYPE:STRING="Debug" ${CMAKE_EXTRA_ARGS} ../
+ - make VERBOSE=1
+ - make ${TEST_TARGET}
+ - make install DESTDIR="$BUILD_VERSION"
+ - cd ..
+
+after_success:
+ - if [ "x${TEST_TARGET}" = "xcoverage" ]; then ./codacy-coverage-reporter report -l CPP -r build/coverage.info; fi
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eaf7d65fc..1fae1f418 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,10 +4,10 @@
#
# @section LICENSE
#
-# Copyright (c) 2008-2014 OpenShot Studios, LLC
+# Copyright (c) 2008-2019 OpenShot Studios, LLC
# . This file is part of
-# OpenShot Library (libopenshot), an open-source project dedicated to
-# delivering high quality video editing and animation solutions to the
+# OpenShot Library (libopenshot), an open-source project dedicated to
+# delivering high quality video editing and animation solutions to the
# world. For more information visit .
#
# OpenShot Library (libopenshot) is free software: you can redistribute it
@@ -24,67 +24,133 @@
# along with OpenShot Library. If not, see .
################################################################################
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.2...3.14 FATAL_ERROR)
-MESSAGE("--------------------------------------------------------------")
-MESSAGE("Welcome to the OpenShot Build System! CMake will now check for all required build")
-MESSAGE("dependencies and notify you of any missing files or other issues. If you have any")
-MESSAGE("questions or issues, please visit .")
+message("\
+-----------------------------------------------------------------
+ Welcome to the OpenShot Build System!
+
+CMake will now check libopenshot's build dependencies and inform
+you of any missing files or other issues.
+
+For more information, please visit .
+-----------------------------------------------------------------")
################ ADD CMAKE MODULES ##################
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
-################ GET VERSION INFORMATION FROM VERSION.H ##################
-MESSAGE("--------------------------------------------------------------")
-MESSAGE("Determining Version Number (from Version.h file)")
-
-#### Get the lines related to libopenshot version from the Version.h header
-file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h OPENSHOT_VERSION_LINES
- REGEX "#define[ ]+OPENSHOT_VERSION_.*[0-9]+;.*")
-
-#### Set each line into it's own variable
-list (GET OPENSHOT_VERSION_LINES 0 LINE_MAJOR)
-list (GET OPENSHOT_VERSION_LINES 1 LINE_MINOR)
-list (GET OPENSHOT_VERSION_LINES 2 LINE_BUILD)
-list (GET OPENSHOT_VERSION_LINES 3 LINE_SO)
-
-#### Get the version number out of each line
-STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_MAJOR[ ]+([0-9]+);(.*)" "\\1" MAJOR_VERSION "${LINE_MAJOR}")
-STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_MINOR[ ]+([0-9]+);(.*)" "\\1" MINOR_VERSION "${LINE_MINOR}")
-STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_BUILD[ ]+([0-9]+);(.*)" "\\1" BUILD_VERSION "${LINE_BUILD}")
-STRING(REGEX REPLACE "#define[ ]+OPENSHOT_VERSION_SO[ ]+([0-9]+);(.*)" "\\1" SO_VERSION "${LINE_SO}")
-set(PROJECT_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_VERSION}")
-
-MESSAGE("--> MAJOR Version: ${MAJOR_VERSION}")
-MESSAGE("--> MINOR Version: ${MINOR_VERSION}")
-MESSAGE("--> BUILD Version: ${BUILD_VERSION}")
-MESSAGE("--> SO/API/ABI Version: ${SO_VERSION}")
-MESSAGE("--> VERSION: ${PROJECT_VERSION}")
-MESSAGE("")
+################ PROJECT VERSION ####################
+set(PROJECT_VERSION_FULL "0.2.4")
+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}")
################### SETUP PROJECT ###################
-PROJECT(openshot)
-MESSAGE("--------------------------------------------------------------")
-MESSAGE("Generating build files for ${PROJECT_NAME} (${PROJECT_VERSION})")
+# This will define the following variables
+# PROJECT_NAME
+# PROJECT_VERSION, libopenshot_VERSION
+# PROJECT_VERSION_MAJOR, libopenshot_VERSION_MAJOR
+# PROJECT_VERSION_MINOR, libopenshot_VERSION_MINOR
+# PROJECT_VERSION_PATCH, libopenshot_VERSION_PATCH
+PROJECT(libopenshot LANGUAGES C CXX VERSION ${VERSION_NUM})
+
+message("
+Generating build files for OpenShot with CMake ${CMAKE_VERSION}
+ Building ${PROJECT_NAME} (version ${PROJECT_VERSION})
+ SO/API/ABI Version: ${PROJECT_SO_VERSION}
+")
+
+# Define install paths according to system conventions
+# XXX: This must be AFTER THE PROJECT() COMMAND w/ languages enabled,
+# in order to properly configure CMAKE_INSTALL_LIBDIR path
+include(GNUInstallDirs)
+
+# Collect and display summary of options/dependencies
+include(FeatureSummary)
+
+################ OPTIONS ##################
+# Optional build settings for libopenshot
+option(USE_SYSTEM_JSONCPP "Use system installed JsonCpp, if found" ON)
+option(DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF)
+option(DISABLE_TESTS "Don't build unit tests" OFF)
+option(ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+)" OFF)
+option(ENABLE_COVERAGE "Enable coverage reporting" OFF)
+
+########## 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)
#### Enable C++11 (for std::shared_ptr support)
-set(CMAKE_CXX_FLAGS "-std=c++11")
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
IF (WIN32)
SET_PROPERTY(GLOBAL PROPERTY WIN32 "WIN32")
ENDIF(WIN32)
-############## FIND ALL QT RELATED HEADERS ##############
-set(QT_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/Qt)
-FILE(GLOB QT_HEADER_FILES "${QT_HEADER_DIR}/*.h")
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_BINARY_DIR}/include)
-############## PROCESS SUB-DIRECTORIES ##############
+############## Code Coverage #########################
+if (DISABLE_TESTS AND ENABLE_COVERAGE)
+ message(WARNING "ENABLE_COVERAGE requires tests, overriding DISABLE_TESTS")
+ set(DISABLE_TESTS OFF CACHE BOOL "Don't build unit tests" FORCE)
+endif()
+
+if (ENABLE_COVERAGE)
+ if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Debug")
+ message(STATUS "Coverage enabled, setting build type to Debug")
+ endif()
+ include(CodeCoverage)
+ APPEND_COVERAGE_COMPILER_FLAGS()
+endif()
+add_feature_info("Coverage" ENABLE_COVERAGE "analyze test coverage and generate report")
+
+############## PROCESS src/ DIRECTORIES ##############
add_subdirectory(src)
-add_subdirectory(tests)
################### DOCUMENTATION ###################
# Find Doxygen (used for documentation)
include(cmake/Modules/UseDoxygen.cmake)
-file(GLOB_RECURSE doc_files ${CMAKE_CURRENT_BINARY_DIR}/doc/html/*.*)
-INSTALL(FILES ${doc_files} DESTINATION share/doc/libopenshot)
+# Doxygen was found
+if (TARGET doc)
+ message(STATUS "Doxygen found, documentation target enabled")
+ message("\nTo compile documentation in doc/html, run: 'make doc'")
+
+ # Install docs, if the user builds them with `make doc`
+ install(CODE "MESSAGE(\"Checking for documentation files to install...\")")
+ install(CODE "MESSAGE(\"(Compile with 'make doc' command, requires Doxygen)\")")
+
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html/
+ DESTINATION ${CMAKE_INSTALL_DOCDIR}/API
+ MESSAGE_NEVER # Don't spew about file copies
+ OPTIONAL ) # No error if the docs aren't found
+endif()
+
+############# PROCESS tests/ DIRECTORY ##############
+if(NOT DISABLE_TESTS)
+ add_subdirectory(tests)
+endif()
+
+############## COVERAGE REPORTING #################
+if (ENABLE_COVERAGE)
+ setup_target_for_coverage_lcov(
+ NAME coverage
+ LCOV_ARGS "--no-external"
+ EXECUTABLE openshot-test
+ DEPENDENCIES openshot-test)
+ message("Generate coverage report with 'make coverage'")
+endif()
+
+########### PRINT FEATURE SUMMARY ##############
+feature_summary(WHAT ALL
+ INCLUDE_QUIET_PACKAGES
+ FATAL_ON_MISSING_REQUIRED_PACKAGES
+ DESCRIPTION "Displaying feature summary\n\nBuild configuration:")
diff --git a/Doxyfile.in b/Doxyfile.in
index 7cf50631a..c47d6e651 100644
--- a/Doxyfile.in
+++ b/Doxyfile.in
@@ -1,4 +1,4 @@
-# Doxyfile 1.8.6
+# Doxyfile 1.8.15
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -17,11 +17,11 @@
# Project related configuration options
#---------------------------------------------------------------------------
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
@@ -46,10 +46,10 @@ PROJECT_NUMBER = "@PROJECT_VERSION@"
PROJECT_BRIEF =
-# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
-# the documentation. The maximum height of the logo should not exceed 55 pixels
-# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
-# to the output directory.
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
PROJECT_LOGO =
@@ -60,7 +60,7 @@ PROJECT_LOGO =
OUTPUT_DIRECTORY = "@DOXYFILE_OUTPUT_DIR@"
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# will distribute the generated files over these directories. Enabling this
# option can be useful when feeding doxygen a huge amount of source files, where
@@ -70,6 +70,14 @@ OUTPUT_DIRECTORY = "@DOXYFILE_OUTPUT_DIR@"
CREATE_SUBDIRS = NO
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
@@ -85,14 +93,22 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all generated output in the proper direction.
+# Possible values are: None, LTR, RTL and Context.
+# The default value is: None.
+
+OUTPUT_TEXT_DIRECTION = None
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
# description of a member or function before the detailed description
#
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
@@ -127,7 +143,7 @@ ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
# shortest path that makes the file name unique will be used
# The default value is: YES.
@@ -197,9 +213,9 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
-# new page for each member. If set to NO, the documentation of a member will be
-# part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
@@ -218,7 +234,12 @@ TAB_SIZE = 8
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
+# newlines (in the resulting output). You can put ^^ in the value part of an
+# alias to insert a newline as if a physical newline was in the original file.
+# When you need a literal { or } or , in the value part of an alias you have to
+# escape them by means of a backslash (\), this can lead to conflicts with the
+# commands \{ and \} for these it is advised to use the version @{ and @} or use
+# a double escape (\\{ and \\})
ALIASES =
@@ -256,16 +277,28 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C.
+# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is
+# Fortran), use: inc=Fortran f=C.
#
-# Note For files without extension you can use no_extension as a placeholder.
+# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
@@ -274,7 +307,7 @@ EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
@@ -282,10 +315,19 @@ EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 0.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 0
+
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by by putting a % sign in front of the word
-# or globally by setting AUTOLINK_SUPPORT to NO.
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
@@ -298,7 +340,7 @@ AUTOLINK_SUPPORT = YES
# diagrams that involve STL classes more complete and accurate.
# The default value is: NO.
-BUILTIN_STL_SUPPORT = NO
+BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
@@ -307,7 +349,7 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
@@ -325,13 +367,20 @@ SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
+# tag is set to YES then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
# type (e.g. under the Public Functions section). Set it to NO to prevent
@@ -390,7 +439,7 @@ LOOKUP_CACHE_SIZE = 0
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
@@ -400,35 +449,35 @@ LOOKUP_CACHE_SIZE = 0
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = NO
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local methods,
+# This flag is only useful for Objective-C code. If set to YES, local methods,
# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO only methods in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
# included.
# The default value is: NO.
@@ -453,21 +502,21 @@ HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO these classes will be included in the various overviews. This option has
-# no effect if EXTRACT_ALL is enabled.
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO these declarations will be
+# (class|struct|union) declarations. If set to NO, these declarations will be
# included in the documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO these
+# documentation blocks found inside the body of a function. If set to NO, these
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
@@ -481,7 +530,7 @@ HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES upper-case letters are also
+# names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
@@ -490,12 +539,19 @@ INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES the
+# their full class and namespace scopes in the documentation. If set to YES, the
# scope will be hidden.
# The default value is: NO.
HIDE_SCOPE_NAMES = NO
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
@@ -523,14 +579,14 @@ INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order.
+# name. If set to NO, the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order. Note that
+# name. If set to NO, the members will appear in declaration order. Note that
# this will also influence the order of the classes in the class list.
# The default value is: NO.
@@ -575,27 +631,25 @@ SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
-# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
-# todo list. This list is created by putting \todo commands in the
-# documentation.
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
-# test list. This list is created by putting \test commands in the
-# documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
# the deprecated list. This list is created by putting \deprecated commands in
# the documentation.
# The default value is: YES.
@@ -620,8 +674,8 @@ ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES the list
-# will mention the files that were used to generate the documentation.
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
# The default value is: YES.
SHOW_USED_FILES = YES
@@ -666,11 +720,10 @@ LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. Do not use file names with spaces, bibtex cannot handle them. See
-# also \cite for info how to create references.
+# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
@@ -686,7 +739,7 @@ CITE_BIB_FILES =
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
# this implies that the warnings are on.
#
# Tip: Turn warnings on while writing the documentation.
@@ -694,7 +747,7 @@ QUIET = YES
WARNINGS = YES
-# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
@@ -711,12 +764,19 @@ WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
-# value. If set to NO doxygen will only warn about wrong or incomplete parameter
-# documentation, but not about the absence of documentation.
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation. If
+# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
@@ -740,16 +800,18 @@ WARN_LOGFILE =
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/include" \
- "@CMAKE_CURRENT_SOURCE_DIR@/src"
+ "@CMAKE_CURRENT_SOURCE_DIR@/src" \
+ "@CMAKE_CURRENT_SOURCE_DIR@/doc"
+
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
# possible encodings.
# The default value is: UTF-8.
@@ -757,12 +819,17 @@ INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS =
@@ -797,8 +864,9 @@ EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = "*/.*" \
"*/.*/*" \
- "*/src/Main.cpp*" \
- "*/src/Main_Blackmagic.cpp*"
+ "*/src/examples/*" \
+ "*/src/bindings/*" \
+ "*.py"
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -851,6 +919,10 @@ IMAGE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@"
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
INPUT_FILTER =
@@ -860,11 +932,15 @@ INPUT_FILTER =
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER ) will also be used to filter the input files that are used for
+# INPUT_FILTER) will also be used to filter the input files that are used for
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
# The default value is: NO.
@@ -912,10 +988,10 @@ INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = NO
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
+# entity all documented functions referencing it will be listed.
# The default value is: NO.
-REFERENCED_BY_RELATION = NO
+REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
@@ -924,7 +1000,7 @@ REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
# link to the documentation.
# The default value is: YES.
@@ -944,12 +1020,12 @@ SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
+# (see https://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
@@ -1001,7 +1077,7 @@ IGNORE_PREFIX =
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = YES
@@ -1063,13 +1139,15 @@ HTML_FOOTER =
HTML_STYLESHEET =
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
-# defined cascading style sheet that is included after the standard style sheets
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
# created by doxygen. Using this option one can overrule certain style aspects.
# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefor more robust against future updates.
-# Doxygen will copy the style sheet file to the output directory. For an example
-# see the documentation.
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
@@ -1082,12 +1160,12 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_FILES = "doc/InstallationGuide.pdf"
+HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the stylesheet and background images according to
+# will adjust the colors in the style sheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
@@ -1116,12 +1194,24 @@ HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via Javascript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have Javascript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS = YES
+
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
@@ -1145,13 +1235,13 @@ HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# environment (see: https://developer.apple.com/xcode/), introduced with OSX
+# 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1190,7 +1280,7 @@ DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
@@ -1213,28 +1303,29 @@ GENERATE_HTMLHELP = NO
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
# doxygen will try to run the HTML help compiler on the generated index.hhp.
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
-# The GENERATE_CHI flag controls if a separate .chi index file is generated (
-# YES) or that it should be included in the master .chm file ( NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
-# The BINARY_TOC flag controls whether a binary table of contents is generated (
-# YES) or a normal table of contents ( NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
@@ -1265,7 +1356,7 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1273,7 +1364,7 @@ QHP_NAMESPACE =
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1282,7 +1373,7 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1290,7 +1381,7 @@ QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1298,7 +1389,7 @@ QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
@@ -1347,7 +1438,7 @@ DISABLE_INDEX = NO
# index structure (just like the one that is generated for HTML Help). For this
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
# further fine-tune the look of the index. As an example, the default style
# sheet generated by doxygen has an example that shows how to put an image at
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
@@ -1375,7 +1466,7 @@ ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
# external symbols imported via tag files in a separate window.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1391,7 +1482,7 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
@@ -1403,8 +1494,8 @@ FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# https://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
# to it using the MATHJAX_RELPATH option.
@@ -1430,8 +1521,8 @@ MATHJAX_FORMAT = HTML-CSS
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# MathJax from https://www.mathjax.org before deployment.
+# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
@@ -1474,11 +1565,11 @@ SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
-# are two flavours of web server based searching depending on the
-# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
-# searching and an index file used by the script. When EXTERNAL_SEARCH is
-# enabled the indexing and searching needs to be provided by external tools. See
-# the section "External Indexing and Searching" for details.
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
@@ -1490,9 +1581,9 @@ SERVER_BASED_SEARCH = NO
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
# search results.
#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
+# Xapian (see: https://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
@@ -1503,9 +1594,9 @@ EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Xapian (see: https://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
@@ -1541,7 +1632,7 @@ EXTRA_SEARCH_MAPPINGS =
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = @DOXYFILE_GENERATE_LATEX@
@@ -1557,22 +1648,35 @@ LATEX_OUTPUT = "@DOXYFILE_LATEX_DIR@"
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = "@LATEX_COMPILER@"
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = "@MAKEINDEX_COMPILER@"
-# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: \makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_MAKEINDEX_CMD = \makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
@@ -1590,9 +1694,12 @@ COMPACT_LATEX = NO
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1606,23 +1713,36 @@ EXTRA_PACKAGES =
#
# Note: Only use a user-defined header if you know what you are doing! The
# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
-# replace them by respectively the title of the page, the current date and time,
-# only the current date, the version number of doxygen, the project name (see
-# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer.
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
#
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
# directory. Note that the files will be copied as-is; there are no commands or
@@ -1640,8 +1760,8 @@ LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
-# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES to get a
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
# higher quality PDF documentation.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1676,17 +1796,33 @@ LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
+
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
# readers/editors.
# The default value is: NO.
@@ -1701,7 +1837,7 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
# documents. This may be useful for small projects and may help to save some
# trees in general.
# The default value is: NO.
@@ -1721,9 +1857,9 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
@@ -1732,17 +1868,27 @@ RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
# classes and files.
# The default value is: NO.
@@ -1766,6 +1912,13 @@ MAN_OUTPUT = man
MAN_EXTENSION = .3
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
# man page(s). These additional files only source the real man page, but without
@@ -1779,7 +1932,7 @@ MAN_LINKS = NO
# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
@@ -1793,19 +1946,7 @@ GENERATE_XML = NO
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
-# validating XML parser to check the syntax of the XML files.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
-# validating XML parser to check the syntax of the XML files.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
# of the XML output.
@@ -1814,11 +1955,18 @@ XML_DTD =
XML_PROGRAMLISTING = YES
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
+
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
-# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
# that can be used to generate PDF.
# The default value is: NO.
@@ -1832,14 +1980,23 @@ GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
-# Definitions (see http://autogen.sf.net) file that captures the structure of
-# the code including all documentation. Note that this feature is still
-# experimental and incomplete at the moment.
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
@@ -1848,7 +2005,7 @@ GENERATE_AUTOGEN_DEF = NO
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
# file that captures the structure of the code including all documentation.
#
# Note that this feature is still experimental and incomplete at the moment.
@@ -1856,7 +2013,7 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
# output from the Perl module output.
# The default value is: NO.
@@ -1864,9 +2021,9 @@ GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO the
+# understand what is going on. On the other hand, if this tag is set to NO, the
# size of the Perl module output will be much smaller and Perl will parse it
# just the same.
# The default value is: YES.
@@ -1886,14 +2043,14 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
-# in the source code. If set to NO only conditional compilation will be
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
@@ -1909,7 +2066,7 @@ MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
-# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
@@ -1939,7 +2096,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED =
+PREDEFINED = USE_BLACKMAGIC USE_IMAGEMAGICK
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -1951,9 +2108,9 @@ PREDEFINED =
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all refrences to function-like macros that are alone on a line, have an
-# all uppercase name, and do not end with a semicolon. Such function macros are
-# typically used for boiler-plate code, and will confuse the parser if not
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
# removed.
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
@@ -1973,7 +2130,7 @@ SKIP_FUNCTION_MACROS = YES
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
# section "Linking to external documentation" for more information about the use
# of tag files.
-# Note: Each tag file must have an unique name (where the name does NOT include
+# Note: Each tag file must have a unique name (where the name does NOT include
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
@@ -1985,20 +2142,21 @@ TAGFILES =
GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
-# class index. If set to NO only the inherited external classes will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
-# the modules index. If set to NO, only the current project's groups will be
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
# listed.
# The default value is: YES.
EXTERNAL_GROUPS = YES
-# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
# the related pages index. If set to NO, only the current project's pages will
# be listed.
# The default value is: YES.
@@ -2015,7 +2173,7 @@ PERL_PATH = /usr/bin/perl
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
@@ -2040,7 +2198,7 @@ MSCGEN_PATH =
DIA_PATH =
-# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# If set to YES the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
@@ -2065,7 +2223,7 @@ HAVE_DOT = @DOXYFILE_DOT@
DOT_NUM_THREADS = 0
-# When you want a differently looking font n the dot files that doxygen
+# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
@@ -2073,7 +2231,7 @@ DOT_NUM_THREADS = 0
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTNAME =
+DOT_FONTNAME =
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
@@ -2113,7 +2271,7 @@ COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
# The default value is: NO.
@@ -2165,7 +2323,8 @@ INCLUDED_BY_GRAPH = YES
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
@@ -2176,7 +2335,8 @@ CALL_GRAPH = NO
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
@@ -2199,15 +2359,19 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
-# Possible values are: png, jpg, gif and svg.
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_IMAGE_FORMAT = png
+DOT_IMAGE_FORMAT = svg
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
@@ -2219,7 +2383,7 @@ DOT_IMAGE_FORMAT = png
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
-INTERACTIVE_SVG = NO
+INTERACTIVE_SVG = YES
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -2246,6 +2410,24 @@ MSCFILE_DIRS =
DIAFILE_DIRS =
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
# larger than this value, doxygen will truncate the graph, which is visualized
@@ -2282,7 +2464,7 @@ MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
# this, this feature is disabled by default.
@@ -2299,7 +2481,7 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
# files that are used to generate the various graphs.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
diff --git a/README.md b/README.md
index 8deb86a16..cf69c1cfe 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,13 @@ are also available in the /docs/ source folder.
* [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.
+
## Documentation
Beautiful HTML documentation can be generated using Doxygen.
diff --git a/cmake/Modules/CodeCoverage.cmake b/cmake/Modules/CodeCoverage.cmake
new file mode 100644
index 000000000..786a06b4a
--- /dev/null
+++ b/cmake/Modules/CodeCoverage.cmake
@@ -0,0 +1,414 @@
+# Copyright (c) 2012 - 2017, Lars Bilke
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors
+# may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# CHANGES:
+#
+# 2012-01-31, Lars Bilke
+# - Enable Code Coverage
+#
+# 2013-09-17, Joakim Söderberg
+# - Added support for Clang.
+# - Some additional usage instructions.
+#
+# 2016-02-03, Lars Bilke
+# - Refactored functions to use named parameters
+#
+# 2017-06-02, Lars Bilke
+# - Merged with modified version from github.com/ufz/ogs
+#
+# 2019-05-06, Anatolii Kurotych
+# - Remove unnecessary --coverage flag
+#
+# 2019-12-13, FeRD (Frank Dana)
+# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
+# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
+# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
+# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
+# - Set lcov basedir with -b argument
+# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
+# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
+# - Delete output dir, .info file on 'make clean'
+# - Remove Python detection, since version mismatches will break gcovr
+# - Minor cleanup (lowercase function names, update examples...)
+#
+# 2019-12-19, FeRD (Frank Dana)
+# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
+#
+# USAGE:
+#
+# 1. Copy this file into your cmake modules path.
+#
+# 2. Add the following line to your CMakeLists.txt:
+# include(CodeCoverage)
+#
+# 3. Append necessary compiler flags:
+# append_coverage_compiler_flags()
+#
+# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og
+#
+# 4. If you need to exclude additional directories from the report, specify them
+# using full paths in the COVERAGE_EXCLUDES variable before calling
+# setup_target_for_coverage_*().
+# Example:
+# set(COVERAGE_EXCLUDES
+# '${PROJECT_SOURCE_DIR}/src/dir1/*'
+# '/path/to/my/src/dir2/*')
+# Or, use the EXCLUDE argument to setup_target_for_coverage_*().
+# Example:
+# setup_target_for_coverage_lcov(
+# NAME coverage
+# EXECUTABLE testrunner
+# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*")
+#
+# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set
+# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR)
+# Example:
+# set(COVERAGE_EXCLUDES "dir1/*")
+# setup_target_for_coverage_gcovr_html(
+# NAME coverage
+# EXECUTABLE testrunner
+# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
+# EXCLUDE "dir2/*")
+#
+# 5. Use the functions described below to create a custom make target which
+# runs your test executable and produces a code coverage report.
+#
+# 6. Build a Debug build:
+# cmake -DCMAKE_BUILD_TYPE=Debug ..
+# make
+# make my_coverage_target
+#
+
+include(CMakeParseArguments)
+
+# Check prereqs
+find_program( GCOV_PATH gcov )
+find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
+find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
+find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
+find_program( CPPFILT_PATH NAMES c++filt )
+
+if(NOT GCOV_PATH)
+ message(FATAL_ERROR "gcov not found! Aborting...")
+endif() # NOT GCOV_PATH
+
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
+ if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
+ message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
+ endif()
+elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
+ message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+endif()
+
+set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
+ CACHE INTERNAL "")
+
+set(CMAKE_CXX_FLAGS_COVERAGE
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the C++ compiler during coverage builds."
+ FORCE )
+set(CMAKE_C_FLAGS_COVERAGE
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the C compiler during coverage builds."
+ FORCE )
+set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ ""
+ CACHE STRING "Flags used for linking binaries during coverage builds."
+ FORCE )
+set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ ""
+ CACHE STRING "Flags used by the shared libraries linker during coverage builds."
+ FORCE )
+mark_as_advanced(
+ CMAKE_CXX_FLAGS_COVERAGE
+ CMAKE_C_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
+
+if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
+endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ link_libraries(gcov)
+endif()
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_lcov(
+# NAME testrunner_coverage # New target name
+# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES testrunner # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# NO_DEMANGLE # Don't demangle C++ symbols
+# # even if c++filt is found
+# )
+function(setup_target_for_coverage_lcov)
+
+ set(options NO_DEMANGLE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT LCOV_PATH)
+ message(FATAL_ERROR "lcov not found! Aborting...")
+ endif() # NOT LCOV_PATH
+
+ if(NOT GENHTML_PATH)
+ message(FATAL_ERROR "genhtml not found! Aborting...")
+ endif() # NOT GENHTML_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(${Coverage_BASE_DIRECTORY})
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(LCOV_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES LCOV_EXCLUDES)
+
+ # Conditional arguments
+ if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
+ set(GENHTML_EXTRA_ARGS "--demangle-cpp")
+ endif()
+
+ # Setup target
+ add_custom_target(${Coverage_NAME}
+
+ # Cleanup lcov
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . -b ${BASEDIR} --zerocounters
+ # Create baseline to make sure untouched files show up in the report
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b ${BASEDIR} -o ${Coverage_NAME}.base
+
+ # Run tests
+ COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+
+ # Capturing lcov counters and generating report
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
+ # add baseline counters
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
+ # filter collected data to final coverage report
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
+
+ # Generate HTML output
+ COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o ${Coverage_NAME} ${Coverage_NAME}.info
+
+ # Set output files as GENERATED (will be removed on 'make clean')
+ BYPRODUCTS
+ ${Coverage_NAME}.base
+ ${Coverage_NAME}.capture
+ ${Coverage_NAME}.total
+ ${Coverage_NAME}.info
+ ${Coverage_NAME} # report directory
+
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+ )
+
+ # Show where to find the lcov info report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
+ )
+
+endfunction() # setup_target_for_coverage_lcov
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_gcovr_xml(
+# NAME ctest_coverage # New target name
+# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES executable_target # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# )
+function(setup_target_for_coverage_gcovr_xml)
+
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(${Coverage_BASE_DIRECTORY})
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ string(REPLACE "*" "\\*" EXCLUDE_REPLACED ${EXCLUDE})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE_REPLACED}")
+ endforeach()
+
+ add_custom_target(${Coverage_NAME}
+ # Run tests
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+
+ # Running gcovr
+ COMMAND ${GCOVR_PATH} --xml
+ -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
+ --object-directory=${PROJECT_BINARY_DIR}
+ -o ${Coverage_NAME}.xml
+ BYPRODUCTS ${Coverage_NAME}.xml
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ COMMENT "Running gcovr to produce Cobertura code coverage report."
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
+ )
+endfunction() # setup_target_for_coverage_gcovr_xml
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_gcovr_html(
+# NAME ctest_coverage # New target name
+# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES executable_target # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# )
+function(setup_target_for_coverage_gcovr_html)
+
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(${Coverage_BASE_DIRECTORY})
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ string(REPLACE "*" "\\*" EXCLUDE_REPLACED ${EXCLUDE})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE_REPLACED}")
+ endforeach()
+
+ add_custom_target(${Coverage_NAME}
+ # Run tests
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+
+ # Create folder
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
+
+ # Running gcovr
+ COMMAND ${GCOVR_PATH} --html --html-details
+ -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
+ --object-directory=${PROJECT_BINARY_DIR}
+ -o ${Coverage_NAME}/index.html
+ BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ COMMENT "Running gcovr to produce HTML code coverage report."
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
+ )
+
+endfunction() # setup_target_for_coverage_gcovr_html
+
+function(append_coverage_compiler_flags)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
+ message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
+endfunction() # append_coverage_compiler_flags
diff --git a/cmake/Modules/FindFFmpeg.cmake b/cmake/Modules/FindFFmpeg.cmake
index 34f0a7bdb..b6da92444 100644
--- a/cmake/Modules/FindFFmpeg.cmake
+++ b/cmake/Modules/FindFFmpeg.cmake
@@ -1,55 +1,97 @@
# 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 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
-# _FOUND - System has
-# _INCLUDE_DIRS - Include directory necessary for using the headers
-# _LIBRARIES - Link these to use
-# _DEFINITIONS - Compiler switches required for using
-# _VERSION - The components version
-#
-# Copyright (c) 2006, Matthias Kretz,
-# Copyright (c) 2008, Alexander Neundorf,
-# Copyright (c) 2011, Michael Jansen,
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#[=======================================================================[.rst:
+FindFFmpeg
+----------
+Try to find the requested ffmpeg components(default: avformat, avutil, avcodec)
+
+IMPORTED targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` targets ``FFmpeg:`` for
+each found component (see below).
+
+Components
+^^^^^^^^^^
+
+The module recognizes the following components:
+
+::
+
+ avcodec - target FFmpeg::avcodec
+ avdevice - target FFmpeg::avdevice
+ avformat - target FFmpeg::avformat
+ avfilter - target FFmpeg::avfilter
+ avutil - target FFmpeg::avutil
+ postproc - target FFmpeg::postproc
+ swscale - target FFmpeg::swscale
+ swresample - target FFmpeg::swresample
+ avresample - target FFmpeg::avresample
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ 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 component, ``_FOUND`` will be set if the component is available.
+
+For each ``_FOUND``, the following variables will be defined:
+
+::
+
+ _INCLUDE_DIRS - Include directory necessary for using the headers
+ _LIBRARIES - Link these to use
+ _DEFINITIONS - Compiler switches required for using
+ _VERSION - The components version
+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.
+
+Copyright (c) 2006, Matthias Kretz,
+Copyright (c) 2008, Alexander Neundorf,
+Copyright (c) 2011, Michael Jansen,
+Copyright (c) 2019, FeRD (Frank Dana)
+
+Redistribution and use is allowed according to the terms of the BSD license.
+For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#]=======================================================================]
include(FindPackageHandleStandardArgs)
-# The default components were taken from a survey over other FindFFMPEG.cmake files
+set(FFmpeg_ALL_COMPONENTS avcodec avdevice avformat avfilter avutil postproc swscale swresample avresample)
+
+# Default to all components, if not specified
+if (FFMPEG_FIND_COMPONENTS AND NOT FFmpeg_FIND_COMPONENTS)
+ set(FFmpeg_FIND_COMPONENTS ${FFMPEG_FIND_COMPONENTS})
+endif ()
if (NOT FFmpeg_FIND_COMPONENTS)
- set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
+ set(FFmpeg_FIND_COMPONENTS ${FFmpeg_ALL_COMPONENTS})
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 ()
+ if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
+ # message(STATUS "FFmpeg - ${_component} found.")
+ set(${_component}_FOUND TRUE)
+ else ()
+ if (NOT FFmpeg_FIND_QUIETLY AND NOT FFMPEG_FIND_QUIETLY)
+ message(STATUS "FFmpeg - ${_component} not found.")
+ endif ()
+ endif ()
endmacro()
#
@@ -60,102 +102,153 @@ endmacro()
#
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)
+ 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_${_component}_INCLUDEDIR}
+ ${PC_${_component}_INCLUDE_DIRS}
+ $ENV{FFMPEGDIR}/include/
+ $ENV{FFMPEGDIR}/include/ffmpeg/
+ PATH_SUFFIXES
+ ffmpeg
+ )
+
+ find_library(${_component}_LIBRARIES NAMES ${_library}
+ HINTS
+ ${PC_${_component}_LIBDIR}
+ ${PC_${_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)
+if (NOT FFmpeg_LIBRARIES)
+
+ # Check for all possible component.
+ find_component(avcodec libavcodec avcodec libavcodec/avcodec.h)
+ find_component(avdevice libavdevice avdevice libavdevice/avdevice.h)
+ find_component(avformat libavformat avformat libavformat/avformat.h)
+ find_component(avfilter libavfilter avfilter libavfilter/avfilter.h)
+ find_component(avutil libavutil avutil libavutil/avutil.h)
+ find_component(postproc libpostproc postproc libpostproc/postprocess.h)
+ find_component(swscale libswscale swscale libswscale/swscale.h)
+ find_component(swresample libswresample swresample libswresample/swresample.h)
+ find_component(avresample libavresample avresample libavresample/avresample.h)
+else()
+ # Just set the noncached _FOUND vars for the components.
+ foreach(_component ${FFmpeg_ALL_COMPONENTS})
+ set_component_found(${_component})
+ endforeach ()
+endif()
+
+# Check if the requested components were found and add their stuff to the FFmpeg_* vars.
+foreach (_component ${FFmpeg_FIND_COMPONENTS})
+ string(TOLOWER "${_component}" _component)
+ if (${_component}_FOUND)
+ # message(STATUS "Requested 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 "Requested component ${_component} missing.")
+ endif ()
+endforeach ()
+# Build the result lists with duplicates removed, in case of repeated
+# invocations.
+if (FFmpeg_INCLUDE_DIRS)
+ list(REMOVE_DUPLICATES FFmpeg_INCLUDE_DIRS)
+endif()
+if (FFmpeg_LIBRARIES)
+ list(REMOVE_DUPLICATES FFmpeg_LIBRARIES)
+endif()
+if(FFmpeg_DEFINITIONS)
+ list(REMOVE_DUPLICATES 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 ()
+# 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)
+
+# Backwards compatibility
+foreach(_suffix INCLUDE_DIRS LIBRARIES DEFINITIONS)
+ get_property(_help CACHE FFmpeg_${_suffix} PROPERTY HELPSTRING)
+ set(FFMPEG_${_suffix} ${FFmpeg_${_suffix}} CACHE STRING "${_help}" FORCE)
+ mark_as_advanced(FFMPEG_${_suffix})
+endforeach()
+foreach(_component ${FFmpeg_ALL_COMPONENTS})
+ if(${_component}_FOUND)
+ string(TOUPPER "${_component}" _uc_component)
+ set(${_uc_component}_FOUND TRUE)
+ foreach(_suffix INCLUDE_DIRS LIBRARIES DEFINITIONS VERSION)
+ get_property(_help CACHE ${_component}_${_suffix} PROPERTY HELPSTRING)
+ set(${_uc_component}_${_suffix} ${${_component}_${_suffix}} CACHE STRING "${_help}" FORCE)
+ mark_as_advanced(${_uc_component}_${_suffix})
+ endforeach()
+ endif()
+endforeach()
# Compile the list of required vars
-set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
+set(_FFmpeg_REQUIRED_VARS FFmpeg_LIBRARIES FFmpeg_INCLUDE_DIRS)
foreach (_component ${FFmpeg_FIND_COMPONENTS})
- list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
+ 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})
\ No newline at end of file
+find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
+
+# Export targets for each found component
+foreach (_component ${FFmpeg_ALL_COMPONENTS})
+
+ if(${_component}_FOUND)
+ # message(STATUS "Creating IMPORTED target FFmpeg::${_component}")
+
+ if(NOT TARGET FFmpeg::${_component})
+ add_library(FFmpeg::${_component} UNKNOWN IMPORTED)
+
+ set_target_properties(FFmpeg::${_component} PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${${_component}_INCLUDE_DIRS}")
+
+ set_property(TARGET FFmpeg::${_component} APPEND PROPERTY
+ INTERFACE_COMPILE_DEFINITIONS "${${_component}_DEFINITIONS}")
+
+ set_property(TARGET FFmpeg::${_component} APPEND PROPERTY
+ IMPORTED_LOCATION "${${_component}_LIBRARIES}")
+ endif()
+
+ endif()
+
+endforeach()
diff --git a/cmake/Modules/FindOpenShotAudio.cmake b/cmake/Modules/FindOpenShotAudio.cmake
index 1de4529bd..a0cb9200c 100644
--- a/cmake/Modules/FindOpenShotAudio.cmake
+++ b/cmake/Modules/FindOpenShotAudio.cmake
@@ -5,55 +5,112 @@
# LIBOPENSHOT_AUDIO_INCLUDE_DIRS - The juce.h include directories
# LIBOPENSHOT_AUDIO_LIBRARIES - The libraries needed to use juce
-message("$ENV{LIBOPENSHOT_AUDIO_DIR}")
+if("$ENV{LIBOPENSHOT_AUDIO_DIR}" AND NOT "${OpenShotAudio_FIND_QUIETLY}")
+ message(STATUS "Looking for OpenShotAudio in: $ENV{LIBOPENSHOT_AUDIO_DIR}")
+endif()
-# Find the base directory of juce includes
-find_path(LIBOPENSHOT_AUDIO_BASE_DIR JuceHeader.h
- PATHS $ENV{LIBOPENSHOT_AUDIO_DIR}/include/libopenshot-audio/
- /usr/include/libopenshot-audio/
- /usr/local/include/libopenshot-audio/ )
-
-# Get a list of all header file paths
-FILE(GLOB_RECURSE JUCE_HEADER_FILES
- ${LIBOPENSHOT_AUDIO_BASE_DIR}/*.h
+# Find the libopenshot-audio header files (check env/cache vars first)
+find_path(
+ LIBOPENSHOT_AUDIO_INCLUDE_DIR
+ JuceHeader.h
+ HINTS
+ ENV LIBOPENSHOT_AUDIO_DIR
+ PATHS
+ ${LIBOPENSHOT_AUDIO_DIR}
+ PATH_SUFFIXES
+ include/libopenshot-audio
+ libopenshot-audio
+ include
+ NO_DEFAULT_PATH
)
-# Loop through each header file
-FOREACH(HEADER_PATH ${JUCE_HEADER_FILES})
- # Get the directory of each header file
- get_filename_component(HEADER_DIRECTORY ${HEADER_PATH}
- PATH
- )
+# Find the libopenshot-audio header files (fallback to std. paths)
+find_path(
+ LIBOPENSHOT_AUDIO_INCLUDE_DIR
+ JuceHeader.h
+ HINTS
+ ENV LIBOPENSHOT_AUDIO_DIR
+ PATHS
+ ${LIBOPENSHOT_AUDIO_DIR}
+ PATH_SUFFIXES
+ include/libopenshot-audio
+ libopenshot-audio
+ include
+)
- # Append each directory into the HEADER_DIRECTORIES list
- LIST(APPEND HEADER_DIRECTORIES ${HEADER_DIRECTORY})
-ENDFOREACH(HEADER_PATH)
+# Find libopenshot-audio.so / libopenshot-audio.dll (check env/cache vars first)
+find_library(
+ LIBOPENSHOT_AUDIO_LIBRARY
+ NAMES
+ libopenshot-audio
+ openshot-audio
+ HINTS
+ ENV LIBOPENSHOT_AUDIO_DIR
+ PATHS
+ ${LIBOPENSHOT_AUDIO_DIR}
+ PATH_SUFFIXES
+ lib/libopenshot-audio
+ libopenshot-audio
+ lib
+ NO_DEFAULT_PATH
+)
-# Remove duplicates from the header directories list
-LIST(REMOVE_DUPLICATES HEADER_DIRECTORIES)
+# Find libopenshot-audio.so / libopenshot-audio.dll (fallback)
+find_library(
+ LIBOPENSHOT_AUDIO_LIBRARY
+ NAMES
+ libopenshot-audio
+ openshot-audio
+ HINTS
+ ENV LIBOPENSHOT_AUDIO_DIR
+ PATHS
+ ${LIBOPENSHOT_AUDIO_DIR}
+ PATH_SUFFIXES
+ lib/libopenshot-audio
+ libopenshot-audio
+ lib
+)
-# Find the libopenshot-audio.so (check env var first)
-find_library(LIBOPENSHOT_AUDIO_LIBRARY
- NAMES libopenshot-audio openshot-audio
- PATHS $ENV{LIBOPENSHOT_AUDIO_DIR}/lib/ NO_DEFAULT_PATH)
+set(LIBOPENSHOT_AUDIO_LIBRARIES "${LIBOPENSHOT_AUDIO_LIBRARY}")
+set(LIBOPENSHOT_AUDIO_LIBRARY "${LIBOPENSHOT_AUDIO_LIBRARIES}")
+set(LIBOPENSHOT_AUDIO_INCLUDE_DIRS "${LIBOPENSHOT_AUDIO_INCLUDE_DIR}")
-# Find the libopenshot-audio.so / libopenshot-audio.dll library (fallback)
-find_library(LIBOPENSHOT_AUDIO_LIBRARY
- NAMES libopenshot-audio openshot-audio
- HINTS $ENV{LIBOPENSHOT_AUDIO_DIR}/lib/
- /usr/lib/
- /usr/lib/libopenshot-audio/
- /usr/local/lib/ )
+if(LIBOPENSHOT_AUDIO_INCLUDE_DIR AND EXISTS "${LIBOPENSHOT_AUDIO_INCLUDE_DIR}/JuceHeader.h")
+ file(STRINGS "${LIBOPENSHOT_AUDIO_INCLUDE_DIR}/JuceHeader.h" libosa_version_str
+ REGEX "versionString.*=.*\"[^\"]+\"")
+ if(libosa_version_str MATCHES "versionString.*=.*\"([^\"]+)\"")
+ set(LIBOPENSHOT_AUDIO_VERSION_STRING ${CMAKE_MATCH_1})
+ endif()
+ unset(libosa_version_str)
+ string(REGEX REPLACE "^([0-9]+\.[0-9]+\.[0-9]+).*$" "\\1"
+ LIBOPENSHOT_AUDIO_VERSION "${LIBOPENSHOT_AUDIO_VERSION_STRING}")
+endif()
-set(LIBOPENSHOT_AUDIO_LIBRARIES ${LIBOPENSHOT_AUDIO_LIBRARY})
-set(LIBOPENSHOT_AUDIO_LIBRARY ${LIBOPENSHOT_AUDIO_LIBRARIES})
+# If we couldn't parse M.N.B version, don't keep any of it
+if(NOT LIBOPENSHOT_AUDIO_VERSION)
+ unset(LIBOPENSHOT_AUDIO_VERSION)
+ unset(LIBOPENSHOT_AUDIO_VERSION_STRING)
+endif()
-# Seems to work fine with just the base dir (rather than all the actual include folders)
-set(LIBOPENSHOT_AUDIO_INCLUDE_DIR ${LIBOPENSHOT_AUDIO_BASE_DIR} )
-set(LIBOPENSHOT_AUDIO_INCLUDE_DIRS ${LIBOPENSHOT_AUDIO_BASE_DIR} )
+# Determine compatibility with requested version in find_package()
+if(OpenShotAudio_FIND_VERSION AND LIBOPENSHOT_AUDIO_VERSION)
+ if("${OpenShotAudio_FIND_VERSION}" STREQUAL "${LIBOPENSHOT_AUDIO_VERSION}")
+ set(OpenShotAudio_VERSION_EXACT TRUE)
+ endif()
+ if("${OpenShotAudio_FIND_VERSION}" VERSION_GREATER "${LIBOPENSHOT_AUDIO_VERSION}")
+ set(OpenShotAudio_VERSION_COMPATIBLE FALSE)
+ else()
+ set(OpenShotAudio_VERSION_COMPATIBLE TRUE)
+ endif()
+endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBOPENSHOT_AUDIO_FOUND to TRUE
# if all listed variables are TRUE
-find_package_handle_standard_args(LIBOPENSHOT_AUDIO DEFAULT_MSG
- LIBOPENSHOT_AUDIO_LIBRARY LIBOPENSHOT_AUDIO_INCLUDE_DIR)
+find_package_handle_standard_args(OpenShotAudio
+ REQUIRED_VARS
+ LIBOPENSHOT_AUDIO_LIBRARY
+ LIBOPENSHOT_AUDIO_INCLUDE_DIRS
+ VERSION_VAR
+ LIBOPENSHOT_AUDIO_VERSION_STRING
+)
diff --git a/cmake/Modules/FindPythonLibs.cmake b/cmake/Modules/FindPythonLibs.cmake
deleted file mode 100644
index e2ca1c797..000000000
--- a/cmake/Modules/FindPythonLibs.cmake
+++ /dev/null
@@ -1,294 +0,0 @@
-#.rst:
-# FindPythonLibs
-# --------------
-#
-# Find python libraries
-#
-# This module finds if Python is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
-#
-# ::
-#
-# PYTHONLIBS_FOUND - have the Python libs been found
-# PYTHON_LIBRARIES - path to the python library
-# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
-# PYTHON_INCLUDE_DIRS - path to where Python.h is found
-# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
-# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
-#
-#
-#
-# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
-# of version numbers that should be taken into account when searching
-# for Python. You need to set this variable before calling
-# find_package(PythonLibs).
-#
-# If you'd like to specify the installation of Python to use, you should
-# modify the following cache variables:
-#
-# ::
-#
-# PYTHON_LIBRARY - path to the python library
-# PYTHON_INCLUDE_DIR - path to where Python.h is found
-#
-# If also calling find_package(PythonInterp), call find_package(PythonInterp)
-# first to get the currently active Python version by default with a consistent
-# version of PYTHON_LIBRARIES.
-
-#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-include(CMakeFindFrameworks)
-# Search for the python framework on Apple.
-CMAKE_FIND_FRAMEWORKS(Python)
-
-set(_PYTHON1_VERSIONS 1.6 1.5)
-set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-set(_PYTHON3_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
-
-if(PythonLibs_FIND_VERSION)
- if(PythonLibs_FIND_VERSION_COUNT GREATER 1)
- set(_PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION_MAJOR}.${PythonLibs_FIND_VERSION_MINOR}")
- unset(_PYTHON_FIND_OTHER_VERSIONS)
- if(PythonLibs_FIND_VERSION_EXACT)
- if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
- set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
- else()
- set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
- endif()
- else()
- foreach(_PYTHON_V ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS})
- if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
- list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
- endif()
- endforeach()
- endif()
- unset(_PYTHON_FIND_MAJ_MIN)
- else()
- set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS})
- endif()
-else()
- set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
-endif()
-
-# Set up the versions we know about, in the order we will search. Always add
-# the user supplied additional versions to the front.
-# If FindPythonInterp has already found the major and minor version,
-# insert that version between the user supplied versions and the stock
-# version list.
-set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
-if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
- list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-endif()
-list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
-
-unset(_PYTHON_FIND_OTHER_VERSIONS)
-unset(_PYTHON1_VERSIONS)
-unset(_PYTHON2_VERSIONS)
-unset(_PYTHON3_VERSIONS)
-
-foreach(_CURRENT_VERSION ${_Python_VERSIONS})
- string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
- if(WIN32)
- find_library(PYTHON_DEBUG_LIBRARY
- NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
- PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
- )
- endif()
-
- find_library(PYTHON_LIBRARY
- NAMES
- python${_CURRENT_VERSION_NO_DOTS}
- python${_CURRENT_VERSION}mu
- python${_CURRENT_VERSION}m
- python${_CURRENT_VERSION}u
- python${_CURRENT_VERSION}
- PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
- # Avoid finding the .dll in the PATH. We want the .lib.
- NO_SYSTEM_ENVIRONMENT_PATH
- )
- # Look for the static library in the Python config directory
- find_library(PYTHON_LIBRARY
- NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
- # Avoid finding the .dll in the PATH. We want the .lib.
- NO_SYSTEM_ENVIRONMENT_PATH
- # This is where the static library is usually located
- PATH_SUFFIXES python${_CURRENT_VERSION}/config
- )
-
- # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
- # PYTHON_INCLUDE_DIR is not set.
- if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
- set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
- "Path to where Python.h is found" FORCE)
- endif()
-
- set(PYTHON_FRAMEWORK_INCLUDES)
- if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
- foreach(dir ${Python_FRAMEWORKS})
- set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
- ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
- endforeach()
- endif()
-
- find_path(PYTHON_INCLUDE_DIR
- NAMES Python.h
- PATHS
- ${PYTHON_FRAMEWORK_INCLUDES}
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
- PATH_SUFFIXES
- python${_CURRENT_VERSION}mu
- python${_CURRENT_VERSION}m
- python${_CURRENT_VERSION}u
- python${_CURRENT_VERSION}
- )
-
- # For backward compatibility, set PYTHON_INCLUDE_PATH.
- set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
-
- if(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
- file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
- REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
- string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
- PYTHONLIBS_VERSION_STRING "${python_version_str}")
- unset(python_version_str)
- endif()
-
- if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
- break()
- endif()
-endforeach()
-
-mark_as_advanced(
- PYTHON_DEBUG_LIBRARY
- PYTHON_LIBRARY
- PYTHON_INCLUDE_DIR
-)
-
-# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
-# cache entries because they are meant to specify the location of a single
-# library. We now set the variables listed by the documentation for this
-# module.
-set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
-set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
-
-# These variables have been historically named in this module different from
-# what SELECT_LIBRARY_CONFIGURATIONS() expects.
-set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
-set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
-include(SelectLibraryConfigurations)
-SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
-# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
-# Unset this, this prefix doesn't match the module prefix, they are different
-# for historical reasons.
-unset(PYTHON_FOUND)
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
- REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
- VERSION_VAR PYTHONLIBS_VERSION_STRING)
-
-# PYTHON_ADD_MODULE( src1 src2 ... srcN) is used to build modules for python.
-# PYTHON_WRITE_MODULES_HEADER() writes a header file you can include
-# in your sources to initialize the static python modules
-function(PYTHON_ADD_MODULE _NAME )
- get_property(_TARGET_SUPPORTS_SHARED_LIBS
- GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
- option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
- option(PYTHON_MODULE_${_NAME}_BUILD_SHARED
- "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
-
- # Mark these options as advanced
- mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME}
- PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-
- if(PYTHON_ENABLE_MODULE_${_NAME})
- if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
- set(PY_MODULE_TYPE MODULE)
- else()
- set(PY_MODULE_TYPE STATIC)
- set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
- endif()
-
- set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
- add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
-# target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})
-
- if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
- set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
- if(WIN32 AND NOT CYGWIN)
- set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
- endif()
- endif()
-
- endif()
-endfunction()
-
-function(PYTHON_WRITE_MODULES_HEADER _filename)
-
- get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
-
- get_filename_component(_name "${_filename}" NAME)
- string(REPLACE "." "_" _name "${_name}")
- string(TOUPPER ${_name} _nameUpper)
- set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
-
- set(_filenameTmp "${_filename}.in")
- file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
- file(APPEND ${_filenameTmp}
-"#ifndef ${_nameUpper}
-#define ${_nameUpper}
-
-#include
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif /* __cplusplus */
-
-")
-
- foreach(_currentModule ${PY_STATIC_MODULES_LIST})
- file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
- endforeach()
-
- file(APPEND ${_filenameTmp}
-"#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-")
-
-
- foreach(_currentModule ${PY_STATIC_MODULES_LIST})
- file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
- endforeach()
-
- file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
- foreach(_currentModule ${PY_STATIC_MODULES_LIST})
- file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
- endforeach()
- file(APPEND ${_filenameTmp} "}\n\n")
- file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
-
-# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
-
-endfunction()
diff --git a/cmake/Modules/FindRESVG.cmake b/cmake/Modules/FindRESVG.cmake
index b03a0667e..0538eacd5 100644
--- a/cmake/Modules/FindRESVG.cmake
+++ b/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)
+#]=======================================================================]
+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()
diff --git a/cmake/Modules/FindZeroMQ.cmake b/cmake/Modules/FindZeroMQ.cmake
new file mode 100644
index 000000000..6c3669199
--- /dev/null
+++ b/cmake/Modules/FindZeroMQ.cmake
@@ -0,0 +1,34 @@
+set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
+find_package(PkgConfig)
+pkg_check_modules(PC_LIBZMQ QUIET libzmq)
+
+set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
+
+find_path(ZeroMQ_INCLUDE_DIR zmq.h
+ PATHS ${ZeroMQ_DIR}/include
+ ${PC_LIBZMQ_INCLUDE_DIRS})
+
+find_library(ZeroMQ_LIBRARY
+ NAMES zmq
+ PATHS ${ZeroMQ_DIR}/lib
+ ${PC_LIBZMQ_LIBDIR}
+ ${PC_LIBZMQ_LIBRARY_DIRS})
+
+if(ZeroMQ_LIBRARY)
+ set(ZeroMQ_FOUND ON)
+endif()
+
+set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} )
+set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} )
+
+if(NOT TARGET libzmq)
+ add_library(libzmq UNKNOWN IMPORTED)
+ set_target_properties(libzmq PROPERTIES
+ IMPORTED_LOCATION ${ZeroMQ_LIBRARIES}
+ INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS})
+endif()
+
+include ( FindPackageHandleStandardArgs )
+# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS )
diff --git a/cmake/Modules/UseDoxygen.cmake b/cmake/Modules/UseDoxygen.cmake
index 48480e4dd..807dbac62 100644
--- a/cmake/Modules/UseDoxygen.cmake
+++ b/cmake/Modules/UseDoxygen.cmake
@@ -1,4 +1,30 @@
-# - Run Doxygen
+# Redistribution and use is allowed according to the terms of the New
+# BSD license:
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# - Run Doxygen
#
# Adds a doxygen target that runs doxygen to generate the html
# and optionally the LaTeX API documentation.
@@ -48,7 +74,6 @@
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
macro(usedoxygen_set_default name value type docstring)
@@ -80,12 +105,18 @@ if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
STRING "Additional source files/directories separated by space")
set(DOXYFILE_SOURE_DIRS "\"${DOXYFILE_SOURCE_DIR}\" ${DOXYFILE_EXTRA_SOURCES}")
- usedoxygen_set_default(DOXYFILE_LATEX YES BOOL "Generate LaTeX API documentation" OFF)
+ usedoxygen_set_default(DOXYFILE_LATEX OFF BOOL "Generate LaTeX API documentation")
usedoxygen_set_default(DOXYFILE_LATEX_DIR "latex" STRING "LaTex output directory")
mark_as_advanced(DOXYFILE_OUTPUT_DIR DOXYFILE_HTML_DIR DOXYFILE_LATEX_DIR
DOXYFILE_SOURCE_DIR DOXYFILE_EXTRA_SOURCE_DIRS DOXYFILE_IN)
+ ## Dot
+ usedoxygen_set_default(DOXYFILE_USE_DOT ON BOOL "Use dot (part of graphviz) to generate graphs")
+ set(DOXYFILE_DOT "NO")
+ if(DOXYFILE_USE_DOT AND DOXYGEN_DOT_EXECUTABLE)
+ set(DOXYFILE_DOT "YES")
+ endif()
set_property(DIRECTORY
APPEND PROPERTY
@@ -100,13 +131,12 @@ if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
## LaTeX
set(DOXYFILE_PDFLATEX "NO")
- set(DOXYFILE_DOT "NO")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_LATEX_DIR}")
- if(DOXYFILE_LATEX STREQUAL "ON")
+ if(DOXYFILE_LATEX)
set(DOXYFILE_GENERATE_LATEX "YES")
find_package(LATEX)
find_program(DOXYFILE_MAKE make)
@@ -115,9 +145,6 @@ if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
if(PDFLATEX_COMPILER)
set(DOXYFILE_PDFLATEX "YES")
endif()
- if(DOXYGEN_DOT_EXECUTABLE)
- set(DOXYFILE_DOT "YES")
- endif()
add_custom_command(TARGET doxygen
POST_BUILD
@@ -134,7 +161,9 @@ if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
configure_file("${DOXYFILE_IN}" "${DOXYFILE}" @ONLY)
- get_target_property(DOC_TARGET doc TYPE)
+ if(TARGET doc)
+ get_target_property(DOC_TARGET doc TYPE)
+ endif()
if(NOT DOC_TARGET)
add_custom_target(doc)
endif()
diff --git a/doc/HW-ACCEL.md b/doc/HW-ACCEL.md
new file mode 100644
index 000000000..cbcf5e63f
--- /dev/null
+++ b/doc/HW-ACCEL.md
@@ -0,0 +1,136 @@
+## Hardware Acceleration
+
+OpenShot now has experimental support for hardware acceleration, which uses 1 (or more)
+graphics cards to offload some of the work for both decoding and encoding. This is
+very new and experimental (as of May 2019), but we look forward to "accelerating"
+our support for this in the future!
+
+The following table summarizes our current level of support:
+
+| | Linux Decode | Linux Encode | Mac Decode | Mac Encode | Windows Decode | Windows Encode | Notes |
+|--------------------|:---------------:|:--------------:|:----------:|:--------------:|:--------------:|:--------------:|------------------|
+| VA-API | ✔️ | ✔️ | - | - | - | - | *Linux Only* |
+| VDPAU | ✔️ 1 | ✅ 2 | - | - | - | - | *Linux Only* |
+| CUDA (NVDEC/NVENC) | ❌ 3 | ✔️ | - | - | - | ✔️ | *Cross Platform* |
+| VideoToolBox | - | - | ✔️ | ❌ 4 | - | - | *Mac Only* |
+| DXVA2 | - | - | - | - | ❌ 3 | - | *Windows Only* |
+| D3D11VA | - | - | - | - | ❌ 3 | - | *Windows Only* |
+| QSV | ❌ 3 | ❌ | ❌ | ❌ | ❌ | ❌ | *Cross Platform* |
+
+#### Notes
+
+1. VDPAU for some reason needs a card number one higher than it really is
+2. VDPAU is a decoder only
+3. Green frames (pixel data not correctly tranferred back to system memory)
+4. Crashes and burns
+
+## Supported FFmpeg Versions
+
+* HW accel is supported from FFmpeg version 3.2 (3.3 for nVidia drivers)
+* HW accel was removed for nVidia drivers in Ubuntu for FFmpeg 4+
+
+**Notice:** The FFmpeg versions of Ubuntu and PPAs for Ubuntu show the
+same behaviour. FFmpeg 3 has working nVidia hardware acceleration while
+FFmpeg 4+ has no support for nVidia hardware acceleration
+included.
+
+## OpenShot Settings
+
+The following settings are use by libopenshot to enable, disable, and control
+the various hardware acceleration features.
+
+```{cpp}
+/// Use video codec for faster video decoding (if supported)
+int HARDWARE_DECODER = 0;
+
+/* 0 - No acceleration
+ 1 - Linux VA-API
+ 2 - nVidia NVDEC
+ 3 - Windows D3D9
+ 4 - Windows D3D11
+ 5 - MacOS / VideoToolBox
+ 6 - Linux VDPAU
+ 7 - Intel QSV */
+
+/// Number of threads of OpenMP
+int OMP_THREADS = 12;
+
+/// Number of threads that FFmpeg uses
+int FF_THREADS = 8;
+
+/// Maximum rows that hardware decode can handle
+int DE_LIMIT_HEIGHT_MAX = 1100;
+
+/// Maximum columns that hardware decode can handle
+int DE_LIMIT_WIDTH_MAX = 1950;
+
+/// Which GPU to use to decode (0 is the first, LINUX ONLY)
+int HW_DE_DEVICE_SET = 0;
+
+/// Which GPU to use to encode (0 is the first, LINUX ONLY)
+int HW_EN_DEVICE_SET = 0;
+```
+
+## Libva / VA-API (Video Acceleration API)
+
+The correct version of libva is needed (libva in Ubuntu 16.04 or libva2
+in Ubuntu 18.04) for the AppImage to work with hardware acceleration.
+An AppImage that works on both systems (supporting libva and libva2),
+might be possible when no libva is included in the AppImage.
+
+* vaapi is working for intel and AMD
+* vaapi is working for decode only for nouveau
+* nVidia driver is working for export only
+
+## AMD Graphics Cards (RadeonOpenCompute/ROCm)
+
+Decoding and encoding on the (AMD) GPU is possible with the default drivers.
+On systems where ROCm is installed and run a future use for GPU acceleration
+of effects could be implemented (contributions welcome).
+
+## Multiple Graphics Cards
+
+If the computer has multiple graphics cards installed, you can choose which
+should be used by libopenshot. Also, you can optionally use one card for
+decoding and the other for encoding (if both cards support acceleration).
+This is currently only supported on Linux, due to the device name FFmpeg
+expects (i.e. **/dev/dri/render128**). Contributions welcome if anyone can
+determine what string format to pass for Windows and Mac.
+
+## Help Us Improve Hardware Support
+
+This information might be wrong, and we would love to continue improving
+our support for hardware acceleration in OpenShot. Please help us update
+this document if you find an error or discover new and/or useful information.
+
+**FFmpeg 4 + nVidia** The manual at:
+https://www.tal.org/tutorials/ffmpeg_nvidia_encode
+works pretty well. We could compile and install a version of FFmpeg 4.1.3
+on Mint 19.1 that supports the GPU on nVidia cards. A version of openshot
+with hardware support using these libraries could use the nVidia GPU.
+
+**BUG:** Hardware supported decoding still has some bugs (as you can see from
+the chart above). Also, the speed gains with decoding are not as great
+as with encoding. Currently, if hardware decoding fails, there is no
+fallback (you either get green frames or an "invalid file" error in OpenShot).
+This needs to be improved to successfully fall-back to software decoding.
+
+**Needed:**
+ * A way to get options and limits of the GPU, such as
+ supported dimensions (width and height).
+ * A way to list the actual Graphic Cards available to FFmpeg (for the
+ user to choose which card for decoding and encoding, as opposed
+ to "Graphics Card X")
+
+**Further improvement:** Right now the frame can be decoded on the GPU, but the
+frame is then copied to CPU memory for modifications. It is then copied back to
+GPU memory for encoding. Using the GPU for both decoding and modifications
+will make it possible to do away with these two copies. A possible solution would
+be to use Vulkan compute which would be available on Linux and Windows natively
+and on MacOS via MoltenVK.
+
+## Credit
+
+A big thanks to Peter M (https://github.com/eisneinechse) for all his work
+on integrating hardware acceleration into libopenshot! The community thanks
+you for this major contribution!
diff --git a/doc/INSTALL-LINUX.md b/doc/INSTALL-LINUX.md
index 6ed4f3f67..2a0bbe1bb 100644
--- a/doc/INSTALL-LINUX.md
+++ b/doc/INSTALL-LINUX.md
@@ -1,3 +1,5 @@
+# Building libopenshot for Linux
+
## Getting Started
The best way to get started with libopenshot, is to learn about our build system, obtain all the source code,
@@ -22,47 +24,47 @@ The following libraries are required to build libopenshot. Instructions on how
dependencies vary for each operating system. Libraries and Executables have been labeled in the
list below to help distinguish between them.
-* ### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
+### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
* http://www.ffmpeg.org/ `(Library)`
* This library is used to decode and encode video, audio, and image files. It is also used to obtain information about media files, such as frame rate, sample rate, aspect ratio, and other common attributes.
-* ### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
+### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
* http://www.imagemagick.org/script/magick++.php `(Library)`
* This library is **optional**, and used to decode and encode images.
-* ### OpenShot Audio Library (libopenshot-audio)
+### OpenShot Audio Library (libopenshot-audio)
* https://github.com/OpenShot/libopenshot-audio/ `(Library)`
* This library is used to mix, resample, host plug-ins, and play audio. It is based on the JUCE project, which is an outstanding audio library used by many different applications
-* ### Qt 5 (libqt5)
+### Qt 5 (libqt5)
* http://www.qt.io/qt5/ `(Library)`
* Qt5 is used to display video, store image data, composite images, apply image effects, and many other utility functions, such as file system manipulation, high resolution timers, etc...
-* ### CMake (cmake)
+### CMake (cmake)
* http://www.cmake.org/ `(Executable)`
* This executable is used to automate the generation of Makefiles, check for dependencies, and is the backbone of libopenshot’s cross-platform build process.
-* ### SWIG (swig)
+### SWIG (swig)
* http://www.swig.org/ `(Executable)`
* This executable is used to generate the Python and Ruby bindings for libopenshot. It is a simple and powerful wrapper for C++ libraries, and supports many languages.
-* ### Python 3 (libpython)
+### Python 3 (libpython)
* http://www.python.org/ `(Executable and Library)`
* This library is used by swig to create the Python (version 3+) bindings for libopenshot. This is also the official language used by OpenShot Video Editor (a graphical interface to libopenshot).
-* ### Doxygen (doxygen)
+### Doxygen (doxygen)
* http://www.stack.nl/~dimitri/doxygen/ `(Executable)`
* This executable is used to auto-generate the documentation used by libopenshot.
-* ### UnitTest++ (libunittest++)
+### UnitTest++ (libunittest++)
* https://github.com/unittest-cpp/ `(Library)`
* This library is used to execute unit tests for libopenshot. It contains many macros used to keep our unit testing code very clean and simple.
-* ### ZeroMQ (libzmq)
+### ZeroMQ (libzmq)
* http://zeromq.org/ `(Library)`
* This library is used to communicate between libopenshot and other applications (publisher / subscriber). Primarily used to send debug data from libopenshot.
-* ### OpenMP (-fopenmp)
+### OpenMP (-fopenmp)
* http://openmp.org/wp/ `(Compiler Flag)`
* If your compiler supports this flag (GCC, Clang, and most other compilers), it provides libopenshot with easy methods of using parallel programming techniques to improve performance and take advantage of multi-core processors.
@@ -99,25 +101,25 @@ git clone https://github.com/OpenShot/libopenshot-audio.git
The source code is divided up into the following folders.
-* ### build/
+### build/
* This folder needs to be manually created, and is used by cmake to store the temporary build files, such as makefiles, as well as the final binaries (library and test executables).
-* ### cmake/
+### cmake/
* This folder contains custom modules not included by default in cmake, used to find dependency libraries and headers and determine if these libraries are installed.
-* ### doc/
+### doc/
* This folder contains documentation and related files, such as logos and images required by the doxygen auto-generated documentation.
-* ### include/
+### include/
* This folder contains all headers (*.h) used by libopenshot.
-* ### src/
+### src/
* This folder contains all source code (*.cpp) used by libopenshot.
-* ### tests/
+### tests/
* This folder contains all unit test code. Each class has it’s own test file (*.cpp), and uses UnitTest++ macros to keep the test code simple and manageable.
-* ### thirdparty/
+### thirdparty/
* This folder contains code not written by the OpenShot team. For example, jsoncpp, an open-source JSON parser.
## Install Dependencies
diff --git a/doc/INSTALL-MAC.md b/doc/INSTALL-MAC.md
index ab7f79c35..ac0c7f7c2 100644
--- a/doc/INSTALL-MAC.md
+++ b/doc/INSTALL-MAC.md
@@ -1,3 +1,5 @@
+# Building libopenshot for MacOS
+
## Getting Started
The best way to get started with libopenshot, is to learn about our build system, obtain all the source code,
@@ -22,47 +24,47 @@ The following libraries are required to build libopenshot. Instructions on how
dependencies vary for each operating system. Libraries and Executables have been labeled in the
list below to help distinguish between them.
-* ### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
+### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
* http://www.ffmpeg.org/ `(Library)`
* This library is used to decode and encode video, audio, and image files. It is also used to obtain information about media files, such as frame rate, sample rate, aspect ratio, and other common attributes.
-* ### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
+### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
* http://www.imagemagick.org/script/magick++.php `(Library)`
* This library is **optional**, and used to decode and encode images.
-* ### OpenShot Audio Library (libopenshot-audio)
+### OpenShot Audio Library (libopenshot-audio)
* https://github.com/OpenShot/libopenshot-audio/ `(Library)`
* This library is used to mix, resample, host plug-ins, and play audio. It is based on the JUCE project, which is an outstanding audio library used by many different applications
-* ### Qt 5 (libqt5)
+### Qt 5 (libqt5)
* http://www.qt.io/qt5/ `(Library)`
* Qt5 is used to display video, store image data, composite images, apply image effects, and many other utility functions, such as file system manipulation, high resolution timers, etc...
-* ### CMake (cmake)
+### CMake (cmake)
* http://www.cmake.org/ `(Executable)`
* This executable is used to automate the generation of Makefiles, check for dependencies, and is the backbone of libopenshot’s cross-platform build process.
-* ### SWIG (swig)
+### SWIG (swig)
* http://www.swig.org/ `(Executable)`
* This executable is used to generate the Python and Ruby bindings for libopenshot. It is a simple and powerful wrapper for C++ libraries, and supports many languages.
-* ### Python 3 (libpython)
+### Python 3 (libpython)
* http://www.python.org/ `(Executable and Library)`
* This library is used by swig to create the Python (version 3+) bindings for libopenshot. This is also the official language used by OpenShot Video Editor (a graphical interface to libopenshot).
-* ### Doxygen (doxygen)
+### Doxygen (doxygen)
* http://www.stack.nl/~dimitri/doxygen/ `(Executable)`
* This executable is used to auto-generate the documentation used by libopenshot.
-* ### UnitTest++ (libunittest++)
+### UnitTest++ (libunittest++)
* https://github.com/unittest-cpp/ `(Library)`
* This library is used to execute unit tests for libopenshot. It contains many macros used to keep our unit testing code very clean and simple.
-* ### ZeroMQ (libzmq)
+### ZeroMQ (libzmq)
* http://zeromq.org/ `(Library)`
* This library is used to communicate between libopenshot and other applications (publisher / subscriber). Primarily used to send debug data from libopenshot.
-* ### OpenMP (-fopenmp)
+### OpenMP (-fopenmp)
* http://openmp.org/wp/ `(Compiler Flag)`
* If your compiler supports this flag (GCC, Clang, and most other compilers), it provides libopenshot with easy methods of using parallel programming techniques to improve performance and take advantage of multi-core processors.
@@ -98,25 +100,25 @@ git clone https://github.com/OpenShot/libopenshot-audio.git
The source code is divided up into the following folders.
-* ### build/
+### build/
* This folder needs to be manually created, and is used by cmake to store the temporary build files, such as makefiles, as well as the final binaries (library and test executables).
-* ### cmake/
+### cmake/
* This folder contains custom modules not included by default in cmake, used to find dependency libraries and headers and determine if these libraries are installed.
-* ### doc/
+### doc/
* This folder contains documentation and related files, such as logos and images required by the doxygen auto-generated documentation.
-* ### include/
+### include/
* This folder contains all headers (*.h) used by libopenshot.
-* ### src/
+### src/
* This folder contains all source code (*.cpp) used by libopenshot.
-* ### tests/
+### tests/
* This folder contains all unit test code. Each class has it’s own test file (*.cpp), and uses UnitTest++ macros to keep the test code simple and manageable.
-* ### thirdparty/
+### thirdparty/
* This folder contains code not written by the OpenShot team. For example, jsoncpp, an open-source JSON parser.
## Install Dependencies
diff --git a/doc/INSTALL-WINDOWS.md b/doc/INSTALL-WINDOWS.md
index 7f5b8f782..2b17569b6 100644
--- a/doc/INSTALL-WINDOWS.md
+++ b/doc/INSTALL-WINDOWS.md
@@ -1,3 +1,5 @@
+# Building libopenshot for Windows
+
## Getting Started
The best way to get started with libopenshot, is to learn about our build system, obtain all the
@@ -24,47 +26,47 @@ The following libraries are required to build libopenshot. Instructions on how
install these dependencies vary for each operating system. Libraries and Executables
have been labeled in the list below to help distinguish between them.
-* ### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
+### FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
* http://www.ffmpeg.org/ `(Library)`
* This library is used to decode and encode video, audio, and image files. It is also used to obtain information about media files, such as frame rate, sample rate, aspect ratio, and other common attributes.
-* ### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
+### ImageMagick++ (libMagick++, libMagickWand, libMagickCore)
* http://www.imagemagick.org/script/magick++.php `(Library)`
* This library is **optional**, and used to decode and encode images.
-* ### OpenShot Audio Library (libopenshot-audio)
+### OpenShot Audio Library (libopenshot-audio)
* https://github.com/OpenShot/libopenshot-audio/ `(Library)`
* This library is used to mix, resample, host plug-ins, and play audio. It is based on the JUCE project, which is an outstanding audio library used by many different applications
-* ### Qt 5 (libqt5)
+### Qt 5 (libqt5)
* http://www.qt.io/qt5/ `(Library)`
* Qt5 is used to display video, store image data, composite images, apply image effects, and many other utility functions, such as file system manipulation, high resolution timers, etc...
-* ### CMake (cmake)
+### CMake (cmake)
* http://www.cmake.org/ `(Executable)`
* This executable is used to automate the generation of Makefiles, check for dependencies, and is the backbone of libopenshot’s cross-platform build process.
-* ### SWIG (swig)
+### SWIG (swig)
* http://www.swig.org/ `(Executable)`
* This executable is used to generate the Python and Ruby bindings for libopenshot. It is a simple and powerful wrapper for C++ libraries, and supports many languages.
-* ### Python 3 (libpython)
+### Python 3 (libpython)
* http://www.python.org/ `(Executable and Library)`
* This library is used by swig to create the Python (version 3+) bindings for libopenshot. This is also the official language used by OpenShot Video Editor (a graphical interface to libopenshot).
-* ### Doxygen (doxygen)
+### Doxygen (doxygen)
* http://www.stack.nl/~dimitri/doxygen/ `(Executable)`
* This executable is used to auto-generate the documentation used by libopenshot.
-* ### UnitTest++ (libunittest++)
+### UnitTest++ (libunittest++)
* https://github.com/unittest-cpp/ `(Library)`
* This library is used to execute unit tests for libopenshot. It contains many macros used to keep our unit testing code very clean and simple.
-* ### ZeroMQ (libzmq)
+### ZeroMQ (libzmq)
* http://zeromq.org/ `(Library)`
* This library is used to communicate between libopenshot and other applications (publisher / subscriber). Primarily used to send debug data from libopenshot.
-* ### OpenMP (-fopenmp)
+### OpenMP (-fopenmp)
* http://openmp.org/wp/ `(Compiler Flag)`
* If your compiler supports this flag (GCC, Clang, and most other compilers), it provides libopenshot with easy methods of using parallel programming techniques to improve performance and take advantage of multi-core processors.
@@ -109,7 +111,7 @@ check each folder path for accuracy, as your paths will likely be different than
* UNITTEST_DIR (`C:\UnitTest++`)
* ZMQDIR (`C:\msys2\usr\local\`)
* PATH (`The following paths are an example`)
- * C:\Qt5\bin; C:\Qt5\MinGW\bin\; C:\msys\1.0\local\lib; C:\Program Files\CMake 2.8\bin; C:\UnitTest++\build; C:\libopenshot\build\src; C:\Program Files\doxygen\bin; C:\ffmpeg-git-95f163b-win32-dev\lib; C:\swigwin-2.0.4; C:\Python33; C:\Program Files\Project\lib; C:\msys2\usr\local\
+ * `C:\Qt5\bin; C:\Qt5\MinGW\bin\; C:\msys\1.0\local\lib; C:\Program Files\CMake 2.8\bin; C:\UnitTest++\build; C:\libopenshot\build\src; C:\Program Files\doxygen\bin; C:\ffmpeg-git-95f163b-win32-dev\lib; C:\swigwin-2.0.4; C:\Python33; C:\Program Files\Project\lib; C:\msys2\usr\local\`
@@ -130,29 +132,29 @@ git clone https://github.com/OpenShot/libopenshot-audio.git
The source code is divided up into the following folders.
-* ### build/
+### build/
* This folder needs to be manually created, and is used by cmake to store the temporary
build files, such as makefiles, as well as the final binaries (library and test executables).
-* ### cmake/
+### cmake/
* This folder contains custom modules not included by default in cmake, used to find
dependency libraries and headers and determine if these libraries are installed.
-* ### doc/
+### doc/
* This folder contains documentation and related files, such as logos and images
required by the doxygen auto-generated documentation.
-* ### include/
+### include/
* This folder contains all headers (*.h) used by libopenshot.
-* ### src/
+### src/
* This folder contains all source code (*.cpp) used by libopenshot.
-* ### tests/
+### tests/
* This folder contains all unit test code. Each class has it’s own test file (*.cpp), and
uses UnitTest++ macros to keep the test code simple and manageable.
-* ### thirdparty/
+### thirdparty/
* This folder contains code not written by the OpenShot team. For example, jsoncpp, an
open-source JSON parser.
@@ -240,28 +242,28 @@ mingw32-make install
## Manual Dependencies
-* ### DLfcn
+### DLfcn
* https://github.com/dlfcn-win32/dlfcn-win32
- * Download and Extract the Win32 Static (.tar.bz2) archive to a local folder: C:\libdl\
- * Create an environment variable called DL_DIR and set the value to C:\libdl\. This environment variable will be used by CMake to find the binary and header file.
+ * Download and Extract the Win32 Static (.tar.bz2) archive to a local folder: `C:\libdl\`
+ * Create an environment variable called DL_DIR and set the value to `C:\libdl\`. This environment variable will be used by CMake to find the binary and header file.
-* ### DirectX SDK / Windows SDK
+### DirectX SDK / Windows SDK
* Windows 7: (DirectX SDK) http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812
* Windows 8: (Windows SDK)
* https://msdn.microsoft.com/en-us/windows/desktop/aa904949
* Download and Install the SDK Setup program. This is needed for the JUCE library to play audio on Windows.
-Create an environment variable called DXSDK_DIR and set the value to C:\Program Files\Microsoft DirectX SDK (June 2010)\ (your path might be different). This environment variable will be used by CMake to find the binaries and header files.
+Create an environment variable called DXSDK_DIR and set the value to `C:\Program Files\Microsoft DirectX SDK (June 2010)\` (your path might be different). This environment variable will be used by CMake to find the binaries and header files.
-* ### libSndFile
+### libSndFile
* http://www.mega-nerd.com/libsndfile/#Download
* Download and Install the Win32 Setup program.
- * Create an environment variable called SNDFILE_DIR and set the value to C:\Program Files\libsndfile. This environment variable will be used by CMake to find the binary and header files.
+ * Create an environment variable called SNDFILE_DIR and set the value to `C:\Program Files\libsndfile`. This environment variable will be used by CMake to find the binary and header files.
-* ### libzmq
+### libzmq
* http://zeromq.org/intro:get-the-software
* Download source code (zip)
* Follow their instructions, and build with mingw
- * Create an environment variable called ZMQDIR and set the value to C:\libzmq\build\ (the location of the compiled version). This environment variable will be used by CMake to find the binary and header files.
+ * Create an environment variable called ZMQDIR and set the value to `C:\libzmq\build\` (the location of the compiled version). This environment variable will be used by CMake to find the binary and header files.
## Windows Build Instructions (libopenshot-audio)
In order to compile libopenshot-audio, launch a command prompt and enter the following commands. This does not require the MSYS2 prompt, but it should work in both the Windows command prompt and the MSYS2 prompt.
@@ -314,8 +316,8 @@ built, we need to install it (i.e. copy it to the correct folder, so other libra
mingw32-make install
```
-This should copy the binary files to C:\Program Files\openshot\lib\, and the header
-files to C:\Program Files\openshot\include\... This is where other projects will
+This should copy the binary files to `C:\Program Files\openshot\lib\`, and the header
+files to `C:\Program Files\openshot\include\...` This is where other projects will
look for the libopenshot files when building.. Python 3 bindings are also installed
at this point. let's verify the python bindings work:
diff --git a/include/AudioBufferSource.h b/include/AudioBufferSource.h
index 57826f66e..3a17feb3c 100644
--- a/include/AudioBufferSource.h
+++ b/include/AudioBufferSource.h
@@ -3,9 +3,12 @@
* @brief Header file for AudioBufferSource class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,18 +31,8 @@
#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
-#include "JuceLibraryCode/JuceHeader.h"
-
-using namespace std;
+#include "JuceHeader.h"
/// This namespace is the default namespace for all code in the openshot library
namespace openshot
@@ -51,25 +44,25 @@ namespace openshot
* The JUCE library cannot play audio directly from an AudioSampleBuffer, so this class exposes
* an AudioSampleBuffer as a AudioSource, so that JUCE can play the audio.
*/
- class AudioBufferSource : public PositionableAudioSource
+ class AudioBufferSource : public juce::PositionableAudioSource
{
private:
int position;
int start;
bool repeat;
- AudioSampleBuffer *buffer;
+ juce::AudioSampleBuffer *buffer;
public:
/// @brief Default constructor
/// @param audio_buffer This buffer contains the samples you want to play through JUCE.
- AudioBufferSource(AudioSampleBuffer *audio_buffer);
+ AudioBufferSource(juce::AudioSampleBuffer *audio_buffer);
/// Destructor
~AudioBufferSource();
/// @brief Get the next block of audio samples
/// @param info This struct informs us of which samples are needed next.
- void getNextAudioBlock (const AudioSourceChannelInfo& info);
+ void getNextAudioBlock (const juce::AudioSourceChannelInfo& info);
/// Prepare to play this audio source
void prepareToPlay(int, double);
@@ -79,13 +72,13 @@ namespace openshot
/// @brief Set the next read position of this source
/// @param newPosition The sample # to start reading from
- void setNextReadPosition (int64 newPosition);
+ void setNextReadPosition (juce::int64 newPosition);
/// Get the next read position of this source
- int64 getNextReadPosition() const;
+ juce::int64 getNextReadPosition() const;
/// Get the total length (in samples) of this audio source
- int64 getTotalLength() const;
+ juce::int64 getTotalLength() const;
/// Determines if this audio source should repeat when it reaches the end
bool isLooping() const;
@@ -95,7 +88,7 @@ namespace openshot
void setLooping (bool shouldLoop);
/// Update the internal buffer used by this source
- void setBuffer (AudioSampleBuffer *audio_buffer);
+ void setBuffer (juce::AudioSampleBuffer *audio_buffer);
};
}
diff --git a/include/AudioDeviceInfo.h b/include/AudioDeviceInfo.h
new file mode 100644
index 000000000..454bf9235
--- /dev/null
+++ b/include/AudioDeviceInfo.h
@@ -0,0 +1,47 @@
+/**
+ * @file
+ * @brief Header file for Audio Device Info struct
+ * @author Jonathan Thomas
+ *
+ * @ref License
+ */
+
+/* LICENSE
+ *
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
+ * . This file is part of
+ * OpenShot Library (libopenshot), an open-source project dedicated to
+ * delivering high quality video editing and animation solutions to the
+ * world. For more information visit .
+ *
+ * OpenShot Library (libopenshot) is free software: you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * OpenShot Library (libopenshot) is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with OpenShot Library. If not, see .
+ */
+
+#ifndef OPENSHOT_AUDIODEVICEINFO_H
+#define OPENSHOT_AUDIODEVICEINFO_H
+
+
+/**
+ * @brief This struct hold information about Audio Devices
+ *
+ * The type and name of the audio device.
+ */
+namespace openshot {
+ struct AudioDeviceInfo
+ {
+ std::string name;
+ std::string type;
+ };
+}
+#endif
diff --git a/include/AudioReaderSource.h b/include/AudioReaderSource.h
index 31b17d809..c4e2d2480 100644
--- a/include/AudioReaderSource.h
+++ b/include/AudioReaderSource.h
@@ -3,9 +3,12 @@
* @brief Header file for AudioReaderSource class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,19 +31,9 @@
#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
-#include "JuceLibraryCode/JuceHeader.h"
#include "ReaderBase.h"
-
-using namespace std;
+#include "JuceHeader.h"
/// This namespace is the default namespace for all code in the openshot library
namespace openshot
@@ -51,13 +44,13 @@ namespace openshot
*
* This allows any reader to play audio through JUCE (our audio framework).
*/
- class AudioReaderSource : public PositionableAudioSource
+ class AudioReaderSource : public juce::PositionableAudioSource
{
private:
int position; /// The position of the audio source (index of buffer)
bool repeat; /// Repeat the audio source when finished
int size; /// The size of the internal buffer
- AudioSampleBuffer *buffer; /// The audio sample buffer
+ juce::AudioSampleBuffer *buffer; /// The audio sample buffer
int speed; /// The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
ReaderBase *reader; /// The reader to pull samples from
@@ -87,7 +80,7 @@ namespace openshot
/// @brief Get the next block of audio samples
/// @param info This struct informs us of which samples are needed next.
- void getNextAudioBlock (const AudioSourceChannelInfo& info);
+ void getNextAudioBlock (const juce::AudioSourceChannelInfo& info);
/// Prepare to play this audio source
void prepareToPlay(int, double);
@@ -97,13 +90,13 @@ namespace openshot
/// @brief Set the next read position of this source
/// @param newPosition The sample # to start reading from
- void setNextReadPosition (int64 newPosition);
+ void setNextReadPosition (juce::int64 newPosition);
/// Get the next read position of this source
- int64 getNextReadPosition() const;
+ juce::int64 getNextReadPosition() const;
/// Get the total length (in samples) of this audio source
- int64 getTotalLength() const;
+ juce::int64 getTotalLength() const;
/// Determines if this audio source should repeat when it reaches the end
bool isLooping() const;
@@ -113,7 +106,7 @@ namespace openshot
void setLooping (bool shouldLoop);
/// Update the internal buffer used by this source
- void setBuffer (AudioSampleBuffer *audio_buffer);
+ void setBuffer (juce::AudioSampleBuffer *audio_buffer);
const ReaderInfo & getReaderInfo() const { return reader->info; }
diff --git a/include/AudioResampler.h b/include/AudioResampler.h
index 412d49b16..d88eb7cbe 100644
--- a/include/AudioResampler.h
+++ b/include/AudioResampler.h
@@ -3,9 +3,12 @@
* @brief Header file for AudioResampler class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,19 +31,9 @@
#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 "JuceLibraryCode/JuceHeader.h"
#include "AudioBufferSource.h"
#include "Exceptions.h"
+#include "JuceHeader.h"
namespace openshot {
@@ -52,11 +45,11 @@ namespace openshot {
*/
class AudioResampler {
private:
- AudioSampleBuffer *buffer;
- AudioSampleBuffer *resampled_buffer;
- AudioBufferSource *buffer_source;
- ResamplingAudioSource *resample_source;
- AudioSourceChannelInfo resample_callback_buffer;
+ juce::AudioSampleBuffer *buffer;
+ juce::AudioSampleBuffer *resampled_buffer;
+ openshot::AudioBufferSource *buffer_source;
+ juce::ResamplingAudioSource *resample_source;
+ juce::AudioSourceChannelInfo resample_callback_buffer;
int num_of_samples;
int new_num_of_samples;
@@ -75,15 +68,15 @@ namespace openshot {
/// @param new_buffer The buffer of audio samples needing to be resampled
/// @param sample_rate The original sample rate of the buffered samples
/// @param new_sample_rate The requested sample rate you need
- void SetBuffer(AudioSampleBuffer *new_buffer, double sample_rate, double new_sample_rate);
+ void SetBuffer(juce::AudioSampleBuffer *new_buffer, double sample_rate, double new_sample_rate);
/// @brief Sets the audio buffer and key settings
/// @param new_buffer The buffer of audio samples needing to be resampled
/// @param ratio The multiplier that needs to be applied to the sample rate (this is how resampling happens)
- void SetBuffer(AudioSampleBuffer *new_buffer, double ratio);
+ void SetBuffer(juce::AudioSampleBuffer *new_buffer, double ratio);
/// Get the resampled audio buffer
- AudioSampleBuffer* GetResampledBuffer();
+ juce::AudioSampleBuffer* GetResampledBuffer();
};
}
diff --git a/include/CacheBase.h b/include/CacheBase.h
index aaef53203..aad65a846 100644
--- a/include/CacheBase.h
+++ b/include/CacheBase.h
@@ -3,9 +3,12 @@
* @brief Header file for CacheBase class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -29,6 +32,7 @@
#define OPENSHOT_CACHE_BASE_H
#include
+#include
#include "Frame.h"
#include "Exceptions.h"
#include "Json.h"
@@ -45,11 +49,11 @@ namespace openshot {
class CacheBase
{
protected:
- string cache_type; ///< This is a friendly type name of the derived cache instance
+ std::string cache_type; ///< This is a friendly type name of the derived cache instance
int64_t max_bytes; ///< This is the max number of bytes to cache (0 = no limit)
/// Section lock for multiple threads
- CriticalSection *cacheCriticalSection;
+ juce::CriticalSection *cacheCriticalSection;
public:
@@ -62,7 +66,7 @@ namespace openshot {
/// @brief Add a Frame to the cache
/// @param frame The openshot::Frame object needing to be cached.
- virtual void Add(std::shared_ptr frame) = 0;
+ virtual void Add(std::shared_ptr frame) = 0;
/// Clear the cache of all frames
virtual void Clear() = 0;
@@ -72,13 +76,13 @@ namespace openshot {
/// @brief Get a frame from the cache
/// @param frame_number The frame number of the cached frame
- virtual std::shared_ptr GetFrame(int64_t frame_number) = 0;
+ virtual std::shared_ptr GetFrame(int64_t frame_number) = 0;
/// Gets the maximum bytes value
virtual int64_t GetBytes() = 0;
/// Get the smallest frame number
- virtual std::shared_ptr GetSmallestFrame() = 0;
+ virtual std::shared_ptr GetSmallestFrame() = 0;
/// @brief Remove a specific frame
/// @param frame_number The frame number of the cached frame
@@ -105,10 +109,11 @@ namespace openshot {
void SetMaxBytesFromInfo(int64_t number_of_frames, int width, int height, int sample_rate, int channels);
/// Get and Set JSON methods
- virtual string Json() = 0; ///< Generate JSON string of this object
- virtual void SetJson(string value) = 0; ///< Load JSON string into this object
+ virtual std::string Json() = 0; ///< Generate JSON string of this object
+ virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
+ virtual ~CacheBase() = default;
};
diff --git a/include/CacheDisk.h b/include/CacheDisk.h
index adecda9a6..e69cc3578 100644
--- a/include/CacheDisk.h
+++ b/include/CacheDisk.h
@@ -3,9 +3,12 @@
* @brief Header file for CacheDisk class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -50,24 +53,24 @@ namespace openshot {
class CacheDisk : public CacheBase {
private:
QDir path; ///< This is the folder path of the cache directory
- map frames; ///< This map holds the frame number and Frame objects
- deque frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
- string image_format;
+ std::map frames; ///< This map holds the frame number and Frame objects
+ std::deque frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
+ std::string image_format;
float image_quality;
float image_scale;
int64_t frame_size_bytes; ///< The size of the cached frame in bytes
bool needs_range_processing; ///< Something has changed, and the range data needs to be re-calculated
- string json_ranges; ///< JSON ranges of frame numbers
- vector ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
- map frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
+ std::string json_ranges; ///< JSON ranges of frame numbers
+ std::vector ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
+ std::map frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
int64_t range_version; ///< The version of the JSON range data (incremented with each change)
/// Clean up cached frames that exceed the max number of bytes
void CleanUp();
/// Init path directory
- void InitPath(string cache_path);
+ void InitPath(std::string cache_path);
/// Calculate ranges of frames
void CalculateRanges();
@@ -78,7 +81,7 @@ namespace openshot {
/// @param format The image format for disk caching (ppm, jpg, png)
/// @param quality The quality of the image (1.0=highest quality/slowest speed, 0.0=worst quality/fastest speed)
/// @param scale The scale factor for the preview images (1.0 = original size, 0.5=half size, 0.25=quarter size, etc...)
- CacheDisk(string cache_path, string format, float quality, float scale);
+ CacheDisk(std::string cache_path, std::string format, float quality, float scale);
/// @brief Constructor that sets the max bytes to cache
/// @param cache_path The folder path of the cache directory (empty string = /tmp/preview-cache/)
@@ -86,14 +89,14 @@ namespace openshot {
/// @param quality The quality of the image (1.0=highest quality/slowest speed, 0.0=worst quality/fastest speed)
/// @param scale The scale factor for the preview images (1.0 = original size, 0.5=half size, 0.25=quarter size, etc...)
/// @param max_bytes The maximum bytes to allow in the cache. Once exceeded, the cache will purge the oldest frames.
- CacheDisk(string cache_path, string format, float quality, float scale, int64_t max_bytes);
+ CacheDisk(std::string cache_path, std::string format, float quality, float scale, int64_t max_bytes);
// Default destructor
~CacheDisk();
/// @brief Add a Frame to the cache
/// @param frame The openshot::Frame object needing to be cached.
- void Add(std::shared_ptr frame);
+ void Add(std::shared_ptr frame);
/// Clear the cache of all frames
void Clear();
@@ -103,13 +106,13 @@ namespace openshot {
/// @brief Get a frame from the cache
/// @param frame_number The frame number of the cached frame
- std::shared_ptr GetFrame(int64_t frame_number);
+ std::shared_ptr GetFrame(int64_t frame_number);
/// Gets the maximum bytes value
int64_t GetBytes();
/// Get the smallest frame number
- std::shared_ptr GetSmallestFrame();
+ std::shared_ptr GetSmallestFrame();
/// @brief Move frame to front of queue (so it lasts longer)
/// @param frame_number The frame number of the cached frame
@@ -125,8 +128,8 @@ namespace openshot {
void Remove(int64_t start_frame_number, int64_t end_frame_number);
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
};
diff --git a/include/CacheMemory.h b/include/CacheMemory.h
index 2f3f018be..fb3c75f66 100644
--- a/include/CacheMemory.h
+++ b/include/CacheMemory.h
@@ -3,9 +3,12 @@
* @brief Header file for CacheMemory class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -47,13 +50,13 @@ namespace openshot {
*/
class CacheMemory : public CacheBase {
private:
- map > frames; ///< This map holds the frame number and Frame objects
- deque frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
+ std::map > frames; ///< This map holds the frame number and Frame objects
+ std::deque frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
bool needs_range_processing; ///< Something has changed, and the range data needs to be re-calculated
- string json_ranges; ///< JSON ranges of frame numbers
- vector ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
- map frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
+ std::string json_ranges; ///< JSON ranges of frame numbers
+ std::vector ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
+ std::map frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
int64_t range_version; ///< The version of the JSON range data (incremented with each change)
/// Clean up cached frames that exceed the max number of bytes
@@ -71,11 +74,11 @@ namespace openshot {
CacheMemory(int64_t max_bytes);
// Default destructor
- ~CacheMemory();
+ virtual ~CacheMemory();
/// @brief Add a Frame to the cache
/// @param frame The openshot::Frame object needing to be cached.
- void Add(std::shared_ptr frame);
+ void Add(std::shared_ptr frame);
/// Clear the cache of all frames
void Clear();
@@ -85,13 +88,13 @@ namespace openshot {
/// @brief Get a frame from the cache
/// @param frame_number The frame number of the cached frame
- std::shared_ptr GetFrame(int64_t frame_number);
+ std::shared_ptr GetFrame(int64_t frame_number);
/// Gets the maximum bytes value
int64_t GetBytes();
/// Get the smallest frame number
- std::shared_ptr GetSmallestFrame();
+ std::shared_ptr GetSmallestFrame();
/// @brief Move frame to front of queue (so it lasts longer)
/// @param frame_number The frame number of the cached frame
@@ -107,8 +110,8 @@ namespace openshot {
void Remove(int64_t start_frame_number, int64_t end_frame_number);
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
};
diff --git a/include/ChannelLayouts.h b/include/ChannelLayouts.h
index 657d2757f..673eeccdf 100644
--- a/include/ChannelLayouts.h
+++ b/include/ChannelLayouts.h
@@ -3,9 +3,12 @@
* @brief Header file for ChannelLayout class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/ChunkReader.h b/include/ChunkReader.h
index b780602ba..9d99fcd47 100644
--- a/include/ChunkReader.h
+++ b/include/ChunkReader.h
@@ -3,9 +3,12 @@
* @brief Header file for ChunkReader class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -36,14 +39,12 @@
#include
#include
#include
-#include
+#include
#include
#include "Json.h"
#include "CacheMemory.h"
#include "Exceptions.h"
-using namespace std;
-
namespace openshot
{
@@ -102,22 +103,22 @@ namespace openshot
class ChunkReader : public ReaderBase
{
private:
- string path;
+ std::string path;
bool is_open;
int64_t chunk_size;
- ReaderBase *local_reader;
+ openshot::ReaderBase *local_reader;
ChunkLocation previous_location;
ChunkVersion version;
- std::shared_ptr last_frame;
+ std::shared_ptr last_frame;
/// Check if folder path existing
- bool does_folder_exist(string path);
+ bool does_folder_exist(std::string path);
/// Find the location of a frame in a chunk
ChunkLocation find_chunk_frame(int64_t requested_frame);
/// get a formatted path of a specific chunk
- string get_chunk_path(int64_t chunk_number, string folder, string extension);
+ std::string get_chunk_path(int64_t chunk_number, std::string folder, std::string extension);
/// Load JSON meta data about this chunk folder
void load_json();
@@ -128,7 +129,7 @@ namespace openshot
/// frame 1, or it throws one of the following exceptions.
/// @param path The folder path / location of a chunk (chunks are stored as folders)
/// @param chunk_version Choose the video version / quality (THUMBNAIL, PREVIEW, or FINAL)
- ChunkReader(string path, ChunkVersion chunk_version);
+ ChunkReader(std::string path, ChunkVersion chunk_version);
/// Close the reader
void Close();
@@ -142,22 +143,22 @@ namespace openshot
void SetChunkSize(int64_t new_size) { chunk_size = new_size; };
/// Get the cache object used by this reader (always return NULL for this reader)
- CacheMemory* GetCache() { return NULL; };
+ openshot::CacheMemory* GetCache() { return NULL; };
/// @brief Get an openshot::Frame object for a specific frame number of this reader.
/// @returns The requested frame (containing the image and audio)
/// @param requested_frame The frame number you want to retrieve
- std::shared_ptr GetFrame(int64_t requested_frame);
+ std::shared_ptr GetFrame(int64_t requested_frame);
/// Determine if reader is open or closed
bool IsOpen() { return is_open; };
/// Return the type name of the class
- string Name() { return "ChunkReader"; };
+ std::string Name() { return "ChunkReader"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
diff --git a/include/ChunkWriter.h b/include/ChunkWriter.h
index 2cdef4feb..5fee5a375 100644
--- a/include/ChunkWriter.h
+++ b/include/ChunkWriter.h
@@ -3,9 +3,12 @@
* @brief Header file for ChunkWriter class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -46,8 +49,6 @@
#include "Json.h"
-using namespace std;
-
namespace openshot
{
/**
@@ -80,27 +81,27 @@ namespace openshot
class ChunkWriter : public WriterBase
{
private:
- string path;
+ std::string path;
int64_t chunk_count;
int64_t chunk_size;
int64_t frame_count;
bool is_open;
bool is_writing;
- ReaderBase *local_reader;
- FFmpegWriter *writer_thumb;
- FFmpegWriter *writer_preview;
- FFmpegWriter *writer_final;
+ openshot::ReaderBase *local_reader;
+ openshot::FFmpegWriter *writer_thumb;
+ openshot::FFmpegWriter *writer_preview;
+ openshot::FFmpegWriter *writer_final;
std::shared_ptr last_frame;
bool last_frame_needed;
- string default_extension;
- string default_vcodec;
- string default_acodec;
+ std::string default_extension;
+ std::string default_vcodec;
+ std::string default_acodec;
/// check for chunk folder
- void create_folder(string path);
+ void create_folder(std::string path);
/// get a formatted path of a specific chunk
- string get_chunk_path(int64_t chunk_number, string folder, string extension);
+ std::string get_chunk_path(int64_t chunk_number, std::string folder, std::string extension);
/// check for valid chunk json
bool is_chunk_valid();
@@ -113,7 +114,7 @@ namespace openshot
/// @brief Constructor for ChunkWriter. Throws one of the following exceptions.
/// @param path The folder path of the chunk file to be created
/// @param reader The initial reader to base this chunk file's meta data on (such as fps, height, width, etc...)
- ChunkWriter(string path, ReaderBase *reader);
+ ChunkWriter(std::string path, openshot::ReaderBase *reader);
/// Close the writer
void Close();
@@ -133,7 +134,7 @@ namespace openshot
/// @brief Add a frame to the stack waiting to be encoded.
/// @param frame The openshot::Frame object that needs to be written to this chunk file.
- void WriteFrame(std::shared_ptr frame);
+ void WriteFrame(std::shared_ptr frame);
/// @brief Write a block of frames from a reader
/// @param start The starting frame number to write (of the reader passed into the constructor)
@@ -144,7 +145,7 @@ namespace openshot
/// @param reader The reader containing the frames you need
/// @param start The starting frame number to write
/// @param length The number of frames to write
- void WriteFrame(ReaderBase* reader, int64_t start, int64_t length);
+ void WriteFrame(openshot::ReaderBase* reader, int64_t start, int64_t length);
};
diff --git a/include/Clip.h b/include/Clip.h
index 3cd33b3a5..6fa02c9a1 100644
--- a/include/Clip.h
+++ b/include/Clip.h
@@ -3,9 +3,12 @@
* @brief Header file for Clip class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,15 +31,9 @@
#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
#include
#include
-#include "JuceLibraryCode/JuceHeader.h"
#include "AudioResampler.h"
#include "ClipBase.h"
#include "Color.h"
@@ -47,9 +44,7 @@
#include "Fraction.h"
#include "KeyFrame.h"
#include "ReaderBase.h"
-
-using namespace std;
-using namespace openshot;
+#include "JuceHeader.h"
namespace openshot {
@@ -57,7 +52,7 @@ namespace openshot {
/// from lowest layer to top layer (since that is sequence clips are combined), and then by
/// position, and then by effect order.
struct CompareClipEffects{
- bool operator()( EffectBase* lhs, EffectBase* rhs){
+ bool operator()( openshot::EffectBase* lhs, openshot::EffectBase* rhs){
if( lhs->Layer() < rhs->Layer() ) return true;
if( lhs->Layer() == rhs->Layer() && lhs->Position() < rhs->Position() ) return true;
if( lhs->Layer() == rhs->Layer() && lhs->Position() == rhs->Position() && lhs->Order() > rhs->Order() ) return true;
@@ -76,7 +71,7 @@ namespace openshot {
* Clip c1(new ImageReader("MyAwesomeLogo.jpeg"));
* Clip c2(new FFmpegReader("BackgroundVideo.webm"));
*
- * // CLIP 1 (logo) - Set some clip properties (with Keyframes)
+ * // CLIP 1 (logo) - Set some clip properties (with openshot::Keyframes)
* c1.Position(0.0); // Set the position or location (in seconds) on the timeline
* c1.gravity = GRAVITY_LEFT; // Set the alignment / gravity of the clip (position on the screen)
* c1.scale = SCALE_CROP; // Set the scale mode (how the image is resized to fill the screen)
@@ -87,7 +82,7 @@ namespace openshot {
* c1.alpha.AddPoint(500, 0.0); // Keep the alpha transparent until frame #500
* c1.alpha.AddPoint(565, 1.0); // Animate the alpha from transparent to visible (between frame #501 and #565)
*
- * // CLIP 2 (background video) - Set some clip properties (with Keyframes)
+ * // CLIP 2 (background video) - Set some clip properties (with openshot::Keyframes)
* c2.Position(0.0); // Set the position or location (in seconds) on the timeline
* c2.Start(10.0); // Set the starting position of the video (trim the left side of the video)
* c2.Layer(0); // Set the layer of the timeline (higher layers cover up images of lower layers)
@@ -97,37 +92,40 @@ namespace openshot {
* c2.alpha.AddPoint(384, 1.0); // Animate the alpha to visible (between frame #360 and frame #384)
* @endcode
*/
- class Clip : public ClipBase {
+ class Clip : public openshot::ClipBase {
protected:
/// Section lock for multiple threads
- CriticalSection getFrameCriticalSection;
+ juce::CriticalSection getFrameCriticalSection;
private:
bool waveform; ///< Should a waveform be used instead of the clip's image
- list effects; /// effects; /// apply_effects(std::shared_ptr frame);
+ std::shared_ptr apply_effects(std::shared_ptr frame);
/// Get file extension
- string get_file_extension(string path);
+ std::string get_file_extension(std::string path);
/// Get a frame object or create a blank one
- std::shared_ptr GetOrCreateFrame(int64_t number);
+ std::shared_ptr GetOrCreateFrame(int64_t number);
/// Adjust the audio and image of a time mapped frame
- void get_time_mapped_frame(std::shared_ptr frame, int64_t frame_number);
+ void get_time_mapped_frame(std::shared_ptr frame, int64_t frame_number);
/// Init default settings for a clip
void init_settings();
@@ -142,117 +140,117 @@ namespace openshot {
void reverse_buffer(juce::AudioSampleBuffer* buffer);
public:
- GravityType gravity; ///< The gravity of a clip determines where it snaps to it's parent
- ScaleType scale; ///< The scale determines how a clip should be resized to fit it's parent
- AnchorType anchor; ///< The anchor determines what parent a clip should snap to
- FrameDisplayType display; ///< The format to display the frame number (if any)
- VolumeMixType mixing; ///< What strategy should be followed when mixing audio with other clips
+ openshot::GravityType gravity; ///< The gravity of a clip determines where it snaps to its parent
+ openshot::ScaleType scale; ///< The scale determines how a clip should be resized to fit its parent
+ openshot::AnchorType anchor; ///< The anchor determines what parent a clip should snap to
+ openshot::FrameDisplayType display; ///< The format to display the frame number (if any)
+ openshot::VolumeMixType mixing; ///< What strategy should be followed when mixing audio with other clips
/// Default Constructor
Clip();
/// @brief Constructor with filepath (reader is automatically created... by guessing file extensions)
/// @param path The path of a reader (video file, image file, etc...). The correct reader will be used automatically.
- Clip(string path);
+ Clip(std::string path);
/// @brief Constructor with reader
/// @param new_reader The reader to be used by this clip
- Clip(ReaderBase* new_reader);
+ Clip(openshot::ReaderBase* new_reader);
/// Destructor
- ~Clip();
+ virtual ~Clip();
/// @brief Add an effect to the clip
/// @param effect Add an effect to the clip. An effect can modify the audio or video of an openshot::Frame.
- void AddEffect(EffectBase* effect);
+ void AddEffect(openshot::EffectBase* effect);
/// Close the internal reader
void Close();
/// Return the list of effects on the timeline
- list Effects() { return effects; };
+ std::list Effects() { return effects; };
/// @brief Get an openshot::Frame object for a specific frame number of this timeline.
///
/// @returns The requested frame (containing the image)
/// @param requested_frame The frame number that is requested
- std::shared_ptr GetFrame(int64_t requested_frame);
+ std::shared_ptr GetFrame(int64_t requested_frame);
/// Open the internal reader
void Open();
/// @brief Set the current reader
/// @param new_reader The reader to be used by this clip
- void Reader(ReaderBase* new_reader);
+ void Reader(openshot::ReaderBase* new_reader);
/// Get the current reader
- ReaderBase* Reader();
+ openshot::ReaderBase* Reader();
/// Override End() method
float End(); ///< Get end position (in seconds) of clip (trim end of video), which can be affected by the time curve.
void End(float value) { end = value; } ///< Set end position (in seconds) of clip (trim end of video)
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
- string PropertiesJSON(int64_t requested_frame);
+ std::string PropertiesJSON(int64_t requested_frame);
/// @brief Remove an effect from the clip
/// @param effect Remove an effect from the clip.
- void RemoveEffect(EffectBase* effect);
+ void RemoveEffect(openshot::EffectBase* effect);
/// Waveform property
bool Waveform() { return waveform; } ///< Get the waveform property of this clip
void Waveform(bool value) { waveform = value; } ///< Set the waveform property of this clip
// Scale and Location curves
- Keyframe scale_x; ///< Curve representing the horizontal scaling in percent (0 to 1)
- Keyframe scale_y; ///< Curve representing the vertical scaling in percent (0 to 1)
- Keyframe location_x; ///< Curve representing the relative X position in percent based on the gravity (-1 to 1)
- Keyframe location_y; ///< Curve representing the relative Y position in percent based on the gravity (-1 to 1)
+ openshot::Keyframe scale_x; ///< Curve representing the horizontal scaling in percent (0 to 1)
+ openshot::Keyframe scale_y; ///< Curve representing the vertical scaling in percent (0 to 1)
+ openshot::Keyframe location_x; ///< Curve representing the relative X position in percent based on the gravity (-1 to 1)
+ openshot::Keyframe location_y; ///< Curve representing the relative Y position in percent based on the gravity (-1 to 1)
// Alpha and Rotation curves
- Keyframe alpha; ///< Curve representing the alpha (1 to 0)
- Keyframe rotation; ///< Curve representing the rotation (0 to 360)
+ openshot::Keyframe alpha; ///< Curve representing the alpha (1 to 0)
+ openshot::Keyframe rotation; ///< Curve representing the rotation (0 to 360)
// Time and Volume curves
- Keyframe time; ///< Curve representing the frames over time to play (used for speed and direction of video)
- Keyframe volume; ///< Curve representing the volume (0 to 1)
+ openshot::Keyframe time; ///< Curve representing the frames over time to play (used for speed and direction of video)
+ openshot::Keyframe volume; ///< Curve representing the volume (0 to 1)
/// Curve representing the color of the audio wave form
- Color wave_color;
+ openshot::Color wave_color;
// Crop settings and curves
- GravityType crop_gravity; ///< Cropping needs to have a gravity to determine what side we are cropping
- Keyframe crop_width; ///< Curve representing width in percent (0.0=0%, 1.0=100%)
- Keyframe crop_height; ///< Curve representing height in percent (0.0=0%, 1.0=100%)
- Keyframe crop_x; ///< Curve representing X offset in percent (-1.0=-100%, 0.0=0%, 1.0=100%)
- Keyframe crop_y; ///< Curve representing Y offset in percent (-1.0=-100%, 0.0=0%, 1.0=100%)
+ openshot::GravityType crop_gravity; ///< Cropping needs to have a gravity to determine what side we are cropping
+ openshot::Keyframe crop_width; ///< Curve representing width in percent (0.0=0%, 1.0=100%)
+ openshot::Keyframe crop_height; ///< Curve representing height in percent (0.0=0%, 1.0=100%)
+ openshot::Keyframe crop_x; ///< Curve representing X offset in percent (-1.0=-100%, 0.0=0%, 1.0=100%)
+ openshot::Keyframe crop_y; ///< Curve representing Y offset in percent (-1.0=-100%, 0.0=0%, 1.0=100%)
// Shear and perspective curves
- Keyframe shear_x; ///< Curve representing X shear angle in degrees (-45.0=left, 45.0=right)
- Keyframe shear_y; ///< Curve representing Y shear angle in degrees (-45.0=down, 45.0=up)
- Keyframe perspective_c1_x; ///< Curves representing X for coordinate 1
- Keyframe perspective_c1_y; ///< Curves representing Y for coordinate 1
- Keyframe perspective_c2_x; ///< Curves representing X for coordinate 2
- Keyframe perspective_c2_y; ///< Curves representing Y for coordinate 2
- Keyframe perspective_c3_x; ///< Curves representing X for coordinate 3
- Keyframe perspective_c3_y; ///< Curves representing Y for coordinate 3
- Keyframe perspective_c4_x; ///< Curves representing X for coordinate 4
- Keyframe perspective_c4_y; ///< Curves representing Y for coordinate 4
+ openshot::Keyframe shear_x; ///< Curve representing X shear angle in degrees (-45.0=left, 45.0=right)
+ openshot::Keyframe shear_y; ///< Curve representing Y shear angle in degrees (-45.0=down, 45.0=up)
+ openshot::Keyframe perspective_c1_x; ///< Curves representing X for coordinate 1
+ openshot::Keyframe perspective_c1_y; ///< Curves representing Y for coordinate 1
+ openshot::Keyframe perspective_c2_x; ///< Curves representing X for coordinate 2
+ openshot::Keyframe perspective_c2_y; ///< Curves representing Y for coordinate 2
+ openshot::Keyframe perspective_c3_x; ///< Curves representing X for coordinate 3
+ openshot::Keyframe perspective_c3_y; ///< Curves representing Y for coordinate 3
+ openshot::Keyframe perspective_c4_x; ///< Curves representing X for coordinate 4
+ openshot::Keyframe perspective_c4_y; ///< Curves representing Y for coordinate 4
/// Audio channel filter and mappings
- Keyframe channel_filter; ///< A number representing an audio channel to filter (clears all other channels)
- Keyframe channel_mapping; ///< A number representing an audio channel to output (only works when filtering a channel)
+ openshot::Keyframe channel_filter; ///< A number representing an audio channel to filter (clears all other channels)
+ openshot::Keyframe channel_mapping; ///< A number representing an audio channel to output (only works when filtering a channel)
/// Override has_video and has_audio properties of clip (and their readers)
- Keyframe has_audio; ///< An optional override to determine if this clip has audio (-1=undefined, 0=no, 1=yes)
- Keyframe has_video; ///< An optional override to determine if this clip has video (-1=undefined, 0=no, 1=yes)
+ 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)
};
diff --git a/include/ClipBase.h b/include/ClipBase.h
index 3dae8a536..cf0d11fab 100644
--- a/include/ClipBase.h
+++ b/include/ClipBase.h
@@ -3,9 +3,12 @@
* @brief Header file for ClipBase class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,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
#include
#include "Exceptions.h"
@@ -40,8 +38,6 @@
#include "KeyFrame.h"
#include "Json.h"
-using namespace std;
-
namespace openshot {
/**
@@ -52,18 +48,18 @@ namespace openshot {
*/
class ClipBase {
protected:
- string id; ///< ID Property for all derived Clip and Effect classes.
+ std::string id; ///< ID Property for all derived Clip and Effect classes.
float position; ///< The position on the timeline where this clip should start playing
int layer; ///< The layer this clip is on. Lower clips are covered up by higher clips.
float start; ///< The position in seconds to start playing (used to trim the beginning of a clip)
float end; ///< The position in seconds to end playing (used to trim the ending of a clip)
- string previous_properties; ///< This string contains the previous JSON properties
+ std::string previous_properties; ///< This string contains the previous JSON properties
/// Generate JSON for a property
- Json::Value add_property_json(string name, float value, string type, string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame);
+ Json::Value add_property_json(std::string name, float value, std::string type, std::string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame);
/// Generate JSON choice for a property (dropdown properties)
- Json::Value add_property_choice_json(string name, int value, int selected_value);
+ Json::Value add_property_choice_json(std::string name, int value, int selected_value);
public:
@@ -77,7 +73,7 @@ namespace openshot {
bool operator>= ( ClipBase& a) { return (Position() >= a.Position()); }
/// Get basic properties
- string Id() { return id; } ///< Get the Id of this clip object
+ std::string Id() { return id; } ///< Get the Id of this clip object
float Position() { return position; } ///< Get position on timeline (in seconds)
int Layer() { return layer; } ///< Get layer of clip on timeline (lower number is covered by higher numbers)
float Start() { return start; } ///< Get start position (in seconds) of clip (trim start of video)
@@ -85,22 +81,23 @@ namespace openshot {
float Duration() { return end - start; } ///< Get the length of this clip (in seconds)
/// Set basic properties
- void Id(string value) { id = value; } ///> Set the Id of this clip object
+ void Id(std::string value) { id = value; } ///> Set the Id of this clip object
void Position(float value) { position = value; } ///< Set position on timeline (in seconds)
void Layer(int value) { layer = value; } ///< Set layer of clip on timeline (lower number is covered by higher numbers)
void Start(float value) { start = value; } ///< Set start position (in seconds) of clip (trim start of video)
void End(float value) { end = value; } ///< Set end position (in seconds) of clip (trim end of video)
/// Get and Set JSON methods
- virtual string Json() = 0; ///< Generate JSON string of this object
- virtual void SetJson(string value) = 0; ///< Load JSON string into this object
+ virtual std::string Json() = 0; ///< Generate JSON string of this object
+ virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
- virtual string PropertiesJSON(int64_t requested_frame) = 0;
+ virtual std::string PropertiesJSON(int64_t requested_frame) = 0;
+ virtual ~ClipBase() = default;
};
diff --git a/include/Color.h b/include/Color.h
index a0edd6025..47db29a7f 100644
--- a/include/Color.h
+++ b/include/Color.h
@@ -3,9 +3,12 @@
* @brief Header file for Color class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -42,33 +45,33 @@ namespace openshot {
class Color{
public:
- Keyframe red; ///
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -33,8 +36,6 @@
#include "Fraction.h"
#include "Json.h"
-using namespace std;
-
namespace openshot {
/**
@@ -65,9 +66,9 @@ namespace openshot {
Coordinate(double x, double y);
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
+ std::string Json(); ///< Generate JSON string of this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
- void SetJson(string value); ///< Load JSON string into this object
+ void SetJson(std::string value); ///< Load JSON string into this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
};
diff --git a/include/CrashHandler.h b/include/CrashHandler.h
index 12c79a864..76d788f29 100644
--- a/include/CrashHandler.h
+++ b/include/CrashHandler.h
@@ -3,9 +3,12 @@
* @brief Header file for CrashHandler class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/DecklinkInput.h b/include/DecklinkInput.h
index cfd5b6b11..3541811ee 100644
--- a/include/DecklinkInput.h
+++ b/include/DecklinkInput.h
@@ -3,7 +3,10 @@
* @brief Header file for DecklinkInput class
* @author Jonathan Thomas , Blackmagic Design
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
* Copyright (c) 2009 Blackmagic Design
*
@@ -30,7 +33,7 @@
* DEALINGS IN THE SOFTWARE.
*
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -76,7 +79,7 @@ class DeckLinkInputDelegate : public IDeckLinkInputCallback
unsigned long final_frameCount;
// Queue of raw video frames
- deque raw_video_frames;
+ std::deque raw_video_frames;
openshot::CacheMemory final_frames;
// Convert between YUV and RGB
diff --git a/include/DecklinkOutput.h b/include/DecklinkOutput.h
index ddb6e9bc6..9b1618b09 100644
--- a/include/DecklinkOutput.h
+++ b/include/DecklinkOutput.h
@@ -3,7 +3,10 @@
* @brief Header file for DecklinkOutput class
* @author Jonathan Thomas , Blackmagic Design
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
* Copyright (c) 2009 Blackmagic Design
*
@@ -30,7 +33,7 @@
* DEALINGS IN THE SOFTWARE.
*
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -90,14 +93,14 @@ class DeckLinkOutputDelegate : public IDeckLinkVideoOutputCallback, public IDeck
unsigned long frameCount;
//map temp_cache;
- map temp_cache;
+ std::map temp_cache;
BMDTimeValue frameRateDuration, frameRateScale;
// Queue of raw video frames
//deque final_frames;
- deque final_frames;
- deque > raw_video_frames;
+ std::deque final_frames;
+ std::deque > raw_video_frames;
// Convert between YUV and RGB
IDeckLinkOutput *deckLinkOutput;
diff --git a/include/DecklinkReader.h b/include/DecklinkReader.h
index 3ce9273f9..de077bdf8 100644
--- a/include/DecklinkReader.h
+++ b/include/DecklinkReader.h
@@ -3,9 +3,12 @@
* @brief Header file for DecklinkReader class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -47,8 +50,6 @@
#include "Frame.h"
#include "DecklinkInput.h"
-using namespace std;
-
namespace openshot
{
@@ -114,11 +115,11 @@ namespace openshot
bool IsOpen() { return is_open; };
/// Return the type name of the class
- string Name() { return "DecklinkReader"; };
+ std::string Name() { return "DecklinkReader"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
diff --git a/include/DecklinkWriter.h b/include/DecklinkWriter.h
index 00ac8b3e0..84117d0ea 100644
--- a/include/DecklinkWriter.h
+++ b/include/DecklinkWriter.h
@@ -3,9 +3,12 @@
* @brief Header file for DecklinkWriter class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -47,8 +50,6 @@
#include "Frame.h"
#include "DecklinkOutput.h"
-using namespace std;
-
namespace openshot
{
diff --git a/include/DummyReader.h b/include/DummyReader.h
index 559215de6..0b40f0790 100644
--- a/include/DummyReader.h
+++ b/include/DummyReader.h
@@ -3,9 +3,12 @@
* @brief Header file for DummyReader class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -40,8 +43,6 @@
#include "Exceptions.h"
#include "Fraction.h"
-using namespace std;
-
namespace openshot
{
/**
@@ -53,7 +54,7 @@ namespace openshot
class DummyReader : public ReaderBase
{
private:
- std::shared_ptr image_frame;
+ std::shared_ptr image_frame;
bool is_open;
public:
@@ -62,7 +63,9 @@ namespace openshot
DummyReader();
/// Constructor for DummyReader.
- DummyReader(Fraction fps, int width, int height, int sample_rate, int channels, float duration);
+ DummyReader(openshot::Fraction fps, int width, int height, int sample_rate, int channels, float duration);
+
+ virtual ~DummyReader();
/// Close File
void Close();
@@ -75,17 +78,17 @@ namespace openshot
///
/// @returns The requested frame (containing the image)
/// @param requested_frame The frame number that is requested.
- std::shared_ptr GetFrame(int64_t requested_frame);
+ std::shared_ptr GetFrame(int64_t requested_frame);
/// Determine if reader is open or closed
bool IsOpen() { return is_open; };
/// Return the type name of the class
- string Name() { return "DummyReader"; };
+ std::string Name() { return "DummyReader"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
diff --git a/include/EffectBase.h b/include/EffectBase.h
index 209369a8c..f462526db 100644
--- a/include/EffectBase.h
+++ b/include/EffectBase.h
@@ -3,9 +3,12 @@
* @brief Header file for EffectBase class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -32,10 +35,8 @@
#include
#include
#include "ClipBase.h"
-#include "Frame.h"
#include "Json.h"
-
-using namespace std;
+#include "Frame.h"
namespace openshot
{
@@ -48,10 +49,9 @@ namespace openshot
*/
struct EffectInfoStruct
{
- string class_name; ///< The class name of the effect
- string short_name; ///< A short name of the effect, commonly used for icon names, etc...
- string name; ///< The name of the effect
- string description; ///< The description of this effect and what it does
+ std::string class_name; ///< The class name of the effect
+ 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
bool has_audio; ///< Determines if this effect manipulates the audio of a frame
};
@@ -82,20 +82,20 @@ namespace openshot
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
- /// tells the effect which settings to use from it's keyframes (starting at 1).
+ /// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
- virtual std::shared_ptr GetFrame(std::shared_ptr frame, int64_t frame_number) = 0;
+ virtual std::shared_ptr GetFrame(std::shared_ptr frame, int64_t frame_number) = 0;
/// Initialize the values of the EffectInfo struct. It is important for derived classes to call
/// this method, or the EffectInfo struct values will not be initialized.
void InitEffectInfo();
/// Get and Set JSON methods
- virtual string Json() = 0; ///< Generate JSON string of this object
- virtual void SetJson(string value) = 0; ///< Load JSON string into this object
+ virtual std::string Json() = 0; ///< Generate JSON string of this object
+ virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
Json::Value JsonInfo(); ///< Generate JSON object of meta data / info
@@ -105,6 +105,7 @@ namespace openshot
/// Set the order that this effect should be executed.
void Order(int new_order) { order = new_order; }
+ virtual ~EffectBase() = default;
};
}
diff --git a/include/EffectInfo.h b/include/EffectInfo.h
index 999c9b6a7..1015b0da7 100644
--- a/include/EffectInfo.h
+++ b/include/EffectInfo.h
@@ -3,9 +3,12 @@
* @brief Header file for the EffectInfo class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -31,8 +34,6 @@
#include "Effects.h"
-using namespace std;
-
namespace openshot
{
@@ -46,10 +47,10 @@ namespace openshot
{
public:
// Create an instance of an effect (factory style)
- EffectBase* CreateEffect(string effect_type);
+ EffectBase* CreateEffect(std::string effect_type);
/// JSON methods
- static string Json(); ///< Generate JSON string of this object
+ static std::string Json(); ///< Generate JSON string of this object
static Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
};
diff --git a/include/Effects.h b/include/Effects.h
index 224c48be2..746da4c0f 100644
--- a/include/Effects.h
+++ b/include/Effects.h
@@ -6,9 +6,12 @@
* @brief This header includes all commonly used effects for libopenshot, for ease-of-use.
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/Enums.h b/include/Enums.h
index fb91f1fa7..387191ea4 100644
--- a/include/Enums.h
+++ b/include/Enums.h
@@ -3,9 +3,12 @@
* @brief Header file for TextReader class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/Exceptions.h b/include/Exceptions.h
index fe76d6dc3..28942050b 100644
--- a/include/Exceptions.h
+++ b/include/Exceptions.h
@@ -3,9 +3,12 @@
* @brief Header file for all Exception classes
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -29,7 +32,6 @@
#define OPENSHOT_EXCEPTIONS_H
#include
-using namespace std;
namespace openshot {
@@ -42,11 +44,11 @@ namespace openshot {
class BaseException : public std::exception //: public exception
{
protected:
- string m_message;
+ std::string m_message;
public:
- BaseException(string message) : m_message(message) { }
- virtual ~BaseException() throw () {}
- virtual const char* what() const throw () {
+ BaseException(std::string message) : m_message(message) { }
+ virtual ~BaseException() noexcept {}
+ virtual const char* what() const noexcept {
// return custom message
return m_message.c_str();
}
@@ -56,13 +58,20 @@ namespace openshot {
class ChunkNotFound : public BaseException
{
public:
- string file_path;
int64_t frame_number;
int64_t chunk_number;
int64_t chunk_frame;
- ChunkNotFound(string message, int64_t frame_number, int64_t chunk_number, int64_t chunk_frame)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param frame_number The frame number being processed
+ * @param chunk_number The chunk requested
+ * @param chunk_frame The chunk frame
+ */
+ ChunkNotFound(std::string message, int64_t frame_number, int64_t chunk_number, int64_t chunk_frame)
: BaseException(message), frame_number(frame_number), chunk_number(chunk_number), chunk_frame(chunk_frame) { }
- virtual ~ChunkNotFound() throw () {}
+ virtual ~ChunkNotFound() noexcept {}
};
@@ -70,132 +79,206 @@ namespace openshot {
class DecklinkError : public BaseException
{
public:
- DecklinkError(string message)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ */
+ DecklinkError(std::string message)
: BaseException(message) { }
- virtual ~DecklinkError() throw () {}
+ virtual ~DecklinkError() noexcept {}
};
/// Exception when decoding audio packet
class ErrorDecodingAudio : public BaseException
{
public:
- string file_path;
int64_t frame_number;
- ErrorDecodingAudio(string message, int64_t frame_number)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param frame_number The frame number being processed
+ */
+ ErrorDecodingAudio(std::string message, int64_t frame_number)
: BaseException(message), frame_number(frame_number) { }
- virtual ~ErrorDecodingAudio() throw () {}
+ virtual ~ErrorDecodingAudio() noexcept {}
};
/// Exception when encoding audio packet
class ErrorEncodingAudio : public BaseException
{
public:
- string file_path;
int64_t frame_number;
- ErrorEncodingAudio(string message, int64_t frame_number)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param frame_number The frame number being processed
+ */
+ ErrorEncodingAudio(std::string message, int64_t frame_number)
: BaseException(message), frame_number(frame_number) { }
- virtual ~ErrorEncodingAudio() throw () {}
+ virtual ~ErrorEncodingAudio() noexcept {}
};
/// Exception when encoding audio packet
class ErrorEncodingVideo : public BaseException
{
public:
- string file_path;
int64_t frame_number;
- ErrorEncodingVideo(string message, int64_t frame_number)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param frame_number The frame number being processed
+ */
+ ErrorEncodingVideo(std::string message, int64_t frame_number)
: BaseException(message), frame_number(frame_number) { }
- virtual ~ErrorEncodingVideo() throw () {}
+ virtual ~ErrorEncodingVideo() noexcept {}
};
/// Exception when an invalid # of audio channels are detected
class InvalidChannels : public BaseException
{
public:
- string file_path;
- InvalidChannels(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ InvalidChannels(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidChannels() throw () {}
+ virtual ~InvalidChannels() noexcept {}
};
/// Exception when no valid codec is found for a file
class InvalidCodec : public BaseException
{
public:
- string file_path;
- InvalidCodec(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ InvalidCodec(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidCodec() throw () {}
+ virtual ~InvalidCodec() noexcept {}
};
/// Exception for files that can not be found or opened
class InvalidFile : public BaseException
{
public:
- string file_path;
- InvalidFile(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path The input file being processed
+ */
+ InvalidFile(std::string message, std::string file_path)
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidFile() throw () {}
+ virtual ~InvalidFile() noexcept {}
};
/// Exception when no valid format is found for a file
class InvalidFormat : public BaseException
{
public:
- string file_path;
- InvalidFormat(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ InvalidFormat(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidFormat() throw () {}
+ virtual ~InvalidFormat() noexcept {}
};
/// Exception for invalid JSON
class InvalidJSON : public BaseException
{
public:
- string file_path;
- InvalidJSON(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ InvalidJSON(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidJSON() throw () {}
+ virtual ~InvalidJSON() noexcept {}
};
/// Exception when invalid encoding options are used
class InvalidOptions : public BaseException
{
public:
- string file_path;
- InvalidOptions(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ InvalidOptions(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidOptions() throw () {}
+ virtual ~InvalidOptions() noexcept {}
};
/// Exception when invalid sample rate is detected during encoding
class InvalidSampleRate : public BaseException
{
public:
- string file_path;
- InvalidSampleRate(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ InvalidSampleRate(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~InvalidSampleRate() throw () {}
+ virtual ~InvalidSampleRate() noexcept {}
};
/// Exception for missing JSON Change key
class InvalidJSONKey : public BaseException
{
public:
- string json;
- InvalidJSONKey(string message, string json)
+ std::string json;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param json The json data being processed
+ */
+ InvalidJSONKey(std::string message, std::string json)
: BaseException(message), json(json) { }
- virtual ~InvalidJSONKey() throw () {}
+ virtual ~InvalidJSONKey() noexcept {}
};
/// Exception when no streams are found in the file
class NoStreamsFound : public BaseException
{
public:
- string file_path;
- NoStreamsFound(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ NoStreamsFound(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~NoStreamsFound() throw () {}
+ virtual ~NoStreamsFound() noexcept {}
};
/// Exception for frames that are out of bounds.
@@ -204,9 +287,16 @@ namespace openshot {
public:
int64_t FrameRequested;
int64_t MaxFrames;
- OutOfBoundsFrame(string message, int64_t frame_requested, int64_t max_frames)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param frame_requested The out-of-bounds frame number requested
+ * @param max_frames The maximum available frame number
+ */
+ OutOfBoundsFrame(std::string message, int64_t frame_requested, int64_t max_frames)
: BaseException(message), FrameRequested(frame_requested), MaxFrames(max_frames) { }
- virtual ~OutOfBoundsFrame() throw () {}
+ virtual ~OutOfBoundsFrame() noexcept {}
};
/// Exception for an out of bounds key-frame point.
@@ -215,59 +305,96 @@ namespace openshot {
public:
int PointRequested;
int MaxPoints;
- OutOfBoundsPoint(string message, int point_requested, int max_points)
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param point_requested The out-of-bounds point requested
+ * @param max_points The maximum available point value
+ */
+ OutOfBoundsPoint(std::string message, int point_requested, int max_points)
: BaseException(message), PointRequested(point_requested), MaxPoints(max_points) { }
- virtual ~OutOfBoundsPoint() throw () {}
+ virtual ~OutOfBoundsPoint() noexcept {}
};
/// Exception when memory could not be allocated
class OutOfMemory : public BaseException
{
public:
- string file_path;
- OutOfMemory(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ OutOfMemory(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~OutOfMemory() throw () {}
+ virtual ~OutOfMemory() noexcept {}
};
/// Exception when a reader is closed, and a frame is requested
class ReaderClosed : public BaseException
{
public:
- string file_path;
- ReaderClosed(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ ReaderClosed(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~ReaderClosed() throw () {}
+ virtual ~ReaderClosed() noexcept {}
};
/// Exception when resample fails
class ResampleError : public BaseException
{
public:
- string file_path;
- ResampleError(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The input file being processed
+ */
+ ResampleError(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~ResampleError() throw () {}
+ virtual ~ResampleError() noexcept {}
};
/// Exception when too many seek attempts happen
class TooManySeeks : public BaseException
{
public:
- string file_path;
- TooManySeeks(string message, string file_path)
+ 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="")
: BaseException(message), file_path(file_path) { }
- virtual ~TooManySeeks() throw () {}
+ virtual ~TooManySeeks() noexcept {}
};
/// Exception when a writer is closed, and a frame is requested
class WriterClosed : public BaseException
{
public:
- string file_path;
- WriterClosed(string message, string file_path)
+ std::string file_path;
+ /**
+ * @brief Constructor
+ *
+ * @param message A message to accompany the exception
+ * @param file_path (optional) The output file being written
+ */
+ WriterClosed(std::string message, std::string file_path="")
: BaseException(message), file_path(file_path) { }
- virtual ~WriterClosed() throw () {}
+ virtual ~WriterClosed() noexcept {}
};
}
diff --git a/include/FFmpegReader.h b/include/FFmpegReader.h
index eaa459438..9faa86a35 100644
--- a/include/FFmpegReader.h
+++ b/include/FFmpegReader.h
@@ -3,9 +3,12 @@
* @brief Header file for FFmpegReader class
* @author Jonathan Thomas , Fabrice Bellard
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC, Fabrice Bellard
* (http://www.openshotstudios.com). This file is part of
* OpenShot Library (http://www.openshot.org), an open-source project
* dedicated to delivering high quality video editing and animation solutions
@@ -48,20 +51,17 @@
#include "Settings.h"
-using namespace std;
-
-namespace openshot
-{
+namespace openshot {
/**
* @brief This struct holds the associated video frame and starting sample # for an audio packet.
*
* Because audio packets do not match up with video frames, this helps determine exactly
* where the audio packet's samples belong.
*/
- struct AudioLocation
- {
+ struct AudioLocation {
int64_t frame;
int sample_start;
+
bool is_near(AudioLocation location, int samples_per_frame, int64_t amount);
};
@@ -91,14 +91,16 @@ namespace openshot
* r.Close();
* @endcode
*/
- class FFmpegReader : public ReaderBase
- {
+ class FFmpegReader : public ReaderBase {
private:
- string path;
+ std::string path;
AVFormatContext *pFormatCtx;
int i, videoStream, audioStream;
AVCodecContext *pCodecCtx, *aCodecCtx;
+#if (LIBAVFORMAT_VERSION_MAJOR >= 57)
+ AVBufferRef *hw_device_ctx = NULL; //PM
+#endif
AVStream *pStream, *aStream;
AVPacket *packet;
AVFrame *pFrame;
@@ -110,15 +112,15 @@ namespace openshot
CacheMemory working_cache;
CacheMemory missing_frames;
- map processing_video_frames;
- multimap processing_audio_frames;
- map processed_video_frames;
- map processed_audio_frames;
- multimap missing_video_frames;
- multimap missing_video_frames_source;
- multimap missing_audio_frames;
- multimap missing_audio_frames_source;
- map checked_frames;
+ std::map processing_video_frames;
+ std::multimap processing_audio_frames;
+ std::map processed_video_frames;
+ std::map processed_audio_frames;
+ std::multimap missing_video_frames;
+ std::multimap missing_video_frames_source;
+ std::multimap missing_audio_frames;
+ std::multimap missing_audio_frames_source;
+ std::map checked_frames;
AudioLocation previous_packet_location;
// DEBUG VARIABLES (FOR AUDIO ISSUES)
@@ -128,7 +130,7 @@ namespace openshot
int64_t pts_counter;
int64_t num_packets_since_video_frame;
int64_t num_checks_since_final;
- std::shared_ptr last_video_frame;
+ std::shared_ptr last_video_frame;
bool is_seeking;
int64_t seeking_pts;
@@ -142,7 +144,15 @@ namespace openshot
int64_t video_pts_offset;
int64_t last_frame;
int64_t largest_frame_processed;
- int64_t current_video_frame; // can't reliably use PTS of video to determine this
+ int64_t current_video_frame; // can't reliably use PTS of video to determine this
+
+ int hw_de_supported = 0; // Is set by FFmpegReader
+#if IS_FFMPEG_3_2
+ AVPixelFormat hw_de_av_pix_fmt = AV_PIX_FMT_NONE;
+ AVHWDeviceType hw_de_av_device_type = AV_HWDEVICE_TYPE_NONE;
+#endif
+
+ int IsHardwareDecodeSupported(int codecid);
/// Check for the correct frames per second value by scanning the 1st few seconds of video packets.
void CheckFPS();
@@ -150,7 +160,7 @@ namespace openshot
/// Check the current seek position and determine if we need to seek again
bool CheckSeek(bool is_video);
- /// Check if a frame is missing and attempt to replace it's frame image (and
+ /// Check if a frame is missing and attempt to replace its frame image (and
bool CheckMissingFrame(int64_t requested_frame);
/// Check the working queue, and move finished frames to the finished queue
@@ -166,7 +176,7 @@ namespace openshot
int64_t ConvertVideoPTStoFrame(int64_t pts);
/// Create a new Frame (or return an existing one) and add it to the working queue.
- std::shared_ptr CreateFrame(int64_t requested_frame);
+ std::shared_ptr CreateFrame(int64_t requested_frame);
/// Calculate Starting video frame and sample # for an audio PTS
AudioLocation GetAudioPTSLocation(int64_t pts);
@@ -196,13 +206,13 @@ namespace openshot
void ProcessAudioPacket(int64_t requested_frame, int64_t target_frame, int starting_sample);
/// Read the stream until we find the requested Frame
- std::shared_ptr ReadStream(int64_t requested_frame);
+ std::shared_ptr ReadStream(int64_t requested_frame);
- /// Remove AVFrame from cache (and deallocate it's memory)
- void RemoveAVFrame(AVFrame*);
+ /// Remove AVFrame from cache (and deallocate its memory)
+ void RemoveAVFrame(AVFrame *);
- /// Remove AVPacket from cache (and deallocate it's memory)
- void RemoveAVPacket(AVPacket*);
+ /// Remove AVPacket from cache (and deallocate its memory)
+ void RemoveAVPacket(AVPacket *);
/// Seek to a specific Frame. This is not always frame accurate, it's more of an estimation on many codecs.
void Seek(int64_t requested_frame);
@@ -226,37 +236,37 @@ namespace openshot
/// Constructor for FFmpegReader. This automatically opens the media file and loads
/// frame 1, or it throws one of the following exceptions.
- FFmpegReader(string path);
+ FFmpegReader(std::string path);
- /// Constructor for FFmpegReader. This only opens the media file to inspect it's properties
+ /// Constructor for FFmpegReader. This only opens the media file to inspect its properties
/// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful
/// when you are inflating the object using JSON after instantiating it.
- FFmpegReader(string path, bool inspect_reader);
+ FFmpegReader(std::string path, bool inspect_reader);
/// Destructor
- ~FFmpegReader();
+ virtual ~FFmpegReader();
/// Close File
void Close();
/// Get the cache object used by this reader
- CacheMemory* GetCache() { return &final_cache; };
+ CacheMemory *GetCache() { return &final_cache; };
/// Get a shared pointer to a openshot::Frame object for a specific frame number of this reader.
///
/// @returns The requested frame of video
/// @param requested_frame The frame number that is requested.
- std::shared_ptr GetFrame(int64_t requested_frame);
+ std::shared_ptr GetFrame(int64_t requested_frame);
/// Determine if reader is open or closed
bool IsOpen() { return is_open; };
/// Return the type name of the class
- string Name() { return "FFmpegReader"; };
+ std::string Name() { return "FFmpegReader"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
diff --git a/include/FFmpegUtilities.h b/include/FFmpegUtilities.h
index 346da5418..c673305eb 100644
--- a/include/FFmpegUtilities.h
+++ b/include/FFmpegUtilities.h
@@ -3,9 +3,12 @@
* @brief Header file for FFmpegUtilities
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -42,6 +45,9 @@
extern "C" {
#include
#include
+ #if (LIBAVFORMAT_VERSION_MAJOR >= 57)
+ #include //PM
+ #endif
#include
// Change this to the first version swrescale works
#if (LIBAVFORMAT_VERSION_MAJOR >= 57)
@@ -85,12 +91,11 @@
#endif
// This wraps an unsafe C macro to be C++ compatible function
- static const std::string av_make_error_string(int errnum)
+ inline static const std::string av_make_error_string(int errnum)
{
char errbuf[AV_ERROR_MAX_STRING_SIZE];
av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE);
- std::string errstring(errbuf);
- return errstring;
+ return (std::string)errbuf;
}
// Redefine the C macro to use our new C++ function
@@ -100,13 +105,13 @@
// Define this for compatibility
#ifndef PixelFormat
#define PixelFormat AVPixelFormat
- #endif
+ #endif
#ifndef PIX_FMT_RGBA
#define PIX_FMT_RGBA AV_PIX_FMT_RGBA
- #endif
+ #endif
#ifndef PIX_FMT_NONE
#define PIX_FMT_NONE AV_PIX_FMT_NONE
- #endif
+ #endif
#ifndef PIX_FMT_RGB24
#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
#endif
@@ -114,6 +119,13 @@
#define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
#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
+ #ifdef RSHIFT
+ #define FF_RSHIFT(a, b) RSHIFT(a, b)
+ #undef RSHIFT
+ #endif
+
#ifdef USE_SW
#define SWR_CONVERT(ctx, out, linesize, out_count, in, linesize2, in_count) \
swr_convert(ctx, out, out_count, (const uint8_t **)in, in_count)
@@ -137,11 +149,12 @@
#define AV_REGISTER_ALL
#define AVCODEC_REGISTER_ALL
#define AV_FILENAME url
+ #define AV_SET_FILENAME(oc, f) oc->AV_FILENAME = av_strdup(f)
#define MY_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() av_frame_alloc()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) av_image_alloc(av_frame->data, av_frame->linesize, width, height, pix_fmt, 1)
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
- #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
+ #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
@@ -172,11 +185,12 @@
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
#define AV_FILENAME filename
+ #define AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() av_frame_alloc()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) av_image_alloc(av_frame->data, av_frame->linesize, width, height, pix_fmt, 1)
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
- #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
+ #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
@@ -199,19 +213,23 @@
#define AV_FORMAT_NEW_STREAM(oc, st_codec, 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; \
- av_st->codecpar->codec_id = av_codec->id;
+ _Pragma ("GCC diagnostic push"); \
+ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\""); \
+ avcodec_get_context_defaults3(av_st->codec, av_codec); \
+ c = av_st->codec; \
+ _Pragma ("GCC diagnostic pop"); \
+ st_codec = c;
#define AV_COPY_PARAMS_FROM_CONTEXT(av_stream, av_codec) avcodec_parameters_from_context(av_stream->codecpar, av_codec);
#elif LIBAVFORMAT_VERSION_MAJOR >= 55
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
#define AV_FILENAME filename
+ #define AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() av_frame_alloc()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) avpicture_alloc((AVPicture *) av_frame, pix_fmt, width, height)
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
- #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
+ #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define AV_FREE_CONTEXT(av_context) avcodec_close(av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codec->codec_type
@@ -237,6 +255,7 @@
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
#define AV_FILENAME filename
+ #define AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() avcodec_alloc_frame()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) avpicture_alloc((AVPicture *) av_frame, pix_fmt, width, height)
diff --git a/include/FFmpegWriter.h b/include/FFmpegWriter.h
index e219f72c6..dc3a2cf7b 100644
--- a/include/FFmpegWriter.h
+++ b/include/FFmpegWriter.h
@@ -3,9 +3,12 @@
* @brief Header file for FFmpegWriter class
* @author Jonathan Thomas , Fabrice Bellard
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC, Fabrice Bellard
* (http://www.openshotstudios.com). This file is part of
* OpenShot Library (http://www.openshot.org), an open-source project
* dedicated to delivering high quality video editing and animation solutions
@@ -54,16 +57,12 @@
#include "Settings.h"
-using namespace std;
-
-namespace openshot
-{
+namespace openshot {
/// This enumeration designates the type of stream when encoding (video or audio)
- enum StreamType
- {
- VIDEO_STREAM, ///< A video stream (used to determine which type of stream)
- AUDIO_STREAM ///< An audio stream (used to determine which type of stream)
+ enum StreamType {
+ VIDEO_STREAM, ///< A video stream (used to determine which type of stream)
+ AUDIO_STREAM ///< An audio stream (used to determine which type of stream)
};
/**
@@ -83,7 +82,7 @@ namespace openshot
* FFmpegWriter w("/home/jonathan/NewVideo.webm");
*
* // Set options
- * w.SetAudioOptions(true, "libvorbis", 44100, 2, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
+ * w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
*
* // Open the writer
@@ -110,7 +109,7 @@ namespace openshot
* FFmpegWriter w("/home/jonathan/NewVideo.webm");
*
* // Set options
- * w.SetAudioOptions(true, "libvorbis", 44100, 2, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
+ * w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
*
* // Prepare Streams (Optional method that must be called before any SetOption calls)
@@ -141,10 +140,9 @@ namespace openshot
* r.Close();
* @endcode
*/
- class FFmpegWriter : public WriterBase
- {
+ class FFmpegWriter : public WriterBase {
private:
- string path;
+ std::string path;
int cache_size;
bool is_writing;
bool is_open;
@@ -155,56 +153,56 @@ namespace openshot
bool write_header;
bool write_trailer;
- AVOutputFormat *fmt;
- AVFormatContext *oc;
- AVStream *audio_st, *video_st;
- AVCodecContext *video_codec;
- AVCodecContext *audio_codec;
- SwsContext *img_convert_ctx;
- double audio_pts, video_pts;
- int16_t *samples;
- uint8_t *audio_outbuf;
- uint8_t *audio_encoder_buffer;
-
- int num_of_rescalers;
+ AVOutputFormat *fmt;
+ AVFormatContext *oc;
+ AVStream *audio_st, *video_st;
+ AVCodecContext *video_codec;
+ AVCodecContext *audio_codec;
+ SwsContext *img_convert_ctx;
+ double audio_pts, video_pts;
+ int16_t *samples;
+ uint8_t *audio_outbuf;
+ uint8_t *audio_encoder_buffer;
+
+ int num_of_rescalers;
int rescaler_position;
- vector image_rescalers;
+ std::vector image_rescalers;
- int audio_outbuf_size;
- int audio_input_frame_size;
- int initial_audio_input_frame_size;
- int audio_input_position;
- int audio_encoder_buffer_size;
- SWRCONTEXT *avr;
- SWRCONTEXT *avr_planar;
+ int audio_outbuf_size;
+ int audio_input_frame_size;
+ int initial_audio_input_frame_size;
+ int audio_input_position;
+ int audio_encoder_buffer_size;
+ SWRCONTEXT *avr;
+ SWRCONTEXT *avr_planar;
- /* Resample options */
- int original_sample_rate;
- int original_channels;
+ /* Resample options */
+ int original_sample_rate;
+ int original_channels;
- std::shared_ptr last_frame;
- deque > spooled_audio_frames;
- deque > spooled_video_frames;
+ std::shared_ptr last_frame;
+ std::deque > spooled_audio_frames;
+ std::deque > spooled_video_frames;
- deque > queued_audio_frames;
- deque > queued_video_frames;
+ std::deque > queued_audio_frames;
+ std::deque > queued_video_frames;
- deque > processed_frames;
- deque > deallocate_frames;
+ std::deque > processed_frames;
+ std::deque > deallocate_frames;
- map, AVFrame*> av_frames;
+ std::map, AVFrame *> av_frames;
- /// Add an AVFrame to the cache
- void add_avframe(std::shared_ptr frame, AVFrame* av_frame);
+ /// Add an AVFrame to the cache
+ void add_avframe(std::shared_ptr frame, AVFrame *av_frame);
/// Add an audio output stream
- AVStream* add_audio_stream();
+ AVStream *add_audio_stream();
/// Add a video output stream
- AVStream* add_video_stream();
+ AVStream *add_video_stream();
/// Allocate an AVFrame object
- AVFrame* allocate_avframe(PixelFormat pix_fmt, int width, int height, int *buffer_size, uint8_t *new_buffer);
+ AVFrame *allocate_avframe(PixelFormat pix_fmt, int width, int height, int *buffer_size, uint8_t *new_buffer);
/// Auto detect format (from path)
void auto_detect_format();
@@ -233,13 +231,13 @@ namespace openshot
void open_video(AVFormatContext *oc, AVStream *st);
/// process video frame
- void process_video_packet(std::shared_ptr frame);
+ void process_video_packet(std::shared_ptr frame);
/// write all queued frames' audio to the video file
- void write_audio_packets(bool final);
+ void write_audio_packets(bool is_final);
/// write video frame
- bool write_video_packet(std::shared_ptr frame, AVFrame* frame_final);
+ bool write_video_packet(std::shared_ptr frame, AVFrame *frame_final);
/// write all queued frames
void write_queued_frames();
@@ -248,7 +246,7 @@ namespace openshot
/// @brief Constructor for FFmpegWriter. Throws one of the following exceptions.
/// @param path The file path of the video file you want to open and read
- FFmpegWriter(string path);
+ FFmpegWriter(std::string path);
/// Close the writer
void Close();
@@ -260,7 +258,7 @@ namespace openshot
bool IsOpen() { return is_open; };
/// Determine if codec name is valid
- static bool IsValidCodec(string codec_name);
+ static bool IsValidCodec(std::string codec_name);
/// Open writer
void Open();
@@ -287,7 +285,7 @@ namespace openshot
/// @param channels The number of audio channels needed in this file
/// @param channel_layout The 'layout' of audio channels (i.e. mono, stereo, surround, etc...)
/// @param bit_rate The audio bit rate used during encoding
- void SetAudioOptions(bool has_audio, string codec, int sample_rate, int channels, ChannelLayout channel_layout, int bit_rate);
+ void SetAudioOptions(bool has_audio, std::string codec, int sample_rate, int channels, openshot::ChannelLayout channel_layout, int bit_rate);
/// @brief Set the cache size
/// @param new_size The number of frames to queue before writing to the file
@@ -303,14 +301,14 @@ namespace openshot
/// @param interlaced Does this video need to be interlaced?
/// @param top_field_first Which frame should be used as the top field?
/// @param bit_rate The video bit rate used during encoding
- void SetVideoOptions(bool has_video, string codec, Fraction fps, int width, int height,Fraction pixel_ratio, bool interlaced, bool top_field_first, int bit_rate);
+ void SetVideoOptions(bool has_video, std::string codec, openshot::Fraction fps, int width, int height, openshot::Fraction pixel_ratio, bool interlaced, bool top_field_first, int bit_rate);
/// @brief Set custom options (some codecs accept additional params). This must be called after the
/// PrepareStreams() method, otherwise the streams have not been initialized yet.
/// @param stream The stream (openshot::StreamType) this option should apply to
/// @param name The name of the option you want to set (i.e. qmin, qmax, etc...)
/// @param value The new value of this option
- void SetOption(StreamType stream, string name, string value);
+ void SetOption(openshot::StreamType stream, std::string name, std::string value);
/// @brief Write the file header (after the options are set). This method is called automatically
/// by the Open() method if this method has not yet been called.
@@ -318,13 +316,13 @@ namespace openshot
/// @brief Add a frame to the stack waiting to be encoded.
/// @param frame The openshot::Frame object to write to this image
- void WriteFrame(std::shared_ptr frame);
+ void WriteFrame(std::shared_ptr frame);
/// @brief Write a block of frames from a reader
/// @param reader A openshot::ReaderBase object which will provide frames to be written
/// @param start The starting frame number of the reader
/// @param length The number of frames to write
- void WriteFrame(ReaderBase* reader, int64_t start, int64_t length);
+ void WriteFrame(openshot::ReaderBase *reader, int64_t start, int64_t length);
/// @brief Write the file trailer (after all frames are written). This is called automatically
/// by the Close() method if this method has not yet been called.
diff --git a/include/Fraction.h b/include/Fraction.h
index 7f5e58819..9ffcda1fd 100644
--- a/include/Fraction.h
+++ b/include/Fraction.h
@@ -3,9 +3,12 @@
* @brief Header file for Fraction class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/Frame.h b/include/Frame.h
index eba7f8bbf..f4ff54d44 100644
--- a/include/Frame.h
+++ b/include/Frame.h
@@ -3,9 +3,12 @@
* @brief Header file for Frame class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,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
#include
#include
@@ -53,17 +47,14 @@
#include
#include
#include "ZmqLogger.h"
-#ifdef USE_IMAGEMAGICK
- #include "Magick++.h"
-#endif
-#include "JuceLibraryCode/JuceHeader.h"
#include "ChannelLayouts.h"
#include "AudioBufferSource.h"
#include "AudioResampler.h"
#include "Fraction.h"
-
-#pragma SWIG nowarn=362
-using namespace std;
+#include "JuceHeader.h"
+#ifdef USE_IMAGEMAGICK
+ #include "MagickUtilities.h"
+#endif
namespace openshot
{
@@ -119,16 +110,16 @@ namespace openshot
std::shared_ptr wave_image;
std::shared_ptr audio;
std::shared_ptr previewApp;
- CriticalSection addingImageSection;
- CriticalSection addingAudioSection;
+ juce::CriticalSection addingImageSection;
+ juce::CriticalSection addingAudioSection;
const unsigned char *qbuffer;
- Fraction pixel_ratio;
+ openshot::Fraction pixel_ratio;
int channels;
ChannelLayout channel_layout;
int width;
int height;
int sample_rate;
- string color;
+ std::string color;
int64_t max_audio_sample; ///< The max audio sample count added to this frame
/// Constrain a color value from 0 to 255
@@ -144,13 +135,13 @@ namespace openshot
Frame();
/// Constructor - image only (48kHz audio silence)
- Frame(int64_t number, int width, int height, string color);
+ Frame(int64_t number, int width, int height, std::string color);
/// Constructor - audio only (300x200 blank image)
Frame(int64_t number, int samples, int channels);
/// Constructor - image & audio
- Frame(int64_t number, int width, int height, string color, int samples, int channels);
+ Frame(int64_t number, int width, int height, std::string color, int samples, int channels);
/// Copy constructor
Frame ( const Frame &other );
@@ -159,10 +150,10 @@ namespace openshot
Frame& operator= (const Frame& other);
/// Destructor
- ~Frame();
+ virtual ~Frame();
/// Add (or replace) pixel data to the frame (based on a solid color)
- void AddColor(int new_width, int new_height, string new_color);
+ void AddColor(int new_width, int new_height, std::string new_color);
/// Add (or replace) pixel data to the frame
void AddImage(int new_width, int new_height, int bytes_per_pixel, QImage::Format type, const unsigned char *pixels_);
@@ -189,15 +180,15 @@ namespace openshot
/// Channel Layout of audio samples. A frame needs to keep track of this, since Writers do not always
/// know the original channel layout of a frame's audio samples (i.e. mono, stereo, 5 point surround, etc...)
- ChannelLayout ChannelsLayout();
+ openshot::ChannelLayout ChannelsLayout();
// Set the channel layout of audio samples (i.e. mono, stereo, 5 point surround, etc...)
- void ChannelsLayout(ChannelLayout new_channel_layout) { channel_layout = new_channel_layout; };
+ void ChannelsLayout(openshot::ChannelLayout new_channel_layout) { channel_layout = new_channel_layout; };
/// Clean up buffer after QImage is deleted
static void cleanUpBuffer(void *info);
- /// Clear the waveform image (and deallocate it's memory)
+ /// Clear the waveform image (and deallocate its memory)
void ClearWaveform();
/// Copy data and pointers from another Frame instance
@@ -216,10 +207,10 @@ namespace openshot
float* GetAudioSamples(int channel);
/// Get an array of sample data (all channels interleaved together), using any sample rate
- float* GetInterleavedAudioSamples(int new_sample_rate, AudioResampler* resampler, int* sample_count);
+ float* GetInterleavedAudioSamples(int new_sample_rate, openshot::AudioResampler* resampler, int* sample_count);
// Get a planar array of sample data, using any sample rate
- float* GetPlanarAudioSamples(int new_sample_rate, AudioResampler* resampler, int* sample_count);
+ float* GetPlanarAudioSamples(int new_sample_rate, openshot::AudioResampler* resampler, int* sample_count);
/// Get number of audio channels
int GetAudioChannelsCount();
@@ -241,7 +232,7 @@ namespace openshot
#endif
/// Set Pixel Aspect Ratio
- Fraction GetPixelRatio() { return pixel_ratio; };
+ openshot::Fraction GetPixelRatio() { return pixel_ratio; };
/// Get pixel data (as packets)
const unsigned char* GetPixels();
@@ -249,14 +240,17 @@ namespace openshot
/// Get pixel data (for only a single scan-line)
const unsigned char* GetPixels(int row);
+ /// Check a specific pixel color value (returns True/False)
+ bool CheckPixel(int row, int col, int red, int green, int blue, int alpha, int threshold);
+
/// Get height of image
int GetHeight();
/// Calculate the # of samples per video frame (for the current frame number)
- int GetSamplesPerFrame(Fraction fps, int sample_rate, int channels);
+ int GetSamplesPerFrame(openshot::Fraction fps, int sample_rate, int channels);
/// Calculate the # of samples per video frame (for a specific frame number and frame rate)
- static int GetSamplesPerFrame(int64_t frame_number, Fraction fps, int sample_rate, int channels);
+ static int GetSamplesPerFrame(int64_t frame_number, openshot::Fraction fps, int sample_rate, int channels);
/// Get an audio waveform image
std::shared_ptr GetWaveform(int width, int height, int Red, int Green, int Blue, int Alpha);
@@ -268,7 +262,7 @@ namespace openshot
int GetWidth();
/// Resize audio container to hold more (or less) samples and channels
- void ResizeAudio(int channels, int length, int sample_rate, ChannelLayout channel_layout);
+ void ResizeAudio(int channels, int length, int sample_rate, openshot::ChannelLayout channel_layout);
/// Get the original sample rate of this frame's audio data
int SampleRate();
@@ -277,7 +271,7 @@ namespace openshot
void SampleRate(int orig_sample_rate) { sample_rate = orig_sample_rate; };
/// Save the frame image to the specified path. The image format can be BMP, JPG, JPEG, PNG, PPM, XBM, XPM
- void Save(string path, float scale, string format="PNG", int quality=100);
+ void Save(std::string path, float scale, std::string format="PNG", int quality=100);
/// Set frame number
void SetFrameNumber(int64_t number);
@@ -287,8 +281,8 @@ namespace openshot
/// Thumbnail the frame image with tons of options to the specified path. The image format is determined from the extension (i.e. image.PNG, image.JPEG).
/// This method allows for masks, overlays, background color, and much more accurate resizing (including padding and centering)
- void Thumbnail(string path, int new_width, int new_height, string mask_path, string overlay_path,
- string background_color, bool ignore_aspect, string format="png", int quality=100, float rotate=0.0);
+ void Thumbnail(std::string path, int new_width, int new_height, std::string mask_path, std::string overlay_path,
+ std::string background_color, bool ignore_aspect, std::string format="png", int quality=100, float rotate=0.0);
/// Play audio samples for this frame
void Play();
diff --git a/include/FrameMapper.h b/include/FrameMapper.h
index 216fe73f6..f2b030a36 100644
--- a/include/FrameMapper.h
+++ b/include/FrameMapper.h
@@ -3,9 +3,12 @@
* @brief Header file for the FrameMapper class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -46,9 +49,6 @@
#include "OpenMPUtilities.h"
-
-using namespace std;
-
namespace openshot
{
/**
@@ -163,14 +163,14 @@ namespace openshot
public:
// Init some containers
- vector fields; // List of all fields
- vector frames; // List of all frames
+ std::vector fields; // List of all fields
+ std::vector frames; // List of all frames
/// Default constructor for openshot::FrameMapper class
FrameMapper(ReaderBase *reader, Fraction target_fps, PulldownType target_pulldown, int target_sample_rate, int target_channels, ChannelLayout target_channel_layout);
/// Destructor
- ~FrameMapper();
+ virtual ~FrameMapper();
/// Change frame rate or audio mapping details
void ChangeMapping(Fraction target_fps, PulldownType pulldown, int target_sample_rate, int target_channels, ChannelLayout target_channel_layout);
@@ -196,11 +196,11 @@ namespace openshot
bool IsOpen();
/// Return the type name of the class
- string Name() { return "FrameMapper"; };
+ std::string Name() { return "FrameMapper"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
@@ -213,6 +213,9 @@ namespace openshot
/// Get the current reader
ReaderBase* Reader();
+ /// Set the current reader
+ void Reader(ReaderBase *new_reader) { reader = new_reader; }
+
/// Resample audio and map channels (if needed)
void ResampleMappedAudio(std::shared_ptr frame, int64_t original_frame_number);
diff --git a/include/ImageReader.h b/include/ImageReader.h
index e698e0c1b..8da450eb7 100644
--- a/include/ImageReader.h
+++ b/include/ImageReader.h
@@ -3,9 +3,12 @@
* @brief Header file for ImageReader class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -28,6 +31,9 @@
#ifndef OPENSHOT_IMAGE_READER_H
#define OPENSHOT_IMAGE_READER_H
+// Require ImageMagick support
+#ifdef USE_IMAGEMAGICK
+
#include "ReaderBase.h"
#include
@@ -36,11 +42,9 @@
#include
#include
#include
-#include "Magick++.h"
#include "CacheMemory.h"
#include "Exceptions.h"
-
-using namespace std;
+#include "MagickUtilities.h"
namespace openshot
{
@@ -67,7 +71,7 @@ namespace openshot
class ImageReader : public ReaderBase
{
private:
- string path;
+ std::string path;
std::shared_ptr image;
bool is_open;
@@ -75,12 +79,12 @@ namespace openshot
/// Constructor for ImageReader. This automatically opens the media file and loads
/// frame 1, or it throws one of the following exceptions.
- ImageReader(string path);
+ ImageReader(std::string path);
- /// Constructor for ImageReader. This only opens the media file to inspect it's properties
+ /// Constructor for ImageReader. This only opens the media file to inspect its properties
/// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful
/// when you are inflating the object using JSON after instantiating it.
- ImageReader(string path, bool inspect_reader);
+ ImageReader(std::string path, bool inspect_reader);
/// Close File
void Close();
@@ -99,11 +103,11 @@ namespace openshot
bool IsOpen() { return is_open; };
/// Return the type name of the class
- string Name() { return "ImageReader"; };
+ std::string Name() { return "ImageReader"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
@@ -113,4 +117,5 @@ namespace openshot
}
-#endif
+#endif //USE_IMAGEMAGICK
+#endif //OPENSHOT_IMAGE_READER_H
diff --git a/include/ImageWriter.h b/include/ImageWriter.h
index 251771348..87e8a9a95 100644
--- a/include/ImageWriter.h
+++ b/include/ImageWriter.h
@@ -3,9 +3,12 @@
* @brief Header file for ImageWriter class
* @author Jonathan Thomas , Fabrice Bellard
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2013 OpenShot Studios, LLC, Fabrice Bellard
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC, Fabrice Bellard
* (http://www.openshotstudios.com). This file is part of
* OpenShot Library (http://www.openshot.org), an open-source project
* dedicated to delivering high quality video editing and animation solutions
@@ -32,10 +35,11 @@
* along with OpenShot Library. If not, see .
*/
-
#ifndef OPENSHOT_IMAGE_WRITER_H
#define OPENSHOT_IMAGE_WRITER_H
+#ifdef USE_IMAGEMAGICK
+
#include "ReaderBase.h"
#include "WriterBase.h"
@@ -44,13 +48,10 @@
#include
#include
#include
-#include "Magick++.h"
#include "CacheMemory.h"
#include "Exceptions.h"
#include "OpenMPUtilities.h"
-
-
-using namespace std;
+#include "MagickUtilities.h"
namespace openshot
{
@@ -85,12 +86,12 @@ namespace openshot
class ImageWriter : public WriterBase
{
private:
- string path;
+ std::string path;
int cache_size;
bool is_writing;
bool is_open;
int64_t write_video_count;
- vector frames;
+ std::vector frames;
int image_quality;
int number_of_loops;
bool combine_frames;
@@ -101,7 +102,7 @@ namespace openshot
/// @brief Constructor for ImageWriter. Throws one of the following exceptions.
/// @param path The path of the file you want to create
- ImageWriter(string path);
+ ImageWriter(std::string path);
/// @brief Close the writer and encode/output final image to the disk. This is a requirement of ImageMagick,
/// which writes all frames of a multi-frame image at one time.
@@ -127,8 +128,8 @@ namespace openshot
/// @param height Height in pixels of image
/// @param quality Quality of image (0 to 100, 70 is default)
/// @param loops Number of times to repeat the image (used on certain multi-frame image formats, such as GIF)
- /// @param combine Combine frames into a single image (if possible), or save each frame as it's own image
- void SetVideoOptions(string format, Fraction fps, int width, int height,
+ /// @param combine Combine frames into a single image (if possible), or save each frame as its own image
+ void SetVideoOptions(std::string format, Fraction fps, int width, int height,
int quality, int loops, bool combine);
/// @brief Add a frame to the stack waiting to be encoded.
@@ -145,4 +146,5 @@ namespace openshot
}
-#endif
+#endif //USE_IMAGEMAGICK
+#endif //OPENSHOT_IMAGE_WRITER_H
diff --git a/include/Json.h b/include/Json.h
index 970034a5f..3a10ab744 100644
--- a/include/Json.h
+++ b/include/Json.h
@@ -3,9 +3,12 @@
* @brief Header file for JSON class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/KeyFrame.h b/include/KeyFrame.h
index bab87f7c4..6ed395530 100644
--- a/include/KeyFrame.h
+++ b/include/KeyFrame.h
@@ -3,9 +3,12 @@
* @brief Header file for the Keyframe class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -39,9 +42,6 @@
#include "Point.h"
#include "Json.h"
-using namespace std;
-using namespace openshot;
-
namespace openshot {
/**
@@ -63,39 +63,14 @@ namespace openshot {
*/
class Keyframe {
private:
- bool needs_update;
- double FactorialLookup[4];
-
- /*
- * Because points can be added in any order, we need to reorder them
- * in ascending order based on the point.co.X value. This simplifies
- * processing the curve, due to all the points going from left to right.
- */
- void ReorderPoints();
-
- // Process an individual segment
- void ProcessSegment(int Segment, Point p1, Point p2);
-
- // create lookup table for fast factorial calculation
- void CreateFactorialTable();
-
- // Get a factorial for a coordinate
- double Factorial(int64_t n);
-
- // Calculate the factorial function for Bernstein basis
- double Ni(int64_t n, int64_t i);
-
- // Calculate Bernstein Basis
- double Bernstein(int64_t n, int64_t i, double t);
+ std::vector Points; ///< Vector of all Points
public:
- vector Points; ///< Vector of all Points
- vector Values; ///< Vector of all Values (i.e. the processed coordinates from the curve)
/// Default constructor for the Keyframe class
- Keyframe();
+ Keyframe() = default;
- /// Constructor which sets the default point & coordinate at X=0
+ /// Constructor which sets the default point & coordinate at X=1
Keyframe(double value);
/// Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle.
@@ -108,68 +83,60 @@ namespace openshot {
void AddPoint(double x, double y, InterpolationType interpolate);
/// Does this keyframe contain a specific point
- bool Contains(Point p);
+ bool Contains(Point p) const;
/// Flip all the points in this openshot::Keyframe (useful for reversing an effect or transition, etc...)
void FlipPoints();
/// Get the index of a point by matching a coordinate
- int64_t FindIndex(Point p);
+ int64_t FindIndex(Point p) const;
/// Get the value at a specific index
- double GetValue(int64_t index);
+ double GetValue(int64_t index) const;
/// Get the rounded INT value at a specific index
- int GetInt(int64_t index);
+ int GetInt(int64_t index) const;
/// Get the rounded LONG value at a specific index
- int64_t GetLong(int64_t index);
+ int64_t GetLong(int64_t index) const;
/// Get the fraction that represents how many times this value is repeated in the curve
- Fraction GetRepeatFraction(int64_t index);
+ Fraction GetRepeatFraction(int64_t index) const;
/// Get the change in Y value (from the previous Y value)
- double GetDelta(int64_t index);
+ double GetDelta(int64_t index) const;
/// Get a point at a specific index
- Point& GetPoint(int64_t index);
+ Point const & GetPoint(int64_t index) const;
/// Get current point (or closest point to the right) from the X coordinate (i.e. the frame number)
- Point GetClosestPoint(Point p);
+ Point GetClosestPoint(Point p) const;
/// Get current point (or closest point) from the X coordinate (i.e. the frame number)
/// Either use the closest left point, or right point
- Point GetClosestPoint(Point p, bool useLeft);
+ Point GetClosestPoint(Point p, bool useLeft) const;
/// Get previous point (
- Point GetPreviousPoint(Point p);
+ Point GetPreviousPoint(Point p) const;
/// Get max point (by Y coordinate)
- Point GetMaxPoint();
+ Point GetMaxPoint() const;
// Get the number of values (i.e. coordinates on the X axis)
- int64_t GetLength();
+ int64_t GetLength() const;
/// Get the number of points (i.e. # of points)
- int64_t GetCount();
+ int64_t GetCount() const;
/// Get the direction of the curve at a specific index (increasing or decreasing)
- bool IsIncreasing(int index);
+ bool IsIncreasing(int index) const;
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json() const; ///< Generate JSON string of this object
+ Json::Value JsonValue() const; ///< Generate Json::JsonValue for this object
+ void SetJson(std::string value); ///< Load JSON string into this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
- /**
- * @brief Calculate all of the values for this keyframe.
- *
- * This clears any existing data in the "values" vector. This method is automatically called
- * by AddPoint(), so you don't typically need to call this method.
- */
- void Process();
-
/// Remove a point by matching a coordinate
void RemovePoint(Point p);
@@ -184,10 +151,10 @@ namespace openshot {
void UpdatePoint(int64_t index, Point p);
/// Print a list of points
- void PrintPoints();
+ void PrintPoints() const;
/// Print just the Y value of the point's primary coordinate
- void PrintValues();
+ void PrintValues() const;
};
diff --git a/include/MagickUtilities.h b/include/MagickUtilities.h
new file mode 100644
index 000000000..74365904a
--- /dev/null
+++ b/include/MagickUtilities.h
@@ -0,0 +1,61 @@
+/**
+ * @file
+ * @brief Header file for MagickUtilities (IM6/IM7 compatibility overlay)
+ * @author Jonathan Thomas
+ * @author FeRD (Frank Dana)
+ */
+
+/* LICENSE
+ *
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
+ * . This file is part of
+ * OpenShot Library (libopenshot), an open-source project dedicated to
+ * delivering high quality video editing and animation solutions to the
+ * world. For more information visit .
+ *
+ * OpenShot Library (libopenshot) is free software: you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * OpenShot Library (libopenshot) is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with OpenShot Library. If not, see .
+ */
+
+#ifndef OPENSHOT_MAGICK_UTILITIES_H
+#define OPENSHOT_MAGICK_UTILITIES_H
+
+#ifdef USE_IMAGEMAGICK
+
+ #include "Magick++.h"
+
+ // Determine ImageMagick version, as IM7 isn't fully
+ // backwards compatible
+ #ifndef NEW_MAGICK
+ #define NEW_MAGICK (MagickLibVersion >= 0x700)
+ #endif
+
+ // IM7: ->alpha(bool)
+ // IM6: ->matte(bool)
+ #if NEW_MAGICK
+ #define MAGICK_IMAGE_ALPHA(im, a) im->alpha((a))
+ #else
+ #define MAGICK_IMAGE_ALPHA(im, a) im->matte((a))
+ #endif
+
+ // IM7: vector
+ // IM6: list
+ // (both have the push_back() method which is all we use)
+ #if NEW_MAGICK
+ #define MAGICK_DRAWABLE std::vector
+ #else
+ #define MAGICK_DRAWABLE std::list
+ #endif
+
+#endif
+#endif
diff --git a/include/OpenMPUtilities.h b/include/OpenMPUtilities.h
index 65047c316..9810d636e 100644
--- a/include/OpenMPUtilities.h
+++ b/include/OpenMPUtilities.h
@@ -3,9 +3,12 @@
* @brief Header file for OpenMPUtilities (set some common macros)
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -32,11 +35,11 @@
#include
#include
-// Calculate the # of OpenMP and FFmpeg Threads to allow. We are limiting both
-// of these based on our own performance tests (more is not always better).
-#define OPEN_MP_NUM_PROCESSORS (min(omp_get_num_procs(), 6))
-#define FF_NUM_PROCESSORS (min(omp_get_num_procs(), 12))
+#include "Settings.h"
+// Calculate the # of OpenMP Threads to allow
+#define OPEN_MP_NUM_PROCESSORS (std::min(omp_get_num_procs(), std::max(2, openshot::Settings::Instance()->OMP_THREADS) ))
+#define FF_NUM_PROCESSORS (std::min(omp_get_num_procs(), std::max(2, openshot::Settings::Instance()->FF_THREADS) ))
#endif
diff --git a/include/OpenShot.h b/include/OpenShot.h
index 207f4b42b..5273ff0d3 100644
--- a/include/OpenShot.h
+++ b/include/OpenShot.h
@@ -64,15 +64,18 @@
* canvas (i.e. pan & scan).
* \image html /doc/images/Timeline_Layers.png
*
- * ### Build Instructions (Linux, Mac, and Windows) ###
- * For a step-by-step guide to building / compiling libopenshot, check out the
- * Official Installation Guide.
+ * ### Build Instructions ###
+ * Build instructions are available for all three major Operating Systems:
+ * * [Building libopenshot for Windows](doc/INSTALL-WINDOWS.md)
+ * * [Building libopenshot for MacOS](doc/INSTALL-MAC.md)
+ * * [Building libopenshot for Linux](doc/INSTALL-LINUX.md)
*
* ### Want to Learn More? ###
* To continue learning about libopenshot, take a look at the full list of classes available.
*
+ * \anchor License
* ### License & Copyright ###
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -93,7 +96,7 @@
*/
// Include the version number of OpenShot Library
-#include "Version.h"
+#include "OpenShotVersion.h"
// Include all other classes
#include "AudioBufferSource.h"
@@ -132,7 +135,9 @@
#include "PlayerBase.h"
#include "Point.h"
#include "Profiles.h"
+#include "QtHtmlReader.h"
#include "QtImageReader.h"
+#include "QtTextReader.h"
#include "Timeline.h"
#include "Settings.h"
diff --git a/include/OpenShotVersion.h.in b/include/OpenShotVersion.h.in
new file mode 100644
index 000000000..e15662b2e
--- /dev/null
+++ b/include/OpenShotVersion.h.in
@@ -0,0 +1,70 @@
+/**
+ * @file
+ * @brief Header file that includes the version number of libopenshot
+ * @author Jonathan Thomas
+ *
+ * @ref License
+ */
+
+/* LICENSE
+ *
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
+ * . This file is part of
+ * OpenShot Library (libopenshot), an open-source project dedicated to
+ * delivering high quality video editing and animation solutions to the
+ * world. For more information visit .
+ *
+ * OpenShot Library (libopenshot) is free software: you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * OpenShot Library (libopenshot) is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with OpenShot Library. If not, see .
+ */
+
+#ifndef OPENSHOT_VERSION_H
+#define OPENSHOT_VERSION_H
+
+#define OPENSHOT_VERSION_ALL "@PROJECT_VERSION@" /// A string of the entire version "Major.Minor.Build"
+#define OPENSHOT_VERSION_FULL "@PROJECT_VERSION_FULL@" /// A string of the full version identifier, including suffixes (e.g. "0.0.0-dev0")
+
+#define OPENSHOT_VERSION_MAJOR_MINOR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@" /// A string of the "Major.Minor" version
+
+#define OPENSHOT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ /// Major version number is incremented when huge features are added or improved.
+#define OPENSHOT_VERSION_MINOR @PROJECT_VERSION_MINOR@ /// Minor version is incremented when smaller (but still very important) improvements are added.
+#define OPENSHOT_VERSION_BUILD @PROJECT_VERSION_PATCH@ /// Build number is incremented when minor bug fixes and less important improvements are added.
+
+#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)
+
+#include
+
+namespace openshot
+{
+ /// This struct holds version number information. Use the GetVersion() method to access the current version of libopenshot.
+ struct OpenShotVersion {
+ static const int Major = OPENSHOT_VERSION_MAJOR; /// Major version number
+ static const int Minor = OPENSHOT_VERSION_MINOR; /// Minor version number
+ static const int Build = OPENSHOT_VERSION_BUILD; /// Build number
+ static const int So = OPENSHOT_VERSION_SO; /// Shared Object Number (incremented when API or ABI changes)
+
+ /// Get a string version of the version (i.e. "Major.Minor.Build")
+ inline static const std::string ToString() {
+ std::stringstream version_string;
+ version_string << Major << "." << Minor << "." << Build;
+ return version_string.str();
+ }
+ };
+
+ static const openshot::OpenShotVersion Version;
+
+ /// Get the current version number of libopenshot (major, minor, and build number)
+ openshot::OpenShotVersion GetVersion();
+}
+
+#endif // OPENSHOT_VERSION_H
\ No newline at end of file
diff --git a/include/PlayerBase.h b/include/PlayerBase.h
index ecc222a81..aa34c5d23 100644
--- a/include/PlayerBase.h
+++ b/include/PlayerBase.h
@@ -3,9 +3,12 @@
* @brief Header file for PlayerBase class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -31,8 +34,6 @@
#include
#include "ReaderBase.h"
-using namespace std;
-
namespace openshot
{
/**
@@ -60,7 +61,7 @@ namespace openshot
protected:
float speed;
float volume;
- ReaderBase *reader;
+ openshot::ReaderBase *reader;
PlaybackMode mode;
public:
@@ -78,7 +79,7 @@ namespace openshot
virtual void Pause() = 0;
/// Get the current frame number being played
- virtual int Position() = 0;
+ virtual int64_t Position() = 0;
/// Seek to a specific frame in the player
virtual void Seek(int64_t new_frame) = 0;
@@ -93,10 +94,10 @@ namespace openshot
virtual void Stop() = 0;
/// Get the current reader, such as a FFmpegReader
- virtual ReaderBase* Reader() = 0;
+ virtual openshot::ReaderBase* Reader() = 0;
/// Set the current reader, such as a FFmpegReader
- virtual void Reader(ReaderBase *new_reader) = 0;
+ virtual void Reader(openshot::ReaderBase *new_reader) = 0;
/// Get the Volume
virtual float Volume() = 0;
@@ -104,6 +105,7 @@ namespace openshot
/// Set the Volume (1.0 = normal volume, <1.0 = quieter, >1.0 louder)
virtual void Volume(float new_volume) = 0;
+ virtual ~PlayerBase() = default;
};
}
diff --git a/include/Point.h b/include/Point.h
index 139aa64dc..3fdcd9176 100644
--- a/include/Point.h
+++ b/include/Point.h
@@ -3,9 +3,12 @@
* @brief Header file for Point class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -32,8 +35,6 @@
#include "Exceptions.h"
#include "Json.h"
-using namespace std;
-
namespace openshot
{
/**
@@ -118,9 +119,9 @@ namespace openshot
void Initialize_RightHandle(float x, float y);
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
+ std::string Json(); ///< Generate JSON string of this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
- void SetJson(string value); ///< Load JSON string into this object
+ void SetJson(std::string value); ///< Load JSON string into this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
};
diff --git a/include/Profiles.h b/include/Profiles.h
index fa279d577..bc5fe3e01 100644
--- a/include/Profiles.h
+++ b/include/Profiles.h
@@ -3,9 +3,12 @@
* @brief Header file for Profile class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -42,8 +45,6 @@
#include "Fraction.h"
#include "Json.h"
-using namespace std;
-
namespace openshot
{
@@ -55,7 +56,7 @@ namespace openshot
*/
struct ProfileInfo
{
- string description; ///< The description of this profile.
+ std::string description; ///< The description of this profile.
int height; ///< The height of the video (in pixels)
int width; ///< The width of the video (in pixels)
int pixel_format; ///< The pixel format (i.e. YUV420P, RGB24, etc...)
@@ -86,12 +87,12 @@ namespace openshot
/// @brief Constructor for Profile.
/// @param path The folder path / location of a profile file
- Profile(string path);
+ Profile(std::string path);
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
+ std::string Json(); ///< Generate JSON string of this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
- void SetJson(string value); ///< Load JSON string into this object
+ void SetJson(std::string value); ///< Load JSON string into this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
};
diff --git a/include/Qt/AudioPlaybackThread.h b/include/Qt/AudioPlaybackThread.h
index 68a2be3b9..348a0f48a 100644
--- a/include/Qt/AudioPlaybackThread.h
+++ b/include/Qt/AudioPlaybackThread.h
@@ -4,9 +4,12 @@
* @author Duzy Chan
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -32,19 +35,18 @@
#include "../ReaderBase.h"
#include "../RendererBase.h"
#include "../AudioReaderSource.h"
+#include "../AudioDeviceInfo.h"
+#include "../Settings.h"
namespace openshot
{
- using juce::Thread;
- using juce::WaitableEvent;
-
- struct SafeTimeSliceThread : TimeSliceThread
+ struct SafeTimeSliceThread : juce::TimeSliceThread
{
- SafeTimeSliceThread(const String & s) : TimeSliceThread(s) {}
+ SafeTimeSliceThread(const String & s) : juce::TimeSliceThread(s) {}
void run()
{
try {
- TimeSliceThread::run();
+ juce::TimeSliceThread::run();
} catch (const TooManySeeks & e) {
// ...
}
@@ -57,14 +59,20 @@ namespace openshot
class AudioDeviceManagerSingleton {
private:
/// Default constructor (Don't allow user to create an instance of this singleton)
- AudioDeviceManagerSingleton(){};
+ AudioDeviceManagerSingleton(){ initialise_error=""; };
/// Private variable to keep track of singleton instance
static AudioDeviceManagerSingleton * m_pInstance;
public:
- /// Create or get an instance of this singleton (invoke the class with this method)
- static AudioDeviceManagerSingleton * Instance(int numChannels);
+ /// Error found during JUCE initialise method
+ std::string initialise_error;
+
+ /// List of valid audio device names
+ std::vector audio_device_names;
+
+ /// Override with no channels and no preferred audio device
+ static AudioDeviceManagerSingleton * Instance();
/// Public device manager property
AudioDeviceManager audioDeviceManager;
@@ -76,54 +84,66 @@ namespace openshot
/**
* @brief The audio playback thread
*/
- class AudioPlaybackThread : Thread
+ class AudioPlaybackThread : juce::Thread
{
- AudioSourcePlayer player;
- AudioTransportSource transport;
- MixerAudioSource mixer;
- AudioReaderSource *source;
- double sampleRate;
- int numChannels;
- WaitableEvent play;
- WaitableEvent played;
- int buffer_size;
- bool is_playing;
- SafeTimeSliceThread time_thread;
-
- /// Constructor
- AudioPlaybackThread();
- /// Destructor
- ~AudioPlaybackThread();
-
- /// Set the current thread's reader
- void Reader(ReaderBase *reader);
-
- /// Get the current frame object (which is filling the buffer)
- std::shared_ptr getFrame();
-
- /// Get the current frame number being played
- int64_t getCurrentFramePosition();
-
- /// Play the audio
- void Play();
-
- /// Seek the audio thread
- void Seek(int64_t new_position);
-
- /// Stop the audio playback
- void Stop();
-
- /// Start thread
- void run();
-
- /// Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
- void setSpeed(int new_speed) { if (source) source->setSpeed(new_speed); }
-
- /// Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
- int getSpeed() const { if (source) return source->getSpeed(); else return 1; }
-
- friend class PlayerPrivate;
- friend class QtPlayer;
+ AudioSourcePlayer player;
+ AudioTransportSource transport;
+ MixerAudioSource mixer;
+ AudioReaderSource *source;
+ double sampleRate;
+ int numChannels;
+ juce::WaitableEvent play;
+ juce::WaitableEvent played;
+ int buffer_size;
+ bool is_playing;
+ SafeTimeSliceThread time_thread;
+
+ /// Constructor
+ AudioPlaybackThread();
+ /// Destructor
+ ~AudioPlaybackThread();
+
+ /// Set the current thread's reader
+ void Reader(openshot::ReaderBase *reader);
+
+ /// Get the current frame object (which is filling the buffer)
+ std::shared_ptr getFrame();
+
+ /// Get the current frame number being played
+ int64_t getCurrentFramePosition();
+
+ /// Play the audio
+ void Play();
+
+ /// Seek the audio thread
+ void Seek(int64_t new_position);
+
+ /// Stop the audio playback
+ void Stop();
+
+ /// Start thread
+ void run();
+
+ /// Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
+ void setSpeed(int new_speed) { if (source) source->setSpeed(new_speed); }
+
+ /// Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
+ int getSpeed() const { if (source) return source->getSpeed(); else return 1; }
+
+ /// Get Audio Error (if any)
+ std::string getError()
+ {
+ return AudioDeviceManagerSingleton::Instance()->initialise_error;
+ }
+
+ /// Get Audio Device Names (if any)
+ std::vector getAudioDeviceNames()
+ {
+ return AudioDeviceManagerSingleton::Instance()->audio_device_names;
+ };
+
+ friend class PlayerPrivate;
+ friend class QtPlayer;
};
}
diff --git a/include/Qt/PlayerDemo.h b/include/Qt/PlayerDemo.h
index c02f863cb..f444334b5 100644
--- a/include/Qt/PlayerDemo.h
+++ b/include/Qt/PlayerDemo.h
@@ -3,9 +3,12 @@
* @brief Header file for demo application for QtPlayer class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -43,8 +46,6 @@ namespace openshot
class QtPlayer;
}
-using openshot::QtPlayer;
-
class PlayerDemo : public QWidget
{
Q_OBJECT
@@ -54,7 +55,7 @@ class PlayerDemo : public QWidget
~PlayerDemo();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
private slots:
@@ -64,7 +65,7 @@ private slots:
QVBoxLayout *vbox;
QMenuBar *menu;
VideoRenderWidget *video;
- QtPlayer *player;
+ openshot::QtPlayer *player;
};
#endif // OPENSHOT_PLAYER_H
diff --git a/include/Qt/PlayerPrivate.h b/include/Qt/PlayerPrivate.h
index f626fb993..e403c10e2 100644
--- a/include/Qt/PlayerPrivate.h
+++ b/include/Qt/PlayerPrivate.h
@@ -4,9 +4,12 @@
* @author Duzy Chan
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -38,27 +41,25 @@
namespace openshot
{
- using juce::Thread;
-
/**
* @brief The private part of QtPlayer class, which contains an audio thread and video thread,
* and controls the video timing and audio synchronization code.
*/
- class PlayerPrivate : Thread
+ class PlayerPrivate : juce::Thread
{
- std::shared_ptr frame; /// The current frame
+ std::shared_ptr frame; /// The current frame
int64_t video_position; /// The current frame position.
int64_t audio_position; /// The current frame position.
- ReaderBase *reader; /// The reader which powers this player
- AudioPlaybackThread *audioPlayback; /// The audio thread
- VideoPlaybackThread *videoPlayback; /// The video thread
- VideoCacheThread *videoCache; /// The cache thread
+ openshot::ReaderBase *reader; /// The reader which powers this player
+ openshot::AudioPlaybackThread *audioPlayback; /// The audio thread
+ openshot::VideoPlaybackThread *videoPlayback; /// The video thread
+ openshot::VideoCacheThread *videoCache; /// The cache thread
int speed; /// The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)
- RendererBase *renderer;
+ openshot::RendererBase *renderer;
int64_t last_video_position; /// The last frame actually displayed
/// Constructor
- PlayerPrivate(RendererBase *rb);
+ PlayerPrivate(openshot::RendererBase *rb);
/// Destructor
virtual ~PlayerPrivate();
@@ -72,7 +73,7 @@ namespace openshot
void stopPlayback(int timeOutMilliseconds = -1);
/// Get the next frame (based on speed and direction)
- std::shared_ptr getFrame();
+ std::shared_ptr getFrame();
/// The parent class of PlayerPrivate
friend class QtPlayer;
diff --git a/include/Qt/VideoCacheThread.h b/include/Qt/VideoCacheThread.h
index 4afb7ee57..6fbf6d58f 100644
--- a/include/Qt/VideoCacheThread.h
+++ b/include/Qt/VideoCacheThread.h
@@ -3,9 +3,12 @@
* @brief Source file for VideoCacheThread class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/Qt/VideoPlaybackThread.h b/include/Qt/VideoPlaybackThread.h
index 90dc36811..753c7778e 100644
--- a/include/Qt/VideoPlaybackThread.h
+++ b/include/Qt/VideoPlaybackThread.h
@@ -4,9 +4,12 @@
* @author Duzy Chan
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/Qt/VideoRenderWidget.h b/include/Qt/VideoRenderWidget.h
index 19675cc8e..07c61037b 100644
--- a/include/Qt/VideoRenderWidget.h
+++ b/include/Qt/VideoRenderWidget.h
@@ -3,9 +3,12 @@
* @brief Header file for Video RendererWidget class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -57,7 +60,7 @@ class VideoRenderWidget : public QWidget
QRect centeredViewport(int width, int height);
private slots:
- void present(const QImage &image);
+ void present(const QImage &image);
};
diff --git a/include/Qt/VideoRenderer.h b/include/Qt/VideoRenderer.h
index aaf973ca3..1bdbfac33 100644
--- a/include/Qt/VideoRenderer.h
+++ b/include/Qt/VideoRenderer.h
@@ -3,9 +3,12 @@
* @brief Header file for Video Renderer class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
diff --git a/include/QtHtmlReader.h b/include/QtHtmlReader.h
new file mode 100644
index 000000000..c102038c4
--- /dev/null
+++ b/include/QtHtmlReader.h
@@ -0,0 +1,145 @@
+/**
+ * @file
+ * @brief Header file for QtHtmlReader class
+ * @author Jonathan Thomas
+ * @author Sergei Kolesov (jediserg)
+ * @author Jeff Shillitto (jeffski)
+ *
+ * @ref License
+ */
+
+/* LICENSE
+ *
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
+ * . This file is part of
+ * OpenShot Library (libopenshot), an open-source project dedicated to
+ * delivering high quality video editing and animation solutions to the
+ * world. For more information visit .
+ *
+ * OpenShot Library (libopenshot) is free software: you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * OpenShot Library (libopenshot) is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with OpenShot Library. If not, see .
+ */
+
+#ifndef OPENSHOT_QT_HTML_READER_H
+#define OPENSHOT_QT_HTML_READER_H
+
+#include "ReaderBase.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "CacheMemory.h"
+#include "Enums.h"
+#include "Exceptions.h"
+
+class QImage;
+
+namespace openshot
+{
+
+ /**
+ * @brief This class uses Qt libraries, to create frames with rendered HTML, and return
+ * openshot::Frame objects.
+ *
+ * Supports HTML/CSS subset available via Qt libraries, see: https://doc.qt.io/qt-5/richtext-html-subset.html
+ *
+ * @code
+ * // Any application using this class must instantiate either QGuiApplication or QApplication
+ * QApplication a(argc, argv);
+ *
+ * // Create a reader to generate an openshot::Frame containing text
+ * QtHtmlReader r(720, // width
+ * 480, // height
+ * 5, // x_offset
+ * 5, // y_offset
+ * GRAVITY_CENTER, // gravity
+ * "Check out this Text!", // html
+ * "b { color: #ff0000 }", // css
+ * "#000000" // background_color
+ * );
+ * r.Open(); // Open the reader
+ *
+ * // Get frame number 1 from the video (in fact, any frame # you request will return the same frame)
+ * std::shared_ptr f = r.GetFrame(1);
+ *
+ * // Now that we have an openshot::Frame object, lets have some fun!
+ * f->Display(); // Display the frame on the screen
+ *
+ * // Close the reader
+ * r.Close();
+ * @endcode
+ */
+ class QtHtmlReader : public ReaderBase
+ {
+ private:
+ int width;
+ int height;
+ int x_offset;
+ int y_offset;
+ std::string html;
+ std::string css;
+ std::string background_color;
+ std::shared_ptr image;
+ bool is_open;
+ openshot::GravityType gravity;
+ public:
+
+ /// Default constructor (blank text)
+ QtHtmlReader();
+
+ /// @brief Constructor for QtHtmlReader with all parameters.
+ /// @param width The width of the requested openshot::Frame (not the size of the text)
+ /// @param height The height of the requested openshot::Frame (not the size of the text)
+ /// @param x_offset The number of pixels to offset the text on the X axis (horizontal)
+ /// @param y_offset The number of pixels to offset the text on the Y axis (vertical)
+ /// @param gravity The alignment / gravity of the text
+ /// @param html The HTML you want to render / display
+ /// @param css The CSS you want to apply to style the HTML
+ /// @param background_color The background color of the frame image (valid values are a color string in \#RRGGBB or \#AARRGGBB notation, a CSS color name, or 'transparent')
+ QtHtmlReader(int width, int height, int x_offset, int y_offset, GravityType gravity, std::string html, std::string css, std::string background_color);
+
+ /// Close Reader
+ void Close();
+
+ /// Get the cache object used by this reader (always returns NULL for this object)
+ openshot::CacheMemory* GetCache() { return NULL; };
+
+ /// Get an openshot::Frame object for a specific frame number of this reader. All numbers
+ /// return the same Frame, since they all share the same image data.
+ ///
+ /// @returns The requested frame (containing the image)
+ /// @param requested_frame The frame number that is requested.
+ std::shared_ptr GetFrame(int64_t requested_frame);
+
+ /// Determine if reader is open or closed
+ bool IsOpen() { return is_open; };
+
+ /// Return the type name of the class
+ std::string Name() { return "QtHtmlReader"; };
+
+ /// Get and Set JSON methods
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
+ Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
+ void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
+
+ /// Open Reader - which is called by the constructor automatically
+ void Open();
+ };
+
+}
+
+#endif
diff --git a/include/QtImageReader.h b/include/QtImageReader.h
index 6b260f159..3153e7a39 100644
--- a/include/QtImageReader.h
+++ b/include/QtImageReader.h
@@ -3,9 +3,12 @@
* @brief Header file for QtImageReader class
* @author Jonathan Thomas
*
- * @section LICENSE
+ * @ref License
+ */
+
+/* LICENSE
*
- * Copyright (c) 2008-2014 OpenShot Studios, LLC
+ * Copyright (c) 2008-2019 OpenShot Studios, LLC
* . This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
@@ -37,8 +40,6 @@
#include "Exceptions.h"
#include "ReaderBase.h"
-using namespace std;
-
namespace openshot
{
@@ -64,21 +65,24 @@ namespace openshot
class QtImageReader : public ReaderBase
{
private:
- string path;
- std::shared_ptr image; ///> Original image (full quality)
- std::shared_ptr cached_image; ///> Scaled for performance
- bool is_open;
+ QString path;
+ std::shared_ptr image; ///> Original image (full quality)
+ std::shared_ptr cached_image; ///> Scaled for performance
+ bool is_open; ///> Is Reader opened
+ QSize max_size; ///> Current max_size as calculated with Clip properties
public:
/// Constructor for QtImageReader. This automatically opens the media file and loads
/// frame 1, or it throws one of the following exceptions.
- QtImageReader(string path);
+ QtImageReader(std::string path);
- /// Constructor for QtImageReader. This only opens the media file to inspect it's properties
+ /// Constructor for QtImageReader. This only opens the media file to inspect its properties
/// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful
/// when you are inflating the object using JSON after instantiating it.
- QtImageReader(string path, bool inspect_reader);
+ QtImageReader(std::string path, bool inspect_reader);
+
+ virtual ~QtImageReader();
/// Close File
void Close();
@@ -97,11 +101,11 @@ namespace openshot
bool IsOpen() { return is_open; };
/// Return the type name of the class
- string Name() { return "QtImageReader"; };
+ std::string Name() { return "QtImageReader"; };
/// Get and Set JSON methods
- string Json(); ///< Generate JSON string of this object
- void SetJson(string value); ///< Load JSON string into this object
+ std::string Json(); ///< Generate JSON string of this object
+ void SetJson(std::string value); ///< Load JSON string into this object
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
diff --git a/include/QtPlayer.h b/include/QtPlayer.h
index 354bbfc88..7ddf6adab 100644
--- a/include/QtPlayer.h
+++ b/include/QtPlayer.h
@@ -4,9 +4,12 @@
* @author Duzy Chan