diff --git a/acquire-driver-common/.clang-format b/.clang-format similarity index 100% rename from acquire-driver-common/.clang-format rename to .clang-format diff --git a/acquire-driver-common/.clang-tidy b/.clang-tidy similarity index 100% rename from acquire-driver-common/.clang-tidy rename to .clang-tidy diff --git a/.gitignore b/.gitignore index 99b0c00..c0c9c35 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ install CMakeSettings.json .vs TestResults -cmake-build-debug-visual-studio-coverage cmake-build* .DS_Store *.zip diff --git a/acquire-driver-common/.pre-commit-config.yaml b/.pre-commit-config.yaml similarity index 100% rename from acquire-driver-common/.pre-commit-config.yaml rename to .pre-commit-config.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..af5d636 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased + +### Added + +- Additional validation in `test-change-external-metadata`. + +### Changed + +- Simplified CMakeLists.txt in acquire-core-libs, acquire-video-runtime, and acquire-driver-common. +- Moved `write-side-by-side-tiff.cpp` to acquire-driver-common subproject. + +### Removed + +- PR template. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b857eb0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.23) +project(acquire-common) +cmake_policy(SET CMP0079 NEW) # use targets from other directories +enable_testing() + +include(cmake/aq_require.cmake) +include(cmake/git-versioning.cmake) +include(cmake/ide.cmake) +include(cmake/msvc.cmake) +include(cmake/simd.cmake) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 20) + +add_subdirectory(acquire-core-libs) +add_subdirectory(acquire-video-runtime) +add_subdirectory(acquire-driver-common) + +include(CPack) \ No newline at end of file diff --git a/acquire-core-libs/LICENSE b/LICENSE similarity index 100% rename from acquire-core-libs/LICENSE rename to LICENSE diff --git a/README.md b/README.md new file mode 100644 index 0000000..92fb96b --- /dev/null +++ b/README.md @@ -0,0 +1,149 @@ +# Acquire common libraries + +[![Build](https://github.com/acquire-project/acquire-common/actions/workflows/build.yml/badge.svg)](https://github.com/acquire-project/acquire-common/actions/workflows/build.yml) +[![Tests](https://github.com/acquire-project/acquire-common/actions/workflows/test.yml/badge.svg)](https://github.com/acquire-project/acquire-common/actions/workflows/test.yml) + +## Components + +### Acquire Core Libraries + +This builds the core static libraries that get used in other parts of Acquire. +For the most part, these are interfaces private to Acquire, although there are +some exceptions. + +- **acquire-core-logger** Logging facility. +- **acquire-core-platform** Enables compatibility across operating systems. +- **acquire-device-properties** Defines the parameters used for configuring devices. +- **acquire-device-kit** Defines the API needed for implementing a new device driver. +- **acquire-device-hal** Defines the API the runtime uses for interacting with drivers and devices. + +#### Acquire core logger + +Acquire reports debug and trace events by printing them through a "logger". +This library defines what that is and provides a function for setting a global +callback at runtime that handles incoming messages. + +This involves very little code. It barely merits being its own library. It's +here to define what the expected callback interface is - something almost every +component needs to know about. + +#### Acquire core platform + +The Acquire core platform library defines a platform-independent interface for +interacting with the linux, osx, or windows operating systems. + +This is used internally with certain Acquire components. + +#### Acquire device properties + +This library defines many of the types that the Acquire device interfaces rely on to configure and query devices. + +#### Acquire Device Kit + +This is a header only library. Some types are defined outside this library - +it needs to be combined with `acquire-device-properties` to be fully defined. + +Acquire relies on device adapters to define video sources, filters and sinks. +The Device Kit defines the interfaces that need to be implemented to create a +device adapter. + +Each device adapter is compiled to a shared library that exposes a single +function, `acquire_driver_init_v0()`. That function returns a "Driver" +instance. Here, a Driver's responsibility is to list a number of devices that +can be opened and to manage those devices as resources. It also manages those +resources. + +The "Devices" themselves may implement specific interfaces depending on their +Kind. See `storage.h` and `camera.h` for details. + +#### Acquire Hardware Abstraction Library (HAL) + +The Acquire HAL defines internal (private) functionality that the runtime uses +to interface with different kinds of devices. + +### Acquire Video Runtime + +This is a multi-camera video streaming library _focusing_ on cameras and file-formats for microscopy. + +This is the video runtime for the Acquire project. + +## Acquire Common Driver + +This is an Acquire Driver that exposes commonly used devices. + +#### Camera devices + +- **simulated: uniform random** - Produces uniform random noise for each pixel. +- **simulated: radial sin** - Produces an animated radial sin-wave pattern. +- **simulated: empty** - Produces no data, leaving image buffers blank. Simulates going as fast as possible. + +#### Storage devices + +- **raw** - Streams to a raw binary file. +- **tiff** - Streams to a [bigtiff] file. Metadata is stored in the `ImageDescription` tag for each frame as a `json` + string. +- **tiff-json** - Stores the video stream in a *bigtiff* (as above) and stores metadata in a `json` file. Both are + located in a folder identified by the `filename` property. +- **Trash** - Writes nothing. Discards incoming data. + +[bigtiff]: http://bigtiff.org/ + +## Platform support + +These libraries support Windows, OSX and Linux. + +Windows support is the highest priority and has the widest device compatibility. OSX and Linux are actively tested. + +## Compiler support + +The primary compiler targeted is MSVC's toolchain. + +## Build environment + +1. Install CMake 3.23 or newer +2. Install a fairly recent version of Microsoft Visual Studio. + +From the repository root: + +``` +mkdir build +cd build +cmake-gui .. +``` + +## Build + +From the repository root: + +``` +cmake --build build +``` + +## Using [pre-commit](https://pre-commit.com/) + +Pre-commit is a utility that runs certain checks before you can create a commit +in git. This helps ensure each commit addresses any quality/formatting issues. + +To use, first install it. It's a python package so you can use `pip`. + +``` +pip install pre-commit +``` + +Then, navigate to this repo and initialize: + +``` +cd acquire-common +pre-commit install +``` + +This will configure the git hooks so they get run the next time you try to commit. + +> **Tips** +> +> - The formatting checks modify the files to fix them. +> - The commands that get run are in `.pre-commit-config.yaml` + > You'll have to install those. +> - `cppcheck` is disabled by default, but can be enabled by uncommenting the + > corresponding lines in `.pre-commit-config.yaml`. See that file for more + > details. \ No newline at end of file diff --git a/acquire-core-libs/.clang-format b/acquire-core-libs/.clang-format deleted file mode 100644 index 70a3827..0000000 --- a/acquire-core-libs/.clang-format +++ /dev/null @@ -1,177 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: Mozilla -AccessModifierOffset: -2 -AlignAfterOpenBracket: Align -AlignArrayOfStructures: None -AlignConsecutiveMacros: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None -AlignEscapedNewlines: Right -AlignOperands: Align -AlignTrailingComments: true -AllowAllArgumentsOnNextLine: true -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortEnumsOnASingleLine: true -AllowShortBlocksOnASingleLine: Never -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -AllowShortLambdasOnASingleLine: All -AllowShortIfStatementsOnASingleLine: Never -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: TopLevel -AlwaysBreakAfterReturnType: TopLevel -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: Yes -AttributeMacros: - - __capability -BinPackArguments: false -BinPackParameters: false -BraceWrapping: - AfterCaseLabel: false - AfterClass: true - AfterControlStatement: Never - AfterEnum: true - AfterFunction: true - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: true - AfterUnion: true - AfterExternBlock: true - BeforeCatch: false - BeforeElse: false - BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: false - SplitEmptyNamespace: true -BreakBeforeBinaryOperators: None -BreakBeforeConceptDeclarations: true -BreakBeforeBraces: Mozilla -BreakBeforeInheritanceComma: false -BreakInheritanceList: BeforeComma -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeComma -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true -ColumnLimit: 80 -CommentPragmas: '^ IWYU pragma:' -CompactNamespaces: false -ConstructorInitializerIndentWidth: 2 -ContinuationIndentWidth: 2 -Cpp11BracedListStyle: false -DeriveLineEnding: true -DerivePointerAlignment: false -DisableFormat: false -EmptyLineAfterAccessModifier: Never -EmptyLineBeforeAccessModifier: LogicalBlock -ExperimentalAutoDetectBinPacking: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false -AllowAllConstructorInitializersOnNextLine: true -FixNamespaceComments: false -ForEachMacros: - - foreach - - Q_FOREACH - - BOOST_FOREACH -IfMacros: - - KJ_IF_MAYBE -IncludeBlocks: Preserve -IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Priority: 2 - SortPriority: 0 - CaseSensitive: false - - Regex: '^(<|"(gtest|gmock|isl|json)/)' - Priority: 3 - SortPriority: 0 - CaseSensitive: false - - Regex: '.*' - Priority: 1 - SortPriority: 0 - CaseSensitive: false -IncludeIsMainRegex: '(Test)?$' -IncludeIsMainSourceRegex: '' -IndentAccessModifiers: false -IndentCaseLabels: true -IndentCaseBlocks: false -IndentGotoLabels: true -IndentPPDirectives: None -IndentExternBlock: AfterExternBlock -IndentRequires: false -IndentWidth: 4 -IndentWrappedFunctionNames: false -InsertTrailingCommas: None -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true -LambdaBodyIndentation: Signature -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCBinPackProtocolList: Auto -ObjCBlockIndentWidth: 2 -ObjCBreakBeforeNestedBlockParam: true -ObjCSpaceAfterProperty: true -ObjCSpaceBeforeProtocolList: false -PenaltyBreakAssignment: 2 -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyBreakTemplateDeclaration: 10 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PenaltyIndentedWhitespace: 0 -PointerAlignment: Left -PPIndentWidth: -1 -ReferenceAlignment: Pointer -ReflowComments: true -ShortNamespaceLines: 1 -SortIncludes: Never -SortJavaStaticImport: Before -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeCaseColon: false -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: ControlStatements -SpaceAroundPointerQualifiers: Default -SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: Never -SpacesInConditionalStatement: false -SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInLineCommentPrefix: - Minimum: 1 - Maximum: -1 -SpacesInParentheses: false -SpacesInSquareBrackets: false -SpaceBeforeSquareBrackets: false -BitFieldColonSpacing: Both -Standard: Latest -StatementAttributeLikeMacros: - - Q_EMIT -StatementMacros: - - Q_UNUSED - - QT_REQUIRE_VERSION -TabWidth: 8 -UseCRLF: false -UseTab: Never -WhitespaceSensitiveMacros: - - STRINGIZE - - PP_STRINGIZE - - BOOST_PP_STRINGIZE - - NS_SWIFT_NAME - - CF_SWIFT_NAME -... diff --git a/acquire-core-libs/.clang-tidy b/acquire-core-libs/.clang-tidy deleted file mode 100644 index 6f4e9d2..0000000 --- a/acquire-core-libs/.clang-tidy +++ /dev/null @@ -1,45 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,-*DeprecatedOrUnsafeBufferHandling' -WarningsAsErrors: '' -HeaderFilterRegex: '' -AnalyzeTemporaryDtors: false -FormatStyle: none -User: nclack -CheckOptions: - - key: llvm-else-after-return.WarnOnConditionVariables - value: 'false' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons - value: 'false' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: cert-err33-c.CheckedFunctions - value: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;' - - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField - value: 'false' - - key: cert-dcl16-c.NewSuffixes - value: 'L;LL;LU;LLU' - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic - value: 'true' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: llvm-qualified-auto.AddConstToQualified - value: 'false' - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: llvm-else-after-return.WarnOnUnfixable - value: 'false' - - key: google-readability-function-size.StatementThreshold - value: '800' -... diff --git a/acquire-core-libs/.gitignore b/acquire-core-libs/.gitignore deleted file mode 100644 index 4c00f47..0000000 --- a/acquire-core-libs/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -.idea -build*/ -install -.vscode -.cache -CMakeSettings.json -.vs -TestResults -cmake-build* -.DS_Store -*.zip -_CPack_Packages/ -.PVS-Studio diff --git a/acquire-core-libs/.pre-commit-config.yaml b/acquire-core-libs/.pre-commit-config.yaml deleted file mode 100644 index 37d577d..0000000 --- a/acquire-core-libs/.pre-commit-config.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -fail_fast: false -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files -- repo: https://github.com/pocc/pre-commit-hooks - rev: v1.3.5 - hooks: - - id: clang-format - args: ["-i"] - - id: clang-tidy - args: ["-p=build"] - -# I'd love cppcheck to be included in the precommit by default but: -# -# - it requires hard-coding the build directory -# - it's sensitive to the use of `cmake -G Ninja` which isn't the default -# on Windows. -# - it can take a few seconds to run, which is annoying -# -# Feel free to enable it yourself by uncommenting below. - - # - id: cppcheck - # args: [ - # "--project=build/compile_commands.json", - # "--inline-suppr", - # "-iexamples/common/imgui", - # "--suppress=*:examples/common/imgui/imgui.h", - # "-isrc/devices/cameras/3rdParty", - # "--suppress=constParameter:*", - # "--suppress=useStlAlgorithm:*", - # "--suppress=unusedStructMember:*", - # "--suppress=unusedFunction:*", - # "--suppress=cstyleCast:*", - # ] diff --git a/acquire-core-libs/CMakeLists.txt b/acquire-core-libs/CMakeLists.txt index 226bf88..0500740 100644 --- a/acquire-core-libs/CMakeLists.txt +++ b/acquire-core-libs/CMakeLists.txt @@ -1,18 +1,4 @@ -cmake_minimum_required(VERSION 3.5) project(acquire-core-libs) -cmake_policy(SET CMP0079 NEW) # use targets from other directories -enable_testing() - -include(cmake/aq_require.cmake) -include(cmake/ide.cmake) -include(cmake/msvc.cmake) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 20) add_subdirectory(src) add_subdirectory(tests) - -include(CPack) diff --git a/acquire-core-libs/README.md b/acquire-core-libs/README.md deleted file mode 100644 index 40718b7..0000000 --- a/acquire-core-libs/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Acquire Core Libraries - -[![Tests](https://github.com/acquire-project/acquire-core-libs/actions/workflows/test_pr.yml/badge.svg)](https://github.com/acquire-project/acquire-core-libs/actions/workflows/test_pr.yml) - -This builds the core static libraries that get used in other parts of Acquire. -For the most part, these are interfaces private to Acquire, although there are -some exceptions. - -- **acquire-core-logger** Logging facility. -- **acquire-core-platform** Enables compatibility across operating systems. -- **acquire-device-properties** Defines the parameters used for configuring devices. -- **acquire-device-kit** Defines the API needed for implementing a new device driver. -- **acquire-device-hal** Defines the API the runtime uses for interacting with drivers and devices. - -## Acquire core logger - -Acquire reports debug and trace events by printing them through a "logger". -This library defines what that is and provides a function for setting a global -callback at runtime that handles incoming messages. - -This involves very little code. It barely merits being its own library. It's -here to define what the expected callback interface is - something almost every -component needs to know about. - -## Acquire core platform - -The Acquire core platform library defines a platform-independent interface for -interacting with the linux, osx, or windows operating systems. - -This is used internally with certain Acquire components. - -## Acquire device properties - -This library defines many of the types that the Acquire device interfaces rely on to configure and query devices. - -## Acquire Device Kit - -This is a header only library. Some types are defined outside this library - -it needs to be combined with `acquire-device-properties` to be fully defined. - -Acquire relies on device adapters to define video sources, filters and sinks. -The Device Kit defines the interfaces that need to be implemented to create a -device adapter. - -Each device adapter is compiled to a shared library that exposes a single -function, `acquire_driver_init_v0()`. That function returns a "Driver" -instance. Here, a Driver's responsibility is to list a number of devices that -can be opened and to manage those devices as resources. It also manages those -resources. - -The "Devices" themselves may implement specific interfaces depending on their -Kind. See `storage.h` and `camera.h` for details. - -## Acquire Hardware Abstraction Library (HAL) - -The Acquire HAL defines internal (private) functionality that the runtime uses -to interface with different kinds of devices. diff --git a/acquire-core-libs/tests/file-create-behavior.cpp b/acquire-core-libs/tests/file-create-behavior.cpp index 57de7b7..0f355b7 100644 --- a/acquire-core-libs/tests/file-create-behavior.cpp +++ b/acquire-core-libs/tests/file-create-behavior.cpp @@ -1,5 +1,7 @@ +//! @file file-create-behavior.cpp //! Test that we can't create the same file for writing within this process //! using the file_create() platform api. + #include "platform.h" #include "logger.h" diff --git a/acquire-core-libs/tests/instance-types.cpp b/acquire-core-libs/tests/instance-types.cpp index af9e21a..ae29dc0 100644 --- a/acquire-core-libs/tests/instance-types.cpp +++ b/acquire-core-libs/tests/instance-types.cpp @@ -1,4 +1,5 @@ -// Just check that we can instance the types. +/// @file instance-types.cpp +/// Just check that we can instance the types. #include "device/kit/driver.h" #include "device/kit/storage.h" diff --git a/acquire-core-libs/tests/unit-tests.cpp b/acquire-core-libs/tests/unit-tests.cpp index 3db7a26..b9d81ec 100644 --- a/acquire-core-libs/tests/unit-tests.cpp +++ b/acquire-core-libs/tests/unit-tests.cpp @@ -1,3 +1,6 @@ +/// @file unit-tests.cpp +/// Runs all unit tests in this project. + // This is a "unit test" driver. // // Adding unit test functions here will run them as part of the CTest suite diff --git a/acquire-driver-common/.gitignore b/acquire-driver-common/.gitignore deleted file mode 100644 index 99b0c00..0000000 --- a/acquire-driver-common/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -.idea -build*/ -install -.vscode -.cache -CMakeSettings.json -.vs -TestResults -cmake-build-debug-visual-studio-coverage -cmake-build* -.DS_Store -*.zip -_CPack_Packages/ -.PVS-Studio diff --git a/acquire-driver-common/CMakeLists.txt b/acquire-driver-common/CMakeLists.txt index fea188e..e6fa193 100644 --- a/acquire-driver-common/CMakeLists.txt +++ b/acquire-driver-common/CMakeLists.txt @@ -1,20 +1,4 @@ -cmake_minimum_required(VERSION 3.23) project(acquire-driver-common) -enable_testing() - -include(cmake/aq_require.cmake) -include(cmake/git-versioning.cmake) -include(cmake/ide.cmake) -include(cmake/install-prefix.cmake) -include(cmake/msvc.cmake) -include(cmake/simd.cmake) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 20) add_subdirectory(src) add_subdirectory(tests) - -include(CPack) diff --git a/acquire-driver-common/LICENSE b/acquire-driver-common/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/acquire-driver-common/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/acquire-driver-common/README.md b/acquire-driver-common/README.md deleted file mode 100644 index 4392720..0000000 --- a/acquire-driver-common/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Acquire Common Driver - -[![Build](https://github.com/acquire-project/acquire-driver-common/actions/workflows/build.yml/badge.svg)](https://github.com/acquire-project/acquire-driver-common/actions/workflows/build.yml) -[![Tests](https://github.com/acquire-project/acquire-driver-common/actions/workflows/test_pr.yml/badge.svg)](https://github.com/acquire-project/acquire-driver-common/actions/workflows/test_pr.yml) - -This is an Acquire Driver that exposes commonly used devices. - -## Devices - -### Cameras - -- **simulated: uniform random** - Produces uniform random noise for each pixel. -- **simulated: radial sin** - Produces an animated radial sin-wave pattern. -- **simulated: empty** - Produces no data, leaving a image buffers blank. Simulates going as fast as possible. - -### Storage - -- **raw** - Streams to a raw binary file. -- **tiff** - Streams to a [bigtiff][] file. Metadata is stored in the `ImageDescription` tag for each frame as a `json` - string. -- **tiff-json** - Stores the video stream in a *bigtiff* (as above) and stores metadata in a `json` file. Both are - located - in a folder identified by the `filename` property. -- **Trash** - Writes nothing. Discards incoming data. - -[bigtiff]: http://bigtiff.org/ diff --git a/acquire-driver-common/cmake/aq_require.cmake b/acquire-driver-common/cmake/aq_require.cmake deleted file mode 100644 index 079be8c..0000000 --- a/acquire-driver-common/cmake/aq_require.cmake +++ /dev/null @@ -1,5 +0,0 @@ -function(aq_require tgt) - if(NOT TARGET ${tgt}) - add_subdirectory(${tgt}) - endif() -endfunction() \ No newline at end of file diff --git a/acquire-driver-common/cmake/ide.cmake b/acquire-driver-common/cmake/ide.cmake deleted file mode 100644 index 5b7dc66..0000000 --- a/acquire-driver-common/cmake/ide.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) \ No newline at end of file diff --git a/acquire-driver-common/cmake/msvc.cmake b/acquire-driver-common/cmake/msvc.cmake deleted file mode 100644 index f9b1c32..0000000 --- a/acquire-driver-common/cmake/msvc.cmake +++ /dev/null @@ -1,7 +0,0 @@ -option(ACQUIRE_MSVC_USE_MD "When ON, prefer linking to the Multhreaded DLL Microsoft C Runtime library (use /MD)") - -if(ACQUIRE_MSVC_USE_MD) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") -else() - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -endif() diff --git a/acquire-driver-common/tests/devkit/CMakeLists.txt b/acquire-driver-common/tests/devkit/CMakeLists.txt index 9d08f85..20d776a 100644 --- a/acquire-driver-common/tests/devkit/CMakeLists.txt +++ b/acquire-driver-common/tests/devkit/CMakeLists.txt @@ -1,6 +1,6 @@ -if(${NOTEST}) +if (${NOTEST}) message(STATUS "Skipping test targets") -else() +else () # # PARAMETERS # @@ -11,41 +11,41 @@ else() # Tests # set(tests - list-devices - can-load-driver-interface - storage-get-meta - unit-tests + list-devices + can-load-driver-interface + storage-get-meta + unit-tests ) - foreach(name ${tests}) + foreach (name ${tests}) set(tgt ${project}-${name}) add_executable(${tgt} ${name}.cpp) target_compile_definitions(${tgt} PUBLIC "TEST=\"${tgt}\"") target_include_directories(${tgt} PRIVATE "../src/simcams") target_link_libraries(${tgt} - acquire-core-platform - acquire-core-logger - acquire-device-kit - acquire-device-hal - acquire-device-properties + acquire-core-platform + acquire-core-logger + acquire-device-kit + acquire-device-hal + acquire-device-properties ) add_test(NAME test-${tgt} COMMAND ${tgt}) set_tests_properties(test-${tgt} PROPERTIES LABELS "anyplatform;acquire-driver-common") - endforeach() + endforeach () # # Copy driver to tests # list(POP_FRONT tests onename) add_custom_target(${project}-copy-${driver}-for-devkit-tests - COMMAND ${CMAKE_COMMAND} -E copy - $ - $ - DEPENDS ${driver} - COMMENT "Copying ${driver} to $" + COMMAND ${CMAKE_COMMAND} -E copy + $ + $ + DEPENDS ${driver} + COMMENT "Copying ${driver} to $" ) - foreach(name ${tests}) + foreach (name ${tests}) add_dependencies(${tgt} ${project}-copy-${driver}-for-devkit-tests) - endforeach() -endif() + endforeach () +endif () diff --git a/acquire-driver-common/tests/devkit/can-load-driver-interface.cpp b/acquire-driver-common/tests/devkit/can-load-driver-interface.cpp index 5461d87..1327659 100644 --- a/acquire-driver-common/tests/devkit/can-load-driver-interface.cpp +++ b/acquire-driver-common/tests/devkit/can-load-driver-interface.cpp @@ -1,3 +1,6 @@ +/// @file can-load-driver-interface.cpp +/// Tests that the driver interface can be loaded. + #include "platform.h" #include "logger.h" diff --git a/acquire-driver-common/tests/devkit/list-devices.cpp b/acquire-driver-common/tests/devkit/list-devices.cpp index 8719a22..a033892 100644 --- a/acquire-driver-common/tests/devkit/list-devices.cpp +++ b/acquire-driver-common/tests/devkit/list-devices.cpp @@ -1,4 +1,4 @@ -/// @file +/// @file list-devices.cpp /// @brief Lists the devices exposed by this driver. /// Exercises the device enumeration interface. diff --git a/acquire-driver-common/tests/devkit/storage-get-meta.cpp b/acquire-driver-common/tests/devkit/storage-get-meta.cpp index 65a9862..937acac 100644 --- a/acquire-driver-common/tests/devkit/storage-get-meta.cpp +++ b/acquire-driver-common/tests/devkit/storage-get-meta.cpp @@ -1,4 +1,4 @@ -/// @file +/// @file storage-get-meta.cpp /// @brief Check that all storage devices implement the get_meta function. /// Also, since none of the basic storage devices support chunking or /// multiscale, check that this is reflected in the metadata. diff --git a/acquire-driver-common/tests/devkit/unit-tests.cpp b/acquire-driver-common/tests/devkit/unit-tests.cpp index 8043afe..481398a 100644 --- a/acquire-driver-common/tests/devkit/unit-tests.cpp +++ b/acquire-driver-common/tests/devkit/unit-tests.cpp @@ -1,3 +1,6 @@ +/// @file unit-tests.cpp +/// Runs all unit tests in this project. + #include "platform.h" #include "logger.h" diff --git a/acquire-driver-common/tests/integration/CMakeLists.txt b/acquire-driver-common/tests/integration/CMakeLists.txt index 4a73f40..fcb4ad6 100644 --- a/acquire-driver-common/tests/integration/CMakeLists.txt +++ b/acquire-driver-common/tests/integration/CMakeLists.txt @@ -1,10 +1,6 @@ -if(${NOTEST}) +if (${NOTEST}) message(STATUS "Skipping test targets") -else() - set(NOTEST "TRUE") - aq_require(acquire-video-runtime) - set(NOTEST "FALSE") - +else () # # PARAMETERS # @@ -14,48 +10,49 @@ else() # Tests # set(tests - abort-while-waiting-for-trigger - configure-triggering - list-digital-lines - software-trigger-acquires-single-frames + abort-while-waiting-for-trigger + configure-triggering + list-digital-lines + software-trigger-acquires-single-frames + write-side-by-side-tiff ) - foreach(name ${tests}) + foreach (name ${tests}) set(tgt "${project}-${name}") add_executable(${tgt} ${name}.cpp) target_compile_definitions(${tgt} PUBLIC "TEST=\"${tgt}\"") set_target_properties(${tgt} PROPERTIES - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" ) target_include_directories(${tgt} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/../") target_link_libraries(${tgt} - acquire-core-logger - acquire-core-platform - acquire-video-runtime + acquire-core-logger + acquire-core-platform + acquire-video-runtime ) add_test(NAME test-${tgt} COMMAND ${tgt}) set_tests_properties(test-${tgt} PROPERTIES LABELS acquire-driver-common) - endforeach() + endforeach () # # Copy driver to tests # list(POP_FRONT tests onename) - foreach(driver - acquire-driver-common + foreach (driver + acquire-driver-common ) add_custom_target(${project}-copy-${driver}-for-integration-tests - COMMAND ${CMAKE_COMMAND} -E copy - $ - $ - DEPENDS ${driver} - COMMENT "Copying ${driver} to $" + COMMAND ${CMAKE_COMMAND} -E copy + $ + $ + DEPENDS ${driver} + COMMENT "Copying ${driver} to $" ) - foreach(name ${tests}) + foreach (name ${tests}) add_dependencies(${tgt} ${project}-copy-${driver}-for-integration-tests) - endforeach() - endforeach() -endif() + endforeach () + endforeach () +endif () diff --git a/acquire-driver-common/tests/integration/abort-while-waiting-for-trigger.cpp b/acquire-driver-common/tests/integration/abort-while-waiting-for-trigger.cpp index 144d193..f5ba794 100644 --- a/acquire-driver-common/tests/integration/abort-while-waiting-for-trigger.cpp +++ b/acquire-driver-common/tests/integration/abort-while-waiting-for-trigger.cpp @@ -1,3 +1,4 @@ +//! @file abort-while-waiting-for-trigger.cpp //! Test: Aborting an acquisition while waiting for a trigger should return //! the runtime to a stopped state without generating errors. diff --git a/acquire-driver-common/tests/integration/configure-triggering.cpp b/acquire-driver-common/tests/integration/configure-triggering.cpp index 32fa8e2..8d53641 100644 --- a/acquire-driver-common/tests/integration/configure-triggering.cpp +++ b/acquire-driver-common/tests/integration/configure-triggering.cpp @@ -1,3 +1,4 @@ +//! @file configure-triggering.cpp //! Checks various trigger setting manipulation on the simulated camera #include "acquire.h" diff --git a/acquire-driver-common/tests/integration/list-digital-lines.cpp b/acquire-driver-common/tests/integration/list-digital-lines.cpp index 2e0bf6f..99abc21 100644 --- a/acquire-driver-common/tests/integration/list-digital-lines.cpp +++ b/acquire-driver-common/tests/integration/list-digital-lines.cpp @@ -1,4 +1,6 @@ +//! @file list-digital-lines.cpp //! Exercises the api for inspecting digital lines (for trigger assignment) + #include "acquire.h" #include "device/hal/device.manager.h" #include "logger.h" diff --git a/acquire-driver-common/tests/integration/software-trigger-acquires-single-frames.cpp b/acquire-driver-common/tests/integration/software-trigger-acquires-single-frames.cpp index bb23986..c8ab466 100644 --- a/acquire-driver-common/tests/integration/software-trigger-acquires-single-frames.cpp +++ b/acquire-driver-common/tests/integration/software-trigger-acquires-single-frames.cpp @@ -1,3 +1,4 @@ +//! @file software-trigger-acquires-single-frames.cpp //! Test: For simulated cameras, software trigger events should be usable to //! control acquisition of single frames. diff --git a/acquire-video-runtime/tests/write-side-by-side-tiff.cpp b/acquire-driver-common/tests/integration/write-side-by-side-tiff.cpp similarity index 97% rename from acquire-video-runtime/tests/write-side-by-side-tiff.cpp rename to acquire-driver-common/tests/integration/write-side-by-side-tiff.cpp index d7a4111..bf44725 100644 --- a/acquire-video-runtime/tests/write-side-by-side-tiff.cpp +++ b/acquire-driver-common/tests/integration/write-side-by-side-tiff.cpp @@ -1,3 +1,6 @@ +/// @file write-side-by-side-tiff.cpp +/// Test that the side-by-side tiff/JSON writer writes a TIFF file and a JSON file. + #include "acquire.h" #include "device/hal/device.manager.h" #include "platform.h" @@ -142,7 +145,6 @@ acquire(AcquireRuntime* runtime, const char* filename) int main() { - auto runtime = acquire_init(reporter); const char* filename = TEST ".dir"; acquire(runtime, filename); diff --git a/acquire-video-runtime/.clang-format b/acquire-video-runtime/.clang-format deleted file mode 100644 index a7ef856..0000000 --- a/acquire-video-runtime/.clang-format +++ /dev/null @@ -1,177 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: Mozilla -AccessModifierOffset: -2 -AlignAfterOpenBracket: Align -AlignArrayOfStructures: None -AlignConsecutiveMacros: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None -AlignEscapedNewlines: Right -AlignOperands: Align -AlignTrailingComments: true -AllowAllArgumentsOnNextLine: true -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortEnumsOnASingleLine: true -AllowShortBlocksOnASingleLine: Never -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -AllowShortLambdasOnASingleLine: All -AllowShortIfStatementsOnASingleLine: Never -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: TopLevel -AlwaysBreakAfterReturnType: TopLevel -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: Yes -AttributeMacros: - - __capability -BinPackArguments: false -BinPackParameters: false -BraceWrapping: - AfterCaseLabel: false - AfterClass: true - AfterControlStatement: Never - AfterEnum: true - AfterFunction: true - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: true - AfterUnion: true - AfterExternBlock: true - BeforeCatch: false - BeforeElse: false - BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: false - SplitEmptyNamespace: true -BreakBeforeBinaryOperators: None -BreakBeforeConceptDeclarations: true -BreakBeforeBraces: Mozilla -BreakBeforeInheritanceComma: false -BreakInheritanceList: BeforeComma -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeComma -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true -ColumnLimit: 80 -CommentPragmas: '^ IWYU pragma:' -CompactNamespaces: false -ConstructorInitializerIndentWidth: 2 -ContinuationIndentWidth: 2 -Cpp11BracedListStyle: false -DeriveLineEnding: true -DerivePointerAlignment: false -DisableFormat: false -EmptyLineAfterAccessModifier: Never -EmptyLineBeforeAccessModifier: LogicalBlock -ExperimentalAutoDetectBinPacking: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false -AllowAllConstructorInitializersOnNextLine: true -FixNamespaceComments: false -ForEachMacros: - - foreach - - Q_FOREACH - - BOOST_FOREACH -IfMacros: - - KJ_IF_MAYBE -IncludeBlocks: Preserve -IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Priority: 2 - SortPriority: 0 - CaseSensitive: false - - Regex: '^(<|"(gtest|gmock|isl|json)/)' - Priority: 3 - SortPriority: 0 - CaseSensitive: false - - Regex: '.*' - Priority: 1 - SortPriority: 0 - CaseSensitive: false -IncludeIsMainRegex: '(Test)?$' -IncludeIsMainSourceRegex: '' -IndentAccessModifiers: false -IndentCaseLabels: true -IndentCaseBlocks: false -IndentGotoLabels: true -IndentPPDirectives: None -IndentExternBlock: AfterExternBlock -IndentRequires: false -IndentWidth: 4 -IndentWrappedFunctionNames: false -InsertTrailingCommas: None -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true -LambdaBodyIndentation: Signature -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCBinPackProtocolList: Auto -ObjCBlockIndentWidth: 2 -ObjCBreakBeforeNestedBlockParam: true -ObjCSpaceAfterProperty: true -ObjCSpaceBeforeProtocolList: false -PenaltyBreakAssignment: 2 -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyBreakTemplateDeclaration: 10 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 200 -PenaltyIndentedWhitespace: 0 -PointerAlignment: Left -PPIndentWidth: -1 -ReferenceAlignment: Pointer -ReflowComments: true -ShortNamespaceLines: 1 -SortIncludes: Never -SortJavaStaticImport: Before -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeCaseColon: false -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: ControlStatements -SpaceAroundPointerQualifiers: Default -SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: Never -SpacesInConditionalStatement: false -SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInLineCommentPrefix: - Minimum: 1 - Maximum: -1 -SpacesInParentheses: false -SpacesInSquareBrackets: false -SpaceBeforeSquareBrackets: false -BitFieldColonSpacing: Both -Standard: Latest -StatementAttributeLikeMacros: - - Q_EMIT -StatementMacros: - - Q_UNUSED - - QT_REQUIRE_VERSION -TabWidth: 8 -UseCRLF: false -UseTab: Never -WhitespaceSensitiveMacros: - - STRINGIZE - - PP_STRINGIZE - - BOOST_PP_STRINGIZE - - NS_SWIFT_NAME - - CF_SWIFT_NAME -... diff --git a/acquire-video-runtime/.clang-tidy b/acquire-video-runtime/.clang-tidy deleted file mode 100644 index fe92f54..0000000 --- a/acquire-video-runtime/.clang-tidy +++ /dev/null @@ -1,45 +0,0 @@ ---- -Checks: 'clang-diagnostic-*,clang-analyzer-*,-*DeprecatedOrUnsafeBufferHandling' -WarningsAsErrors: '' -HeaderFilterRegex: '' -AnalyzeTemporaryDtors: false -FormatStyle: none -User: nclack -CheckOptions: - - key: llvm-else-after-return.WarnOnConditionVariables - value: 'false' - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-replace-auto-ptr.IncludeStyle - value: llvm - - key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons - value: 'false' - - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' - - key: cert-err33-c.CheckedFunctions - value: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;' - - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField - value: 'false' - - key: cert-dcl16-c.NewSuffixes - value: 'L;LL;LU;LLU' - - key: google-readability-braces-around-statements.ShortStatementLines - value: '1' - - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic - value: 'true' - - key: google-readability-namespace-comments.SpacesBeforeComments - value: '2' - - key: modernize-loop-convert.MaxCopySize - value: '16' - - key: modernize-pass-by-value.IncludeStyle - value: llvm - - key: modernize-use-nullptr.NullMacros - value: 'NULL' - - key: llvm-qualified-auto.AddConstToQualified - value: 'false' - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: llvm-else-after-return.WarnOnUnfixable - value: 'false' - - key: google-readability-function-size.StatementThreshold - value: '800' -... diff --git a/acquire-video-runtime/.gitignore b/acquire-video-runtime/.gitignore deleted file mode 100644 index c0c9c35..0000000 --- a/acquire-video-runtime/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -.idea -build*/ -install -.vscode -.cache -CMakeSettings.json -.vs -TestResults -cmake-build* -.DS_Store -*.zip -_CPack_Packages/ -.PVS-Studio diff --git a/acquire-video-runtime/.pre-commit-config.yaml b/acquire-video-runtime/.pre-commit-config.yaml deleted file mode 100644 index 07c6cd6..0000000 --- a/acquire-video-runtime/.pre-commit-config.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -fail_fast: false -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files -- repo: https://github.com/pocc/pre-commit-hooks - rev: v1.3.5 - hooks: - - id: clang-format - args: ["-i"] - - id: clang-tidy - args: ["-p=build"] - -# I'd love cppcheck to be included in the precommit by default but: -# -# - it requires hard-coding the build directory -# - it's sensitive to the use of `cmake -G Ninja` which isn't the default -# on Windows. -# - it can take a few seconds to run, which is annoying -# -# Feel free to enable it yourself by uncommenting below. - - # - id: cppcheck - # args: [ - # "--project=build/compile_commands.json", - # "--inline-suppr", - # "-iexamples/common/imgui", - # "--suppress=*:examples/common/imgui/imgui.h", - # "-isrc/devices/cameras/3rdParty", - # "--suppress=constParameter:*", - # "--suppress=useStlAlgorithm:*", - # "--suppress=unusedStructMember:*", - # "--suppress=unusedFunction:*", - # "--suppress=cstyleCast:*", - # ] diff --git a/acquire-video-runtime/CMakeLists.txt b/acquire-video-runtime/CMakeLists.txt index 73c9091..1fd7ede 100644 --- a/acquire-video-runtime/CMakeLists.txt +++ b/acquire-video-runtime/CMakeLists.txt @@ -1,20 +1,4 @@ -cmake_minimum_required(VERSION 3.23) project(acquire-video-runtime) -enable_testing() - -include(cmake/aq_require.cmake) -include(cmake/git-versioning.cmake) -include(cmake/ide.cmake) -include(cmake/install-prefix.cmake) -include(cmake/msvc.cmake) -include(cmake/simd.cmake) - -set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 20) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_subdirectory(src) add_subdirectory(tests) - -include(CPack) diff --git a/acquire-video-runtime/LICENSE b/acquire-video-runtime/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/acquire-video-runtime/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/acquire-video-runtime/README.md b/acquire-video-runtime/README.md deleted file mode 100644 index 14f71c1..0000000 --- a/acquire-video-runtime/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Acquire Video - -[![Tests](https://github.com/acquire-project/acquire-video-runtime/actions/workflows/test_pr.yml/badge.svg)](https://github.com/acquire-project/acquire-video-runtime/actions/workflows/test_pr.yml) -[![Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://acquire-imaging.zulipchat.com/) - -This is a multi-camera video streaming library _focusing_ on cameras and file-formats for microscopy. - -This is the video runtime for the Acquire project. - -## Platform support - -The library supports Windows, OSX and Linux. - -Windows support is the highest priority and has the widest device compatibility. OSX and Linux are actively tested. - -## Compiler support - -The primary compiler targeted is MSVC's toolchain. - -## Build environment - -1. Install CMake 3.23 or newer -2. Install a fairly recent version of Microsoft Visual Studio. - -From the repository root: - -``` -mkdir build -cd build -cmake-gui .. -``` - -## Build - -From the repository root: - -``` -cmake --build build -``` - -## Using [pre-commit](https://pre-commit.com/) - -Pre-commit is a utility that runs certain checks before you can create a commit -in git. This helps ensure each commit addresses any quality/formatting issues. - -To use, first install it. It's a python package so you can use `pip`. - -``` -pip install pre-commit -``` - -Then, navigate to this repo and initialize: - -``` -cd acquire -pre-commit install -``` - -This will configure the git hooks so they get run the next time you try to commit. - -> **Tips** -> -> - The formatting checks modify the files to fix them. -> - The commands that get run are in `.pre-commit-config.yaml` - > You'll have to install those. -> - `cppcheck` is disabled by default, but can be enabled by uncommenting the - > corresponding lines in `.pre-commit-config.yaml`. See that file for more - > details. diff --git a/acquire-video-runtime/cmake/TargetArch.cmake b/acquire-video-runtime/cmake/TargetArch.cmake deleted file mode 100644 index b6e34e0..0000000 --- a/acquire-video-runtime/cmake/TargetArch.cmake +++ /dev/null @@ -1,139 +0,0 @@ -# Sourced from: https://github.com/axr/solar-cmake/blob/master/TargetArch.cmake -# By Jake Petroules -# See also: https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake/12024211#12024211 -# See also: https://stackoverflow.com/questions/73122708/cmake-generator-expression-for-target-architecture - -# Based on the Qt 5 processor detection code, so should be very accurate -# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h -# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64) - -# Regarding POWER/PowerPC, just as is noted in the Qt source, -# "There are many more known variants/revisions that we do not handle/detect." - -set(archdetect_c_code " -#if defined(__arm__) || defined(__TARGET_ARCH_ARM) - #if defined(__ARM_ARCH_7__) \\ - || defined(__ARM_ARCH_7A__) \\ - || defined(__ARM_ARCH_7R__) \\ - || defined(__ARM_ARCH_7M__) \\ - || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) - #error cmake_ARCH armv7 - #elif defined(__ARM_ARCH_6__) \\ - || defined(__ARM_ARCH_6J__) \\ - || defined(__ARM_ARCH_6T2__) \\ - || defined(__ARM_ARCH_6Z__) \\ - || defined(__ARM_ARCH_6K__) \\ - || defined(__ARM_ARCH_6ZK__) \\ - || defined(__ARM_ARCH_6M__) \\ - || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) - #error cmake_ARCH armv6 - #elif defined(__ARM_ARCH_5TEJ__) \\ - || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) - #error cmake_ARCH armv5 - #else - #error cmake_ARCH arm - #endif -#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) - #error cmake_ARCH i386 -#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) - #error cmake_ARCH x86_64 -#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) - #error cmake_ARCH ia64 -#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\ - || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\ - || defined(_M_MPPC) || defined(_M_PPC) - #if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__) - #error cmake_ARCH ppc64 - #else - #error cmake_ARCH ppc - #endif -#endif - -#error cmake_ARCH unknown -") - -# Set ppc_support to TRUE before including this file or ppc and ppc64 -# will be treated as invalid architectures since they are no longer supported by Apple - -function(target_architecture output_var) - if (APPLE AND CMAKE_OSX_ARCHITECTURES) - # On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set - # First let's normalize the order of the values - - # Note that it's not possible to compile PowerPC applications if you are using - # the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we - # disable it by default - # See this page for more information: - # http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 - - # Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime. - # On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise. - - foreach (osx_arch ${CMAKE_OSX_ARCHITECTURES}) - if ("${osx_arch}" STREQUAL "ppc" AND ppc_support) - set(osx_arch_ppc TRUE) - elseif ("${osx_arch}" STREQUAL "i386") - set(osx_arch_i386 TRUE) - elseif ("${osx_arch}" STREQUAL "x86_64") - set(osx_arch_x86_64 TRUE) - elseif ("${osx_arch}" STREQUAL "ppc64" AND ppc_support) - set(osx_arch_ppc64 TRUE) - else () - message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}") - endif () - endforeach () - - # Now add all the architectures in our normalized order - if (osx_arch_ppc) - list(APPEND ARCH ppc) - endif () - - if (osx_arch_i386) - list(APPEND ARCH i386) - endif () - - if (osx_arch_x86_64) - list(APPEND ARCH x86_64) - endif () - - if (osx_arch_ppc64) - list(APPEND ARCH ppc64) - endif () - else () - file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}") - - enable_language(C) - - # Detect the architecture in a rather creative way... - # This compiles a small C program which is a series of ifdefs that selects a - # particular #error preprocessor directive whose message string contains the - # target architecture. The program will always fail to compile (both because - # file is not a valid C program, and obviously because of the presence of the - # #error preprocessor directives... but by exploiting the preprocessor in this - # way, we can detect the correct target architecture even when cross-compiling, - # since the program itself never needs to be run (only the compiler/preprocessor) - try_run( - run_result_unused - compile_result_unused - "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}/arch.c" - COMPILE_OUTPUT_VARIABLE ARCH - CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - ) - - # Parse the architecture name from the compiler output - string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}") - - # Get rid of the value marker leaving just the architecture name - string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}") - - # If we are compiling with an unknown architecture this variable should - # already be set to "unknown" but in the case that it's empty (i.e. due - # to a typo in the code), then set it to unknown - if (NOT ARCH) - set(ARCH unknown) - endif () - endif () - - set(${output_var} "${ARCH}" PARENT_SCOPE) -endfunction() diff --git a/acquire-video-runtime/cmake/aq_require.cmake b/acquire-video-runtime/cmake/aq_require.cmake deleted file mode 100644 index 9e05781..0000000 --- a/acquire-video-runtime/cmake/aq_require.cmake +++ /dev/null @@ -1,5 +0,0 @@ -function(aq_require tgt) - if(NOT TARGET ${tgt}) - add_subdirectory(${tgt}) - endif() -endfunction() diff --git a/acquire-video-runtime/cmake/git-versioning.cmake b/acquire-video-runtime/cmake/git-versioning.cmake deleted file mode 100644 index 46ecbca..0000000 --- a/acquire-video-runtime/cmake/git-versioning.cmake +++ /dev/null @@ -1,35 +0,0 @@ -find_program(GIT git) -set(GIT_TAG "v0") -set(GIT_HASH "") - -if(GIT) - execute_process(COMMAND ${GIT} describe --tags --abbrev=0 - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE _GIT_TAG - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - execute_process(COMMAND ${GIT} describe --always - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE GIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - - string(FIND "${_GIT_TAG}" "fatal" find_result) - - if(${find_result} EQUAL -1) - set(GIT_TAG "${_GIT_TAG}") - endif() -endif() - -set(CPACK_PACKAGE_VERSION ${GIT_TAG}) - -# Adds GIT_TAG and GIT_HASH compiler definitions for target -function(target_add_git_versioning tgt) - message(STATUS "${tgt} Version ${GIT_TAG} ${GIT_HASH}") - target_compile_definitions(${tgt} PRIVATE - -DGIT_TAG=${GIT_TAG} - -DGIT_HASH=${GIT_HASH} - ) -endfunction() diff --git a/acquire-video-runtime/cmake/ide.cmake b/acquire-video-runtime/cmake/ide.cmake deleted file mode 100644 index 9c47f8f..0000000 --- a/acquire-video-runtime/cmake/ide.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) diff --git a/acquire-video-runtime/cmake/install-prefix.cmake b/acquire-video-runtime/cmake/install-prefix.cmake deleted file mode 100644 index ed82ef5..0000000 --- a/acquire-video-runtime/cmake/install-prefix.cmake +++ /dev/null @@ -1,3 +0,0 @@ -if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "default install path" FORCE) -endif () diff --git a/acquire-video-runtime/cmake/msvc.cmake b/acquire-video-runtime/cmake/msvc.cmake deleted file mode 100644 index f9b1c32..0000000 --- a/acquire-video-runtime/cmake/msvc.cmake +++ /dev/null @@ -1,7 +0,0 @@ -option(ACQUIRE_MSVC_USE_MD "When ON, prefer linking to the Multhreaded DLL Microsoft C Runtime library (use /MD)") - -if(ACQUIRE_MSVC_USE_MD) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") -else() - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -endif() diff --git a/acquire-video-runtime/cmake/simd.cmake b/acquire-video-runtime/cmake/simd.cmake deleted file mode 100644 index 569319c..0000000 --- a/acquire-video-runtime/cmake/simd.cmake +++ /dev/null @@ -1,15 +0,0 @@ -include(cmake/TargetArch.cmake) - -function(target_enable_simd tgt) - if(NOT APPLE) - # something about this is borken on github's osx runners - target_architecture(arch) - set(is_gcc_like "$,$>") - set(is_msvc_like "$,$>") - set(is_arch_x64 "$") - target_compile_options(${tgt} PRIVATE - $<$:-mavx2> - $<$:/arch:AVX2> - ) - endif() -endfunction() diff --git a/acquire-video-runtime/src/CMakeLists.txt b/acquire-video-runtime/src/CMakeLists.txt index 43b0ddf..9dbd6b3 100644 --- a/acquire-video-runtime/src/CMakeLists.txt +++ b/acquire-video-runtime/src/CMakeLists.txt @@ -1,7 +1,3 @@ -if(NOT TARGET acquire-core-logger) - add_subdirectory(acquire-core-libs) -endif() - set(tgt acquire-video-runtime) add_library(${tgt} STATIC acquire.c diff --git a/acquire-video-runtime/tests/CMakeLists.txt b/acquire-video-runtime/tests/CMakeLists.txt index 5df0eb7..51376fb 100644 --- a/acquire-video-runtime/tests/CMakeLists.txt +++ b/acquire-video-runtime/tests/CMakeLists.txt @@ -1,10 +1,6 @@ -if(${NOTEST}) +if (${NOTEST}) message(STATUS "Skipping test targets") -else() - set(NOTEST "TRUE") - aq_require(acquire-driver-common) - set(NOTEST "FALSE") - +else () # # PARAMETERS # @@ -15,50 +11,49 @@ else() # Tests # set(tests - list-devices - abort-or-stop - change-external-metadata - change-file-name - client-queue-is-flushed-after-abort - configure-after-shutdown-and-reinitialize - device-selection - no-abort-on-dropped-frames - one-video-stream - repeat-start - repeat-start-no-stop - two-video-streams - unit-tests - zero-config-start - write-side-by-side-tiff - filter-video-average + list-devices + abort-or-stop + change-external-metadata + change-file-name + client-queue-is-flushed-after-abort + configure-after-shutdown-and-reinitialize + device-selection + no-abort-on-dropped-frames + one-video-stream + repeat-start + repeat-start-no-stop + two-video-streams + unit-tests + zero-config-start + filter-video-average ) - foreach(name ${tests}) + foreach (name ${tests}) set(tgt "${project}-${name}") add_executable(${tgt} ${name}.cpp) target_link_libraries(${tgt} - acquire-video-runtime - acquire-device-kit - acquire-device-hal + acquire-video-runtime + acquire-device-kit + acquire-device-hal ) target_compile_definitions(${tgt} PUBLIC TEST="${tgt}") add_test(NAME test-${tgt} COMMAND ${tgt}) set_tests_properties(test-${tgt} PROPERTIES LABELS "anyplatform;acquire-video-runtime") - endforeach() + endforeach () # # Copy driver to tests # list(POP_FRONT tests onename) add_custom_target(${project}-copy-${driver}-for-tests - COMMAND ${CMAKE_COMMAND} -E copy - $ - $ - DEPENDS ${driver} - COMMENT "Copying ${driver} to $" + COMMAND ${CMAKE_COMMAND} -E copy + $ + $ + DEPENDS ${driver} + COMMENT "Copying ${driver} to $" ) - foreach(name ${tests}) + foreach (name ${tests}) add_dependencies(${tgt} ${project}-copy-${driver}-for-tests) - endforeach() -endif() + endforeach () +endif () diff --git a/acquire-video-runtime/tests/abort-or-stop.cpp b/acquire-video-runtime/tests/abort-or-stop.cpp index 6e8324e..5d6a46f 100644 --- a/acquire-video-runtime/tests/abort-or-stop.cpp +++ b/acquire-video-runtime/tests/abort-or-stop.cpp @@ -1,3 +1,4 @@ +/// @file abort-or-stop.cpp /// Calling acquire_abort() should immediately terminate acquisition. /// Calling acquire_stop() should wait until the frame count is reached. diff --git a/acquire-video-runtime/tests/change-external-metadata.cpp b/acquire-video-runtime/tests/change-external-metadata.cpp index ffddcbf..5349247 100644 --- a/acquire-video-runtime/tests/change-external-metadata.cpp +++ b/acquire-video-runtime/tests/change-external-metadata.cpp @@ -1,3 +1,7 @@ +/// @file change-external-metadata.cpp +/// Test that we can change the external metadata string in the storage +/// properties. + #include "acquire.h" #include "device/hal/device.manager.h" #include "logger.h" @@ -60,6 +64,14 @@ acquire(AcquireRuntime* runtime, OK(acquire_start(runtime)); OK(acquire_stop(runtime)); + OK(acquire_get_configuration(runtime, props)); + EXPECT( + 0 == strcmp(external_metadata_json, + props->video[0].storage.settings.external_metadata_json.str), + "Expected: %s\nActual: %s", + external_metadata_json, + props->video[0].storage.settings.external_metadata_json.str); + LOG(R"(Done "%s")", external_metadata_json); } diff --git a/acquire-video-runtime/tests/change-file-name.cpp b/acquire-video-runtime/tests/change-file-name.cpp index 6749289..006713b 100644 --- a/acquire-video-runtime/tests/change-file-name.cpp +++ b/acquire-video-runtime/tests/change-file-name.cpp @@ -1,3 +1,6 @@ +/// @file change-file-name.cpp +/// Test that we can change the file name in the storage properties. + #include "acquire.h" #include "device/hal/device.manager.h" #include "device/props/storage.h" diff --git a/acquire-video-runtime/tests/client-queue-is-flushed-after-abort.cpp b/acquire-video-runtime/tests/client-queue-is-flushed-after-abort.cpp index 9872502..c85efca 100644 --- a/acquire-video-runtime/tests/client-queue-is-flushed-after-abort.cpp +++ b/acquire-video-runtime/tests/client-queue-is-flushed-after-abort.cpp @@ -1,3 +1,4 @@ +/// @file client-queue-is-flushed-after-abort.cpp /// Frames acquired in a failed run should not remain on the queue when the next /// acquisition begins. diff --git a/acquire-video-runtime/tests/configure-after-shutdown-and-reinitialize.cpp b/acquire-video-runtime/tests/configure-after-shutdown-and-reinitialize.cpp index 40bdf94..ca774d2 100644 --- a/acquire-video-runtime/tests/configure-after-shutdown-and-reinitialize.cpp +++ b/acquire-video-runtime/tests/configure-after-shutdown-and-reinitialize.cpp @@ -1,3 +1,6 @@ +/// @file configure-after-shutdown-and-reinitialize.cpp +/// Test that we are able to reinitialize and reconfigure after shutdown. + #include "acquire.h" #include "device/hal/device.manager.h" #include "logger.h" diff --git a/acquire-video-runtime/tests/device-selection.cpp b/acquire-video-runtime/tests/device-selection.cpp index 6a68c52..e83e56c 100644 --- a/acquire-video-runtime/tests/device-selection.cpp +++ b/acquire-video-runtime/tests/device-selection.cpp @@ -1,3 +1,6 @@ +/// @file device-selection.cpp +/// Test that device selection behavior is well defined and consistent. + #include "acquire.h" #include "device/hal/device.manager.h" #include "logger.h" diff --git a/acquire-video-runtime/tests/filter-video-average.cpp b/acquire-video-runtime/tests/filter-video-average.cpp index 2e97b60..29b9086 100644 --- a/acquire-video-runtime/tests/filter-video-average.cpp +++ b/acquire-video-runtime/tests/filter-video-average.cpp @@ -1,3 +1,6 @@ +/// @file filter-video-average.cpp +/// Test that the frame average filter works as expected. + #include "acquire.h" #include "device/hal/device.manager.h" #include "platform.h" diff --git a/acquire-video-runtime/tests/list-devices.cpp b/acquire-video-runtime/tests/list-devices.cpp index 4b5f5af..8209529 100644 --- a/acquire-video-runtime/tests/list-devices.cpp +++ b/acquire-video-runtime/tests/list-devices.cpp @@ -1,3 +1,6 @@ +/// @file list-devices.cpp +/// Test that we can list devices using the device manager. + #include "acquire.h" #include "device/hal/device.manager.h" #include "logger.h" @@ -32,7 +35,7 @@ reporter(int is_error, } int -main(int n, char** args) +main() { auto runtime = acquire_init(reporter); CHECK(runtime); diff --git a/acquire-video-runtime/tests/no-abort-on-dropped-frames.cpp b/acquire-video-runtime/tests/no-abort-on-dropped-frames.cpp index 90e8c81..9867dba 100644 --- a/acquire-video-runtime/tests/no-abort-on-dropped-frames.cpp +++ b/acquire-video-runtime/tests/no-abort-on-dropped-frames.cpp @@ -1,3 +1,4 @@ +/// @file no-abort-on-dropped-frames.cpp /// If, during acquisition, we have dropped any frames, as determined by a gap /// in the sequence of frame IDs, acquisition should NOT abort. diff --git a/acquire-video-runtime/tests/one-video-stream.cpp b/acquire-video-runtime/tests/one-video-stream.cpp index 57dbf4f..367bea7 100644 --- a/acquire-video-runtime/tests/one-video-stream.cpp +++ b/acquire-video-runtime/tests/one-video-stream.cpp @@ -1,3 +1,6 @@ +/// @file one-video-stream.cpp +/// Test that we can consistently acquire frames from a single video stream. + #include "acquire.h" #include "device/hal/device.manager.h" #include "platform.h" diff --git a/acquire-video-runtime/tests/repeat-start-no-stop.cpp b/acquire-video-runtime/tests/repeat-start-no-stop.cpp index d295dce..48c02ab 100644 --- a/acquire-video-runtime/tests/repeat-start-no-stop.cpp +++ b/acquire-video-runtime/tests/repeat-start-no-stop.cpp @@ -1,3 +1,4 @@ +/// @file repeat-start-no-stop.cpp /// Calling acquire_start() twice without stopping in between should return an /// error. diff --git a/acquire-video-runtime/tests/repeat-start.cpp b/acquire-video-runtime/tests/repeat-start.cpp index b3efbe6..1876570 100644 --- a/acquire-video-runtime/tests/repeat-start.cpp +++ b/acquire-video-runtime/tests/repeat-start.cpp @@ -1,3 +1,6 @@ +/// @file repeat-start.cpp +/// Test that we can start and stop repeatedly without issue. + #include "acquire.h" #include "device/hal/device.manager.h" #include "platform.h" diff --git a/acquire-video-runtime/tests/two-video-streams.cpp b/acquire-video-runtime/tests/two-video-streams.cpp index 73988a0..76250aa 100644 --- a/acquire-video-runtime/tests/two-video-streams.cpp +++ b/acquire-video-runtime/tests/two-video-streams.cpp @@ -1,3 +1,6 @@ +/// @file two-video-streams.cpp +/// Test that we can consistently acquire frames from two video streams. + #include "acquire.h" #include "device/hal/device.manager.h" #include "platform.h" diff --git a/acquire-video-runtime/tests/unit-tests.cpp b/acquire-video-runtime/tests/unit-tests.cpp index 528db99..a0c7f56 100644 --- a/acquire-video-runtime/tests/unit-tests.cpp +++ b/acquire-video-runtime/tests/unit-tests.cpp @@ -1,3 +1,6 @@ +/// @file unit-tests.cpp +/// Runs all unit tests in this project. + #include "acquire.h" #include "logger.h" diff --git a/acquire-video-runtime/tests/zero-config-start.cpp b/acquire-video-runtime/tests/zero-config-start.cpp index 0bfcf81..3e6db96 100644 --- a/acquire-video-runtime/tests/zero-config-start.cpp +++ b/acquire-video-runtime/tests/zero-config-start.cpp @@ -1,3 +1,6 @@ +/// @file zero-config-start.cpp +/// Attempting to start the runtime without any configuration should fail. + #include "acquire.h" #include "logger.h" diff --git a/acquire-driver-common/cmake/TargetArch.cmake b/cmake/TargetArch.cmake similarity index 100% rename from acquire-driver-common/cmake/TargetArch.cmake rename to cmake/TargetArch.cmake diff --git a/acquire-core-libs/cmake/aq_require.cmake b/cmake/aq_require.cmake similarity index 100% rename from acquire-core-libs/cmake/aq_require.cmake rename to cmake/aq_require.cmake diff --git a/acquire-video-runtime/cmake/coverage.cmake b/cmake/coverage.cmake similarity index 100% rename from acquire-video-runtime/cmake/coverage.cmake rename to cmake/coverage.cmake diff --git a/acquire-driver-common/cmake/git-versioning.cmake b/cmake/git-versioning.cmake similarity index 100% rename from acquire-driver-common/cmake/git-versioning.cmake rename to cmake/git-versioning.cmake diff --git a/acquire-core-libs/cmake/ide.cmake b/cmake/ide.cmake similarity index 100% rename from acquire-core-libs/cmake/ide.cmake rename to cmake/ide.cmake diff --git a/acquire-driver-common/cmake/install-prefix.cmake b/cmake/install-prefix.cmake similarity index 100% rename from acquire-driver-common/cmake/install-prefix.cmake rename to cmake/install-prefix.cmake diff --git a/acquire-core-libs/cmake/msvc.cmake b/cmake/msvc.cmake similarity index 62% rename from acquire-core-libs/cmake/msvc.cmake rename to cmake/msvc.cmake index 8aad671..e917144 100644 --- a/acquire-core-libs/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -1,4 +1,4 @@ -option(ACQUIRE_MSVC_USE_MD "When ON, prefer linking to the Multhreaded DLL Microsoft C Runtime library (use /MD)") +option(ACQUIRE_MSVC_USE_MD "When ON, prefer linking to the Multithreaded DLL Microsoft C Runtime library (use /MD)") if(ACQUIRE_MSVC_USE_MD) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") diff --git a/acquire-driver-common/cmake/simd.cmake b/cmake/simd.cmake similarity index 100% rename from acquire-driver-common/cmake/simd.cmake rename to cmake/simd.cmake diff --git a/acquire-video-runtime/cmake/wsl.cmake b/cmake/wsl.cmake similarity index 100% rename from acquire-video-runtime/cmake/wsl.cmake rename to cmake/wsl.cmake