Merge pull request #1554 from srcejon/android_fixes

Android related changes
This commit is contained in:
Edouard Griffiths 2023-01-03 23:12:39 +01:00 committed by GitHub
commit 0b476f6dd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 1687 additions and 874 deletions

View File

@ -371,103 +371,169 @@ elseif (WIN32)
elseif(ANDROID)
set(EXTERNAL_LIBRARY_FOLDER "${CMAKE_SOURCE_DIR}/external/android")
set(Boost_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/ndk_21_boost_1.72.0/include" CACHE INTERNAL "")
set(FFTW3F_FOUND ON CACHE INTERNAL "")
set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/include" CACHE INTERNAL "")
set(FFTW3F_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/lib/libfftw3f.a" CACHE INTERNAL "")
set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/fftw-3/include" CACHE INTERNAL "")
set(FFTW3F_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/fftw-3/lib/libfftw3f.a" CACHE INTERNAL "")
set(OPUS_FOUND ON CACHE INTERNAL "")
set(OPUS_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/libopus/include" CACHE INTERNAL "")
set(OPUS_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libopus/lib/libopus.a" CACHE INTERNAL "")
set(OPUS_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libopus/include" CACHE INTERNAL "")
set(OPUS_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libopus/lib/libopus.a" CACHE INTERNAL "")
set(CODEC2_FOUND ON CACHE INTERNAL "")
set(CODEC2_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/codec2/include" CACHE INTERNAL "")
set(CODEC2_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/codec2/lib/libcodec2.a" CACHE INTERNAL "")
set(CODEC2_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/codec2/include" CACHE INTERNAL "")
set(CODEC2_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/codec2/lib/libcodec2.a" CACHE INTERNAL "")
set(APT_FOUND ON CACHE INTERNAL "")
set(APT_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/aptdec/include/apt" CACHE INTERNAL "")
set(APT_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/aptdec/lib/libaptstatic.a" CACHE INTERNAL "")
set(APT_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/aptdec/include/apt" CACHE INTERNAL "")
set(APT_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/aptdec/lib/libaptstatic.a" CACHE INTERNAL "")
set(SGP4_FOUND ON CACHE INTERNAL "")
set(SGP4_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/sgp4/include/libsgp4" CACHE INTERNAL "")
set(SGP4_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/sgp4/lib/libsgp4.a" CACHE INTERNAL "")
set(SGP4_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/sgp4/include/libsgp4" CACHE INTERNAL "")
set(SGP4_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/sgp4/lib/libsgp4.a" CACHE INTERNAL "")
set(ZLIB_FOUND ON CACHE INTERNAL "")
set(ZLIB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/zlib/include" CACHE INTERNAL "")
set(ZLIB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/zlib/lib/libz.a" CACHE INTERNAL "")
set(ZLIB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/zlib/include" CACHE INTERNAL "")
set(ZLIB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/zlib/lib/libz.a" CACHE INTERNAL "")
set(FAAD_FOUND ON CACHE INTERNAL "")
set(FAAD_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/faad2/include" CACHE INTERNAL "")
set(FAAD_LIBRARY "${EXTERNAL_LIBRARY_FOLDER}/faad2/lib/liblibfaadstatic.a" CACHE INTERNAL "")
set(FAAD_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/faad2/include" CACHE INTERNAL "")
set(FAAD_LIBRARY "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/faad2/lib/liblibfaadstatic.a" CACHE INTERNAL "")
set(DAB_FOUND ON CACHE INTERNAL "")
set(DAB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libdab/include/dab_lib" CACHE INTERNAL "")
set(DAB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libdab/lib/libdab_lib.so" CACHE INTERNAL "")
set(DAB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libdab/include/dab_lib" CACHE INTERNAL "")
set(DAB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libdab/lib/libdab_lib.so" CACHE INTERNAL "")
set(LIBMBE_FOUND ON CACHE INTERNAL "")
set(LIBMBE_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/mbelib/include/" CACHE INTERNAL "")
set(LIBMBE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/mbelib/lib/libmbe.a" CACHE INTERNAL "")
set(LIBMBE_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/mbelib/include/" CACHE INTERNAL "")
set(LIBMBE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/mbelib/lib/libmbe.a" CACHE INTERNAL "")
set(LIBDSDCC_FOUND ON CACHE INTERNAL "")
set(LIBDSDCC_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/dsdcc/include/" CACHE INTERNAL "")
set(LIBDSDCC_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/dsdcc/lib/libdsdcc.so" CACHE INTERNAL "")
set(LIBDSDCC_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/dsdcc/include/" CACHE INTERNAL "")
set(LIBDSDCC_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/dsdcc/lib/libdsdcc.so" CACHE INTERNAL "")
set(FFMPEG_FOUND ON CACHE INTERNAL "")
set(FFMEG_SKIP_CHECK ON CACHE INTERNAL "")
set(FFMPEG_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
set(FFMPEG_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/bin" CACHE INTERNAL "")
set(AVCODEC_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
set(AVCODEC_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavcodec.so" CACHE INTERNAL "")
set(AVFORMAT_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
set(AVFORMAT_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavformat.so" CACHE INTERNAL "")
set(AVUTIL_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
set(AVUTIL_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavutil.so" CACHE INTERNAL "")
set(SWRESAMPLE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
set(SWRESAMPLE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libswresample.so" CACHE INTERNAL "")
set(SWSCALE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
set(SWSCALE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libswscale.so" CACHE INTERNAL "")
set(FFMPEG_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "")
set(FFMPEG_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/bin" CACHE INTERNAL "")
set(AVCODEC_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "")
set(AVCODEC_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavcodec.so" CACHE INTERNAL "")
set(AVFORMAT_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "")
set(AVFORMAT_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavformat.so" CACHE INTERNAL "")
set(AVUTIL_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "")
set(AVUTIL_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavutil.so" CACHE INTERNAL "")
set(SWRESAMPLE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "")
set(SWRESAMPLE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libswresample.so" CACHE INTERNAL "")
set(SWSCALE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "")
set(SWSCALE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libswscale.so" CACHE INTERNAL "")
set(LIBUSB_FOUND ON CACHE INTERNAL "")
set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libusb/include/" CACHE INTERNAL "")
set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libusb/lib/libusb1.0.so" CACHE INTERNAL "")
set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/include/" CACHE INTERNAL "")
set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/lib/libusb1.0.so" CACHE INTERNAL "")
set(LIBAIRSPYHF_FOUND ON CACHE INTERNAL "")
set(LIBAIRSPYHF_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/airspyhf/include/" CACHE INTERNAL "")
set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/airspyhf/lib/libairspyhf.a" CACHE INTERNAL "")
set(LIBAIRSPYHF_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/airspyhf/include/" CACHE INTERNAL "")
set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/airspyhf/lib/libairspyhf.a" CACHE INTERNAL "")
set(LIBAIRSPY_FOUND ON CACHE INTERNAL "")
set(LIBAIRSPY_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/airspy/include/" CACHE INTERNAL "")
set(LIBAIRSPY_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/airspy/lib/libairspy.a" CACHE INTERNAL "")
set(LIBAIRSPY_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/airspy/include/" CACHE INTERNAL "")
set(LIBAIRSPY_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/airspy/lib/libairspy.a" CACHE INTERNAL "")
set(LIBRTLSDR_FOUND ON CACHE INTERNAL "")
set(LIBRTLSDR_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/librtlsdr/include/" CACHE INTERNAL "")
set(LIBRTLSDR_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/librtlsdr/lib/librtlsdr.a" CACHE INTERNAL "")
set(LIBRTLSDR_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/librtlsdr/include/" CACHE INTERNAL "")
set(LIBRTLSDR_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/librtlsdr/lib/librtlsdr.a" CACHE INTERNAL "")
set(LIMESUITE_FOUND ON CACHE INTERNAL "")
set(LIMESUITE_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/limesuite/include/" CACHE INTERNAL "")
set(LIMESUITE_LIBRARY "${EXTERNAL_LIBRARY_FOLDER}/limesuite/lib/libLimeSuite.a" CACHE INTERNAL "")
set(LIMESUITE_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/limesuite/include/" CACHE INTERNAL "")
set(LIMESUITE_LIBRARY "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/limesuite/lib/libLimeSuite.a" CACHE INTERNAL "")
set(ANDROID_EXTRA_LIBS
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6Charts_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6Concurrent_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6MultimediaWidgets_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6SerialPort_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6TextToSpeech_arm64-v8a.so
${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libssl_1_1.so
${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libcrypto_1_1.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavcodec.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavdevice.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavfilter.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavformat.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libavutil.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libswresample.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libswscale.so
${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/libc++_shared.so
${EXTERNAL_LIBRARY_FOLDER}/libdab/lib/libdab_lib.so
${EXTERNAL_LIBRARY_FOLDER}/dsdcc/lib/libdsdcc.so
${EXTERNAL_LIBRARY_FOLDER}/libusb/lib/libunrooted_android.so
${EXTERNAL_LIBRARY_FOLDER}/libusb/lib/libusb1.0.so
CACHE INTERNAL ""
)
if (ENABLE_QT6)
set(ANDROID_EXTRA_LIBS
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6Charts_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6Concurrent_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6MultimediaWidgets_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6SerialPort_arm64-v8a.so
${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6TextToSpeech_arm64-v8a.so
${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libssl_1_1.so
${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libcrypto_1_1.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavcodec.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavdevice.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavfilter.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavformat.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavutil.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libswresample.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libswscale.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libc++_shared.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libdab/lib/libdab_lib.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/dsdcc/lib/libdsdcc.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/lib/libunrooted_android.so
${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/lib/libusb1.0.so
CACHE INTERNAL ""
)
else()
set(ANDROID_EXTRA_LIBS
${Qt5_DIR}/plugins/sqldrivers/libplugins_sqldrivers_qsqlite_arm64-v8a.so
${Qt5_DIR}/plugins/geoservices/libplugins_geoservices_qtgeoservices_mapboxgl_arm64-v8a.so
${Qt5_DIR}/lib/libQt5Sql_arm64-v8a.so
${Qt5_DIR}/lib/libQt5SerialPort_arm64-v8a.so
${Qt5_DIR}/lib/libQt5Charts_arm64-v8a.so
${Qt5_DIR}/lib/libQt5Positioning_arm64-v8a.so
${Qt5_DIR}/lib/libQt5PositioningQuick_arm64-v8a.so
${Qt5_DIR}/lib/libQt5Location_arm64-v8a.so
${Qt5_DIR}/lib/libQt5Concurrent_arm64-v8a.so
${Qt5_DIR}/lib/libQt5MultimediaWidgets_arm64-v8a.so
${Qt5_DIR}/lib/libQt5SerialPort_arm64-v8a.so
${Qt5_DIR}/lib/libQt5TextToSpeech_arm64-v8a.so
${Qt5_DIR}/lib/libQt5QuickControls2_arm64-v8a.so
${Qt5_DIR}/lib/libQt5QuickWidgets_arm64-v8a.so
${Qt5_DIR}/lib/libQt5QuickTemplates2_arm64-v8a.so
${Qt5_DIR}/lib/libQt5QuickShapes_arm64-v8a.so
${Qt5_DIR}/lib/libQt5Sql_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5SerialPort_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5Charts_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5Positioning_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5PositioningQuick_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5Location_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5Concurrent_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5MultimediaWidgets_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5SerialPort_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5TextToSpeech_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5QuickControls2_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5QuickWidgets_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5QuickTemplates2_armeabi-v7a.so
${Qt5_DIR}/lib/libQt5QuickShapes_armeabi-v7a.so
${Qt5_DIR}/plugins/sqldrivers/libplugins_sqldrivers_qsqlite_armeabi-v7a.so
${Qt5_DIR}/plugins/geoservices/libplugins_geoservices_qtgeoservices_mapboxgl_armeabi-v7a.so
${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libssl_1_1.so
${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libcrypto_1_1.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libavcodec.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libavdevice.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libavfilter.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libavformat.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libavutil.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libswresample.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libswscale.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/ffmpeg/lib/libc++_shared.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/libdab/lib/libdab_lib.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/dsdcc/lib/libdsdcc.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/libusb/lib/libunrooted_android.so
${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/libusb/lib/libusb1.0.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavcodec.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavdevice.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavfilter.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavformat.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavutil.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libswresample.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libswscale.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libc++_shared.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/libdab/lib/libdab_lib.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/dsdcc/lib/libdsdcc.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/libusb/lib/libunrooted_android.so
${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/libusb/lib/libusb1.0.so
CACHE INTERNAL ""
)
endif()
endif()
# When building a bundle on MacOS, we want to keep build paths in the library

View File

@ -1,220 +1,221 @@
include_guard(GLOBAL)
include(CheckCXXCompilerFlag)
include(CheckSymbolExists)
include(CMakePushCheckState)
# Detect current compilation architecture and create standard definitions
macro(detect_architecture symbol arch)
if (NOT DEFINED ARCHITECTURE)
check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
if (ARCHITECTURE_${arch})
set(ARCHITECTURE ${arch})
set(ARCHITECTURE_${arch} TRUE)
add_compile_definitions(ARCHITECTURE_${arch})
endif()
endif()
endmacro()
macro(force_ext_available extension)
message(STATUS "Looking for __${extension}__ - forced found")
set(HAS_${extension} 1 CACHE INTERNAL "")
endmacro()
function(detect_extensions extension)
unset(HAS_${extension})
if (ARGC EQUAL 2 AND (${ARGV1})) # force available
force_ext_available(${extension})
endif()
check_symbol_exists("__${extension}__" "" HAS_${extension})
if (HAS_${extension})
add_compile_definitions(USE_${extension})
endif()
endfunction()
function(detect_msvc_native_opt)
set(TEST_DIR ${PROJECT_SOURCE_DIR}/cmake/test)
try_run(RUN_AVX512 COMPILE_AVX512 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx512.cxx" COMPILE_DEFINITIONS /arch:AVX512)
if (COMPILE_AVX512 AND RUN_AVX512 EQUAL 0)
set(ARCH_OPT "AVX512" PARENT_SCOPE)
return()
endif()
try_run(RUN_AVX2 COMPILE_AVX2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx2.cxx" COMPILE_DEFINITIONS /arch:AVX2)
if (COMPILE_AVX2 AND RUN_AVX2 EQUAL 0)
set(ARCH_OPT "AVX2" PARENT_SCOPE)
return()
endif()
try_run(RUN_AVX COMPILE_AVX "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx.cxx" COMPILE_DEFINITIONS /arch:AVX)
if (COMPILE_AVX AND RUN_AVX EQUAL 0)
set(ARCH_OPT "AVX" PARENT_SCOPE)
return()
endif()
# Supporting 32-bit x86, what year is it?
set(COMPILE_DEF "")
set(ARCH_OPT "" PARENT_SCOPE)
if (ARCHITECTURE_x86)
set(COMPILE_DEF "/arch:SSE2")
set(ARCH_OPT "SSE2" PARENT_SCOPE)
endif()
try_run(RUN_SSE42 COMPILE_SSE42 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse42.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE42 AND RUN_SSE42 EQUAL 0)
force_ext_available(SSE4_2)
return()
endif()
try_run(RUN_SSE41 COMPILE_SSE41 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse41.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE41 AND RUN_SSE41 EQUAL 0)
force_ext_available(SSE4_1)
return()
endif()
try_run(RUN_SSSE3 COMPILE_SSSE3 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_ssse3.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSSE3 AND RUN_SSSE3 EQUAL 0)
force_ext_available(SSSE3)
return()
endif()
try_run(RUN_SSE3 COMPILE_SSE3 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse3.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE3 AND RUN_SSE3 EQUAL 0)
force_ext_available(SSE3)
return()
endif()
try_run(RUN_SSE2 COMPILE_SSE2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse2.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE2 AND RUN_SSE2 EQUAL 0)
force_ext_available(SSE2)
return()
endif()
if (ARCHITECTURE_x86)
# At this point we might as well...
set(ARCH_OPT "IA32" PARENT_SCOPE)
return()
endif()
endfunction()
if (MSVC)
detect_architecture("_M_AMD64" x86_64)
detect_architecture("_M_IX86" x86)
detect_architecture("_M_ARM" ARM)
detect_architecture("_M_ARM64" ARM64)
else()
detect_architecture("__x86_64__" x86_64)
detect_architecture("__i386__" x86)
detect_architecture("__arm__" ARM)
detect_architecture("__aarch64__" ARM64)
detect_architecture("__PPC64__" PPC64)
endif()
if (NOT DEFINED ARCHITECTURE)
message(FATAL_ERROR "Not supported. Please add needed architecture detection.")
endif()
# Note: On x86 MSVC's /arch:SSE2 enables all SSE intrinsics support and is default option.
# On x86_64 MSVC's SSE is supported and enabled, so only AVX selection is needed.
if (FORCE_SSSE3)
message(WARNING "FORCE_SSSE3 flag is deprecated, please use ARCH_OPT option.")
set(ARCH_OPT "")
if (MSVC)
if (ARCHITECTURE_x86)
set(ARCH_OPT "SSE2")
endif()
force_ext_available(SSSE3)
else()
set(FORCE_OPT "-mssse3")
endif()
endif()
if (FORCE_SSE41)
message(WARNING "FORCE_SSE41 flag is deprecated, please use ARCH_OPT option.")
set(ARCH_OPT "")
if (MSVC)
if (ARCHITECTURE_x86)
set(ARCH_OPT "SSE2")
else()
force_ext_available(SSE4_1)
endif()
else()
set(FORCE_OPT "-msse4.1")
endif()
endif()
if (MSVC)
# Glue to make ARCH_OPT more flexible for MSVC
if (ARCH_OPT STREQUAL "native")
# Some compilers simulating MSVC supports the march flag, so use it if we can
check_cxx_compiler_flag("-march=native" MARCH_NATIVE_SUPPORTED)
if (NOT MARCH_NATIVE_SUPPORTED)
detect_msvc_native_opt()
FILE(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/tmp)
endif()
elseif(ARCH_OPT STREQUAL "SSE4_2")
force_ext_available(SSE4_2)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSE4_1")
force_ext_available(SSE4_1)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSSE3")
force_ext_available(SSSE3)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSE3")
force_ext_available(SSE3)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSE2")
force_ext_available(SSE2)
set(ARCH_OPT "")
endif()
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}-${ARCH_OPT}")
cmake_push_check_state(RESET)
if (ARCH_OPT)
if(MSVC AND NOT MARCH_NATIVE_SUPPORTED)
set(CMAKE_REQUIRED_FLAGS "/arch:${ARCH_OPT}")
add_compile_options(${CMAKE_REQUIRED_FLAGS})
elseif (ARCHITECTURE_PPC64)
set(CMAKE_REQUIRED_FLAGS "-mcpu=${ARCH_OPT}")
add_compile_options(-mcpu=${ARCH_OPT})
else()
set(CMAKE_REQUIRED_FLAGS "-march=${ARCH_OPT}")
add_compile_options(-march=${ARCH_OPT})
endif()
elseif(FORCE_SSSE3 OR FORCE_SSE41)
if (NOT MSVC)
set(CMAKE_REQUIRED_FLAGS ${FORCE_OPT})
add_compile_options(${FORCE_OPT})
endif()
endif()
check_cxx_compiler_flag("${CMAKE_REQUIRED_FLAGS}" FLAG_SUPPORTED)
if (NOT FLAG_SUPPORTED)
message(FATAL_ERROR "Flag '${CMAKE_REQUIRED_FLAGS}' rejected by compiler. Please adjust ARCH_OPT option.")
endif()
if (ARCHITECTURE_ARM)
if (MSVC)
force_ext_available(ARM_NEON)
else()
list(APPEND CMAKE_REQUIRED_FLAGS -mfpu=neon)
endif()
endif()
# Extensions detection for ARM
check_symbol_exists("__ARM_NEON" "" HAS_NEON)
if (HAS_NEON)
message(STATUS "ARM Neon extensions enabled")
add_compile_definitions(USE_NEON)
endif()
# This is quite basic detection, can be extended if needed
detect_extensions(AVX512F)
detect_extensions(AVX2 HAS_AVX512F)
detect_extensions(AVX HAS_AVX2)
detect_extensions(SSE4_2 HAS_AVX)
detect_extensions(SSE4_1 HAS_SSE4_2)
detect_extensions(SSSE3 HAS_SSE4_1)
detect_extensions(SSE3 HAS_SSSE3)
detect_extensions(SSE2 HAS_SSE3)
cmake_pop_check_state()
include_guard(GLOBAL)
include(CheckCXXCompilerFlag)
include(CheckSymbolExists)
include(CMakePushCheckState)
# Detect current compilation architecture and create standard definitions
macro(detect_architecture symbol arch)
if (NOT DEFINED ARCHITECTURE)
check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
if (ARCHITECTURE_${arch})
set(ARCHITECTURE ${arch})
set(ARCHITECTURE_${arch} TRUE)
add_compile_definitions(ARCHITECTURE_${arch})
endif()
endif()
endmacro()
macro(force_ext_available extension)
message(STATUS "Looking for __${extension}__ - forced found")
set(HAS_${extension} 1 CACHE INTERNAL "")
endmacro()
function(detect_extensions extension)
unset(HAS_${extension})
if (ARGC EQUAL 2 AND (${ARGV1})) # force available
force_ext_available(${extension})
endif()
check_symbol_exists("__${extension}__" "" HAS_${extension})
if (HAS_${extension})
add_compile_definitions(USE_${extension})
endif()
endfunction()
function(detect_msvc_native_opt)
set(TEST_DIR ${PROJECT_SOURCE_DIR}/cmake/test)
try_run(RUN_AVX512 COMPILE_AVX512 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx512.cxx" COMPILE_DEFINITIONS /arch:AVX512)
if (COMPILE_AVX512 AND RUN_AVX512 EQUAL 0)
set(ARCH_OPT "AVX512" PARENT_SCOPE)
return()
endif()
try_run(RUN_AVX2 COMPILE_AVX2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx2.cxx" COMPILE_DEFINITIONS /arch:AVX2)
if (COMPILE_AVX2 AND RUN_AVX2 EQUAL 0)
set(ARCH_OPT "AVX2" PARENT_SCOPE)
return()
endif()
try_run(RUN_AVX COMPILE_AVX "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx.cxx" COMPILE_DEFINITIONS /arch:AVX)
if (COMPILE_AVX AND RUN_AVX EQUAL 0)
set(ARCH_OPT "AVX" PARENT_SCOPE)
return()
endif()
# Supporting 32-bit x86, what year is it?
set(COMPILE_DEF "")
set(ARCH_OPT "" PARENT_SCOPE)
if (ARCHITECTURE_x86)
set(COMPILE_DEF "/arch:SSE2")
set(ARCH_OPT "SSE2" PARENT_SCOPE)
endif()
try_run(RUN_SSE42 COMPILE_SSE42 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse42.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE42 AND RUN_SSE42 EQUAL 0)
force_ext_available(SSE4_2)
return()
endif()
try_run(RUN_SSE41 COMPILE_SSE41 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse41.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE41 AND RUN_SSE41 EQUAL 0)
force_ext_available(SSE4_1)
return()
endif()
try_run(RUN_SSSE3 COMPILE_SSSE3 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_ssse3.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSSE3 AND RUN_SSSE3 EQUAL 0)
force_ext_available(SSSE3)
return()
endif()
try_run(RUN_SSE3 COMPILE_SSE3 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse3.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE3 AND RUN_SSE3 EQUAL 0)
force_ext_available(SSE3)
return()
endif()
try_run(RUN_SSE2 COMPILE_SSE2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse2.cxx" COMPILE_DEFINITIONS ${COMPILE_DEF})
if (COMPILE_SSE2 AND RUN_SSE2 EQUAL 0)
force_ext_available(SSE2)
return()
endif()
if (ARCHITECTURE_x86)
# At this point we might as well...
set(ARCH_OPT "IA32" PARENT_SCOPE)
return()
endif()
endfunction()
if (MSVC)
detect_architecture("_M_AMD64" x86_64)
detect_architecture("_M_IX86" x86)
detect_architecture("_M_ARM" ARM)
detect_architecture("_M_ARM64" ARM64)
else()
detect_architecture("__x86_64__" x86_64)
detect_architecture("__i386__" x86)
detect_architecture("__arm__" ARM)
detect_architecture("__aarch64__" ARM64)
detect_architecture("__PPC64__" PPC64)
endif()
if (NOT DEFINED ARCHITECTURE)
message(FATAL_ERROR "Not supported. Please add needed architecture detection.")
endif()
# Note: On x86 MSVC's /arch:SSE2 enables all SSE intrinsics support and is default option.
# On x86_64 MSVC's SSE is supported and enabled, so only AVX selection is needed.
if (FORCE_SSSE3)
message(WARNING "FORCE_SSSE3 flag is deprecated, please use ARCH_OPT option.")
set(ARCH_OPT "")
if (MSVC)
if (ARCHITECTURE_x86)
set(ARCH_OPT "SSE2")
endif()
force_ext_available(SSSE3)
else()
set(FORCE_OPT "-mssse3")
endif()
endif()
if (FORCE_SSE41)
message(WARNING "FORCE_SSE41 flag is deprecated, please use ARCH_OPT option.")
set(ARCH_OPT "")
if (MSVC)
if (ARCHITECTURE_x86)
set(ARCH_OPT "SSE2")
else()
force_ext_available(SSE4_1)
endif()
else()
set(FORCE_OPT "-msse4.1")
endif()
endif()
if (MSVC)
# Glue to make ARCH_OPT more flexible for MSVC
if (ARCH_OPT STREQUAL "native")
# Some compilers simulating MSVC supports the march flag, so use it if we can
check_cxx_compiler_flag("-march=native" MARCH_NATIVE_SUPPORTED)
if (NOT MARCH_NATIVE_SUPPORTED)
detect_msvc_native_opt()
FILE(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/tmp)
endif()
elseif(ARCH_OPT STREQUAL "SSE4_2")
force_ext_available(SSE4_2)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSE4_1")
force_ext_available(SSE4_1)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSSE3")
force_ext_available(SSSE3)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSE3")
force_ext_available(SSE3)
set(ARCH_OPT "")
elseif(ARCH_OPT STREQUAL "SSE2")
force_ext_available(SSE2)
set(ARCH_OPT "")
endif()
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}-${ARCH_OPT}")
cmake_push_check_state(RESET)
if (ARCH_OPT)
if(MSVC AND NOT MARCH_NATIVE_SUPPORTED)
set(CMAKE_REQUIRED_FLAGS "/arch:${ARCH_OPT}")
add_compile_options(${CMAKE_REQUIRED_FLAGS})
elseif (ARCHITECTURE_PPC64)
set(CMAKE_REQUIRED_FLAGS "-mcpu=${ARCH_OPT}")
add_compile_options(-mcpu=${ARCH_OPT})
elseif(ANDROID)
else()
set(CMAKE_REQUIRED_FLAGS "-march=${ARCH_OPT}")
add_compile_options(-march=${ARCH_OPT})
endif()
elseif(FORCE_SSSE3 OR FORCE_SSE41)
if (NOT MSVC)
set(CMAKE_REQUIRED_FLAGS ${FORCE_OPT})
add_compile_options(${FORCE_OPT})
endif()
endif()
check_cxx_compiler_flag("${CMAKE_REQUIRED_FLAGS}" FLAG_SUPPORTED)
if (NOT FLAG_SUPPORTED)
message(FATAL_ERROR "Flag '${CMAKE_REQUIRED_FLAGS}' rejected by compiler. Please adjust ARCH_OPT option.")
endif()
if (ARCHITECTURE_ARM)
if (MSVC)
force_ext_available(ARM_NEON)
else()
list(APPEND CMAKE_REQUIRED_FLAGS -mfpu=neon)
endif()
endif()
# Extensions detection for ARM
check_symbol_exists("__ARM_NEON" "" HAS_NEON)
if (HAS_NEON)
message(STATUS "ARM Neon extensions enabled")
add_compile_definitions(USE_NEON)
endif()
# This is quite basic detection, can be extended if needed
detect_extensions(AVX512F)
detect_extensions(AVX2 HAS_AVX512F)
detect_extensions(AVX HAS_AVX2)
detect_extensions(SSE4_2 HAS_AVX)
detect_extensions(SSE4_1 HAS_SSE4_2)
detect_extensions(SSSE3 HAS_SSE4_1)
detect_extensions(SSE3 HAS_SSSE3)
detect_extensions(SSE2 HAS_SSE3)
cmake_pop_check_state()

View File

@ -128,7 +128,7 @@ if(NOT SERVER_MODE)
if(WIN32)
add_subdirectory(demoddatv)
else()
if(((AVUTIL_VERSION VERSION_GREATER "55.27.99") AND (AVCODEC_VERSION VERSION_GREATER "57.48.101")) OR FFMPEG_EXTERNAL)
if(((AVUTIL_VERSION VERSION_GREATER "55.27.99") AND (AVCODEC_VERSION VERSION_GREATER "57.48.101")) OR FFMPEG_EXTERNAL OR FFMEG_SKIP_CHECK)
message(STATUS "Include demoddatv")
add_subdirectory(demoddatv)
else()

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<width>506</width>
<height>1046</height>
</rect>
</property>
@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>600</width>
<width>400</width>
<height>0</height>
</size>
</property>
@ -35,13 +35,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<width>500</width>
<height>141</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>598</width>
<width>400</width>
<height>0</height>
</size>
</property>
@ -758,7 +758,7 @@
<rect>
<x>0</x>
<y>140</y>
<width>598</width>
<width>500</width>
<height>600</height>
</rect>
</property>
@ -770,7 +770,7 @@
</property>
<property name="minimumSize">
<size>
<width>598</width>
<width>400</width>
<height>0</height>
</size>
</property>
@ -810,7 +810,7 @@
</property>
<property name="minimumSize">
<size>
<width>600</width>
<width>400</width>
<height>150</height>
</size>
</property>
@ -841,6 +841,9 @@
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<column>
<property name="text">
<string>ICAO ID</string>

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>440</width>
<width>434</width>
<height>569</height>
</rect>
</property>
@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>440</width>
<width>360</width>
<height>0</height>
</size>
</property>
@ -792,8 +792,8 @@
<widget class="QGraphicsView" name="image">
<property name="minimumSize">
<size>
<width>300</width>
<height>350</height>
<width>200</width>
<height>200</height>
</size>
</property>
</widget>
@ -802,6 +802,11 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
@ -820,11 +825,6 @@
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>deltaFrequency</tabstop>

View File

@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>450</width>
<width>400</width>
<height>0</height>
</size>
</property>
@ -48,7 +48,7 @@
</property>
<property name="minimumSize">
<size>
<width>450</width>
<width>400</width>
<height>0</height>
</size>
</property>
@ -1883,6 +1883,11 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
@ -1890,9 +1895,10 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LevelMeterSignalDB</class>
@ -1912,12 +1918,6 @@
<header>gui/glspectrumgui.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ValueDialZ</class>
<extends>QWidget</extends>
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -18,8 +18,9 @@ namespace ldpctool {
class LDPCUtil
{
public:
#if defined(__APPLE__)
#if defined(__APPLE__) || defined(ANDROID)
// Recent versions of MacOS support aligned_alloc, but Mojave doesn't
// Likewise, API level 28 needed for aligned_alloc on Android, but we want to support 23
static void *aligned_malloc(size_t alignment, size_t size)
{
void *p = nullptr;

View File

@ -34,7 +34,7 @@ if(NOT SERVER_MODE)
)
set(TARGET_NAME demodpacket)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Positioning)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ if (ENABLE_FEATURE_GS232CONTROLLER AND Qt${QT_DEFAULT_MAJOR_VERSION}SerialPort_F
add_subdirectory(gs232controller)
endif()
if (ENABLE_FEATURE_MAP AND Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Location_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}WebEngine_FOUND)
if (ENABLE_FEATURE_MAP AND Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Location_FOUND)
add_subdirectory(map)
endif()

View File

@ -18,7 +18,7 @@
</property>
<property name="minimumSize">
<size>
<width>462</width>
<width>400</width>
<height>0</height>
</size>
</property>

View File

@ -22,6 +22,15 @@ set(map_HEADERS
webserver.h
)
set(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngine_FOUND FALSE)
if(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngine_FOUND)
add_compile_definitions(QT_WEBENGINE_FOUND)
configure_file(mapguiwebengine.ui mapgui.ui)
else()
configure_file(mapguinowebengine.ui mapgui.ui)
endif()
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_BINARY_DIR})
include_directories(
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${Qt${QT_DEFAULT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}
@ -31,7 +40,7 @@ if(NOT SERVER_MODE)
set(map_SOURCES
${map_SOURCES}
mapgui.cpp
mapgui.ui
${CMAKE_CURRENT_BINARY_DIR}/mapgui.ui
maplocationdialog.cpp
maplocationdialog.ui
mapmaidenheaddialog.cpp
@ -70,9 +79,14 @@ if(NOT SERVER_MODE)
)
set(TARGET_NAME map)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Positioning Qt::Location Qt::WebEngine Qt::WebEngineCore Qt::WebEngineWidgets)
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
if(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngine_FOUND)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Positioning Qt::Location Qt::WebEngine Qt::WebEngineCore Qt::WebEngineWidgets)
else()
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Positioning Qt::Location)
endif()
else()
set(TARGET_NAME mapsrv)
set(TARGET_LIB "")

View File

@ -24,12 +24,15 @@
#include <QGeoCodingManager>
#include <QGeoServiceProvider>
#ifdef QT_WEBENGINE_FOUND
#include <QtWebEngineWidgets/QWebEngineView>
#include <QtWebEngineWidgets/QWebEngineSettings>
#include <QtWebEngineWidgets/QWebEngineProfile>
#endif
#include "feature/featureuiset.h"
#include "gui/basicfeaturesettingsdialog.h"
#include "gui/dialogpositioner.h"
#include "mainwindow.h"
#include "device/deviceuiset.h"
#include "util/units.h"
@ -201,6 +204,8 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
m_webPort = 0;
m_webServer = new WebServer(m_webPort);
ui->map->setAttribute(Qt::WA_AcceptTouchEvents, true);
ui->map->rootContext()->setContextProperty("mapModel", &m_mapModel);
// 5.12 doesn't display map items when fully zoomed out
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
@ -220,9 +225,11 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
#ifdef QT_WEBENGINE_FOUND
QWebEngineSettings *settings = ui->web->settings();
settings->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
connect(ui->web->page(), &QWebEnginePage::fullScreenRequested, this, &MapGUI::fullScreenRequested);
#endif
// Get station position
float stationLatitude = MainCore::instance()->getSettings().getLatitude();
@ -279,6 +286,9 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
ui->map->installEventFilter(this);
makeUIConnections();
new DialogPositioner(&m_beaconDialog, true);
new DialogPositioner(&m_ibpBeaconDialog, true);
new DialogPositioner(&m_radioTimeDialog, true);
}
MapGUI::~MapGUI()
@ -505,13 +515,17 @@ void MapGUI::mufUpdated(const QJsonDocument& document)
//#include <QtLocation/private/qgeojson_p.h>
//QVariantList list = QGeoJson::importGeoJson(document);
m_webServer->addFile("/map/map/muf.geojson", document.toJson());
m_cesium->showMUF(m_settings.m_displayMUF);
if (m_cesium) {
m_cesium->showMUF(m_settings.m_displayMUF);
}
}
void MapGUI::foF2Updated(const QJsonDocument& document)
{
m_webServer->addFile("/map/map/fof2.geojson", document.toJson());
m_cesium->showfoF2(m_settings.m_displayfoF2);
if (m_cesium) {
m_cesium->showfoF2(m_settings.m_displayfoF2);
}
}
static QString arrayToString(QJsonArray array)
@ -817,7 +831,7 @@ bool MapGUI::eventFilter(QObject *obj, QEvent *event)
}
}
}
return false;
return FeatureGUI::eventFilter(obj, event);
}
void MapGUI::supportedMapsChanged()
@ -876,6 +890,7 @@ void MapGUI::on_mapTypes_currentIndexChanged(int index)
void MapGUI::applyMap3DSettings(bool reloadMap)
{
#ifdef QT_WEBENGINE_FOUND
if (m_settings.m_map3DEnabled && ((m_cesium == nullptr) || reloadMap))
{
if (m_cesium == nullptr) {
@ -916,10 +931,18 @@ void MapGUI::applyMap3DSettings(bool reloadMap)
}
m_giro->getMUFPeriodically(m_settings.m_displayMUF ? 15 : 0);
m_giro->getfoF2Periodically(m_settings.m_displayfoF2 ? 15 : 0);
#else
ui->displayMUF->setVisible(false);
ui->displayfoF2->setVisible(false);
m_mapModel.allUpdated();
float stationLatitude = MainCore::instance()->getSettings().getLatitude();
float stationLongitude = MainCore::instance()->getSettings().getLongitude();
#endif
}
void MapGUI::init3DMap()
{
#ifdef QT_WEBENGINE_FOUND
qDebug() << "MapGUI::init3DMap";
m_cesium->initCZML();
@ -940,6 +963,7 @@ void MapGUI::init3DMap()
m_cesium->showMUF(m_settings.m_displayMUF);
m_cesium->showfoF2(m_settings.m_displayfoF2);
#endif
}
void MapGUI::displaySettings()
@ -977,6 +1001,7 @@ void MapGUI::onMenuDialogCalled(const QPoint &p)
dialog.setDefaultTitle(m_displayedName);
dialog.move(p);
new DialogPositioner(&dialog, false);
dialog.exec();
m_settings.m_title = dialog.getTitle();
@ -1017,6 +1042,7 @@ void MapGUI::applySettings(bool force)
void MapGUI::on_maidenhead_clicked()
{
MapMaidenheadDialog dialog;
new DialogPositioner(&dialog, true);
dialog.exec();
}
@ -1090,6 +1116,7 @@ void MapGUI::geoReply()
{
// Show dialog allowing user to select from the results
MapLocationDialog dialog(qGeoLocs);
new DialogPositioner(&dialog, true);
if (dialog.exec() == QDialog::Accepted)
{
QGeoCoordinate coord = dialog.m_selectedLocation.coordinate();
@ -1208,6 +1235,7 @@ void MapGUI::on_deleteAll_clicked()
void MapGUI::on_displaySettings_clicked()
{
MapSettingsDialog dialog(&m_settings);
new DialogPositioner(&dialog, true);
if (dialog.exec() == QDialog::Accepted)
{
if (dialog.m_osmURLChanged) {
@ -1293,6 +1321,7 @@ void MapGUI::receivedCesiumEvent(const QJsonObject &obj)
}
}
#ifdef QT_WEBENGINE_FOUND
void MapGUI::fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest)
{
fullScreenRequest.accept();
@ -1306,6 +1335,7 @@ void MapGUI::fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest)
ui->splitter->addWidget(ui->web);
}
}
#endif
void MapGUI::preferenceChanged(int elementType)
{

View File

@ -22,7 +22,9 @@
#include <QTimer>
#include <QQuickItem>
#include <QJsonObject>
#ifdef QT_WEBENGINE_FOUND
#include <QWebEngineFullScreenRequest>
#endif
#include <math.h>
#include <limits>
@ -227,9 +229,11 @@ private slots:
void on_ibpBeacons_clicked();
void on_radiotime_clicked();
void receivedCesiumEvent(const QJsonObject &obj);
virtual void showEvent(QShowEvent *event);
virtual bool eventFilter(QObject *obj, QEvent *event);
virtual void showEvent(QShowEvent *event) override;
virtual bool eventFilter(QObject *obj, QEvent *event) override;
#ifdef QT_WEBENGINE_FOUND
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
#endif
void preferenceChanged(int elementType);
void giroDataUpdated(const GIRO::GIROStationData& data);
void mufUpdated(const QJsonDocument& document);

View File

@ -0,0 +1,414 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MapGUI</class>
<widget class="RollupContents" name="MapGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>491</width>
<height>507</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="windowTitle">
<string>Map</string>
</property>
<widget class="QWidget" name="settingsContainer" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>41</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<layout class="QHBoxLayout" name="buttonLayout">
<item>
<widget class="QLabel" name="findLabel">
<property name="text">
<string>Find</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="find">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Enter name of object to find, latitude and longitude, Maidenhead locator or an address</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mapTypes">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Select type of map to display</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="maidenhead">
<property name="toolTip">
<string>Maidenhead locator conversion</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/mem.png</normaloff>:/mem.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="beacons">
<property name="toolTip">
<string>Display Beacon dialog</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/antenna.png</normaloff>:/antenna.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="ibpBeacons">
<property name="toolTip">
<string>Display IBP Beacon dialog</string>
</property>
<property name="text">
<string>IBP</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/map/icons/ibp.png</normaloff>:/map/icons/ibp.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="radiotime">
<property name="toolTip">
<string>Display radio time transmitters dialog</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/map/icons/clock.png</normaloff>:/map/icons/clock.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="displayMUF">
<property name="toolTip">
<string>Display MUF contours</string>
</property>
<property name="text">
<string>^</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/map/icons/muf.png</normaloff>:/map/icons/muf.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="displayfoF2">
<property name="toolTip">
<string>Display foF2 contours</string>
</property>
<property name="text">
<string>^</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/map/icons/fof2.png</normaloff>:/map/icons/fof2.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="displayNames">
<property name="toolTip">
<string>Display names</string>
</property>
<property name="text">
<string>^</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/info.png</normaloff>:/info.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="displaySelectedGroundTracks">
<property name="toolTip">
<string>Display ground tracks for selected item</string>
</property>
<property name="text">
<string>^</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/logarithmic.png</normaloff>:/logarithmic.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="displayAllGroundTracks">
<property name="toolTip">
<string>Display all ground tracks</string>
</property>
<property name="text">
<string>^</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/map/icons/groundtracks.png</normaloff>:/map/icons/groundtracks.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteAll">
<property name="toolTip">
<string>Delete all items on the map</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/bin.png</normaloff>:/bin.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="displaySettings">
<property name="toolTip">
<string>Show settings dialog</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/listing.png</normaloff>:/listing.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="mapContainer" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>60</y>
<width>483</width>
<height>223</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Map</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QSplitter" name="splitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QQuickWidget" name="map">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="toolTip">
<string>Map</string>
</property>
<property name="resizeMode">
<enum>QQuickWidget::SizeRootObjectToView</enum>
</property>
<property name="source">
<url>
<string/>
</url>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>QQuickWidget</class>
<extends>QWidget</extends>
<header location="global">QtQuickWidgets/QQuickWidget</header>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>RollupContents</class>
<extends>QWidget</extends>
<header>gui/rollupcontents.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>find</tabstop>
<tabstop>mapTypes</tabstop>
<tabstop>maidenhead</tabstop>
<tabstop>beacons</tabstop>
<tabstop>displayNames</tabstop>
<tabstop>deleteAll</tabstop>
<tabstop>displaySettings</tabstop>
<tabstop>map</tabstop>
</tabstops>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>
<include location="icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -172,6 +172,16 @@ MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) :
on_map3DEnabled_clicked(m_settings->m_map3DEnabled);
connect(&m_dlm, &HttpDownloadManagerGUI::downloadComplete, this, &MapSettingsDialog::downloadComplete);
#ifndef QT_WEBENGINE_FOUND
ui->map3DSettings->setVisible(false);
ui->downloadModels->setVisible(false);
ui->mapItemSettings->hideColumn(COL_3D_MODEL);
ui->mapItemSettings->hideColumn(COL_3D_MIN_PIXELS);
ui->mapItemSettings->hideColumn(COL_3D_LABEL);
ui->mapItemSettings->hideColumn(COL_3D_POINT);
ui->mapItemSettings->hideColumn(COL_3D_TRACK);
ui->mapItemSettings->hideColumn(COL_3D_LABEL_SCALE);
#endif
}
MapSettingsDialog::~MapSettingsDialog()

View File

@ -59,6 +59,7 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
swagger
${LIBAIRSPYHF_LIBRARIES}
${LIBUSB_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -100,7 +100,17 @@ void FileInput::openFileStream()
{
//stopInput();
if (m_ifstream.is_open()) {
#ifdef ANDROID
if (m_inputFile.isOpen()) {
m_inputFile.close();
}
m_inputFile.setFileName(m_settings.m_fileName);
m_inputFile.open(QIODevice::ReadOnly | QIODevice::ExistingOnly);
quint64 fileSize = (quint64) m_inputFile.size();
#else
if (m_ifstream.is_open()) {
m_ifstream.close();
}
@ -110,12 +120,18 @@ void FileInput::openFileStream()
m_ifstream.open(m_settings.m_fileName.toStdString().c_str(), std::ios::binary | std::ios::ate);
#endif
quint64 fileSize = m_ifstream.tellg();
#endif
if (m_settings.m_fileName.endsWith(".wav"))
{
WavFileRecord::Header header;
#ifdef ANDROID
m_inputFile.seek(0);
bool headerOK = WavFileRecord::readHeader(m_inputFile, header);
#else
m_ifstream.seekg(0, std::ios_base::beg);
bool headerOK = WavFileRecord::readHeader(m_ifstream, header);
#endif
m_sampleRate = header.m_sampleRate;
if (header.m_auxiHeader.m_size > 0)
{
@ -136,7 +152,12 @@ void FileInput::openFileStream()
if (headerOK && (m_sampleRate > 0) && (m_sampleSize > 0))
{
m_recordLengthMuSec = ((fileSize - m_ifstream.tellg()) * 1000000UL) / ((m_sampleSize == 24 ? 8 : 4) * m_sampleRate);
#ifdef ANDROID
qint64 pos = m_inputFile.pos();
#else
qint64 pos = m_ifstream.tellg();
#endif
m_recordLengthMuSec = ((fileSize - pos) * 1000000UL) / ((m_sampleSize == 24 ? 8 : 4) * m_sampleRate);
}
else
{
@ -153,8 +174,13 @@ void FileInput::openFileStream()
else if (fileSize > sizeof(FileRecord::Header))
{
FileRecord::Header header;
#ifdef ANDROID
m_inputFile.seek(0);
bool crcOK = FileRecord::readHeader(m_inputFile, header);
#else
m_ifstream.seekg(0,std::ios_base::beg);
bool crcOK = FileRecord::readHeader(m_ifstream, header);
#endif
m_sampleRate = header.sampleRate;
m_centerFrequency = header.centerFrequency;
m_startingTimeStamp = header.startTimeStamp;
@ -208,7 +234,11 @@ void FileInput::openFileStream()
}
if (m_recordLengthMuSec == 0) {
#ifdef ANDROID
m_inputFile.close();
#else
m_ifstream.close();
#endif
}
}
@ -216,14 +246,24 @@ void FileInput::seekFileStream(int seekMillis)
{
QMutexLocker mutexLocker(&m_mutex);
if ((m_ifstream.is_open()) && m_fileInputWorker && !m_fileInputWorker->isRunning())
if (
#ifdef ANDROID
m_inputFile.isOpen()
#else
m_ifstream.is_open()
#endif
&& m_fileInputWorker && !m_fileInputWorker->isRunning())
{
quint64 seekPoint = ((m_recordLengthMuSec * seekMillis) / 1000) * m_sampleRate;
seekPoint /= 1000000UL;
m_fileInputWorker->setSamplesCount(seekPoint);
seekPoint *= (m_sampleSize == 24 ? 8 : 4); // + sizeof(FileRecord::Header)
#ifdef ANDROID
m_inputFile.seek(seekPoint + sizeof(FileRecord::Header));
#else
m_ifstream.clear();
m_ifstream.seekg(seekPoint + sizeof(FileRecord::Header), std::ios::beg);
#endif
}
}
@ -235,7 +275,11 @@ void FileInput::init()
bool FileInput::start()
{
#ifdef ANDROID
if (!m_inputFile.isOpen())
#else
if (!m_ifstream.is_open())
#endif
{
qWarning("FileInput::start: file not open. not starting");
return false;
@ -244,11 +288,15 @@ bool FileInput::start()
QMutexLocker mutexLocker(&m_mutex);
qDebug() << "FileInput::start";
#ifdef ANDROID
m_inputFile.seek(0);
#else
if (m_ifstream.tellg() != (std::streampos)0)
{
m_ifstream.clear();
m_ifstream.seekg(sizeof(FileRecord::Header), std::ios::beg);
}
#endif
if (!m_sampleFifo.setSize(m_settings.m_accelerationFactor * m_sampleRate * sizeof(Sample)))
{
@ -256,7 +304,11 @@ bool FileInput::start()
return false;
}
#ifdef ANDROID
m_fileInputWorker = new FileInputWorker(&m_inputFile, &m_sampleFifo, m_masterTimer, &m_inputMessageQueue);
#else
m_fileInputWorker = new FileInputWorker(&m_ifstream, &m_sampleFifo, m_masterTimer, &m_inputMessageQueue);
#endif
m_fileInputWorker->moveToThread(&m_fileInputWorkerThread);
m_fileInputWorker->setSampleRateAndSize(m_settings.m_accelerationFactor * m_sampleRate, m_sampleSize); // Fast Forward: 1 corresponds to live. 1/2 is half speed, 2 is double speed
startWorker();

View File

@ -28,6 +28,7 @@
#include <QThread>
#include <QMutex>
#include <QNetworkRequest>
#include <QFile>
#include "dsp/devicesamplesource.h"
#include "fileinputsettings.h"
@ -334,7 +335,11 @@ public:
DeviceAPI *m_deviceAPI;
QMutex m_mutex;
FileInputSettings m_settings;
#ifdef ANDROID
QFile m_inputFile;
#else
std::ifstream m_ifstream;
#endif
FileInputWorker* m_fileInputWorker;
QThread m_fileInputWorkerThread;
QString m_deviceDescription;

View File

@ -28,6 +28,7 @@
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "gui/basicdevicesettingsdialog.h"
#include "gui/dialogpositioner.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
@ -313,7 +314,8 @@ void FileInputGUI::on_showFileDialog_clicked(bool checked)
{
(void) checked;
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open I/Q record file"), ".", tr("SDR I/Q Files (*.sdriq *.wav)"), 0, QFileDialog::DontUseNativeDialog);
tr("Open I/Q record file"), ".", tr("SDR I/Q Files (*.sdriq *.wav)"), 0);
if (fileName != "")
{
@ -450,6 +452,7 @@ void FileInputGUI::openDeviceSettingsDialog(const QPoint& p)
dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
dialog.move(p);
new DialogPositioner(&dialog, false);
dialog.exec();
m_settings.m_useReverseAPI = dialog.useReverseAPI();

View File

@ -26,7 +26,12 @@
MESSAGE_CLASS_DEFINITION(FileInputWorker::MsgReportEOF, Message)
FileInputWorker::FileInputWorker(std::ifstream *samplesStream,
FileInputWorker::FileInputWorker(
#ifdef ANDROID
QFile *samplesStream,
#else
std::ifstream *samplesStream,
#endif
SampleSinkFifo* sampleFifo,
const QTimer& timer,
MessageQueue *fileInputMessageQueue,
@ -69,7 +74,11 @@ void FileInputWorker::startWork()
{
qDebug() << "FileInputThread::startWork: ";
#ifdef ANDROID
if (m_ifstream->isOpen())
#else
if (m_ifstream->is_open())
#endif
{
qDebug() << "FileInputThread::startWork: file stream open, starting...";
m_elapsedTimer.start();
@ -172,6 +181,23 @@ void FileInputWorker::tick()
setBuffers(m_chunksize);
}
#ifdef ANDROID
// read samples directly feeding the SampleFifo (no callback)
qint64 bytesRead = m_ifstream->read(reinterpret_cast<char*>(m_fileBuf), m_chunksize);
if (m_ifstream->atEnd())
{
writeToSampleFifo(m_fileBuf, (qint32) bytesRead);
MsgReportEOF *message = MsgReportEOF::create();
m_fileInputMessageQueue->push(message);
}
else
{
writeToSampleFifo(m_fileBuf, (qint32) m_chunksize);
m_samplesCount += m_chunksize / (2 * m_samplebytes);
}
#else
// read samples directly feeding the SampleFifo (no callback)
m_ifstream->read(reinterpret_cast<char*>(m_fileBuf), m_chunksize);
@ -186,6 +212,7 @@ void FileInputWorker::tick()
writeToSampleFifo(m_fileBuf, (qint32) m_chunksize);
m_samplesCount += m_chunksize / (2 * m_samplebytes);
}
#endif
}
}

View File

@ -50,7 +50,12 @@ public:
{ }
};
FileInputWorker(std::ifstream *samplesStream,
FileInputWorker(
#ifdef ANDROID
QFile *samplesStream,
#else
std::ifstream *samplesStream,
#endif
SampleSinkFifo* sampleFifo,
const QTimer& timer,
MessageQueue *fileInputMessageQueue,
@ -68,7 +73,11 @@ public:
private:
volatile bool m_running;
#ifdef ANDROID
QFile *m_ifstream;
#else
std::ifstream* m_ifstream;
#endif
quint8 *m_fileBuf;
quint8 *m_convertBuf;
std::size_t m_bufsize;

View File

@ -114,16 +114,31 @@ bool FileRecord::startRecording()
stopRecording();
}
#ifdef ANDROID
if (!m_sampleFile.isOpen())
#else
if (!m_sampleFile.is_open())
#endif
{
qDebug() << "FileRecord::startRecording";
m_currentFileName = QString("%1.%2.sdriq").arg(m_fileBase).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz"));
#ifdef ANDROID
// FIXME: No idea how to write to a file where the filename doesn't come from the file picker
m_currentFileName = m_fileBase + ".sdriq";
m_sampleFile.setFileName(m_currentFileName);
if (!m_sampleFile.open(QIODevice::ReadWrite))
{
qWarning() << "FileRecord::startRecording: failed to open file: " << m_currentFileName << " error " << m_sampleFile.error();
return false;
}
#else
m_currentFileName = m_fileBase + "." + QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz") + ".sdriq"; // Don't use QString::arg on Android, as filename can contain %2
m_sampleFile.open(m_currentFileName.toStdString().c_str(), std::ios::binary);
if (!m_sampleFile.is_open())
{
qWarning() << "FileRecord::startRecording: failed to open file: " << m_currentFileName;
return false;
}
#endif
m_recordOn = true;
m_recordStart = true;
m_byteCount = 0;
@ -135,17 +150,24 @@ bool FileRecord::stopRecording()
{
QMutexLocker mutexLocker(&m_mutex);
#ifdef ANDROID
if (m_sampleFile.isOpen())
#else
if (m_sampleFile.is_open())
#endif
{
qDebug() << "FileRecord::stopRecording";
m_sampleFile.close();
m_recordOn = false;
m_recordStart = false;
#ifdef ANDROID
#else
if (m_sampleFile.bad())
{
qWarning() << "FileRecord::stopRecording: an error occurred while writing to " << m_currentFileName;
return false;
}
#endif
}
return true;
}
@ -197,6 +219,14 @@ bool FileRecord::readHeader(std::ifstream& sampleFile, Header& header)
return header.crc32 == crc32.checksum();
}
bool FileRecord::readHeader(QFile& sampleFile, Header& header)
{
sampleFile.read((char *) &header, sizeof(Header));
boost::crc_32_type crc32;
crc32.process_bytes(&header, 28);
return header.crc32 == crc32.checksum();
}
void FileRecord::writeHeader(std::ofstream& sampleFile, Header& header)
{
boost::crc_32_type crc32;
@ -204,3 +234,11 @@ void FileRecord::writeHeader(std::ofstream& sampleFile, Header& header)
header.crc32 = crc32.checksum();
sampleFile.write((const char *) &header, sizeof(Header));
}
void FileRecord::writeHeader(QFile& sampleFile, Header& header)
{
boost::crc_32_type crc32;
crc32.process_bytes(&header, 28);
header.crc32 = crc32.checksum();
sampleFile.write((const char *) &header, sizeof(Header));
}

View File

@ -18,6 +18,8 @@
#ifndef INCLUDE_FILERECORD_H
#define INCLUDE_FILERECORD_H
#include <QFile>
#include <dsp/basebandsamplesink.h>
#include <string>
#include <iostream>
@ -65,7 +67,9 @@ public:
virtual bool isRecording() const { return m_recordOn; }
static bool readHeader(std::ifstream& samplefile, Header& header); //!< returns true if CRC checksum is correct else false
static bool readHeader(QFile& samplefile, Header& header); //!< returns true if CRC checksum is correct else false
static void writeHeader(std::ofstream& samplefile, Header& header);
static void writeHeader(QFile& samplefile, Header& header);
private:
QString m_fileBase;
@ -73,7 +77,11 @@ private:
quint64 m_centerFrequency;
bool m_recordOn;
bool m_recordStart;
#ifdef ANDROID
QFile m_sampleFile;
#else
std::ofstream m_sampleFile;
#endif
QString m_currentFileName;
quint64 m_byteCount;
qint64 m_msShift;

View File

@ -105,8 +105,8 @@ void WavFileRecord::feed(const SampleVector::const_iterator& begin, const Sample
{
// Convert from 24-bit to 16-bit
int16_t samples[2];
samples[0] = it->real() >> 8;
samples[1] = it->imag() >> 8;
samples[0] = std::min(32767, std::max(it->real() >> 8, -32768));
samples[1] = std::min(32767, std::max(it->imag() >> 8, -32768));
m_sampleFile.write(reinterpret_cast<const char*>(&samples), 4);
m_byteCount += 4;
}
@ -154,16 +154,31 @@ bool WavFileRecord::startRecording()
stopRecording();
}
#ifdef ANDROID
if (!m_sampleFile.isOpen())
#else
if (!m_sampleFile.is_open())
#endif
{
qDebug() << "WavFileRecord::startRecording";
m_currentFileName = QString("%1.%2.wav").arg(m_fileBase).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz"));
#ifdef ANDROID
// FIXME: No idea how to write to a file where the filename doesn't come from the file picker
m_currentFileName = m_fileBase + ".wav";
m_sampleFile.setFileName(m_currentFileName);
if (!m_sampleFile.open(QIODevice::ReadWrite))
{
qWarning() << "WavFileRecord::startRecording: failed to open file: " << m_currentFileName << " error " << m_sampleFile.error();
return false;
}
#else
m_currentFileName = m_fileBase + "_" + QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz") + ".wav"; // Don't use QString::arg on Android, as filename can contain %2
m_sampleFile.open(m_currentFileName.toStdString().c_str(), std::ios::binary);
if (!m_sampleFile.is_open())
{
qWarning() << "WavFileRecord::startRecording: failed to open file: " << m_currentFileName;
return false;
}
#endif
m_recordOn = true;
m_recordStart = true;
m_byteCount = 0;
@ -173,25 +188,41 @@ bool WavFileRecord::startRecording()
bool WavFileRecord::stopRecording()
{
#ifdef ANDROID
if (m_sampleFile.isOpen())
#else
if (m_sampleFile.is_open())
#endif
{
qDebug() << "WavFileRecord::stopRecording";
// Fix up chunk sizes
#ifdef ANDROID
long fileSize = (long)m_sampleFile.size();
m_sampleFile.seek(offsetof(Header, m_riffHeader.m_size));
#else
long fileSize = m_sampleFile.tellp();
m_sampleFile.seekp(offsetof(Header, m_riffHeader.m_size));
#endif
qint32 size = (fileSize - 8);
m_sampleFile.write((char *)&size, 4);
#ifdef ANDROID
m_sampleFile.seek(offsetof(Header, m_dataHeader.m_size));
#else
m_sampleFile.seekp(offsetof(Header, m_dataHeader.m_size));
#endif
size = fileSize - sizeof(Header);
m_sampleFile.write((char *)&size, 4);
m_sampleFile.close();
m_recordOn = false;
m_recordStart = false;
#ifdef ANDROID
#else
if (m_sampleFile.bad())
{
qWarning() << "WavFileRecord::stopRecording: an error occurred while writing to " << m_currentFileName;
return false;
}
#endif
}
return true;
}
@ -305,35 +336,7 @@ bool WavFileRecord::readHeader(std::ifstream& sampleFile, Header& header)
return false;
}
if (strncmp(header.m_riffHeader.m_id, "RIFF", 4))
{
qDebug() << "WavFileRecord::readHeader: No RIFF header";
return false;
}
if (strncmp(header.m_type, "WAVE", 4))
{
qDebug() << "WavFileRecord::readHeader: No WAVE header";
return false;
}
if (strncmp(header.m_fmtHeader.m_id, "fmt ", 4))
{
qDebug() << "WavFileRecord::readHeader: No fmt header";
return false;
}
if (header.m_audioFormat != 1)
{
qDebug() << "WavFileRecord::readHeader: Audio format is not PCM";
return false;
}
if (header.m_numChannels != 2)
{
qDebug() << "WavFileRecord::readHeader: Number of channels is not 2";
return false;
}
// FileInputWorker can't handle other bits sizes
if (header.m_bitsPerSample != 16)
{
qDebug() << "WavFileRecord::readHeader: Number of bits per sample is not 16";
if (!checkHeader(header)) {
return false;
}
@ -365,11 +368,89 @@ bool WavFileRecord::readHeader(std::ifstream& sampleFile, Header& header)
return true;
}
bool WavFileRecord::readHeader(QFile& sampleFile, Header& header)
{
memset(&header, 0, sizeof(Header));
sampleFile.read((char *) &header, 8+4+8+16);
if (!checkHeader(header)) {
return false;
}
Chunk chunkHeader;
bool gotData = false;
while (!gotData)
{
if (sampleFile.read((char *) &chunkHeader, 8) != 8)
{
qDebug() << "WavFileRecord::readHeader: End of file without reading data header";
return false;
}
if (!strncmp(chunkHeader.m_id, "auxi", 4))
{
memcpy(&header.m_auxiHeader, &chunkHeader, sizeof(Chunk));
if (sampleFile.read((char *) &header.m_auxi, sizeof(Auxi)) != sizeof(Auxi)) {
return false;
}
}
else if (!strncmp(chunkHeader.m_id, "data", 4))
{
memcpy(&header.m_dataHeader, &chunkHeader, sizeof(Chunk));
gotData = true;
}
}
return true;
}
bool WavFileRecord::checkHeader(Header& header)
{
if (strncmp(header.m_riffHeader.m_id, "RIFF", 4))
{
qDebug() << "WavFileRecord::readHeader: No RIFF header";
return false;
}
if (strncmp(header.m_type, "WAVE", 4))
{
qDebug() << "WavFileRecord::readHeader: No WAVE header";
return false;
}
if (strncmp(header.m_fmtHeader.m_id, "fmt ", 4))
{
qDebug() << "WavFileRecord::readHeader: No fmt header";
return false;
}
if (header.m_audioFormat != 1)
{
qDebug() << "WavFileRecord::readHeader: Audio format is not PCM";
return false;
}
if (header.m_numChannels != 2)
{
qDebug() << "WavFileRecord::readHeader: Number of channels is not 2";
return false;
}
// FileInputWorker can't handle other bits sizes
if (header.m_bitsPerSample != 16)
{
qDebug() << "WavFileRecord::readHeader: Number of bits per sample is not 16";
return false;
}
return true;
}
void WavFileRecord::writeHeader(std::ofstream& sampleFile, Header& header)
{
sampleFile.write((const char *) &header, sizeof(Header));
}
void WavFileRecord::writeHeader(QFile& sampleFile, Header& header)
{
sampleFile.write((const char *) &header, sizeof(Header));
}
bool WavFileRecord::getCenterFrequency(QString fileName, quint64& centerFrequency)
{
// Attempt to extract center frequency from filename

View File

@ -27,6 +27,7 @@
#include <ctime>
#include <QDateTime>
#include <QFile>
#include "dsp/filerecordinterface.h"
#include "export.h"
@ -111,7 +112,9 @@ public:
virtual bool isRecording() const override { return m_recordOn; }
static bool readHeader(std::ifstream& samplefile, Header& header);
static bool readHeader(QFile& samplefile, Header& header);
static void writeHeader(std::ofstream& samplefile, Header& header);
static void writeHeader(QFile& samplefile, Header& header);
// These functions guess from the filename, not contents
static bool getCenterFrequency(QString fileName, quint64& centerFrequency);
@ -123,13 +126,19 @@ private:
quint64 m_centerFrequency;
bool m_recordOn;
bool m_recordStart;
#ifdef ANDROID
QFile m_sampleFile;
#else
std::ofstream m_sampleFile;
#endif
QString m_currentFileName;
quint64 m_byteCount;
qint64 m_msShift;
int m_nbChannels;
void writeHeader();
static bool checkHeader(Header& header);
};
#endif // INCLUDE_WAV_FILERECORD_H

View File

@ -88,6 +88,12 @@ MainCore *MainCore::instance()
void MainCore::setLoggingOptions()
{
if (!m_logger)
{
qDebug() << "MainCore::setLoggingOptions: No logger.";
return;
}
m_logger->setConsoleMinMessageLevel(m_settings.getConsoleMinLogLevel());
if (m_settings.getUseLogFile())
@ -346,11 +352,15 @@ void MainCore::initPosition()
if (m_positionSource)
{
connect(m_positionSource, &QGeoPositionInfoSource::positionUpdated, this, &MainCore::positionUpdated);
connect(m_positionSource, &QGeoPositionInfoSource::updateTimeout, this, &MainCore::positionUpdateTimeout);
connect(m_positionSource, qOverload<QGeoPositionInfoSource::Error>(&QGeoPositionInfoSource::error), this, &MainCore::positionError);
m_position = m_positionSource->lastKnownPosition();
m_positionSource->setUpdateInterval(1000);
m_positionSource->startUpdates();
}
else
{
qDebug() << "MainCore::initPosition: No position source.";
qWarning() << "MainCore::initPosition: No position source.";
}
}
@ -372,3 +382,13 @@ void MainCore::positionUpdated(const QGeoPositionInfo &info)
}
}
}
void MainCore::positionUpdateTimeout()
{
qWarning() << "MainCore::positionUpdateTimeout: GPS signal lost";
}
void MainCore::positionError(QGeoPositionInfoSource::Error positioningError)
{
qWarning() << "MainCore::positionError: " << positioningError;
}

View File

@ -26,6 +26,7 @@
#include <QDateTime>
#include <QObject>
#include <QGeoPositionInfo>
#include <QGeoPositionInfoSource>
#include "export.h"
#include "settings/mainsettings.h"
@ -889,6 +890,8 @@ public:
public slots:
void positionUpdated(const QGeoPositionInfo &info);
void positionUpdateTimeout();
void positionError(QGeoPositionInfoSource::Error positioningError);
signals:
void deviceSetAdded(int index, DeviceAPI *device);

View File

@ -189,25 +189,29 @@ void Android::messageHandler(QtMsgType type, const QMessageLogContext& context,
}
const char * const local = report.toLocal8Bit().constData();
const char * const applicationName = "sdrangel";
int ret;
switch (type)
{
case QtDebugMsg:
__android_log_write(ANDROID_LOG_DEBUG, applicationName, local);
ret = __android_log_write(ANDROID_LOG_DEBUG, applicationName, local);
break;
case QtInfoMsg:
__android_log_write(ANDROID_LOG_INFO, applicationName, local);
ret = __android_log_write(ANDROID_LOG_INFO, applicationName, local);
break;
case QtWarningMsg:
__android_log_write(ANDROID_LOG_WARN, applicationName, local);
ret = __android_log_write(ANDROID_LOG_WARN, applicationName, local);
break;
case QtCriticalMsg:
__android_log_write(ANDROID_LOG_ERROR, applicationName, local);
ret = __android_log_write(ANDROID_LOG_ERROR, applicationName, local);
break;
case QtFatalMsg:
default:
__android_log_write(ANDROID_LOG_FATAL, applicationName, local);
ret = __android_log_write(ANDROID_LOG_FATAL, applicationName, local);
abort();
}
if (ret < 0) {
__android_log_write(ANDROID_LOG_ERROR, applicationName, "Error writing to log");
}
}
#endif // ANDROID

View File

@ -73,7 +73,20 @@ QString HttpDownloadManager::downloadDir()
void HttpDownloadManager::sslErrors(const QList<QSslError> &sslErrors)
{
for (const QSslError &error : sslErrors)
qCritical() << "HttpDownloadManager: SSL error: " << error.errorString();
{
qCritical() << "HttpDownloadManager: SSL error" << (int)error.error() << ": " << error.errorString();
#ifdef ANDROID
// On Android 6 (but not on 12), we always seem to get: "The issuer certificate of a locally looked up certificate could not be found"
// which causes downloads to fail, so ignore
if (error.error() == QSslError::UnableToGetLocalIssuerCertificate)
{
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
QList<QSslError> errorsThatCanBeIgnored;
errorsThatCanBeIgnored << QSslError(QSslError::UnableToGetLocalIssuerCertificate, error.certificate());
reply->ignoreSslErrors(errorsThatCanBeIgnored);
}
#endif
}
}
bool HttpDownloadManager::isHttpRedirect(QNetworkReply *reply)

View File

@ -12,7 +12,7 @@
</property>
<property name="minimumSize">
<size>
<width>460</width>
<width>400</width>
<height>460</height>
</size>
</property>

View File

@ -3078,6 +3078,7 @@ void MainWindow::orientationChanged(Qt::ScreenOrientation orientation)
setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::West);
} else {
setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::South);
}
#else
(void) orientation;
#endif