diff --git a/.gitignore b/.gitignore index 8fd886b..40a8c95 100644 --- a/.gitignore +++ b/.gitignore @@ -55,8 +55,6 @@ ui_*.h Makefile* *.prl *.app -*.pro.user* -*.qmlproject.user* *.autosave *.qmlc .qmake.stash @@ -67,6 +65,7 @@ callgrind.out.* *_qmlcache.qrc test.o-* object_script.* +*.user.* *.user # Ignore files generated by Python # diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e59376..4dbda02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,22 @@ if (APPLE) set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt) set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks) set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera) - set(PACKET_TARGET_ARCH ${TARGET_ARCH}) + set(PACKET_HIDE_ARCH false) + + if (IS_ARM_TARGET) + if (IS_64BITS_TARGET) + set(PACKET_TARGET_ARCH arm64) + else () + set(PACKET_TARGET_ARCH arm32) + endif() + else () + if (IS_64BITS_TARGET) + set(PACKET_TARGET_ARCH x64) + else () + set(PACKET_TARGET_ARCH x86) + endif() + endif() + set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera") set(OUTPUT_FORMATS "MacPkg") elseif (WIN32) @@ -39,6 +54,7 @@ elseif (WIN32) set(BUILD_INFO_FILE share/build-info.txt) set(MAIN_EXECUTABLE ${TARGET_ARCH}/AkVCamManager.exe) set(APP_LIBDIR ${TARGET_ARCH}) + set(PACKET_HIDE_ARCH true) if (IS_64BITS_TARGET) set(PACKET_TARGET_ARCH win64) diff --git a/VCamUtils/src/videoframe.cpp b/VCamUtils/src/videoframe.cpp index 8d2d920..39bcf88 100644 --- a/VCamUtils/src/videoframe.cpp +++ b/VCamUtils/src/videoframe.cpp @@ -170,13 +170,13 @@ namespace AkVCam } template - static inline T bound(T min, T value, T max) + static inline T bound(T min, T value, T max) const { return value < min? min: value > max? max: value; } template - inline T mod(T value, T mod) + inline T mod(T value, T mod) const { return (value % mod + mod) % mod; } @@ -1681,9 +1681,9 @@ void AkVCam::VideoFramePrivate::hslToRgb(int h, int s, int l, int *r, int *g, in int m = 2 * l - c; - *r = (2 * (*r) + m) / 2; - *g = (2 * (*g) + m) / 2; - *b = (2 * (*b) + m) / 2; + *r = (2 * (*r) + m) >> 1; + *g = (2 * (*g) + m) >> 1; + *b = (2 * (*b) + m) >> 1; } std::vector AkVCam::initGammaTable() diff --git a/commons.cmake b/commons.cmake index 2d04e78..434d097 100644 --- a/commons.cmake +++ b/commons.cmake @@ -40,6 +40,15 @@ add_definitions(-DCOMMONS_APPNAME="${COMMONS_APPNAME}" -DPREFIX="${PREFIX}") if (APPLE) + check_cxx_source_compiles(" + #ifndef __arm__ + #error Not ARM + #endif + + int main() + { + return 0; + }" IS_ARM_TARGET) check_cxx_source_compiles(" #ifndef __x86_64__ #error Not x64 diff --git a/package_info.conf.in b/package_info.conf.in index 65f8fea..273da75 100644 --- a/package_info.conf.in +++ b/package_info.conf.in @@ -8,7 +8,7 @@ buildInfoFile = @BUILD_INFO_FILE@ targetArch = @PACKET_TARGET_ARCH@ version = @VERSION@ outputFormats = @OUTPUT_FORMATS@ -hideArch = true +hideArch = @PACKET_HIDE_ARCH@ writeLauncher = false [MacPkg]