diff --git a/.github/workflows/call-api-check.yml b/.github/workflows/call-api-check.yml new file mode 100644 index 000000000..3f9cde70b --- /dev/null +++ b/.github/workflows/call-api-check.yml @@ -0,0 +1,13 @@ +name: apiCheck +on: + pull_request_target: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + api-check: + uses: linuxdeepin/.github/.github/workflows/api-check.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/call-debian-check.yml b/.github/workflows/call-debian-check.yml new file mode 100644 index 000000000..a35159d8c --- /dev/null +++ b/.github/workflows/call-debian-check.yml @@ -0,0 +1,13 @@ +name: debianCheck +on: + pull_request_target: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + debian-check: + uses: linuxdeepin/.github/.github/workflows/debian-check.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/call-static-check.yml b/.github/workflows/call-static-check.yml new file mode 100644 index 000000000..4ed868314 --- /dev/null +++ b/.github/workflows/call-static-check.yml @@ -0,0 +1,13 @@ +name: staticCheck +on: + pull_request_target: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + static-check: + uses: linuxdeepin/.github/.github/workflows/static-check.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/call-update-changelog.yml b/.github/workflows/call-update-changelog.yml new file mode 100644 index 000000000..b76b9b3ff --- /dev/null +++ b/.github/workflows/call-update-changelog.yml @@ -0,0 +1,53 @@ +name: Call update changelog + +on: + workflow_dispatch: + inputs: + version: + description: "Target version; leave empty to auto bump" + required: false + type: string + name: + description: "Maintainer name used in debian/changelog" + required: true + type: string + email: + description: "Maintainer email used in debian/changelog" + required: true + type: string + base_branch: + description: "Base branch to read and target" + required: false + default: master + type: string + distribution: + description: "Changelog distribution" + required: false + default: unstable + type: string + create_pr: + description: "Create a pull request after generating changelog" + required: false + default: true + type: boolean + +jobs: + update_changelog: + uses: linuxdeepin/.github/.github/workflows/update-changelog.yml@master + with: + version: ${{ inputs.version }} + name: ${{ inputs.name }} + email: ${{ inputs.email }} + base_branch: ${{ inputs.base_branch }} + distribution: ${{ inputs.distribution }} + create_pr: ${{ inputs.create_pr }} + secrets: inherit + + show_result: + runs-on: ubuntu-latest + needs: update_changelog + steps: + - name: Show update changelog result + run: | + echo "Version: ${{ needs.update_changelog.outputs.version }}" + echo "Pull Request URL: ${{ needs.update_changelog.outputs.pr_url }}" diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index e808a89b1..d1e8b0ab9 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -14,9 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - run: export - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + allow-unsafe-pr-checkout: true persist-credentials: false - uses: linuxdeepin/action-cppcheck@main with: diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..68baeaf14 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +#Qt +*.user + +*.qm + +moc_*.cpp + +moc_*.h + +qrc_*.cpp + +ui_*.h + +#else +*.autosave + +.cache/ + +#linglong building dir +linglong +build +.vscode +.cursor +.spec-workflow/ +.promptx/ \ No newline at end of file diff --git a/.omo/run-continuation/ses_07c60f6efffewjubKjvUAK1JPM.json b/.omo/run-continuation/ses_07c60f6efffewjubKjvUAK1JPM.json new file mode 100644 index 000000000..96e2325d8 --- /dev/null +++ b/.omo/run-continuation/ses_07c60f6efffewjubKjvUAK1JPM.json @@ -0,0 +1,10 @@ +{ + "sessionID": "ses_07c60f6efffewjubKjvUAK1JPM", + "updatedAt": "2026-07-21T07:43:16.026Z", + "sources": { + "background-task": { + "state": "idle", + "updatedAt": "2026-07-21T07:43:16.026Z" + } + } +} \ No newline at end of file diff --git a/.reuse/dep5 b/.reuse/dep5 index e812a6299..a97470306 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -13,8 +13,8 @@ Files: .gitignore Copyright: None License: CC0-1.0 -# xml toml json conf yaml sh -Files: *.toml *.json *.conf *.yaml *.sh *.transifexrc *.py *.clang-format +# xml toml json conf yaml sh service +Files: *.toml *.json *.conf *.yaml *.sh *.transifexrc *.py *.clang-format *.service Copyright: None License: CC0-1.0 diff --git a/.tx/config b/.tx/config index 99d207a2d..fd05613da 100644 --- a/.tx/config +++ b/.tx/config @@ -3,15 +3,8 @@ host = https://www.transifex.com minimum_perc = 80 mode = developer -[deepin-camera.deepin-camera-ts] +[o:linuxdeepin:p:deepin-camera:r:d12e399c782c32a4eaae13a8120d09b1] file_filter = src/translations/deepin-camera_.ts source_file = src/translations/deepin-camera_en_US.ts source_lang = en_US type = QT - -[deepin-camera.desktop-ts] -file_filter = src/translations/desktop/desktop_.ts -source_file = src/translations/desktop/desktop_en_US.ts -preTranslate_file = src/deepin-camera.desktop -source_lang = en_US -type = QT diff --git a/.tx/transifex.yaml b/.tx/transifex.yaml new file mode 100644 index 000000000..552089669 --- /dev/null +++ b/.tx/transifex.yaml @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: CC0-1.0 +filters: + - filter_type: file + source_file: src/translations/deepin-camera_en_US.ts + file_format: QT + source_language: en_US + translation_files_expression: src/translations/deepin-camera_.ts +settings: + pr_branch_name: transifex_update_ diff --git a/CMakeLists.txt b/CMakeLists.txt index c14914af3..15db74e86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,21 @@ cmake_minimum_required(VERSION 3.0) project(deepin-camera VERSION 1.0.0) -add_subdirectory(src) +if(CMAKE_BUILD_TYPE STREQUAL "Release") + message("Enable build hardening.") + + set(CMAKE_VERBOSE_MAKEFILE ON) -if (CMAKE_BUILD_TYPE STREQUAL "Debug") - add_subdirectory(tests) + set(HARDENING_FLAGS "-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=${CMAKE_SOURCE_DIR}=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${HARDENING_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now") endif() +add_subdirectory(src) + +#if (CMAKE_BUILD_TYPE STREQUAL "Debug") +# add_subdirectory(tests) +#endif() + diff --git a/debian/changelog b/debian/changelog index 744e63413..f97484812 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,391 @@ +deepin-camera (6.5.50) unstable; urgency=medium + + * chore: Update version to 6.5.50 + * build(linglong): add bare libavformat.so symlink to fix recording crash + * feat: adapt deepin-debug-config for dynamic log level control (3/3) + * feat: adapt deepin-debug-config for dynamic log level control (2/3) + * feat: adapt deepin-debug-config for dynamic log level control (1/3) + + -- zhanghongyuan Tue, 10 Nov 2026 10:24:15 +0800 + +deepin-camera (6.5.49) unstable; urgency=medium + + * chore: Update version to 6.5.49 + * build(linglong): migrate to buildext.apt declarative dependencies + * docs(camera): add Portuguese help manual + * fix(thumbnail): pass file URL when opening snapshot via DBus + * i18n: Translate deepin-camera_en_US.ts in ms + + -- re2zero Wed, 28 Oct 2026 14:09:31 +0800 + +deepin-camera (6.5.48) unstable; urgency=medium + + * fix(a11y): add AT-SPI names for exposure slider and image menu + * fix: update Arabic (ar) translations + + -- Liu Zhangjian Mon, 07 Sep 2026 13:27:52 +0800 + +deepin-camera (6.5.47) unstable; urgency=medium + + * fix(ui): enable QPainter antialiasing for Qt6 build + * chore: Sync by https://github.com/linuxdeepin/.github/commit/a300f8523d4876677112edab6a0772f7ad112976 + * fix: use real MJPG decoded size instead of negotiated resolution + * fix: sync resolution config after prepare_new_resolution (#372317) + * fix(ui): fix frozen separator lines in filter thumbnail column + * [skip CI] Translate deepin-camera_en_US.ts in pt + + -- Wang Yu Fri, 28 Aug 2026 08:56:59 +0800 + +deepin-camera (6.5.46) unstable; urgency=medium + + * chore: Update version to 6.5.46 + * fix: use SIGNAL/SLOT macro for sigYUVFrame connect + + -- zhanghongyuan Fri, 07 Aug 2026 09:02:04 +0800 + +deepin-camera (6.5.45) unstable; urgency=medium + + * chore: Update version to 6.5.45 + * fix(camera): fix OpenGL preview rendering and frame ownership (BUG-372435) + + -- zhanghongyuan Thu, 06 Aug 2026 19:22:06 +0800 + +deepin-camera (6.5.44) unstable; urgency=medium + + * chore: Update version to 6.5.44 + * fix(camera): prefer DConfig resolution over local config (BUG-366203) + * feat(config): add useRgbData config to control RGB preview mode + * fix(config): support low performance device config + * feat: enable the configuration for the preferred resolution. + * feat: enable the configuration for device blacklist. + * feat: enable the configuration for 8K preview. + * feat: Add the logic for switching cameras by USB groups. + * fix: Update cppcheck workflow to use checkout@v7 + * fix(exposureslider): always set focus after slider animation + * fix: add X-Deepin-Singleton flag to desktop file + + -- zhanghongyuan Thu, 30 Jul 2026 15:07:01 +0800 + +deepin-camera (6.5.43) unstable; urgency=medium + + * chore: Update version to 6.5.43 + * fix: remove deepin prefix from Chinese translations in desktop file + * fix(logging): add Qt logging filter rules initialization + * fix(videowidget): fix hi-dpi display scaling in video widget + * [skip CI] Translate deepin-camera_en_US.ts in ru + * [skip CI] Translate deepin-camera_en_US.ts in it + + -- zhanghongyuan Thu, 16 Jul 2026 21:17:33 +0800 + +deepin-camera (6.5.42) unstable; urgency=medium + + * chore: Update version to 6.5.42 + + -- zhanghongyuan Thu, 09 Jul 2026 13:15:38 +0800 + +deepin-camera (6.5.41) unstable; urgency=medium + + * chore: Update version to 6.5.41 + * [skip CI] Translate deepin-camera_en_US.ts in cs + * fix: Use D-Bus session query to get DistroID for file prefix + * fix: 异步调用 DBus 打开缩略图文件 + * fix(tests): migrate unit tests to Qt6 and fix DEADLYSIGNAL crash + + -- zhanghongyuan Wed, 17 Jun 2026 15:20:23 +0800 + +deepin-camera (6.5.40) unstable; urgency=medium + + * [skip CI] Translate deepin-camera_en_US.ts in ru + * [skip CI] Translate deepin-camera_en_US.ts in ru + * chore(CI): add debian check workflow + * fix: Add DConfig for preview with no delay. + * fix: In the prompt interface, the grid is hidden to improve user experience. + * feat: The prompt images for the FLM(support camera switch) have been opti... + * chore: Bump version to 6.5.39 + + -- Wang Yu Mon, 19 May 2026 20:06:24 +0800 + +deepin-camera (6.5.39) unstable; urgency=medium + + * chore: Unify linglong.yaml + + -- wangrong Thu, 05 Mar 2026 20:14:08 +0800 + +deepin-camera (6.5.38) unstable; urgency=medium + + * fix: Fix build fail + + -- wangrong Wed, 04 Feb 2026 16:17:47 +0800 + +deepin-camera (6.5.37) unstable; urgency=medium + + * chore: Update compiler flags for security enhancements + * build: modify debian/control to depends libqt5opengl5-dev + * build(debian): separate Qt5/Qt6 build configurations for V25/V20 support + * fix: Listen for SIGTERM and exit the application gracefully + * fix: audio_free_buffers() add a NULL check + * fix: Limit the available resolution to 3840x2160 + * feat: Listen for SIGTERM and exit the application gracefully + * feat: Issues of compile on v20 Qt5 + * feat(perf): add periodic decode timing measurements and reduce verbose logging + * fix: [log] verbosity configuration initialization order + * fix: When the screen is locked while using the camera, face recognition fails to work after unlocking + * fix: Temporarily block 8K resolution to avoid app crashes + * fix: Address potential data truncation issue + * chore: Correction of some misspelled words + * fix: Occasional abnormal color of title bar buttons + * feat: Add VA-API hardware acceleration for MJPEG decoding + * feat: Implement hardware acceleration driver configuration support + * feat: Add hardware acceleration driver configuration options + * feat: Add project-specific device filtering control + * fix: Filter ISP pipeline devices to show only standard cameras + * fix: Improve audio-video sync compatibility in camera recording + * fix: Improve close button visibility when USB camera is connected + * fix: Fix crash when enabling verbose logging + * fix: 移除透明磨砂标题栏 + * fix: 修复长时间录制视频音视频不同步 + * fix: 修复调整曝光度的显示问题 + * fix: 修复4k显示卡顿 + * fix: 修复相机上方边框显示一条白线 + * fix: Recording video with audio and video out of sync + + -- wangrong Wed, 04 Feb 2026 14:08:31 +0800 + +deepin-camera (6.5.36) unstable; urgency=medium + + * chore: Update version to 6.5.36 + * chore: Adapt dbus for linglong + * fix: 修复录制视频时卡住闪退 + * fix: check vaapi encoder fail + * fix: 修复mips问题 + * fix: 优化显示界面 (#346) + * fix: 优化相机显示与录制卡顿回跳问题 + * fix: optimize delay for show + * fix: m_isFlash is placed in the wrong place. + * fix: make screen flash stable during take photo + * fix(udev): add subsystem and devtype function loading + + -- zhanghongyuan Thu, 11 Dec 2025 18:47:05 +0800 + +deepin-camera (6.5.35) unstable; urgency=medium + + * feat(dbus): implement complete D-Bus interface for camera application + + -- zhanghongyuan Thu, 30 Oct 2025 19:20:31 +0800 + +deepin-camera (6.5.34) unstable; urgency=medium + + * fix: Add dynamic Qt version detection and resource deployment for linglong + + -- dengzhongyuan Thu, 23 Oct 2025 20:00:29 +0800 + +deepin-camera (6.5.33) unstable; urgency=medium + + * chore: Update linglong base and runtime + + -- wangrong Wed, 17 Sep 2025 11:15:21 +0800 + +deepin-camera (6.5.32) unstable; urgency=medium + + * Update version to 6.5.32. + + -- Tian ShiLin Thu, 21 Aug 2025 16:37:50 +0800 + +deepin-camera (6.5.31) unstable; urgency=medium + + * chore: Update desktop file translations + + -- dengzhongyuan Wed, 13 Aug 2025 14:15:42 +0800 + +deepin-camera (6.5.30) unstable; urgency=medium + + * chore: Add new Lao translation file + + -- dengzhongyuan Thu, 07 Aug 2025 19:55:41 +0800 + +deepin-camera (6.5.29) unstable; urgency=medium + + * chore: Update package URLs in linglong.yaml files for all architectures + + -- dengzhongyuan Tue, 05 Aug 2025 20:45:37 +0800 + +deepin-camera (6.5.28) unstable; urgency=medium + + * chore: Update package URLs and digests in linglong.yaml files + + -- dengzhongyuan Thu, 10 Jul 2025 18:00:02 +0800 + +deepin-camera (6.5.27) unstable; urgency=medium + + * chore: Update deepin-manual resources + + -- dengzhongyuan Wed, 09 Jul 2025 16:30:46 +0800 + +deepin-camera (6.5.26) unstable; urgency=medium + + * chore: Update deb sources for linglong yaml + + -- wangrong Wed, 02 Jul 2025 16:10:28 +0800 + +deepin-camera (6.5.25) unstable; urgency=medium + + * chore: Update deb sources for linglong yaml + + -- wangrong Wed, 02 Jul 2025 11:13:23 +0800 + +deepin-camera (6.5.24) unstable; urgency=medium + + * Update version to 6.5.24. + + -- Tian ShiLin Fri, 27 Jun 2025 17:19:24 +0800 + +deepin-camera (6.5.23) unstable; urgency=medium + + * fix: Update camera markdown formatting + + -- dengzhongyuan Tue, 24 Jun 2025 17:25:11 +0800 + +deepin-camera (6.5.22) unstable; urgency=medium + + * update version to 6.5.22. + + -- Tian ShiLin Mon, 23 Jun 2025 15:22:58 +0800 + +deepin-camera (6.5.21) unstable; urgency=medium + + * chore: Update dman's resources + + -- dengzhongyuan Thu, 19 Jun 2025 14:19:24 +0800 + +deepin-camera (6.5.20) unstable; urgency=medium + + * Update version to 6.5.20. + + -- Tian ShiLin Wed, 14 May 2025 11:13:34 +0800 + +deepin-camera (6.5.19) unstable; urgency=medium + + * Fix linglong build fail + + -- wangrong Thu, 17 Apr 2025 20:00:21 +0800 + +deepin-camera (6.5.18) unstable; urgency=medium + + * Update version to 6.5.18. + + -- dengzhongyuan Thu, 17 Apr 2025 13:41:30 +0800 + +deepin-camera (6.5.17) unstable; urgency=medium + + * Update version to 6.5.17 + + -- dengzhongyuan Wed, 16 Apr 2025 16:35:23 +0800 + +deepin-camera (6.5.16) unstable; urgency=medium + + * [deepin-camera] Updates for project Deepin Camera (#363) + + -- renbin Wed, 02 Apr 2025 15:47:08 +0800 + +deepin-camera (6.5.15) unstable; urgency=medium + + * refactor: remove unnecessary shell command from Camera service file (#359) + + -- renbin Thu, 06 Mar 2025 19:53:27 +0800 + +deepin-camera (6.5.14) unstable; urgency=medium + + * Bump version to 6.5.14 + + -- wangrong Thu, 27 Feb 2025 19:50:06 +0800 + +deepin-camera (6.5.13) unstable; urgency=medium + + * Update version to 6.5.13 + * Update linglong.yaml for new base + + -- wangrong Tue, 18 Feb 2025 16:38:49 +0800 + +deepin-camera (6.5.12) unstable; urgency=medium + + * Update version to 6.5.12 + + -- wangrong Fri, 07 Feb 2025 13:08:27 +0800 + +deepin-camera (6.5.11) unstable; urgency=medium + + * Update version to 6.5.11 + * Update linglong.yaml for qt6.8 runtime + + -- wangrong Thu, 23 Jan 2025 19:06:25 +0800 + +deepin-camera (6.5.10) unstable; urgency=medium + + * chore: New version 6.5.10. + + -- xiepengfei Mon, 20 Jan 2025 11:48:46 +0800 + +deepin-camera (6.5.9) unstable; urgency=medium + + * chore: New version 6.5.9. + + -- xiepengfei Fri, 20 Dec 2024 13:32:52 +0800 + +deepin-camera (6.5.8) unstable; urgency=medium + + * Update version to 6.5.8 + + -- xiepengfei Sat, 14 Dec 2024 14:25:26 +0800 + +deepin-camera (6.5.7) unstable; urgency=medium + + * Update version to 6.5.7 + + -- renbin Sat, 30 Nov 2024 18:40:11 +0800 + +deepin-camera (6.5.6) unstable; urgency=medium + + * chore: update linglong version + + -- renbin Sat, 30 Nov 2024 13:38:19 +0800 + +deepin-camera (6.5.5) unstable; urgency=medium + + *Fix compact mode adaptation problem + + -- Liu zheng Fri, 08 Nov 2024 13:30:48 +0800 + +deepin-camera (6.5.4) unstable; urgency=medium + + * remove kwayland-shell env + + -- Liu zheng Wed, 06 Nov 2024 16:54:40 +0800 + +deepin-camera (6.5.3) unstable; urgency=medium + + * chore: Update linglong build script. + + -- wangrong Sat, 19 Oct 2024 15:24:32 +0800 + +deepin-camera (6.5.2) unstable; urgency=medium + + * chore: linglong package slimming. + + -- wangrong Fri, 18 Oct 2024 13:02:23 +0800 + +deepin-camera (6.5.1) unstable; urgency=medium + + * tag 6.5.1 + * Adapt linglong. + + -- re2zero Fri, 13 Sep 2024 14:06:16 +0800 + +deepin-camera (6.5.0) unstable; urgency=medium + + * tag 6.5.0 + + -- xiepengfei Wed, 21 Aug 2024 14:52:33 +0800 + deepin-camera (6.0.11) unstable; urgency=medium * tag 6.0.11 diff --git a/debian/control b/debian/control index ba07a0071..40c74a97a 100644 --- a/debian/control +++ b/debian/control @@ -3,16 +3,40 @@ Section: utils Priority: optional Maintainer: Deepin Packages Builder Build-Depends: - debhelper (>=9),cmake, - pkg-config,qtbase5-dev,libdtkgui-dev,libdtkwidget-dev,qtmultimedia5-dev, - libavutil-dev, libavformat-dev, libavcodec-dev,libavfilter-dev,qttools5-dev, - qttools5-dev-tools,deepin-gettext-tools, - libv4l-dev,libsdl2-dev,portaudio19-dev,libpng-dev,libasound2-dev,libpciaccess-dev, - libusb-1.0-0-dev,zlib1g-dev,libudev-dev,libswscale-dev,libswresample-dev,libffmpegthumbnailer-dev, - libx11-dev,libva-dev,libimageeditor-dev, - libdwayland-dev | libkf5wayland-dev, - libwayland-dev, - libgstreamer1.0-dev,libgstreamer-plugins-base1.0-dev,gstreamer1.0-plugins-good + debhelper (>=9), + cmake, + pkg-config, + libavutil-dev, + libavformat-dev, + libavcodec-dev, + libavfilter-dev, + deepin-gettext-tools, + libv4l-dev, + libsdl2-dev, + portaudio19-dev, + libpng-dev, + libasound2-dev, + libpciaccess-dev, + libusb-1.0-0-dev, + zlib1g-dev, + libudev-dev, + libswscale-dev, + libswresample-dev, + libffmpegthumbnailer-dev, + libx11-dev, + libva-dev, + libimageeditor6-dev | libimageeditor-dev, + libgstreamer1.0-dev, + libgstreamer-plugins-base1.0-dev, + gstreamer1.0-plugins-good, +# Qt + qt6-base-dev, + libdtk6gui-dev, + libdtk6widget-dev, + qt6-multimedia-dev, + qt6-tools-dev, + qt6-tools-dev-tools, + qt6-svg-dev Standards-Version: 4.1.2 Homepage: http://www.deepin.org @@ -21,11 +45,7 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, - libavcodec58 (>= 7:4.0) | libavcodec60, libavformat58 (>= 7:4.1) | libavformat60, libavutil56 (>= 7:4.0) | libavutil58, libswresample3 (>= 7:4.0) | libswresample4, libswscale5 (>= 7:4.0) | libswscale7, - libdtkcore5, libdtkgui5, libdtkwidget5, libffmpegthumbnailer4v5, libgl1, libpng16-16 (>= 1.6.2-1), libportaudio2 (>= 19+svn20101113), libqt5concurrent5 (>= 5.0.2), libqt5core5a (>= 5.11.0~rc1), - libqt5dbus5 (>= 5.0.2), libqt5gui5 (>= 5.8.0), libqt5network5 (>= 5.0.2), libqt5printsupport5 (>= 5.0.2), libqt5widgets5 (>= 5.2.0~alpha1), libqt5x11extras5 (>= 5.6.0), libasound2 (>= 1.0.16), - libqt5xml5 (>= 5.0.2), libsdl2-2.0-0 (>= 2.0.9), libstdc++6 (>= 7), libudev1 (>= 183), libusb-1.0-0 (>= 2:1.0.8), libv4l-0 (>= 0.5.0), zlib1g (>= 1:1.1.4), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0), dde-api, - libdwaylandclient5 | libkf5waylandclient5, libdwaylandserver5 | libkf5waylandserver5 -Recommends: libimageeditor, uos-reporter, deepin-event-log + libavcodec58 (>= 7:4.0) | libavcodec60, libavformat58 (>= 7:4.1) | libavformat60, libavutil56 (>= 7:4.0) | libavutil58, libswresample3 (>= 7:4.0) | libswresample4, libswscale5 (>= 7:4.0) | libswscale7, libffmpegthumbnailer4v5, libgl1, libpng16-16 (>= 1.6.2-1), libportaudio2 (>= 19+svn20101113), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0) +Recommends: libimageeditor6 | libimageeditor, uos-reporter, deepin-event-log Description:this package software for UOS deepin-camera is a tool to view camera, and also a smart take photo and video in life. diff --git a/debian/control.1 b/debian/control.1 new file mode 100644 index 000000000..d507bd55c --- /dev/null +++ b/debian/control.1 @@ -0,0 +1,52 @@ +Source: deepin-camera +Section: utils +Priority: optional +Maintainer: Deepin Packages Builder +Build-Depends: + debhelper (>=9), + cmake, + pkg-config, + libavutil-dev, + libavformat-dev, + libavcodec-dev, + libavfilter-dev, + deepin-gettext-tools, + libv4l-dev, + libsdl2-dev, + portaudio19-dev, + libpng-dev, + libasound2-dev, + libpciaccess-dev, + libusb-1.0-0-dev, + zlib1g-dev, + libudev-dev, + libswscale-dev, + libswresample-dev, + libffmpegthumbnailer-dev, + libx11-dev, + libva-dev, + libimageeditor-dev, + libgstreamer1.0-dev, + libgstreamer-plugins-base1.0-dev, + gstreamer1.0-plugins-good, +# Qt + qtbase5-dev, + libdtkgui-dev, + libdtkwidget-dev, + qtmultimedia5-dev, + qttools5-dev, + qttools5-dev-tools, + libqt5svg5-dev, + libqt5opengl5-dev +Standards-Version: 4.1.2 +Homepage: http://www.deepin.org + +Package: deepin-camera +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + libavcodec58 (>= 7:4.0) | libavcodec60, libavformat58 (>= 7:4.1) | libavformat60, libavutil56 (>= 7:4.0) | libavutil58, libswresample3 (>= 7:4.0) | libswresample4, libswscale5 (>= 7:4.0) | libswscale7, libffmpegthumbnailer4v5, libgl1, libpng16-16 (>= 1.6.2-1), libportaudio2 (>= 19+svn20101113), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0) +Recommends: libimageeditor6 | libimageeditor, uos-reporter, deepin-event-log +Description:this package software for UOS + deepin-camera is a tool to view camera, and also a smart take photo and video in life. diff --git a/debian/rules b/debian/rules index 0a27c7039..ab1035174 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f include /usr/share/dpkg/default.mk -export QT_SELECT=5 +export QT_SELECT=6 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) MODULE_NAME=deepin-camera diff --git a/libcam/libcam/cameraconfig.c b/libcam/libcam/cameraconfig.c index 2fdf4a8a6..6cbb85657 100644 --- a/libcam/libcam/cameraconfig.c +++ b/libcam/libcam/cameraconfig.c @@ -48,27 +48,28 @@ static config_t my_config = .device_name = NULL, .device_location = NULL, .format = V4L2_PIX_FMT_MJPEG, - .render = "sdl", - .gui = "qt5", - .audio = "port", - .capture = "mmap", + .render = "sdl", + .gui = "qt5", + .audio = "port", + .capture = "mmap", .video_codec = "mjpg",/*yuy2,mjpg,mpeg,flv1,wmv1,mpg2,mp43,dx50,h264,hevc,vp80,vp90,theo*/ .audio_codec = "aac", - .profile_name = NULL, - .profile_path = NULL, + .profile_name = NULL, + .profile_path = NULL, .video_name = NULL, - .video_path = NULL, - .photo_name = NULL, - .photo_path = NULL, - .video_sufix = 1, - .photo_sufix = 1, - .fps_num = 1, + .video_path = NULL, + .photo_name = NULL, + .photo_path = NULL, + .video_sufix = 1, + .photo_sufix = 1, + .fps_num = 1, .fps_denom = 30, .audio_device = -1,/*will use API default in this case*/ - .video_fx = 0, /*no video fx*/ - .audio_fx = 0, /*no audio fx*/ - .osd_mask = 0, /*REND_OSD_NONE*/ - .crosshair_color=0x0000FF00, /*osd crosshair rgb color (0x00RRGGBB)*/ + .video_fx = 0, /*no video fx*/ + .audio_fx = 0, /*no audio fx*/ + .osd_mask = 0, /*REND_OSD_NONE*/ + .crosshair_color=0x0000FF00, /*osd crosshair rgb color (0x00RRGGBB)*/ + .verbosity=0 }; /* @@ -149,9 +150,10 @@ int config_save(const char *filename) fprintf(fp, "#OSD mask \n"); fprintf(fp, "osd_mask=0x%x\n", my_config.osd_mask); fprintf(fp, "crosshair_color=0x%x\n", my_config.crosshair_color); - + fprintf(fp, "#verbosity \n"); + fprintf(fp, "verbosity=%i\n", my_config.verbosity); /* return to system locale */ - setlocale(LC_NUMERIC, ""); + setlocale(LC_NUMERIC, ""); /* flush stream buffers to filesystem */ fflush(fp); @@ -231,7 +233,7 @@ int config_load(const char *filename) /*skip invalid lines */ if(!token || !value || strlen(token) < 1 || strlen(value) < 1) { - fprintf(stderr, "deepin-camera: (config) skiping invalid config entry at line %i\n", line); + fprintf(stderr, "deepin-camera: (config) skipping invalid config entry at line %i: %s\n", line, bufp); if(token) free(token); if(value) @@ -310,6 +312,10 @@ int config_load(const char *filename) free(my_config.photo_path); my_config.photo_path = strdup(value); } + else if(strcmp(token, "verbosity") == 0) + { + my_config.verbosity = (int) strtoul(value, NULL, 10); + } // else if(strcmp(token, "video_sufix") == 0) // { // my_config.video_sufix = (int) strtoul(value, NULL, 10); @@ -454,7 +460,9 @@ void config_update(options_t *my_options) free(my_config.photo_path); my_config.photo_path = strdup(my_options->photo_path); } - + /*check for verbosity options*/ + if(my_options->verbosity >= 0) + my_config.verbosity = my_options->verbosity; } /* diff --git a/libcam/libcam/cameraconfig.h b/libcam/libcam/cameraconfig.h index ed4f9b5e8..ac6e2d4cc 100644 --- a/libcam/libcam/cameraconfig.h +++ b/libcam/libcam/cameraconfig.h @@ -64,6 +64,7 @@ typedef struct _config_t { uint32_t audio_fx; uint32_t osd_mask; /*OSD bit mask*/ uint32_t crosshair_color; /*osd crosshair rgb color (0x00RRGGBB)*/ + int verbosity; } config_t; /*video sufix flag*/ diff --git a/libcam/libcam/camview.c b/libcam/libcam/camview.c index 45687bdd3..de2c944df 100644 --- a/libcam/libcam/camview.c +++ b/libcam/libcam/camview.c @@ -104,14 +104,21 @@ static int my_encoder_status = 0; static int is_wayland = 0; //是否是wayland的窗口管理器 +static int statusForceGles = 0; //forceGles 1,强走GLES + static int is_pgux = 0; //是否是pugx +static char libva_driver_name[200]; + +static char libvdpau_driver_name[200]; + static uint8_t soundTakePhoto = 1;//拍照声音提示 static char status_message[80]; static int encode_thread_running = 0; +static char project_id[200]; void set_video_time_capture(double video_time) { @@ -1344,8 +1351,20 @@ void set_wayland_status(int status) is_wayland = status; } +void set_forceGles(int status) +{ + statusForceGles = status; +} + +int is_forceGles() +{ + return statusForceGles; +} + int get_wayland_status() { + if (1 == is_forceGles()) + return 0; return is_wayland; } @@ -1368,3 +1387,64 @@ int get_pugx_status() { return is_pgux; } + +void set_project_id(const char *id) +{ + if (id != NULL) { + memset(project_id, 0, sizeof(project_id)); + strncpy(project_id, id, sizeof(project_id) - 1); + } else { + memset(project_id, 0, sizeof(project_id)); + } +} + +const char* get_project_id(void) +{ + return project_id; +} + +void set_libva_driver_name(const char *name) +{ + if (name != NULL) { + memset(libva_driver_name, 0, sizeof(libva_driver_name)); + strncpy(libva_driver_name, name, sizeof(libva_driver_name) - 1); + } else { + memset(libva_driver_name, 0, sizeof(libva_driver_name)); + } +} + +const char* get_libva_driver_name(void) +{ + return libva_driver_name; +} + +void set_libvdpau_driver_name(const char *name) +{ + if (name != NULL) { + memset(libvdpau_driver_name, 0, sizeof(libvdpau_driver_name)); + strncpy(libvdpau_driver_name, name, sizeof(libvdpau_driver_name) - 1); + } else { + memset(libvdpau_driver_name, 0, sizeof(libvdpau_driver_name)); + } +} + +const char* get_libvdpau_driver_name(void) +{ + return libvdpau_driver_name; +} + +int is_driver_available(const char *driver_name) +{ + /* Check if driver name is not NULL, not empty, and not "none" or similar invalid values */ + if (driver_name != NULL && + driver_name[0] != '\0' && + strcmp(driver_name, "none") != 0 && + strcmp(driver_name, "null") != 0 && + strcmp(driver_name, "invalid") != 0 && + strcmp(driver_name, "undefined") != 0 && + strcmp(driver_name, "unknown") != 0) { + return 1; /* Valid driver exists */ + } + + return 0; /* No valid driver */ +} diff --git a/libcam/libcam/camview.h b/libcam/libcam/camview.h index 5efd5b6ab..506b82456 100644 --- a/libcam/libcam/camview.h +++ b/libcam/libcam/camview.h @@ -34,6 +34,7 @@ extern "C" { #define VERTEXIN 0 #define TEXTUREIN 1 +#define UOS2025073011543 "UOS2025073011543" typedef struct _capture_loop_data_t { void *options; void *config; @@ -435,6 +436,94 @@ void set_pugx_status(int status); int get_pugx_status(); +void set_forceGles(int status); + +int is_forceGles(); + +/* + * set project id + * args: + * project_id - project id string + * + * asserts: + * none + * + * returns: none + */ +void set_project_id(const char *project_id); + +/* + * get project id + * args: + * none + * + * asserts: + * none + * + * returns: pointer to project id string + */ +const char* get_project_id(void); + +/* + * set libva driver name + * args: + * name - libva driver name string + * + * asserts: + * none + * + * returns: none + */ +void set_libva_driver_name(const char *name); + +/* + * get libva driver name + * args: + * none + * + * asserts: + * none + * + * returns: pointer to libva driver name string + */ +const char* get_libva_driver_name(void); + +/* + * set libvdpau driver name + * args: + * name - libvdpau driver name string + * + * asserts: + * none + * + * returns: none + */ +void set_libvdpau_driver_name(const char *name); + +/* + * get libvdpau driver name + * args: + * none + * + * asserts: + * none + * + * returns: pointer to libvdpau driver name string + */ +const char* get_libvdpau_driver_name(void); + +/* + * check if driver is available and valid + * args: + * driver_name - pointer to driver name string + * + * asserts: + * none + * + * returns: 1 if valid driver exists, 0 otherwise + */ +int is_driver_available(const char *driver_name); + #ifdef __cplusplus } #endif diff --git a/libcam/libcam_audio/audio.c b/libcam/libcam_audio/audio.c index 3195bfb67..930fb8792 100644 --- a/libcam/libcam_audio/audio.c +++ b/libcam/libcam_audio/audio.c @@ -131,7 +131,13 @@ static void audio_free_buffers() for(i = 0; i < AUDBUFF_NUM; ++i) { + // 在兆芯处理器上,audio_buffers[i].data 概率性出现空指针/重复释放的情况,所以这里需要增加判断 + if (audio_buffers[i].data == NULL) { + continue; + } + free(audio_buffers[i].data); + audio_buffers[i].data = NULL; } free(audio_buffers); diff --git a/libcam/libcam_encoder/encoder.c b/libcam/libcam_encoder/encoder.c index e6ff475e9..30f4354d7 100644 --- a/libcam/libcam_encoder/encoder.c +++ b/libcam/libcam_encoder/encoder.c @@ -45,6 +45,8 @@ #include #include +#include + #include "cameraconfig.h" #include "gviewencoder.h" #include "encoder.h" @@ -579,12 +581,10 @@ static encoder_video_context_t *encoder_video_init(encoder_context_t *encoder_ct else video_codec_data->codec_context->time_base = (AVRational) {1, 15}; //fallback to 15 fps (e.g gspca) - if (video_defaults->gop_size > 0) { - if (pgux == 1) { - video_codec_data->codec_context->gop_size = 3; - } else { - video_codec_data->codec_context->gop_size = video_defaults->gop_size; + video_codec_data->codec_context->gop_size = video_defaults->gop_size; + if (pgux == 1 || is_forceGles()) { + video_codec_data->codec_context->max_b_frames = 0; } } else { video_codec_data->codec_context->gop_size = video_codec_data->codec_context->time_base.den; @@ -592,6 +592,8 @@ static encoder_video_context_t *encoder_video_init(encoder_context_t *encoder_ct switch (video_defaults->codec_id) { case AV_CODEC_ID_H264: { video_codec_data->codec_context->me_range = 16; + video_codec_data->codec_context->gop_size = 250; + video_codec_data->codec_context->max_b_frames = 0; //av_dict_set(&video_codec_data->private_options, "rc_lookahead", "1", 0); getAvutil()->m_av_dict_set(&video_codec_data->private_options, "crf", "23", 0); getAvutil()->m_av_dict_set(&video_codec_data->private_options, "preset", "ultrafast", 0); @@ -1946,7 +1948,7 @@ int encoder_encode_audio(encoder_context_t *encoder_ctx, void *audio_data) void encoder_close(encoder_context_t *encoder_ctx) { encoder_clean_video_ring_buffer(); - + if (!encoder_ctx) return; @@ -2154,6 +2156,84 @@ static int set_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx, int return err; } +// 检查是否支持VAAPI硬编码的函数 +int check_vaapi_support() { + struct pci_device_iterator *iter; + struct pci_device *dev; + VADisplay va_display; + VAStatus status; + int major_version, minor_version; + int is_vaapi_supported = 0; + + // 初始化PCI系统 + if (pci_system_init() != 0) { + fprintf(stderr, "无法初始化PCI系统\n"); + return 0; + } + + iter = pci_slot_match_iterator_create(NULL); + if (iter == NULL) { + fprintf(stderr, "无法创建PCI插槽匹配迭代器\n"); + pci_system_cleanup(); + return 0; + } + + va_display = vaGetDisplay(NULL); // 这里假设使用X11,如果是Wayland需要使用vaGetDisplayWl + if (va_display == NULL) { + fprintf(stderr, "无法打开VA显示\n"); + pci_iterator_destroy(iter); + pci_system_cleanup(); + return 0; + } + + status = vaInitialize(va_display, &major_version, &minor_version); + if (status != VA_STATUS_SUCCESS) { + fprintf(stderr, "无法初始化VAAPI\n"); + vaTerminate(va_display); + pci_iterator_destroy(iter); + pci_system_cleanup(); + return 0; + } + + // 遍历PCI设备 + while ((dev = pci_device_next(iter)) != NULL) { + if (0x03 == ((dev->device_class >> 16) & 0x0ff)) { // 检查是否为显示设备 + printf("检测到显示设备: %04x:%04x\n", dev->vendor_id, dev->device_id); + + // 检查支持的配置文件 + int num_profiles; + VAProfile *profiles; + status = vaQueryConfigProfiles(va_display, NULL, &num_profiles); + if (status != VA_STATUS_SUCCESS) { + fprintf(stderr, "无法查询配置文件\n"); + continue; + } + + profiles = (VAProfile *)malloc(sizeof(VAProfile) * num_profiles); + status = vaQueryConfigProfiles(va_display, profiles, &num_profiles); + if (status != VA_STATUS_SUCCESS) { + fprintf(stderr, "无法查询配置文件\n"); + free(profiles); + continue; + } + + printf("支持的VAAPI配置文件:\n"); + for (int i = 0; i < num_profiles; i++) { + printf(" Profile %d\n", profiles[i]); + is_vaapi_supported = 1; // 如果找到任何支持的配置文件,设置支持标志 + } + + free(profiles); + break; // 找到一个支持的设备就可以退出循环 + } + } + + vaTerminate(va_display); + pci_iterator_destroy(iter); + pci_system_cleanup(); + + return is_vaapi_supported; +} /* @@ -2170,50 +2250,15 @@ static int set_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx, int static encoder_video_context_t *encoder_video_init_vaapi(encoder_context_t *encoder_ctx) { struct pci_device_iterator *iter; - struct pci_device *dev; int ret; is_vaapi = HW_VAAPI_OK; - ret = pci_system_init(); - if (ret != 0) { - fprintf(stderr, "Couldn't initialize PCI system\n"); + + if(!check_vaapi_support()) + { is_vaapi = HW_VAAPI_FAIL1; + fprintf(stderr, "no gpu card for vaapi\n"); return NULL; } - iter = pci_slot_match_iterator_create(NULL); - - while (1) { - if ((dev = pci_device_next(iter)) == NULL) { - is_vaapi = HW_VAAPI_FAIL1; - fprintf(stderr, "no gpu card for vaapi\n"); - return NULL; - } - - if (0x03 == ((dev->device_class >> 16) & 0x0ff)) { - fprintf(stderr, " CLASS 0x%02x subclass 0x%02x prog-if_name 0x%02x REVISION 0x%02x\n", - (dev->device_class >> 16) & 0x0ff, - (dev->device_class >> 8) & 0x0ff, - (dev->device_class >> 0) & 0x0ff, - dev->revision); - fprintf(stderr, "bus 0x%04x cardnum 0x%02x function 0x%02x:" - " vendor 0x%04x device 0x%04x\n", - dev->bus, - dev->dev, - dev->func, - dev->vendor_id, - dev->device_id); - - if (0x8086 == dev->vendor_id) { // intel gpu support vaapi, vendor_id :0x8086 can find from file pci.ids - //Iris Xe Graphics don't suppot vaapi, so softening coding. - if (dev->device_id == 0xa7a0) { - is_vaapi = HW_VAAPI_FAIL1; - return NULL; - } - fprintf(stderr, "try this gpu card for vaapi\n"); - break; - } - } - } - pci_system_cleanup(); //assertions assert(encoder_ctx != NULL); @@ -2233,6 +2278,7 @@ static encoder_video_context_t *encoder_video_init_vaapi(encoder_context_t *enco if (!video_defaults) { fprintf(stderr, "ENCODER: defaults for video codec index %i not found: using raw (direct input)\n", encoder_ctx->video_codec_ind); is_vaapi = HW_VAAPI_FAIL1; + return NULL; } encoder_video_context_t *enc_video_ctx = calloc(1, sizeof(encoder_video_context_t)); diff --git a/libcam/libcam_encoder/mp4.c b/libcam/libcam_encoder/mp4.c index f4ad06964..486608f1d 100644 --- a/libcam/libcam_encoder/mp4.c +++ b/libcam/libcam_encoder/mp4.c @@ -21,12 +21,21 @@ #include "mp4.h" #include +#include "camview.h" #include "load_libs.h" +#include // 为abs函数添加头文件 + +extern int verbosity; // 添加verbosity声明 static int64_t video_pts = 0; static int64_t audio_pts = 0; static int64_t first_pts = 0; static int64_t last_pts = 0; +static int64_t last_video_timestamp = 0; // 添加上一帧视频时间戳记录 + +// 添加同步检查变量 +static int frame_count = 0; +static int64_t last_sync_check_time = 0; AVFormatContext *mp4_create_context(const char *filename) { @@ -121,18 +130,67 @@ int mp4_write_packet( getAvformat()->m_av_write_frame(mp4_ctx, outpacket); set_video_time_capture((double)(pts)/1000/1000000); } else { - fprintf(stderr,"pts err:video_pts: %d last_pts: %d\n", video_pts, last_pts); + fprintf(stderr,"pts err:video_pts: %ld last_pts: %ld\n", video_pts, last_pts); } last_pts = video_pts; if (first_pts == 0) { first_pts = pts; + last_video_timestamp = pts; + video_pts = 0; // 第一个视频包的PTS为0 } else { - video_pts = (double)(pts - first_pts) / 1000000.0 / 33.0; + // 使用真实时间戳计算,而不是硬编码的33ms + // 将纳秒时间戳转换为帧数(基于time_base) + int64_t timestamp_diff = pts - first_pts; // 从开始录制的时间差(纳秒) + + // 根据编码器的time_base计算PTS + // time_base通常是1/fps,所以pts = 时间差 * fps + if (time_base.den > 0 && time_base.num > 0) { + video_pts = (timestamp_diff * time_base.den) / (time_base.num * 1000000000LL); + } else { + // 如果time_base无效,使用动态帧率计算 + int64_t frame_duration = pts - last_video_timestamp; + if (frame_duration > 0) { + // 基于实际帧间隔计算 + video_pts = timestamp_diff / frame_duration; + } else { + // 回退到固定帧率(但使用更精确的计算) + video_pts = timestamp_diff / 33333333LL; // 30fps = 33.33ms + } + } + + last_video_timestamp = pts; + if (video_pts == last_pts) //pts must be strictly incremented video_pts++; if(video_pts < last_pts) video_pts = last_pts + 1; + + if (verbosity > 2) { + fprintf(stderr, "video_pts: %ld (timestamp: %ld, first_pts: %ld)\n", + video_pts, pts, first_pts); + } + + // 每100帧检查一次音视频同步状态 + frame_count++; + if (frame_count % 100 == 0) { + int64_t video_time_ms = (pts - first_pts) / 1000000; // 视频实际时间(毫秒) + int64_t video_pts_time_ms = 0; + + // 根据time_base计算视频PTS对应的时间 + if (time_base.den > 0 && time_base.num > 0) { + video_pts_time_ms = (video_pts * time_base.num * 1000) / time_base.den; + } + + int64_t sync_diff = video_time_ms - video_pts_time_ms; + + if (verbosity > 0 && abs(sync_diff) > 100) { // 如果差异超过100ms + fprintf(stderr, "SYNC CHECK: Frame %d, Real time: %ldms, PTS time: %ldms, Diff: %ldms\n", + frame_count, video_time_ms, video_pts_time_ms, sync_diff); + } + + last_sync_check_time = pts; + } } } @@ -147,9 +205,31 @@ int mp4_write_packet( getLoadLibsInstance()->m_av_packet_rescale_ts(outpacket, time_base, audio_time); getAvformat()->m_av_write_frame(mp4_ctx, outpacket); - //AAC音频标准是1024 - //MP3音频标准是1152 - audio_pts+= 1024; + // 使用基于真实时间的音频PTS计算 + if (first_pts == 0) { + first_pts = pts; // 设置first_pts + audio_pts = 0; // 第一个音频包的PTS为0 + } else { + // 将纳秒时间戳转换为音频时间基准 + int64_t timestamp_diff = pts - first_pts; // 从开始录制的时间差(纳秒) + + if (time_base.den > 0 && time_base.num > 0) { + // 根据音频编码器的time_base计算PTS + audio_pts = (timestamp_diff * time_base.den) / (time_base.num * 1000000000LL); + } else { + // 如果time_base无效,使用采样率计算 + int sample_rate = codec_data->codec_context->sample_rate; + if (sample_rate <= 0) sample_rate = 48000; // 默认采样率 + + // 基于真实时间和采样率计算音频PTS + audio_pts = (timestamp_diff * sample_rate) / 1000000000LL; + } + } + + if (verbosity > 2) { + fprintf(stderr, "audio_pts: %ld (timestamp: %ld, first_pts: %ld)\n", + audio_pts, pts, first_pts); + } } if(outpacket->data){ @@ -166,6 +246,10 @@ void mp4_destroy_context(AVFormatContext *mp4_ctx) video_pts = 0; audio_pts = 0; first_pts = 0; + last_pts = 0; + last_video_timestamp = 0; // 重置新增的变量 + frame_count = 0; // 重置帧计数 + last_sync_check_time = 0; // 重置同步检查时间 if(mp4_ctx != NULL) { getAvformat()->m_avformat_free_context(mp4_ctx); diff --git a/libcam/libcam_encoder/mp4.h b/libcam/libcam_encoder/mp4.h index 22584d4b9..b43f7fd38 100644 --- a/libcam/libcam_encoder/mp4.h +++ b/libcam/libcam_encoder/mp4.h @@ -37,6 +37,7 @@ extern "C" { #include "encoder.h" #include "gviewencoder.h" #include "gview.h" +#include "camview.h" #ifdef __cplusplus } // endof extern "C" diff --git a/libcam/libcam_encoder/muxer.c b/libcam/libcam_encoder/muxer.c index 74b5aa9fe..7d10fcc86 100644 --- a/libcam/libcam_encoder/muxer.c +++ b/libcam/libcam_encoder/muxer.c @@ -263,6 +263,10 @@ void encoder_muxer_init(encoder_context_t *encoder_ctx, const char *filename) assert(encoder_ctx->enc_video_ctx != NULL); encoder_codec_data_t *video_codec_data = (encoder_codec_data_t *) encoder_ctx->enc_video_ctx->codec_data; + if(!video_codec_data) { + printf("deepin-camera: video_codec_data (encoder_ctx->enc_video_ctx->codec_data) is null\n"); + return; + } int video_codec_id = AV_CODEC_ID_NONE; diff --git a/libcam/libcam_v4l2core/frame_decoder.c b/libcam/libcam_v4l2core/frame_decoder.c index 5e4e01501..a5845b13d 100644 --- a/libcam/libcam_v4l2core/frame_decoder.c +++ b/libcam/libcam_v4l2core/frame_decoder.c @@ -99,7 +99,7 @@ int alloc_v4l2_frames(v4l2_dev_t *vd) exit(-1); } - vd->frame_queue[i].yuv_frame = calloc((uint8_t)framesizeIn, sizeof(uint8_t)); + vd->frame_queue[i].yuv_frame = calloc((size_t) framesizeIn, sizeof(uint8_t)); if(vd->frame_queue[i].yuv_frame == NULL) { fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (alloc_v4l2_frames): %s\n", strerror(errno)); @@ -108,7 +108,7 @@ int alloc_v4l2_frames(v4l2_dev_t *vd) } - vd->h264_last_IDR = calloc((uint8_t)(width * height), sizeof(uint8_t)); + vd->h264_last_IDR = calloc((size_t) width * (size_t) height, sizeof(uint8_t)); if(vd->h264_last_IDR == NULL) { fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (alloc_v4l2_frames): %s\n", strerror(errno)); @@ -134,6 +134,7 @@ int alloc_v4l2_frames(v4l2_dev_t *vd) /*frame queue*/ for(i=0; iframe_queue_size; ++i) { + vd->frame_queue[i].yuv_frame_max_size = (size_t) framesizeIn; vd->frame_queue[i].yuv_frame = calloc((size_t) framesizeIn, sizeof(uint8_t)); if(vd->frame_queue[i].yuv_frame == NULL) { @@ -346,6 +347,7 @@ void clean_v4l2_frames(v4l2_dev_t *vd) free(vd->frame_queue[i].yuv_frame); vd->frame_queue[i].yuv_frame = NULL; } + vd->frame_queue[i].yuv_frame_max_size = 0; } if(vd->h264_last_IDR) @@ -828,6 +830,44 @@ int decode_v4l2_frame(v4l2_dev_t *vd, v4l2_frame_buff_t *frame) //} if(verbosity > 3) fprintf(stderr, "V4L2_CORE: (jpeg decoder) decode frame of size %i\n", ret); + if (ret >= 0) + { + int real_w = 0; + int real_h = 0; + if (jpeg_get_decoded_size(&real_w, &real_h) == 0 && + real_w > 0 && real_h > 0 && + (real_w != frame->width || real_h != frame->height)) + { + if(verbosity > 0) + fprintf(stderr, "V4L2_CORE: (jpeg decoder) frame size %dx%d != negotiated %dx%d, using real size\n", + real_w, real_h, frame->width, frame->height); + frame->width = real_w; + frame->height = real_h; + } + + if (real_w > 0 && real_h > 0) + { + size_t need = (size_t)real_w * (size_t)real_h * 3 / 2; + if (need > 0 && need != frame->yuv_frame_max_size) + { + uint8_t *p = (uint8_t *)realloc(frame->yuv_frame, need); + if (p) + { + frame->yuv_frame = p; + frame->yuv_frame_max_size = need; + if(verbosity > 0) + fprintf(stderr, "V4L2_CORE: (jpeg decoder) yuv_frame trimmed %dx%d (%zu bytes)\n", + real_w, real_h, need); + } + else + { + if(verbosity > 0) + fprintf(stderr, "V4L2_CORE: (jpeg decoder) realloc failed for yuv_frame, keep old size\n"); + return E_ALLOC_ERR; + } + } + } + } ret = E_OK; break; diff --git a/libcam/libcam_v4l2core/gui.c b/libcam/libcam_v4l2core/gui.c index 2c5dd5d9a..c742c3527 100644 --- a/libcam/libcam_v4l2core/gui.c +++ b/libcam/libcam_v4l2core/gui.c @@ -690,7 +690,7 @@ void set_photo_name(const char *name) fprintf(stderr, "deepin-camera: no valid file extension for image file %s\n", name); - fprintf(stderr, "deepin-camera: using format %i\n", get_photo_format()); + fprintf(stderr, "deepin-camera: using format %i (1:IMG_FMT_JPG, 2:IMG_FMT_PNG, 3:IMG_FMT_BMP)\n", get_photo_format()); switch(get_photo_format()) { case IMG_FMT_JPG: diff --git a/libcam/libcam_v4l2core/gviewv4l2core.h b/libcam/libcam_v4l2core/gviewv4l2core.h index 7d8c7098a..85a0640ae 100644 --- a/libcam/libcam_v4l2core/gviewv4l2core.h +++ b/libcam/libcam_v4l2core/gviewv4l2core.h @@ -256,6 +256,7 @@ typedef struct _v4l2_frame_buff_t { uint64_t timestamp; // captured frame timestamp uint8_t *raw_frame; // pointer to raw frame + size_t yuv_frame_max_size; //maximum size for decoded yuv frame (bytes); MJPG is trimmed to real decoded size after 1st frame uint8_t *yuv_frame; // pointer to decoded yuv frame uint8_t *h264_frame; // pointer to regular or demultiplexed h264 frame uint8_t *tmp_buffer; //temporary buffer used in decoding diff --git a/libcam/libcam_v4l2core/jpeg_decoder.c b/libcam/libcam_v4l2core/jpeg_decoder.c index 072b96169..e3c8b1ccc 100644 --- a/libcam/libcam_v4l2core/jpeg_decoder.c +++ b/libcam/libcam_v4l2core/jpeg_decoder.c @@ -37,6 +37,7 @@ #include #include +#include "camview.h" #include "gviewv4l2core.h" #include "colorspaces.h" #include "frame_decoder.h" @@ -1356,9 +1357,11 @@ void jpeg_close_decoder() typedef struct _codec_data_t { - AVCodec *codec; - AVCodecContext *context; - AVFrame *picture; + AVCodec *codec; + AVCodecContext *context; + AVFrame *picture; + AVBufferRef *hw_device_ctx; // hardware device context + enum AVPixelFormat hw_pix_fmt; // hardware pixel format } codec_data_t; /* @@ -1378,73 +1381,112 @@ int jpeg_init_decoder(int width, int height) getLoadLibsInstance()->m_avcodec_init(); #endif #if !LIBAVCODEC_VER_AT_LEAST(58,9) - /* - * register all the codecs (we can also register only the codec - * we wish to have smaller code) - */ + /* + * register all the codecs (we can also register only the codec + * we wish to have smaller code) + */ getLoadLibsInstance()->m_avcodec_register_all(); #endif getAvutil()->m_av_log_set_level(AV_LOG_PANIC); - if(jpeg_ctx != NULL) - jpeg_close_decoder(); + if(jpeg_ctx != NULL) + jpeg_close_decoder(); - jpeg_ctx = calloc(1, sizeof(jpeg_decoder_context_t)); - if(jpeg_ctx == NULL) - { - fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (jpeg_init_decoder): %s\n", strerror(errno)); - exit(-1); - } + jpeg_ctx = calloc(1, sizeof(jpeg_decoder_context_t)); + if(jpeg_ctx == NULL) + { + fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (jpeg_init_decoder): %s\n", strerror(errno)); + exit(-1); + } - codec_data_t *codec_data = calloc(1, sizeof(codec_data_t)); - if(codec_data == NULL) - { - fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (jpeg_init_decoder): %s\n", strerror(errno)); - exit(-1); - } + codec_data_t *codec_data = calloc(1, sizeof(codec_data_t)); + if(codec_data == NULL) + { + fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (jpeg_init_decoder): %s\n", strerror(errno)); + exit(-1); + } codec_data->codec = getLoadLibsInstance()->m_avcodec_find_decoder(AV_CODEC_ID_MJPEG); - if(!codec_data->codec) - { - fprintf(stderr, "V4L2_CORE: (mjpeg decoder) codec not found\n"); - free(jpeg_ctx); - free(codec_data); - jpeg_ctx = NULL; - return E_NO_CODEC; - } + if(!codec_data->codec) + { + fprintf(stderr, "V4L2_CORE: (mjpeg decoder) codec not found\n"); + free(jpeg_ctx); + free(codec_data); + jpeg_ctx = NULL; + return E_NO_CODEC; + } #if LIBAVCODEC_VER_AT_LEAST(53,6) codec_data->context = getLoadLibsInstance()->m_avcodec_alloc_context3(codec_data->codec); - getLoadLibsInstance()->m_avcodec_get_context_defaults3 && getLoadLibsInstance()->m_avcodec_get_context_defaults3 (codec_data->context, codec_data->codec); + getLoadLibsInstance()->m_avcodec_get_context_defaults3 && getLoadLibsInstance()->m_avcodec_get_context_defaults3 (codec_data->context, codec_data->codec); #else - codec_data->context = getLoadLibsInstance()->m_avcodec_alloc_context(); - getLoadLibsInstance()->m_avcodec_get_context_defaults(codec_data->context); + codec_data->dec_ctx = getLoadLibsInstance()->m_avcodec_alloc_context(); + getLoadLibsInstance()->m_avcodec_get_context_defaults(codec_data->dec_ctx); #endif - if(codec_data->context == NULL) - { - fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (h264_init_decoder): %s\n", strerror(errno)); - exit(-1); - } - - codec_data->context->pix_fmt = AV_PIX_FMT_YUV422P; - codec_data->context->width = width; - codec_data->context->height = height; - //jpeg_ctx->context->dsp_mask = (FF_MM_MMX | FF_MM_MMXEXT | FF_MM_SSE); + if(codec_data->context == NULL) + { + fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (h264_init_decoder): %s\n", strerror(errno)); + exit(-1); + } + + codec_data->context->pix_fmt = AV_PIX_FMT_YUV422P; + //jpeg_ctx->context->dsp_mask = (FF_MM_MMX | FF_MM_MMXEXT | FF_MM_SSE); + + // Initialize hardware device context (VA-API) + if (is_driver_available(get_libva_driver_name())) { + int ret = getAvutil()->m_av_hwdevice_ctx_create(&codec_data->hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0); + if (ret < 0) { + fprintf(stderr, "V4L2_CORE: Unable to create VA-API hardware context\n"); + // If hardware decoding initialization fails, continue using software decoding + codec_data->hw_device_ctx = NULL; + } else { + codec_data->context->hw_device_ctx = getAvutil()->m_av_buffer_ref(codec_data->hw_device_ctx); + + // Check whether the decoder supports JPEG hardware acceleration + int ret = -1; + for (int i = 0;; i++) { + const AVCodecHWConfig *config = getLoadLibsInstance()->m_avcodec_get_hw_config(codec_data->codec, i); + if (!config) break; + + if (config->device_type == AV_HWDEVICE_TYPE_VAAPI && + config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX) { + codec_data->hw_pix_fmt = config->pix_fmt; + ret = 0; + fprintf(stderr, "V4L2_CORE: (mjpeg decoder) Find supported VA-API hardware acceleration configurations\n"); + break; + } + } + if (ret < 0) { + fprintf(stderr, "V4L2_CORE: (mjpeg decoder) The decoder does not support VA-API JPEG hardware acceleration and will use software decoding\n"); + // Cleaning up hardware device context + if (codec_data->hw_device_ctx) { + getAvutil()->m_av_buffer_unref(&codec_data->hw_device_ctx); + codec_data->hw_device_ctx = NULL; + } + } else { + fprintf(stderr, "V4L2_CORE: (mjpeg decoder) Use VA-API hardware acceleration, pixel format: %s\n", + getAvutil()->m_av_get_pix_fmt_name(codec_data->hw_pix_fmt)); + } + } + } #if LIBAVCODEC_VER_AT_LEAST(53,6) if (getLoadLibsInstance()->m_avcodec_open2(codec_data->context, codec_data->codec, NULL) < 0) #else - if (getLoadLibsInstance()->m_avcodec_open(codec_data->context, codec_data->codec) < 0) + if (getLoadLibsInstance()->m_avcodec_open(codec_data->dec_ctx, codec_data->codec) < 0) #endif - { - fprintf(stderr, "V4L2_CORE: (mjpeg decoder) couldn't open codec\n"); + { + fprintf(stderr, "V4L2_CORE: (mjpeg decoder) couldn't open codec\n"); + if (codec_data->hw_device_ctx) { + getAvutil()->m_av_buffer_unref(&codec_data->hw_device_ctx); + } getLoadLibsInstance()->m_avcodec_close(codec_data->context); - free(codec_data->context); - free(codec_data); - free(jpeg_ctx); - jpeg_ctx = NULL; - return E_NO_CODEC; - } + free(codec_data->context); + free(codec_data); + free(jpeg_ctx); + jpeg_ctx = NULL; + return E_NO_CODEC; + } #if LIBAVCODEC_VER_AT_LEAST(55,28) codec_data->picture = getAvutil()->m_av_frame_alloc(); @@ -1454,23 +1496,23 @@ int jpeg_init_decoder(int width, int height) getLoadLibsInstance()->m_avcodec_get_frame_defaults(codec_data->picture); #endif - /*alloc temp buffer*/ + /*alloc temp buffer*/ jpeg_ctx->tmp_frame = calloc((size_t)(width*height*2), sizeof(uint8_t)); - if(jpeg_ctx->tmp_frame == NULL) - { - fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (jpeg_init_decoder): %s\n", strerror(errno)); - exit(-1); - } + if(jpeg_ctx->tmp_frame == NULL) + { + fprintf(stderr, "V4L2_CORE: FATAL memory allocation failure (jpeg_init_decoder): %s\n", strerror(errno)); + exit(-1); + } #if LIBAVUTIL_VER_AT_LEAST(54,6) jpeg_ctx->pic_size = getAvutil()->m_av_image_get_buffer_size(codec_data->context->pix_fmt, width, height, 1); #else - jpeg_ctx->pic_size = avpicture_get_size(codec_data->context->pix_fmt, width, height); + jpeg_ctx->pic_size = avpicture_get_size(codec_data->dec_ctx->pix_fmt, width, height); #endif - jpeg_ctx->width = width; - jpeg_ctx->height = height; - jpeg_ctx->codec_data = codec_data; + jpeg_ctx->width = width; + jpeg_ctx->height = height; + jpeg_ctx->codec_data = codec_data; - return E_OK; + return E_OK; } /* @@ -1489,39 +1531,124 @@ int jpeg_init_decoder(int width, int height) */ int jpeg_decode(uint8_t *out_buf, uint8_t *in_buf, int size) { - /*asserts*/ - assert(jpeg_ctx != NULL); - assert(in_buf != NULL); - assert(out_buf != NULL); + /*asserts*/ + assert(jpeg_ctx != NULL); + assert(in_buf != NULL); + assert(out_buf != NULL); - AVPacket avpkt; + AVPacket avpkt; getLoadLibsInstance()->m_av_init_packet(&avpkt); - avpkt.size = size; - avpkt.data = in_buf; - - codec_data_t *codec_data = (codec_data_t *) jpeg_ctx->codec_data; - - int got_frame = 0; - int ret = libav_decode(codec_data->context, codec_data->picture, &got_frame, &avpkt); - - if(ret < 0) - { - fprintf(stderr, "V4L2_CORE: (jpeg decoder) error while decoding frame\n"); - return ret; - } - - if(got_frame) - { + avpkt.size = size; + avpkt.data = in_buf; + + codec_data_t *codec_data = (codec_data_t *) jpeg_ctx->codec_data; + + int got_frame = 0; + int ret = libav_decode(codec_data->context, codec_data->picture, &got_frame, &avpkt); + + if(ret < 0) + { + fprintf(stderr, "V4L2_CORE: (jpeg decoder) error while decoding frame, code(%d)\n", ret); + return ret; + } + + if(got_frame) + { + // check use hwdec work ok + if (codec_data->hw_device_ctx && codec_data->picture->format == codec_data->hw_pix_fmt) { + AVFrame *sw_frame = getAvutil()->m_av_frame_alloc(); + if (!sw_frame) { + fprintf(stderr, "V4L2_CORE: (jpeg decoder) Failed to allocate software frame\n"); + return -1; + } + + // Transfer hardware frame data to system memory + if (getAvutil()->m_av_hwframe_transfer_data(sw_frame, codec_data->picture, 0) < 0) { + fprintf(stderr, "V4L2_CORE: (jpeg decoder) Failed to transfer hardware frame data\n"); + getAvutil()->m_av_frame_free(&sw_frame); + return -1; + } + if (verbosity > 0) { + printf(" Width: %d pixels\n", sw_frame->width); + printf(" Height: %d pixels\n", sw_frame->height); + printf(" Pixel format: %s\n", getAvutil()->m_av_get_pix_fmt_name((enum AVPixelFormat)sw_frame->format)); + printf(" Hardware pixel format: %s\n", getAvutil()->m_av_get_pix_fmt_name(codec_data->hw_pix_fmt)); + printf(" Linesize[0]: %d\n", sw_frame->linesize[0]); + printf("-------------------------\n"); + printf(" - %s\n", getAvutil()->m_av_get_pix_fmt_name((enum AVPixelFormat)AV_PIX_FMT_YUV420P)); + } #if LIBAVUTIL_VER_AT_LEAST(54,6) - getAvutil()->m_av_image_copy_to_buffer(jpeg_ctx->tmp_frame, jpeg_ctx->pic_size, - (const uint8_t * const*) codec_data->picture->data, codec_data->picture->linesize, - codec_data->context->pix_fmt, jpeg_ctx->width, jpeg_ctx->height, 1); + { + int dec_w = sw_frame->width; + int dec_h = sw_frame->height; + int need = getAvutil()->m_av_image_get_buffer_size(sw_frame->format, dec_w, dec_h, 1); + if (need > 0 && (size_t)need > (size_t)jpeg_ctx->pic_size) { + uint8_t *p = realloc(jpeg_ctx->tmp_frame, (size_t)need); + if (!p) { + fprintf(stderr, "V4L2_CORE: (jpeg decoder) realloc failed for tmp_frame\n"); + getAvutil()->m_av_frame_free(&sw_frame); + return -1; + } + jpeg_ctx->tmp_frame = p; + jpeg_ctx->pic_size = need; + } + jpeg_ctx->width = dec_w; + jpeg_ctx->height = dec_h; + getAvutil()->m_av_image_copy_to_buffer(jpeg_ctx->tmp_frame, jpeg_ctx->pic_size, + (const uint8_t * const*) sw_frame->data, sw_frame->linesize, + sw_frame->format, dec_w, dec_h, 1); + } + if (sw_frame->format == AV_PIX_FMT_NV12) { + nv12_to_yu12(out_buf, jpeg_ctx->tmp_frame, jpeg_ctx->width, jpeg_ctx->height); + getAvutil()->m_av_frame_free(&sw_frame); + return jpeg_ctx->pic_size; + } #else - avpicture_layout((AVPicture *) codec_data->picture, codec_data->context->pix_fmt, - jpeg_ctx->width, jpeg_ctx->height, jpeg_ctx->tmp_frame, jpeg_ctx->pic_size); + avpicture_layout((AVPicture *) sw_frame, sw_frame->format, + jpeg_ctx->width, jpeg_ctx->height, jpeg_ctx->tmp_frame, jpeg_ctx->pic_size); #endif + getAvutil()->m_av_frame_free(&sw_frame); + } else { + // Software decoding: Use decoded frames directly +#if LIBAVUTIL_VER_AT_LEAST(54,6) + static int decodeCount = 0; + if (verbosity > 0) { + if (decodeCount % LOGGING_INTERVAL == LOGGING_INTERVAL - 1) { + printf("codec_data size(%dx%d) linesize(%d) format(%s) jpeg_ctx size(%dx%d) pic_size(%d)\n", codec_data->picture->width, codec_data->picture->height, + codec_data->picture->linesize[0], + getAvutil()->m_av_get_pix_fmt_name((enum AVPixelFormat)codec_data->picture->format), + jpeg_ctx->width, jpeg_ctx->height, jpeg_ctx->pic_size); + decodeCount = 0; + } + decodeCount++; + } + { + int dec_w = codec_data->picture->width; + int dec_h = codec_data->picture->height; + enum AVPixelFormat dec_fmt = codec_data->picture->format; + int need = getAvutil()->m_av_image_get_buffer_size(dec_fmt, dec_w, dec_h, 1); + if (need > 0 && (size_t)need > (size_t)jpeg_ctx->pic_size) { + uint8_t *p = realloc(jpeg_ctx->tmp_frame, (size_t)need); + if (!p) { + fprintf(stderr, "V4L2_CORE: (jpeg decoder) realloc failed for tmp_frame\n"); + return -1; + } + jpeg_ctx->tmp_frame = p; + jpeg_ctx->pic_size = need; + } + jpeg_ctx->width = dec_w; + jpeg_ctx->height = dec_h; + getAvutil()->m_av_image_copy_to_buffer(jpeg_ctx->tmp_frame, jpeg_ctx->pic_size, + (const uint8_t * const*) codec_data->picture->data, codec_data->picture->linesize, + dec_fmt, dec_w, dec_h, 1); + } +#else + avpicture_layout((AVPicture *) codec_data->picture, codec_data->dec_ctx->pix_fmt, + jpeg_ctx->width, jpeg_ctx->height, jpeg_ctx->tmp_frame, jpeg_ctx->pic_size); +#endif + } if (codec_data->context->pix_fmt == AV_PIX_FMT_YUVJ422P) { /* libavcodec output is in yuvj422p */ @@ -1539,12 +1666,33 @@ int jpeg_decode(uint8_t *out_buf, uint8_t *in_buf, int size) return jpeg_ctx->pic_size; }else return 0; - } - else - return 0; + } + else + return 0; } +/* + * get real (decoded) frame size + * args: + * out_w - pointer to receive real decoded width (may be NULL) + * out_h - pointer to receive real decoded height (may be NULL) + * + * asserts: + * none + * + * returns: 0 on success (valid size available); negative if not initialized + * or not decoded yet + */ +int jpeg_get_decoded_size(int *out_w, int *out_h) +{ + if (jpeg_ctx == NULL || jpeg_ctx->width <= 0 || jpeg_ctx->height <= 0) + return -1; + if (out_w) *out_w = jpeg_ctx->width; + if (out_h) *out_h = jpeg_ctx->height; + return 0; +} + /* * close (m)jpeg decoder context * args: @@ -1557,32 +1705,37 @@ int jpeg_decode(uint8_t *out_buf, uint8_t *in_buf, int size) */ void jpeg_close_decoder() { - if(jpeg_ctx == NULL) - return; + if(jpeg_ctx == NULL) + return; - codec_data_t *codec_data = (codec_data_t *) jpeg_ctx->codec_data; + codec_data_t *codec_data = (codec_data_t *) jpeg_ctx->codec_data; getLoadLibsInstance()->m_avcodec_close(codec_data->context); - free(codec_data->context); + free(codec_data->context); #if LIBAVCODEC_VER_AT_LEAST(55,28) getAvutil()->m_av_frame_free(&codec_data->picture); #else - #if LIBAVCODEC_VER_AT_LEAST(54,28) - getLoadLibsInstance()->m_avcodec_free_frame(&codec_data->picture); - #else - av_freep(&codec_data->picture); - #endif +#if LIBAVCODEC_VER_AT_LEAST(54,28) + getLoadLibsInstance()->m_avcodec_free_frame(&codec_data->picture); +#else + av_freep(&codec_data->picture); +#endif #endif - if(jpeg_ctx->tmp_frame) - free(jpeg_ctx->tmp_frame); + // Release hardware device context + if (codec_data->hw_device_ctx) { + getAvutil()->m_av_buffer_unref(&codec_data->hw_device_ctx); + } - free(codec_data); - free(jpeg_ctx); + if(jpeg_ctx->tmp_frame) + free(jpeg_ctx->tmp_frame); - jpeg_ctx = NULL; + free(codec_data); + free(jpeg_ctx); + + jpeg_ctx = NULL; } #endif diff --git a/libcam/libcam_v4l2core/jpeg_decoder.h b/libcam/libcam_v4l2core/jpeg_decoder.h index f3fa81029..f9aa7cedc 100644 --- a/libcam/libcam_v4l2core/jpeg_decoder.h +++ b/libcam/libcam_v4l2core/jpeg_decoder.h @@ -75,6 +75,16 @@ int jpeg_init_decoder(int width, int height); */ int jpeg_decode(uint8_t *out_buf, uint8_t *in_buf, int size); +/* + * get real (decoded) frame size after jpeg_decode() + * args: + * out_w - pointer to receive real decoded width (may be NULL) + * out_h - pointer to receive real decoded height (may be NULL) + * + * returns: 0 - OK; negative - not initialized or not decoded yet + */ +int jpeg_get_decoded_size(int *out_w, int *out_h); + /* * close (m)jpeg decoder context * args: diff --git a/libcam/libcam_v4l2core/v4l2_controls.c b/libcam/libcam_v4l2core/v4l2_controls.c index bfb001d9b..1f7208528 100644 --- a/libcam/libcam_v4l2core/v4l2_controls.c +++ b/libcam/libcam_v4l2core/v4l2_controls.c @@ -180,32 +180,24 @@ static void print_control(v4l2_ctrl_t *control, int i) printf("\tmin:%d max:%d step:%d def:%d curr:%d\n", control->control.minimum, control->control.maximum, control->control.step, control->control.default_value, control->value); - free(control->name); - control->name=NULL; break; case V4L2_CTRL_TYPE_INTEGER64: printf("control[%d]:(int64) 0x%x '%s'\n",i ,control->control.id, control->name); printf ("\tcurr:%" PRId64 "\n", control->value64); - free(control->name); - control->name=NULL; break; case V4L2_CTRL_TYPE_STRING: printf("control[%d]:(str) 0x%x '%s'\n",i ,control->control.id, control->name); printf ("\tmin:%d max:%d step:%d curr: %s\n", control->control.minimum, control->control.maximum, - control->control.step, control->string); - free(control->name); - control->name=NULL; + control->control.step, control->string); break; case V4L2_CTRL_TYPE_BOOLEAN: printf("control[%d]:(bool) 0x%x '%s'\n",i ,control->control.id, control->name); printf ("\tdef:%d curr:%d\n", - control->control.default_value, control->value); - free(control->name); - control->name=NULL; + control->control.default_value, control->value); break; case V4L2_CTRL_TYPE_MENU: @@ -213,10 +205,8 @@ static void print_control(v4l2_ctrl_t *control, int i) printf("\tmin:%d max:%d def:%d curr:%d\n", control->control.minimum, control->control.maximum, control->control.default_value, control->value); - for (j = 0; (__s32)control->menu[j].index <= control->control.maximum; j++) + for (j = 0; (__s32)control->menu[j].index <= control->control.maximum; j++) printf("\tmenu[%d]: [%d] -> '%s'\n", j, control->menu[j].index, control->menu_entry[j]); - free(control->name); - control->name=NULL; break; case V4L2_CTRL_TYPE_INTEGER_MENU: @@ -224,18 +214,14 @@ static void print_control(v4l2_ctrl_t *control, int i) printf("\tmin:%d max:%d def:%d curr:%d\n", control->control.minimum, control->control.maximum, control->control.default_value, control->value); - for (j = 0; (__s32)control->menu[j].index <= control->control.maximum; j++) + for (j = 0; (__s32)control->menu[j].index <= control->control.maximum; j++) printf("\tmenu[%d]: [%d] -> %" PRId64 " (0x%" PRIx64 ")\n", j, control->menu[j].index, (int64_t) control->menu[j].value, (int64_t) control->menu[j].value); - free(control->name); - control->name=NULL; - break; + break; case V4L2_CTRL_TYPE_BUTTON: printf("control[%d]:(button) 0x%x '%s'\n",i ,control->control.id, control->name); - free(control->name); - control->name=NULL; break; case V4L2_CTRL_TYPE_BITMASK: @@ -249,8 +235,6 @@ static void print_control(v4l2_ctrl_t *control, int i) default: printf("control[%d]:(unknown - 0x%x) 0x%x '%s'\n",i ,control->control.type, control->control.id, control->control.name); - free(control->name); - control->name=NULL; break; } } diff --git a/libcam/libcam_v4l2core/v4l2_core.c b/libcam/libcam_v4l2core/v4l2_core.c index 2824ddfad..3af06a4c5 100644 --- a/libcam/libcam_v4l2core/v4l2_core.c +++ b/libcam/libcam_v4l2core/v4l2_core.c @@ -1115,7 +1115,7 @@ static int process_input_buffer(v4l2_dev_t *vd) * driver timestamp is unreliable * use monotonic system time */ - vd->frame_queue[qind].timestamp = ns_time_monotonic(); + vd->frame_queue[qind].timestamp = ns_time_monotonic(); vd->frame_queue[qind].index = (int)vd->buf.index; @@ -1696,18 +1696,44 @@ void v4l2core_prepare_valid_resolution(v4l2_dev_t *vd) } } - for(int i=0; i < vd->list_stream_formats[format_index].numb_res; i++) - { - if( my_width <= vd->list_stream_formats[format_index].list_stream_cap[i].width && - my_height <= vd->list_stream_formats[format_index].list_stream_cap[i].height && - ((vd->list_stream_formats[format_index].list_stream_cap[i].width % 8) == 0 - && (vd->list_stream_formats[format_index].list_stream_cap[i].width % 16) == 0 - && (vd->list_stream_formats[format_index].list_stream_cap[i].height % 8) == 0)) - { - my_width = vd->list_stream_formats[format_index].list_stream_cap[i].width; - my_height = vd->list_stream_formats[format_index].list_stream_cap[i].height; - } - } + int found_preferred = 0; // 是否找到首选分辨率 + int pref_w = get_preferred_resolution_width(); + int pref_h = get_preferred_resolution_height(); + // 最大分辨率 + int max_width = 0; + int max_height = 0; + // 通过一次遍历,找出首选分辨率,同时找出最大分辨率。虽然最大分辨率可能用不到,但是便于调试分析 + for (int i = 0; i < vd->list_stream_formats[format_index].numb_res; i++) + { + int w = vd->list_stream_formats[format_index].list_stream_cap[i].width; + int h = vd->list_stream_formats[format_index].list_stream_cap[i].height; + if (is_valid_resolution(w, h)) + { + // 找出首选分辨率 + if (!found_preferred && pref_w != 0 && pref_h != 0 && w == pref_w && h == pref_h) { + found_preferred = 1; + } + + // 找出最大分辨率 + if (w > max_width || (w == max_width && h > max_height)) { + max_width = w; + max_height = h; + } + } + } + if (found_preferred) { + // 有首选分辨率,使用首选分辨率 + my_width = pref_w; + my_height = pref_h; + } else { + // 没有首选分辨率,使用最大分辨率 + my_width = max_width; + my_height = max_height; + // 极端情况,没有可用分辨率,发出错误提示 + if (max_width == 0 || max_height == 0) { + fprintf(stderr, "V4L2_CORE: ERROR: no valid resolution found!\n"); + } + } } /* diff --git a/libcam/libcam_v4l2core/v4l2_core.h b/libcam/libcam_v4l2core/v4l2_core.h index 0d9ada9a5..de1bb3bd9 100644 --- a/libcam/libcam_v4l2core/v4l2_core.h +++ b/libcam/libcam_v4l2core/v4l2_core.h @@ -91,3 +91,8 @@ struct _v4l2_dev_t }; void /*__attribute__ ((constructor))*/ v4l2core_init(); #endif + +/* + * logging interval + */ +#define LOGGING_INTERVAL 5 diff --git a/libcam/libcam_v4l2core/v4l2_devices.c b/libcam/libcam_v4l2core/v4l2_devices.c index bb9c48a63..6890fdd54 100644 --- a/libcam/libcam_v4l2core/v4l2_devices.c +++ b/libcam/libcam_v4l2core/v4l2_devices.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "gviewv4l2core.h" #include "v4l2_devices.h" @@ -124,6 +125,93 @@ static void free_device_list() my_device_list.list_devices = NULL; } +/* + * 检查设备是否为标准摄像头设备 + * args: + * fd - 设备文件描述符 + * v4l2_cap - 设备能力结构体 + * device_path - 设备节点路径 (如 /dev/video0) + * + * returns: 1 if standard camera, 0 if not + */ +static int is_standard_camera_device(int fd, struct v4l2_capability *cap, const char *device_path) +{ + struct v4l2_fmtdesc fmt; + int has_standard_format = 0; + + // 1. 检查是否支持标准用户级视频格式 + memset(&fmt, 0, sizeof(fmt)); + fmt.index = 0; + fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + // 标准视频格式列表 + static const uint32_t standard_formats[] = { + V4L2_PIX_FMT_MJPEG, // Motion-JPEG + V4L2_PIX_FMT_YUYV, // YUYV 4:2:2 + V4L2_PIX_FMT_H264, // H.264 + V4L2_PIX_FMT_UYVY, // UYVY 4:2:2 + V4L2_PIX_FMT_NV12, // Y/UV 4:2:0 + V4L2_PIX_FMT_NV21, // Y/VU 4:2:0 + V4L2_PIX_FMT_YUV420 // YUV 4:2:0 + }; + static const int num_standard_formats = sizeof(standard_formats) / sizeof(standard_formats[0]); + + while (xioctl(fd, VIDIOC_ENUM_FMT, &fmt) == 0) { + // 检查是否支持标准格式 + for (int i = 0; i < num_standard_formats; i++) { + if (fmt.pixelformat == standard_formats[i]) { + has_standard_format = 1; + break; + } + } + if (has_standard_format) { + break; // 找到标准格式后立即退出 + } + fmt.index++; + } + + // 2. 检查设备驱动和名称,过滤ISP设备 + static const char* isp_driver_keywords[] = { + "rkcif", "rkisp" + }; + static const char* isp_card_keywords[] = { + "rkisp", "rkcif", "statistics", "mainpath", "selfpath" + }; + static const int num_driver_keywords = sizeof(isp_driver_keywords) / sizeof(isp_driver_keywords[0]); + static const int num_card_keywords = sizeof(isp_card_keywords) / sizeof(isp_card_keywords[0]); + + int is_isp_device = 0; + + // 检查驱动名称 + for (int i = 0; i < num_driver_keywords && !is_isp_device; i++) { + if (strstr((char *)cap->driver, isp_driver_keywords[i]) != NULL) { + is_isp_device = 1; + } + } + + // 检查card名称 + for (int i = 0; i < num_card_keywords && !is_isp_device; i++) { + if (strstr((char *)cap->card, isp_card_keywords[i]) != NULL) { + is_isp_device = 1; + } + } + + // 3. 可以添加更多过滤条件 + // 检查是否为UVC驱动(标准USB摄像头) + int is_uvc_device = (strstr((char *)cap->driver, "uvcvideo") != NULL); + + // 4. 检查总线信息(USB设备通常包含"usb") + int is_usb_device = (strstr((char *)cap->bus_info, "usb") != NULL); + + if (verbosity > 1) { + printf("V4L2_CORE: Device check - %s [%s]: standard_fmt=%d, is_isp=%d, is_uvc=%d, is_usb=%d\n", + device_path, cap->card, has_standard_format, is_isp_device, is_uvc_device, is_usb_device); + } + + // 返回判断结果:有标准格式且不是ISP设备 + return (has_standard_format && !is_isp_device); +} + /* * enumerate available v4l2 devices * and creates list in vd->list_devices @@ -226,6 +314,19 @@ int enum_v4l2_devices() getV4l2()->m_v4l2_close(fd); continue; /*next dir entry*/ } + + // when project_id equals UOS2025073011543 filter out ISP devices + const char* current_project_id = get_project_id(); + if (current_project_id != NULL && strcmp(current_project_id, UOS2025073011543) == 0) { + if (!is_standard_camera_device(fd, &v4l2_cap, v4l2_device)) { + if (verbosity > 0) { + fprintf(stderr, "V4L2_CORE: ignore device %s - not a standard camera (driver: %s, card: %s) [project_id: %s]\n", + v4l2_device, v4l2_cap.driver, v4l2_cap.card, current_project_id); + } + getV4l2()->m_v4l2_close(fd); + continue; /*next dir entry*/ + } + } #endif getV4l2()->m_v4l2_close(fd); @@ -294,6 +395,7 @@ int enum_v4l2_devices() getUdev()->m_udev_enumerate_unref(enumerate); my_device_list.num_devices = num_dev; + printf("V4L2_CORE: num_devices is %d\n", num_dev); return(E_OK); } @@ -335,16 +437,16 @@ void v4l2core_init_device_list() * none * * returns: - * videodevice index in device list [0 - num_devices[ or -1 on error + * videodevice index in device list [0 - num_devices] or -1 on error */ int v4l2core_get_device_index(const char *videodevice) { - if(my_device_list.num_devices > 0 && my_device_list.list_devices != NULL && videodevice != NULL) + if(my_device_list.num_devices > 0 && my_device_list.list_devices != NULL && videodevice != NULL) { int dev_index = 0; for(dev_index = 0; dev_index < my_device_list.num_devices; ++dev_index) { - fprintf(stderr,"v4l2core_get_device_index dev_index(%d) videodevice:%x device:%x\n", dev_index, (unsigned int)videodevice, (unsigned int)(my_device_list.list_devices[dev_index].device)); + fprintf(stderr,"V4L2CORE: v4l2core_get_device_index: dev_index(%d) videodevice(%s) device(%s)\n", dev_index, videodevice, my_device_list.list_devices[dev_index].device); if(strcmp(videodevice, my_device_list.list_devices[dev_index].device)==0) { my_device_list.list_devices[dev_index].current = 1; diff --git a/libcam/libcam_v4l2core/v4l2_formats.c b/libcam/libcam_v4l2core/v4l2_formats.c index 161c3ee57..9e705e90d 100644 --- a/libcam/libcam_v4l2core/v4l2_formats.c +++ b/libcam/libcam_v4l2core/v4l2_formats.c @@ -119,6 +119,12 @@ static uint32_t decoder_supported_formats[] = 0 }; +// 是否开启8K预览 +static int enable_8k_preview = 0; +// 首选分辨率 +static int preferred_resolution_width = 0; +static int preferred_resolution_height = 0; + /* FIXME: doesn't support bigendian formats=> fourcc | (1 << 31) * get pixelformat from fourcc * args: @@ -678,27 +684,34 @@ int get_format_resolution_index(v4l2_dev_t *vd, int format, int width, int heigh return (-1); } + // 查找输入的分辨率是否在支持的分辨率列表中 + // 由于上游guvcview项目在解码3840x2160分辨率以上时会出现异常(出现条纹、崩溃等),所以我们需要限制可用分辨率到3840x2160 int i=0; for(i=0; i < vd->list_stream_formats[format].numb_res; i++) { - if( width == vd->list_stream_formats[format].list_stream_cap[i].width && - height == vd->list_stream_formats[format].list_stream_cap[i].height) - return (i); + int w = vd->list_stream_formats[format].list_stream_cap[i].width; + int h = vd->list_stream_formats[format].list_stream_cap[i].height; + if (width == w && height == h && is_valid_resolution(w, h)) { + return i; + } + } + + // 查找可以支持的最大分辨率 + // 由于上游guvcview项目在解码3840x2160分辨率以上时会出现异常(出现条纹、崩溃等),所以我们需要限制可用分辨率到3840x2160 + int tempwidth = 0; + int tempheight = 0; + int index = -1; + for(i=0; i < vd->list_stream_formats[format].numb_res; i++) + { + int w = vd->list_stream_formats[format].list_stream_cap[i].width; + int h = vd->list_stream_formats[format].list_stream_cap[i].height; + if (tempwidth <= w && tempheight <= h && is_valid_resolution(w, h)) { + tempwidth = w; + tempheight = h; + index = i; + } } - int tempwidth = 0; - int tempheight = 0; - int index = -1; - for(i=0; i < vd->list_stream_formats[format].numb_res; i++) - { - if( tempwidth <= vd->list_stream_formats[format].list_stream_cap[i].width && - tempheight <= vd->list_stream_formats[format].list_stream_cap[i].height) - { - tempwidth = vd->list_stream_formats[format].list_stream_cap[i].width; - tempheight = vd->list_stream_formats[format].list_stream_cap[i].height; - index = i; - } - } - return (index); + return index; } /* @@ -738,3 +751,100 @@ void free_frame_formats(v4l2_dev_t *vd) free(vd->list_stream_formats); vd->list_stream_formats = NULL; } + +int is_valid_resolution(int width, int height) +{ + // 希沃的8K分辨率是8192x2772,过多限制会导致此分辨率不可用 + if (enable_8k_preview) { + return (width > 0 && height > 0) + && (width % 16 == 0 && height % 4 == 0); + } + + // 由于上游guvcview项目在解码3840x2160分辨率以上时会出现异常(出现条纹、崩溃等),所以我们需要限制可用分辨率到3840x2160 + return (width > 0 && height > 0) + && (width <= MAX_WIDTH_LIMIT && height <= MAX_HEIGHT_LIMIT) + && (width % 16 == 0 && height % 8 == 0); +} + +/* + * set enable 8k preview + * args: + * enable - enable 8k preview + * + * asserts: + * none + * + * returns: void + */ +void set_enable_8k_preview(int enable) +{ + enable_8k_preview = enable; +} + +/* + * check if 8k preview is enabled + * args: + * none + * + * asserts: + * none + * + * returns: TRUE(1) if enabled + * FALSE(0) if not + */ +int is_enable_8k_preview() +{ + return enable_8k_preview; +} + +/** + * set preferred resolution + * args: + * width - preferred width + * height - preferred height + * + * asserts: + * none + * + * returns: void + */ +void set_preferred_resolution(int width, int height) +{ + if (width <= 0 || height <= 0) { + printf("V4L2_CORE: Invalid preferred resolution: %dx%d\n", width, height); + return; + } + + preferred_resolution_width = width; + preferred_resolution_height = height; +} + +/** + * get preferred resolution width + * args: + * none + * + * asserts: + * none + * + * returns: preferred width + */ +int get_preferred_resolution_width() +{ + return preferred_resolution_width; +} + +/** + * get preferred resolution height + * args: + * none + * + * asserts: + * none + * + * returns: preferred height + */ +int get_preferred_resolution_height() +{ + return preferred_resolution_height; +} diff --git a/libcam/libcam_v4l2core/v4l2_formats.h b/libcam/libcam_v4l2core/v4l2_formats.h index 61c1e7f35..0ce1a362e 100644 --- a/libcam/libcam_v4l2core/v4l2_formats.h +++ b/libcam/libcam_v4l2core/v4l2_formats.h @@ -24,6 +24,9 @@ #include "gviewv4l2core.h" #include "v4l2_core.h" +#define MAX_WIDTH_LIMIT 3840 +#define MAX_HEIGHT_LIMIT 2160 + /* * check pixelformat against decoder support formats * args: @@ -93,4 +96,80 @@ int get_format_resolution_index(v4l2_dev_t *vd, int format, int width, int heigh */ void free_frame_formats(v4l2_dev_t *vd); +/* + * check if requested resolution is valid + * args: + * width - requested width + * height - requested height + * + * asserts: + * none + * + * returns: TRUE(1) if valid + * FALSE(0) if not + */ +int is_valid_resolution(int width, int height); + +/* + * set enable 8k preview + * args: + * enable - enable 8k preview + * + * asserts: + * none + * + * returns: void + */ +void set_enable_8k_preview(int enable); + +/* + * check if 8k preview is enabled + * args: + * none + * + * asserts: + * none + * + * returns: TRUE(1) if enabled + * FALSE(0) if not + */ +int is_enable_8k_preview(); + +/** + * set preferred resolution + * args: + * width - preferred width + * height - preferred height + * + * asserts: + * none + * + * returns: void + */ +void set_preferred_resolution(int width, int height); + +/** + * get preferred resolution width + * args: + * none + * + * asserts: + * none + * + * returns: preferred width + */ +int get_preferred_resolution_width(); + +/** + * get preferred resolution height + * args: + * none + * + * asserts: + * none + * + * returns: preferred height + */ +int get_preferred_resolution_height(); + #endif diff --git a/linglong.yaml b/linglong.yaml index b4d4a86d0..92b583cc4 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -1,67 +1,124 @@ +# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0-or-later + +version: "1" + package: id: org.deepin.camera name: "deepin-camera" - version: 1.4.0 + version: 6.5.50.1 kind: app description: | camera for deepin os. -variables: - extra_args: | - -DVERSION=${VERSION} +base: org.deepin.base/25.2.2 +runtime: org.deepin.runtime.dtk/6.7.0 + +command: + - deepin-camera + +build: | + # 调整头文件查找路径:gstreamer / libusb 开发头文件经 buildext 装入 /usr/include + # (原脚本由 install_dep 解包到 ${PREFIX}/include),修正 src/CMakeLists.txt + # Qt6 分支的硬编码路径;glib 头文件由 pkg_check_modules(gobject-2.0) 提供 + sed -i 's|${CMAKE_INSTALL_PREFIX}/include/gstreamer-1.0|/usr/include/gstreamer-1.0|g' src/CMakeLists.txt + sed -i 's|${CMAKE_INSTALL_PREFIX}/include/libusb-1.0|/usr/include/libusb-1.0|g' src/CMakeLists.txt + + # 修改路径 + find src -type f -name "*.service" -exec sed -i 's|^Exec=.*|Exec=deepin-camera|g' {} + + + # 构建 + VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') + cmake -B build-linglong ${conf_args} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib/${TRIPLET} \ + -DVERSION=${VERSION} \ + -DLINGLONG_BUILD_ON=1 + cmake --build build-linglong -j`nproc` + cmake --build build-linglong --target install > install.log 2>&1 + + # libblas3/liblapack3 经 apt 闭包(libimageeditor6 推荐链)带入层,其顶层 + # libblas.so.3/liblapack.so.3 是指向 /etc/alternatives 的软链(层内不存在), + # 复制真实库到应用库目录,保证层内 ffmpegthumbnailer/ffmpeg 等二进制的 + # 依赖可解析(ldd 运行时检查),替代旧配方的 mv blas/lapack 逻辑 + install -d -m 0755 ${PREFIX}/lib/${TRIPLET} + for n in libblas.so.3 liblapack.so.3; do + src=$(readlink -f /usr/lib/${TRIPLET}/$n 2>/dev/null || true) + if [ -n "$src" ] && [ -e "$src" ]; then + cp -L "$src" ${PREFIX}/lib/${TRIPLET}/$n + fi + done -runtime: - id: org.deepin.Runtime - version: 23.0.0 + # deepin-camera 运行时用 dlopen 按裸名加载库(libPath()/load_libs.c),层内 + # 与 base 均无裸名符号链接,需按旧层配方补齐,否则缩略图等功能失效;仅补 + # base 缺失的项(base 有的项应用代码可通过版本名命中,如 libavcodec/avutil/ + # swresample/udev/v4l2)。libavformat60/libswscale7 仅由 runtime 层提供, + # 不在 Qt LibrariesPath 扫描目录(/usr/lib/${TRIPLET})内,libPath 会退回 + # 裸名再走 ld.so 解析,而 ld.so 不做通配匹配,缺裸名链接即 dlopen 失败: + # 录像链路(libcam_encoder mp4/muxer → getAvformat)dlopen("libavformat.so") + # 失败后全部 dlsym 返回空,调用即 SIGSEGV(ll-box retval=139),因此 + # libavformat.so 与 libswscale.so/libffmpegthumbnailer.so/libportaudio.so + # 必须一并补齐。 + # build: 阶段依赖库已在构建容器 /usr(build_depends -dev 包提供),取真实 + # 版本名建裸名链接;若 depends 闭包未把真实文件带入应用库目录(skip_existing + # 行为随构建器版本可能变化),兜底 cp -L 复制真实文件,确保裸名链接与其 + # 目标同目录、运行期可解析 + cd ${PREFIX}/lib/${TRIPLET} + for n in libavformat.so libswscale.so libffmpegthumbnailer.so libportaudio.so; do + src=$(readlink -f /usr/lib/${TRIPLET}/$n 2>/dev/null || true) + [ -n "$src" ] && [ -e "$src" ] || continue + real=$(basename "$src") + if [ ! -e "./$real" ]; then + cp -L "$src" "./$real" + fi + ln -sf "$real" "$n" + done + cd - >/dev/null -#libxtst ffmpeg vlc -depends: - - id: ffmpeg - version: 4.1.8 - - id: "udisks2-qt5" - version: 5.0.3 - - id: qtdbusextended - version: 0.0.3 - type: runtime - - id: ffmpegthumbnailer - version: 2.1.1 - - id: "gstreamer1.0" - version: 1.14.6 - - id: "gst-plugins-base1.0" - version: 1.14.5 - type: runtime - - id: "gst-plugins-bad1.0" - version: 1.14.4.2 - type: runtime - - id: "image-editor" - version: 1.0.9 - - id: libusb-1.0 - version: 1.0.24 - - id: portaudio19 - version: 19.6.0 - type: runtime - - id: v4l-utils - version: 1.22.1 - type: runtime - - id: icu - version: 63.1 - type: runtime - - id: xcb-util - version: 0.3.8.1 - type: runtime + # 滤镜 LUT 数据(滤镜功能必需):buildext.apt 的 depends 合并仅拷贝 bin/、 + # sbin/、lib/(linglong_builder mergeOutput 白名单),不包含 share/,而旧 + # install_dep 整包解包会把 libimageeditor6 的 + # /usr/share/libimagevisualresult6/filter_cube(.CUBE/.dat 滤镜查找表)带入层。 + # 应用启动时按编译期 LUT_DIR(${PREFIX}/share/libimagevisualresult6/filter_cube, + # main.cpp initFilters)加载滤镜,目录缺失则全部滤镜失效 + # ("filter:xxx file is not found")。构建容器内该目录由 build_depends 的 + # libimageeditor6-dev → libimageeditor6 提供,此处复制进应用层 + if [ -d /usr/share/libimagevisualresult6/filter_cube ]; then + install -d -m 0755 ${PREFIX}/share/libimagevisualresult6/filter_cube + cp -a /usr/share/libimagevisualresult6/filter_cube/. \ + ${PREFIX}/share/libimagevisualresult6/filter_cube/ + fi -source: - kind: local - url: "http://gerrit.uniontech.com/deepin-camera" - version: develop/snipe - commit: I08d14ec62ac8221581c0cea64f5fc0ae5ad09add - patch: patches/remove-absolute-path-from-cmake-file.patch -build: - kind: manual - manual: - configure: | - mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ${extra_args} .. - make -j6 - make -j install +buildext: + apt: + # 构建依赖:仅声明 base/runtime 层未提供的构建期包。 + # Qt6/DTK6/X11/glib/udev 等开发包与工具链由 runtime 层和 base 层提供。 + build_depends: + - cmake + - libavutil-dev + - libavformat-dev + - libavcodec-dev + - libswscale-dev + - libswresample-dev + - libv4l-dev + - portaudio19-dev + - libpciaccess-dev + - libusb-1.0-0-dev + - libffmpegthumbnailer-dev + - libva-dev + - libimageeditor6-dev + - libgstreamer1.0-dev + - libgstreamer-plugins-base1.0-dev + # 运行依赖:仅声明 base/runtime 层未提供的直接运行时包。 + # ffmpeg/udev/v4l2/usb 等运行库已在 base/runtime 中;deepin-event-log + # 提供代码 dlopen 的裸名 libdeepin-event-log.so。 + depends: + - deepin-event-log + - libimageeditor6 + - libportaudio2 + - libffmpegthumbnailer4v5 + - gstreamer1.0-plugins-base + - gstreamer1.0-plugins-good + - dmidecode diff --git a/patches/remove-absolute-path-from-cmake-file.patch b/patches/remove-absolute-path-from-cmake-file.patch deleted file mode 100644 index adfe5a46d..000000000 --- a/patches/remove-absolute-path-from-cmake-file.patch +++ /dev/null @@ -1,170 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c14914a..835a298 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.0) - - project(deepin-camera VERSION 1.0.0) - -+include_directories( ${CMAKE_INSTALL_PREFIX}/include) - add_subdirectory(src) - - if (CMAKE_BUILD_TYPE STREQUAL "Debug") -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index ae2a68b..7d089e3 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -11,6 +11,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) - project(deepin-camera VERSION 1.0.0) - set(CMD_NAME deepin-camera) - set(TARGET_NAME deepin-camera) -+include_directories( ${CMAKE_INSTALL_PREFIX}/include) -+include_directories( ${CMAKE_INSTALL_PREFIX}/include/libavcodec) - #option (__mips__ "Use UNITTEST" ON) - - # cube文件目录,libvisualresult在打包时,会自动将cube文件安装到share目录下 -@@ -58,8 +60,8 @@ set(PROJECT_INCLUDE - ./src/qtsingleapplication - ./src/accessibility - ./src/accessible -- /usr/include -- /usr/include/libusb-1.0 -+ ${CMAKE_INSTALL_PREFIX}/include -+ ${CMAKE_INSTALL_PREFIX}/include/libusb-1.0 - ) - - # 设置Qt模块 -@@ -96,8 +98,11 @@ pkg_check_modules(3rd_lib REQUIRED - pciaccess - # libv4l2 - # libudev --# libusb-1.0 --# libavcodec -+ libusb-1.0 -+ libavcodec -+ libimageviewer -+ libffmpegthumbnailer -+ portaudio-2.0 - # libavutil - # libavformat - # libswscale -@@ -145,34 +150,34 @@ target_link_libraries(${TARGET_NAME} ${3rd_lib_LIBRARIES} - qt5_use_modules(${TARGET_NAME} ${QtModule}) - - #application --install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - - #desk desktop - install(FILES ${PROJECT_SOURCE_DIR}/deepin-camera.desktop -- DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) - - #table desktop - install(FILES ${PROJECT_SOURCE_DIR}/table/deepin-camera.desktop -- DESTINATION ${CMAKE_INSTALL_DATADIR}/due-shell/shortcuts) -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/due-shell/shortcuts) - - #icons - install(FILES ${PROJECT_SOURCE_DIR}/assets/deepin-camera.svg -- DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) - - #table_icons --install(DIRECTORY ${PROJECT_SOURCE_DIR}/assets/panel/Icons DESTINATION ${CMAKE_INSTALL_DATADIR}/due-shell/shortcuts) -+install(DIRECTORY ${PROJECT_SOURCE_DIR}/assets/panel/Icons DESTINATION ${CMAKE_INSTALL_PREFIX}/share/due-shell/shortcuts) - - #manual --install(DIRECTORY ${PROJECT_SOURCE_DIR}/assets/deepin-camera DESTINATION ${CMAKE_INSTALL_DATADIR}/deepin-manual/manual-assets/application/) -+install(DIRECTORY ${PROJECT_SOURCE_DIR}/assets/deepin-camera DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/) - - #debus_service --install(FILES ${PROJECT_SOURCE_DIR}/com.deepin.Camera.service DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services) -+install(FILES ${PROJECT_SOURCE_DIR}/com.deepin.Camera.service DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dbus-1/services) - - ##translations --#install(FILES ${PROJECT_SOURCE_DIR}/translations/*.qm DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_SOURCE_DIR}/translations) -+#install(FILES ${PROJECT_SOURCE_DIR}/translations/*.qm DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SOURCE_DIR}/translations) - - #translations --set(APPSHAREDIR ${CMAKE_INSTALL_DATADIR}/${TARGET_NAME}) -+set(APPSHAREDIR ${CMAKE_INSTALL_PREFIX}/share/${TARGET_NAME}) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/translations - DESTINATION ${APPSHAREDIR} - FILES_MATCHING PATTERN "*.qm") -diff --git a/src/com.deepin.Camera.service b/src/com.deepin.Camera.service -index bcc39d0..114a477 100644 ---- a/src/com.deepin.Camera.service -+++ b/src/com.deepin.Camera.service -@@ -1,4 +1,4 @@ --$ cat /usr/share/dbus-1/services/com.deepin.Camera.service -+#$ cat ${CMAKE_INSTALL_PREFIX}/share/dbus-1/services/com.deepin.Camera.service - [D-BUS Service] - Name=com.deepin.Camera --Exec=/usr/bin/qdbus --literal com.deepin.SessionManager /com/deepin/StartManager com.deepin.StartManager.Launch /usr/share/applications/deepin-camera.desktop -+Exec=/usr/bin/ll-cli run org.deepin.camera --exec deepin-camera -diff --git a/src/src/mainwindow.cpp b/src/src/mainwindow.cpp -index de1ceb6..6da4b9e 100644 ---- a/src/src/mainwindow.cpp -+++ b/src/src/mainwindow.cpp -@@ -785,18 +785,31 @@ void CMainWindow::slotPopupSettingsDialog() - QString CMainWindow::libPath(const QString &strlib) - { - QDir dir; -- QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); -- dir.setPath(path); -- QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib -- -- if (list.contains(strlib)) -- return strlib; -- -- list.sort(); -- if (list.size() > 0) -- return list.last(); -- -- return ""; -+ QStringList environment = QProcess::systemEnvironment(); -+ QString str, t_str; -+ foreach (str, environment) { -+ if (str.startsWith("LD_LIBRARY_PATH=")) { -+ t_str = str; -+ break; -+ } -+ } -+ if (t_str.isEmpty()) { -+ return QString(); -+ } -+ qDebug() << "lib:"<images/icons/warning.svg deepin-camera.svg images/icons/light/Not connected.svg + images/icons/light/camera_switch_not_on.svg images/icons/light/photograph.svg images/icons/light/record video.svg images/icons/light/select-hover.svg @@ -18,6 +19,7 @@ images/icons/light/Stop Recording.svg images/icons/light/Timer Status.svg images/icons/dark/Not connected_dark.svg + images/icons/dark/camera_switch_not_on_dark.svg images/icons/dark/Take up_dark.svg images/icons/dark/button/photograph_dark.svg images/icons/dark/button/record video_dark.svg diff --git a/src/assets/deepin-camera/camera/common/camera.svg b/src/assets/deepin-camera/camera/common/camera.svg index 4106dcf3b..13eae9e0b 100644 --- a/src/assets/deepin-camera/camera/common/camera.svg +++ b/src/assets/deepin-camera/camera/common/camera.svg @@ -1,56 +1,41 @@ - - - deepin-camera/24 - Created with Sketch. + + apps/128/deepin-camera - - + + - + - - - - - - - - - - - + - - - + + + + - - - - + + + - - - - - - - - + - - + + + + + + @@ -58,86 +43,88 @@ - + - + - + - + - + - - + + + + + - + - - - + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + - - - + + + + + \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/common/camera_96.svg b/src/assets/deepin-camera/camera/common/camera_96.svg index 2a8b642f3..13eae9e0b 100644 --- a/src/assets/deepin-camera/camera/common/camera_96.svg +++ b/src/assets/deepin-camera/camera/common/camera_96.svg @@ -1,168 +1,130 @@ - - - deepin-camera/96 - Created with Sketch. + + apps/128/deepin-camera - - - - + + + + - - - - - - - - - - - + - - - + + + + - - - - + + + - - - - - - - - - - - - + - - - - - - - - - + + + + + + + - + - + - + - + - + - - + - - + - + - - - + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + + + \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/common/close.svg b/src/assets/deepin-camera/camera/common/close.svg index e846c8368..8c3172a91 100644 --- a/src/assets/deepin-camera/camera/common/close.svg +++ b/src/assets/deepin-camera/camera/common/close.svg @@ -1,3 +1,9 @@ - - - + + + x + + + + + + \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/common/deepin_launcher.svg b/src/assets/deepin-camera/camera/common/deepin_launcher.svg index 5793b3846..55c2fd125 100644 --- a/src/assets/deepin-camera/camera/common/deepin_launcher.svg +++ b/src/assets/deepin-camera/camera/common/deepin_launcher.svg @@ -1,43 +1,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + places/128/deepin-launcher + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/common/delay.png b/src/assets/deepin-camera/camera/common/delay.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/exposure.png b/src/assets/deepin-camera/camera/common/exposure.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/filter.png b/src/assets/deepin-camera/camera/common/filter.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/flashlight.png b/src/assets/deepin-camera/camera/common/flashlight.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/fold.png b/src/assets/deepin-camera/camera/common/fold.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/icon_menu.svg b/src/assets/deepin-camera/camera/common/icon_menu.svg index 35dd6eacc..1a5da1a0a 100644 --- a/src/assets/deepin-camera/camera/common/icon_menu.svg +++ b/src/assets/deepin-camera/camera/common/icon_menu.svg @@ -1,84 +1,7 @@ - - - - - - image/svg+xml - - img_upload - - - - - - img_upload - Created with Sketch. - - - - + + + DTK/Toolbar/TitleButton/Menu + + - - - - - - - - + \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/common/more.png b/src/assets/deepin-camera/camera/common/more.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/photograph.png b/src/assets/deepin-camera/camera/common/photograph.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/record.png b/src/assets/deepin-camera/camera/common/record.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/common/switch.png b/src/assets/deepin-camera/camera/common/switch.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/en_US/camera.md b/src/assets/deepin-camera/camera/en_US/camera.md deleted file mode 100644 index 91ad6f569..000000000 --- a/src/assets/deepin-camera/camera/en_US/camera.md +++ /dev/null @@ -1,130 +0,0 @@ -# Camera|deepin-camera| - -## Overview - -Camera is an easy-to-use camera application that supports multiple functions such as taking photos, recording videos, and switching between multiple camera devices. - -## Guide - -You can run, close or create a desktop shortcut for Camera in the following ways. - -### Run Camera - -1. Click the Launcher icon ![launcher](../common/deepin_launcher.svg) in the Dock and enter the Launcher interface. -2. Locate Camera ![camera](../common/camera.svg) by scrolling the mouse wheel or searching "camera" in the Launcher interface and click it to run. -3. Right-click ![camera](../common/camera.svg) and you can: - - - Click **Send to desktop** to create a desktop shortcut. - - Click **Send to dock** to fix the application in the Dock. - - Click **Add to startup** to add the application to startup and it will automatically run when the system starts up. - -### Exit Camera - -- On the Camera interface, click![close_icon](../common/close.svg)to exit Camera. -- Right-click ![camera](../common/camera.svg) in the Dock and select **Close All** to exit Camera. -- On the Camera interface, click ![icon_menu](../common/icon_menu.svg) and select **Exit** to exit Camera. - -## Icon Descriptions - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhotoPhotoVideoVideoSwitch CamerasSwitch Cameras
FoldFold ToolbarUnfold ToolbarUnfold ToolbarDelay CaptureDelay Capture
flashlightEnable flashlightFiltersSet filtersExposureAdjust the exposure level
- - -> ![notes](../common/notes.svg) Notes: The camera switching icon ![1](fig/switch.png) only shows when there are multiple cameras connected. - -## Operations - -You can use the Camera application if your computer comes with a camera or is connected to a camera. Select the photo or video mode on the Camera interface to take photos and record videos. You can also enable the **Mirror mode** in **Settings > Shoot** to flip the photo horizontally. - -> ![notes](../common/notes.svg) Notes: The actual functions supported may differ according to the decoding method adopted. Please refer to the interface. - -### Take Photos - -Photo mode is defaulted when Camera starts up. Click the ![photograph](../common/photograph.png) icon to take photos, and the photos will be displayed on the interface. - -![image](fig/image.png) - -### Record Videos - -On the Camera interface, click **Video** to to enter the video mode. Click the![transcribe](../common/record.svg) icon to start recording, and click the ![stop](../common/stop.svg) icon to stop recording after video recording is completed. Video files will be displayed on the interface, and will also be saved in the default path. - -![video](fig/video.png) - -### Process Photos and Videos - -On the Camera interface, right-click the photos or video files to select copy, delete, print and open folder. - -> ![notes](../common/notes.svg) Notes: The printing function is only available for photo files. - -- Copy: Copy the selected photo/video to another path. - -- Delete: Delete the selected photo/video. - -- Print: Print the selected photo. Click **Print** and you will be direct to the print preview interface. Set the relevant printing parameters and click the **Save** icon to finish printing. - -- Open folder: Open the folder where photos and videos are located. - - -![rightmenu](fig/right_menu.png) - -## Main Menu - -On the main menu, you can change settings for Camera, switch window themes, view help manual, and get more information about Camera. - -### Settings - -1. Click ![icon_menu](../common/icon_menu.svg) on the Camera interface. -2. Click **Settings** to adjust **Basic**, **Shoot** and **Output** settings. - - - **Basic** settings: set up the **File location** for photos and videos as well as gridlines for photos. - - **Shoot** settings: set up the **Sound effects**, **Burst mode**, **Self-timer delay**, **Mirror mode** and **Flashlight** options. - - **Output** settings: check the **Output format** of photos, choose a format of videos, and set up **Resolution settings** for both. - - - -### Theme - -There are three window themes, namely Light Theme, Dark Theme, and System Theme. - -1. Click ![icon_menu](../common/icon_menu.svg) on the Camera interface. -2. Click **Theme** to select a theme. - -### Help - -1. Click ![icon_menu](../common/icon_menu.svg) on the Camera interface. -2. Click **Help** to view the manual of Camera. - -### About - -1. Click ![icon_menu](../common/icon_menu.svg) on the Camera interface. -2. Click **About** to view the version and introduction of Camera. - -### Exit - -1. Click ![icon_menu](../common/icon_menu.svg) on the Camera interface. -2. Click **Exit** to exit Camera. diff --git a/src/assets/deepin-camera/camera/en_US/d_camera.md b/src/assets/deepin-camera/camera/en_US/d_camera.md index b41163f1e..bb58de885 100644 --- a/src/assets/deepin-camera/camera/en_US/d_camera.md +++ b/src/assets/deepin-camera/camera/en_US/d_camera.md @@ -2,128 +2,122 @@ ## Overview -Camera is an easy-to-use camera application that supports multiple functions such as taking photos, recording videos, and switching between multiple camera devices. +Camera is a simple and easy-to-use camera application that enables photo capture, video recording, and supports multiple camera switching. -## Guide +## Getting Started -You can run, close or create a desktop shortcut for Camera in the following ways. +You can run or close the Camera, or create shortcuts through the following methods. -### Run Camera +### Running Camera -1. Click the Launcher icon ![launcher](../common/deepin_launcher.svg) in the Dock and enter the Launcher interface. -2. Locate Camera ![camera](../common/camera.svg) by scrolling the mouse wheel or searching "camera" in the Launcher interface and click it to run. -3. Right-click ![camera](../common/camera.svg) and you can: +1. Click the Launcher icon ![deepin_launcher](../common/deepin_launcher.svg) on the taskbar to enter the Launcher interface. +2. Scroll the mouse wheel or search to locate the Camera icon ![camera](../common/camera.svg), then click to run. +3. Right-click ![camera](../common/camera.svg) to: + - Click **Send to Desktop** to create a desktop shortcut. + - Click **Pin to Taskbar** to pin the application to the taskbar. + - Click **Start on Boot** to add the application to startup items, automatically running when the computer starts. - - Click **Send to desktop** to create a desktop shortcut. - - Click **Send to dock** to fix the application in the Dock. - - Click **Add to startup** to add the application to startup and it will automatically run when the system starts up. +### Closing Camera -### Exit Camera +- Click ![close](../common/close.svg) in the Camera interface to exit. +- Right-click ![camera](../common/camera.svg) on the taskbar and select **Close All** to exit Camera. +- Click ![icon_menu](../common/icon_menu.svg) in the Camera interface and select **Exit** to exit Camera. -- On the Camera interface, click![close_icon](../common/close.svg)to exit Camera. -- Right-click ![camera](../common/camera.svg) in the Dock and select **Close All** to exit Camera. -- On the Camera interface, click ![icon_menu](../common/icon_menu.svg) and select **Exit** to exit Camera. +## Icon Introduction -## Icon Descriptions - - + + - - + + - - - - - - + + + + + + - - - - + + + + - +
PhotoPhotoTake PhotoTake Photo Video VideoSwitch CamerasSwitch CamerasSwitch CameraSwitch Camera
FoldFold ToolbarUnfold ToolbarUnfold ToolbarDelay CaptureDelay CaptureExpandExpand ToolbarCollapseCollapse ToolbarTimerTimer Shooting
flashlightEnable flashlightFiltersSet filtersFlashTurn On FlashFilterSet Filter ExposureAdjust the exposure levelAdjust Exposure
+> ![notes](../common/notes.svg) Note: The camera switch button ![icon](../common/switch.png) will only appear when multiple cameras are connected. -> ![notes](../common/notes.svg) The camera switching icon ![1](fig/switch.png) only shows when there are multiple cameras connected. +## Operations Guide -## Operations +Using Camera requires a built-in or external camera. After opening Camera, click **Take Photo** or **Video** to switch modes. You can also enable mirror camera in **Settings > Photo Settings** to flip the image horizontally. -You can use the Camera application if your computer comes with a camera or is connected to a camera. Select the photo or video mode on the Camera interface to take photos and record videos. You can also enable the **Mirror mode** in **Settings > Shoot** to flip the photo horizontally. +> ![notes](../common/notes.svg) Note: Supported features may vary depending on decoding technology; refer to the actual interface. -### Take Photos +### Taking Photos -Photo mode is defaulted when Camera starts up. Click the ![photograph](../common/photograph.png) icon to take photos, and the photos will be displayed on the interface. +After opening Camera, it defaults to photo mode. Click the photo button ![photograph](../common/photograph.png), and the captured image will be displayed in the interface. -![image](fig/image.png) +image -### Record Videos +### Recording Video -On the Camera interface, click **Video** to to enter the video mode. Click the![transcribe](../common/record.svg) icon to start recording, and click the ![stop](../common/stop.svg) icon to stop recording after video recording is completed. Video files will be displayed on the interface, and will also be saved in the default path. +In the Camera main interface, click **Video** to enter video mode. Click the record button Record to start recording. After recording, click the stop button Stop. The video file will be displayed in the interface and saved to the default path. -![video](fig/video.png) +video -### Process Photos and Videos +### Managing Photos/Videos -On the Camera interface, right-click the photos or video files to select copy, delete, print and open folder. +In the Camera main interface, right-click on a photo/video file to choose copy, delete, print, or open folder. -> ![notes](../common/notes.svg) Notes: The printing function is only available for photo files. +- Copy: Copy selected photo/video to another path. +- Delete: Delete selected photo/video. +- Print: Print selected photo. Click **Print** to jump to the print preview interface where you can adjust settings before printing. -- Copy: Copy the selected photo/video to another path. + > ![notes](../common/notes.svg)Note: Only photo files support printing; video files won't show the print button. -- Delete: Delete the selected photo/video. +- Open Folder: Open the folder containing the photo/video. -- Print: Print the selected photo. Click **Print** and you will be direct to the print preview interface. Set the relevant printing parameters and click the **Save** icon to finish printing. - -- Open folder: Open the folder where photos and videos are located. - - -![rightmenu](fig/right_menu.png) +right_menu ## Main Menu -On the main menu, you can change settings for Camera, switch window themes, view help manual, and get more information about Camera. +In the main menu, you can configure camera settings, switch window themes, view help manuals, etc. ### Settings -1. On the Camera interface, click ![icon_menu](../common/icon_menu.svg). -2. Click **Settings** to adjust **Basic**, **Shoot** and **Output** settings. +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Settings** to configure basic settings, photo settings, and output settings. - - **Basic** settings: set up the **File location** for photos and videos as well as gridlines for photos. - - **Shoot** settings: set up the **Sound effects**, **Burst mode**, **Self-timer delay**, **Mirror mode** and **Flashlight** options. - - - **Output** settings: display the **Output format** and set up **Resolution settings** for photos and videos. - - + - Basic Settings: Set default storage path for photos/videos, choose grid composition style. + - Photo Settings: Configure sound effects, burst count, timer delay; enable/disable mirror camera and flash. + - Output Settings: Display image output format; set video output format; configure photo/video resolution. ### Theme -There are three window themes, namely Light Theme, Dark Theme, and System Theme. - -1. On the Camera interface, click ![icon_menu](../common/icon_menu.svg). -2. Click **Theme** to select a theme. +Window themes include Light, Dark, and System. +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Theme** and select a theme color. ### Help -1. On the Camera interface, click ![icon_menu](../common/icon_menu.svg). -2. Click **Help** to view the manual of Camera. +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Help** to view the help manual and learn more about using Camera. ### About -1. On the Camera interface, click ![icon_menu](../common/icon_menu.svg). -2. Click **About** to view the version and introduction of Camera. +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **About** to view the version and introduction of Camera. ### Exit -1. On the Camera interface, click ![icon_menu](../common/icon_menu.svg). -2. Click **Exit** to exit Camera. \ No newline at end of file +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Exit**. \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/en_US/fig/d_image.png b/src/assets/deepin-camera/camera/en_US/fig/d_image.png index e61db84d7..27bbfe7cb 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/d_image.png and b/src/assets/deepin-camera/camera/en_US/fig/d_image.png differ diff --git a/src/assets/deepin-camera/camera/en_US/fig/d_outputsettings.png b/src/assets/deepin-camera/camera/en_US/fig/d_outputsettings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/en_US/fig/d_right_menu.png b/src/assets/deepin-camera/camera/en_US/fig/d_right_menu.png index 0c2b517fd..70a9c943d 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/d_right_menu.png and b/src/assets/deepin-camera/camera/en_US/fig/d_right_menu.png differ diff --git a/src/assets/deepin-camera/camera/en_US/fig/d_right_menu1.png b/src/assets/deepin-camera/camera/en_US/fig/d_right_menu1.png index d2af934eb..210c13f65 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/d_right_menu1.png and b/src/assets/deepin-camera/camera/en_US/fig/d_right_menu1.png differ diff --git a/src/assets/deepin-camera/camera/en_US/fig/d_settings.png b/src/assets/deepin-camera/camera/en_US/fig/d_settings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/en_US/fig/d_video.png b/src/assets/deepin-camera/camera/en_US/fig/d_video.png index 9fd4d9379..8eb4a8062 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/d_video.png and b/src/assets/deepin-camera/camera/en_US/fig/d_video.png differ diff --git a/src/assets/deepin-camera/camera/en_US/fig/image.png b/src/assets/deepin-camera/camera/en_US/fig/image.png index bedc713ee..b5db1ad90 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/image.png and b/src/assets/deepin-camera/camera/en_US/fig/image.png differ diff --git a/src/assets/deepin-camera/camera/en_US/fig/right_menu.png b/src/assets/deepin-camera/camera/en_US/fig/right_menu.png index 8d00634c0..4a9b5734e 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/right_menu.png and b/src/assets/deepin-camera/camera/en_US/fig/right_menu.png differ diff --git a/src/assets/deepin-camera/camera/en_US/fig/video.png b/src/assets/deepin-camera/camera/en_US/fig/video.png index 8e0839b10..c342b9006 100644 Binary files a/src/assets/deepin-camera/camera/en_US/fig/video.png and b/src/assets/deepin-camera/camera/en_US/fig/video.png differ diff --git a/src/assets/deepin-camera/camera/en_US/p_camera.md b/src/assets/deepin-camera/camera/en_US/p_camera.md new file mode 100644 index 000000000..bb58de885 --- /dev/null +++ b/src/assets/deepin-camera/camera/en_US/p_camera.md @@ -0,0 +1,123 @@ +# Camera|deepin-camera| + +## Overview + +Camera is a simple and easy-to-use camera application that enables photo capture, video recording, and supports multiple camera switching. + +## Getting Started + +You can run or close the Camera, or create shortcuts through the following methods. + +### Running Camera + +1. Click the Launcher icon ![deepin_launcher](../common/deepin_launcher.svg) on the taskbar to enter the Launcher interface. +2. Scroll the mouse wheel or search to locate the Camera icon ![camera](../common/camera.svg), then click to run. +3. Right-click ![camera](../common/camera.svg) to: + - Click **Send to Desktop** to create a desktop shortcut. + - Click **Pin to Taskbar** to pin the application to the taskbar. + - Click **Start on Boot** to add the application to startup items, automatically running when the computer starts. + +### Closing Camera + +- Click ![close](../common/close.svg) in the Camera interface to exit. +- Right-click ![camera](../common/camera.svg) on the taskbar and select **Close All** to exit Camera. +- Click ![icon_menu](../common/icon_menu.svg) in the Camera interface and select **Exit** to exit Camera. + +## Icon Introduction + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Take PhotoTake PhotoVideoVideoSwitch CameraSwitch Camera
ExpandExpand ToolbarCollapseCollapse ToolbarTimerTimer Shooting
FlashTurn On FlashFilterSet FilterExposureAdjust Exposure
+ +> ![notes](../common/notes.svg) Note: The camera switch button ![icon](../common/switch.png) will only appear when multiple cameras are connected. + +## Operations Guide + +Using Camera requires a built-in or external camera. After opening Camera, click **Take Photo** or **Video** to switch modes. You can also enable mirror camera in **Settings > Photo Settings** to flip the image horizontally. + +> ![notes](../common/notes.svg) Note: Supported features may vary depending on decoding technology; refer to the actual interface. + +### Taking Photos + +After opening Camera, it defaults to photo mode. Click the photo button ![photograph](../common/photograph.png), and the captured image will be displayed in the interface. + +image + +### Recording Video + +In the Camera main interface, click **Video** to enter video mode. Click the record button Record to start recording. After recording, click the stop button Stop. The video file will be displayed in the interface and saved to the default path. + +video + +### Managing Photos/Videos + +In the Camera main interface, right-click on a photo/video file to choose copy, delete, print, or open folder. + +- Copy: Copy selected photo/video to another path. +- Delete: Delete selected photo/video. +- Print: Print selected photo. Click **Print** to jump to the print preview interface where you can adjust settings before printing. + + > ![notes](../common/notes.svg)Note: Only photo files support printing; video files won't show the print button. + +- Open Folder: Open the folder containing the photo/video. + +right_menu + +## Main Menu + +In the main menu, you can configure camera settings, switch window themes, view help manuals, etc. + +### Settings + +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Settings** to configure basic settings, photo settings, and output settings. + + - Basic Settings: Set default storage path for photos/videos, choose grid composition style. + - Photo Settings: Configure sound effects, burst count, timer delay; enable/disable mirror camera and flash. + - Output Settings: Display image output format; set video output format; configure photo/video resolution. + +### Theme + +Window themes include Light, Dark, and System. +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Theme** and select a theme color. + +### Help + +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Help** to view the help manual and learn more about using Camera. + +### About + +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **About** to view the version and introduction of Camera. + +### Exit + +1. In the Camera interface, click ![icon_menu](../common/icon_menu.svg). +2. Click **Exit**. \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/d_output_settings.png b/src/assets/deepin-camera/camera/pt_BR/fig/d_output_settings.png new file mode 100644 index 000000000..cd177236c Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/d_output_settings.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/d_settings.png b/src/assets/deepin-camera/camera/pt_BR/fig/d_settings.png new file mode 100644 index 000000000..2ca679046 Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/d_settings.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/image.png b/src/assets/deepin-camera/camera/pt_BR/fig/image.png new file mode 100644 index 000000000..75d8ba459 Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/image.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/output_settings.png b/src/assets/deepin-camera/camera/pt_BR/fig/output_settings.png new file mode 100644 index 000000000..af763c9e8 Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/output_settings.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/right_menu.png b/src/assets/deepin-camera/camera/pt_BR/fig/right_menu.png new file mode 100644 index 000000000..f71edafdf Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/right_menu.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/settings.png b/src/assets/deepin-camera/camera/pt_BR/fig/settings.png new file mode 100644 index 000000000..b14a196b7 Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/settings.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/fig/video.png b/src/assets/deepin-camera/camera/pt_BR/fig/video.png new file mode 100644 index 000000000..be1286e71 Binary files /dev/null and b/src/assets/deepin-camera/camera/pt_BR/fig/video.png differ diff --git a/src/assets/deepin-camera/camera/pt_BR/p_camera.md b/src/assets/deepin-camera/camera/pt_BR/p_camera.md new file mode 100644 index 000000000..018cab335 --- /dev/null +++ b/src/assets/deepin-camera/camera/pt_BR/p_camera.md @@ -0,0 +1,132 @@ +# Câmera|deepin-camera| + +## Visão geral + +A Câmera é um aplicativo de webcam simples e fácil de usar, que permite tirar fotos, gravar vídeos e alternar entre várias câmeras. + +## Primeiros passos + +Você pode iniciar a Câmera, fechá-la ou criar um atalho das seguintes formas. + +### Iniciar a Câmera + +1. Clique no ícone do iniciador na barra de tarefas ![deepin_launcher](../common/deepin_launcher.svg) para abrir a interface do iniciador. +2. Role a roda do mouse para cima ou para baixo ou use a busca para localizar o ícone da Câmera ![camera](../common/camera.svg) e clique nele para iniciar o aplicativo. +3. Clique com o botão direito em ![camera](../common/camera.svg) para: + - Clicar em **Enviar para a área de trabalho** e criar um atalho na área de trabalho. + - Clicar em **Enviar para a barra de tarefas** e fixar o aplicativo na barra de tarefas. + - Clicar em **Iniciar automaticamente ao ligar** e adicionar o aplicativo aos itens de inicialização, para que ele seja executado automaticamente ao ligar o computador. + +### Fechar a Câmera + +- Na interface da Câmera, clique em ![close](../common/close.svg) para sair do aplicativo. +- Na barra de tarefas, clique com o botão direito em ![camera](../common/camera.svg) e selecione **Fechar tudo** para sair do aplicativo. +- Na interface da Câmera, clique em ![icon_menu](../common/icon_menu.svg) e selecione **Sair** para sair do aplicativo. + + +## Ícones + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tirar fotoTirar fotoVídeoVídeoAlternar câmeraAlternar câmera
ExpandirExpandir a barra de ferramentasRecolherRecolher a barra de ferramentasAtrasoCaptura com atraso
FlashAtivar o flashFiltroDefinir filtroExposiçãoAjustar a exposição
+ + +> ![notes](../common/notes.svg) Observação: o botão de alternar câmera ![icon](../common/switch.png) só aparece na interface quando há várias câmeras conectadas. + + + +## Operações + +Para usar a Câmera, o computador precisa ter uma webcam integrada ou uma câmera externa conectada. Depois de abrir a Câmera, clique em **Tirar foto** ou **Vídeo** para alternar o modo; em **Configurações > Configurações de foto** você também pode ativar o espelhamento da câmera, que inverte a imagem na horizontal. + +> ![notes](../common/notes.svg) Observação: tecnologias de decodificação diferentes oferecem conjuntos de recursos diferentes; considere o que aparece na interface real. + +### Tirar foto + +Ao abrir a Câmera, o modo de foto é o padrão. Clique no botão de captura ![photograph](../common/photograph.png) e o arquivo de imagem gerado é exibido na interface. + +image + + +### Gravar vídeo + +Na interface principal da Câmera, clique em **Vídeo** para entrar no modo de vídeo. Clique no botão de gravação transcribe para gravar e, ao terminar, clique no botão de encerrar a gravação stop. O arquivo de vídeo é exibido na interface e também é salvo no caminho padrão. + +video + +### Gerenciar fotos e vídeos + +Na interface principal da Câmera, clique com o botão direito em um arquivo de foto ou vídeo para copiar, excluir, imprimir ou abrir a pasta que o contém. + +- Copiar: copia a foto ou o vídeo selecionado para outro caminho. +- Excluir: exclui a foto ou o vídeo selecionado. +- Imprimir: imprime a foto selecionada. Ao clicar em **Imprimir**, a interface de visualização de impressão é aberta, onde você pode ajustar as opções antes de imprimir. + + > ![notes](../common/notes.svg)Observação: apenas arquivos de imagem podem ser impressos; o botão de imprimir não aparece para arquivos de vídeo. + +- Abrir pasta: abre a pasta em que a foto ou o vídeo está armazenado. + +right_menu + +## Menu principal + +No menu principal você pode configurar a Câmera, alternar o tema da janela e consultar o manual de ajuda. + +### Configurações + +1. Na interface da Câmera, clique em ![icon_menu](../common/icon_menu.svg). +2. Clique em **Configurações** para acessar as configurações básicas, as configurações de foto e as configurações de saída. + + - Configurações básicas: define o caminho padrão de armazenamento de fotos e vídeos e escolhe o estilo da grade de composição. + - Configurações de foto: define o efeito sonoro, a quantidade de fotos em sequência e o tempo de atraso da captura; ativa ou desativa o espelhamento da câmera e o flash. + - Configurações de saída: mostra o formato de saída das imagens, define o formato de saída dos vídeos e a resolução de saída de fotos e vídeos. + + +### Tema + +O tema da janela inclui tema claro, tema escuro e tema do sistema. + +1. Na interface da Câmera, clique em ![icon_menu](../common/icon_menu.svg). +2. Clique em **Tema** e escolha uma cor de tema. + + +### Ajuda + +1. Na interface da Câmera, clique em ![icon_menu](../common/icon_menu.svg). +2. Clique em **Ajuda** para consultar o manual e conhecer melhor o aplicativo. + + +### Sobre + +1. Na interface da Câmera, clique em ![icon_menu](../common/icon_menu.svg). +2. Clique em **Sobre** para ver a versão e a descrição da Câmera. + +### Sair + +1. Na interface da Câmera, clique em ![icon_menu](../common/icon_menu.svg). +2. Clique em **Sair**. diff --git a/src/assets/deepin-camera/camera/zh_CN/d_camera.md b/src/assets/deepin-camera/camera/zh_CN/d_camera.md index a900f839e..be99713e8 100644 --- a/src/assets/deepin-camera/camera/zh_CN/d_camera.md +++ b/src/assets/deepin-camera/camera/zh_CN/d_camera.md @@ -20,8 +20,8 @@ ### 关闭相机 - 在相机界面单击 ![close](../common/close.svg),退出相机。 -- 右键单击任务栏上的 ![camera](../common/camera.svg),选择 **关闭所有** 来退出相机。 -- 在相机界面单击 ![icon_menu](../common/icon_menu.svg),选择 **退出** 来退出相机。 +- 在任务栏上右键单击 ![camera](../common/camera.svg),选择 **关闭所有**,退出相机。 +- 在相机界面单击 ![icon_menu](../common/icon_menu.svg),选择 **退出**,退出相机。 ## 图标介绍 @@ -64,6 +64,8 @@ 使用相机的前提是电脑自带摄像头或外接摄像头。打开相机后,单击 **拍照** 或 **视频** 切换模式,您还可以在 **设置 > 拍照设置** 中开启镜像摄像头功能,将画面左右翻转。 +> ![notes](../common/notes.svg) 说明:采用不同的解码技术,其所支持的功能也会不同,请以实际界面为准。 + ### 拍照 打开相机后,默认进入拍照模式。单击拍照按钮 ![photograph](../common/photograph.png),拍摄的图片文件会展示在界面。 @@ -73,7 +75,7 @@ ### 录制视频 -在相机主界面,单击 **视频**,进入视频模式。单击录制视频按钮 ![transcribe](../common/record.svg) 进行录制,录制完成后单击结束录制按钮 ![stop](../common/stop.svg),视频文件会展示在界面,也会保存在默认路径下。 +在相机主界面,单击 **视频**,进入视频模式。单击录制视频按钮 transcribe 进行录制,录制完成后单击结束录制按钮 stop,视频文件会展示在界面,也会保存在默认路径下。 video @@ -102,7 +104,7 @@ - 基本设置:设置照片和视频的默认存储路径,选择构图网格的样式。 - 拍照设置:设置音效、连拍次数及拍照延时时间,开启或关闭镜像摄像头、闪光灯。 - - 输出设置:显示图片和视频的输出格式,设置输出分辨率。 + - 输出设置:显示图片的输出格式,设置视频的输出格式;设置照片和视频的输出分辨率。 ### 主题 diff --git a/src/assets/deepin-camera/camera/zh_CN/fig/d_output_settings.png b/src/assets/deepin-camera/camera/zh_CN/fig/d_output_settings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_CN/fig/d_settings.png b/src/assets/deepin-camera/camera/zh_CN/fig/d_settings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_CN/fig/image.png b/src/assets/deepin-camera/camera/zh_CN/fig/image.png index 3c4c6158c..9048c0e0c 100644 Binary files a/src/assets/deepin-camera/camera/zh_CN/fig/image.png and b/src/assets/deepin-camera/camera/zh_CN/fig/image.png differ diff --git a/src/assets/deepin-camera/camera/zh_CN/fig/right_menu.png b/src/assets/deepin-camera/camera/zh_CN/fig/right_menu.png old mode 100755 new mode 100644 index 7b3077f24..6fccc3d91 Binary files a/src/assets/deepin-camera/camera/zh_CN/fig/right_menu.png and b/src/assets/deepin-camera/camera/zh_CN/fig/right_menu.png differ diff --git a/src/assets/deepin-camera/camera/zh_CN/fig/video.png b/src/assets/deepin-camera/camera/zh_CN/fig/video.png index 36a33acad..d9e87f2a6 100644 Binary files a/src/assets/deepin-camera/camera/zh_CN/fig/video.png and b/src/assets/deepin-camera/camera/zh_CN/fig/video.png differ diff --git a/src/assets/deepin-camera/camera/zh_CN/camera.md b/src/assets/deepin-camera/camera/zh_CN/p_camera.md similarity index 94% rename from src/assets/deepin-camera/camera/zh_CN/camera.md rename to src/assets/deepin-camera/camera/zh_CN/p_camera.md index 81430cea5..be99713e8 100644 --- a/src/assets/deepin-camera/camera/zh_CN/camera.md +++ b/src/assets/deepin-camera/camera/zh_CN/p_camera.md @@ -75,7 +75,7 @@ ### 录制视频 -在相机主界面,单击 **视频**,进入视频模式。单击录制视频按钮 ![transcribe](../common/record.svg) 进行录制,录制完成后单击结束录制按钮 ![stop](../common/stop.svg),视频文件会展示在界面,也会保存在默认路径下。 +在相机主界面,单击 **视频**,进入视频模式。单击录制视频按钮 transcribe 进行录制,录制完成后单击结束录制按钮 stop,视频文件会展示在界面,也会保存在默认路径下。 video diff --git a/src/assets/deepin-camera/camera/zh_HK/camera.md b/src/assets/deepin-camera/camera/zh_HK/camera.md deleted file mode 100644 index aa3f4ab72..000000000 --- a/src/assets/deepin-camera/camera/zh_HK/camera.md +++ /dev/null @@ -1,126 +0,0 @@ -# 相機|deepin-camera| - -## 概述 - -相機是一款簡單易用的鏡頭應用工具,可實現拍照、錄製影片等功能,支持多鏡頭切換。 - -## 使用入門 - -您可以通過以下方式運行或關閉相機,或者創建快捷方式。 - -### 運行相機 - -1. 單擊任務欄上的啟動器圖標 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器界面。 -2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到相機圖標 ![camera](../common/camera.svg),單擊運行。 -3. 右鍵單擊 ![camera](../common/camera.svg),您可以: - - 單擊 **傳送到桌面**,在桌面創建快捷方式。 - - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。 - - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用程序。 - -### 關閉相機 - -- 在相機界面單擊 ![close](../common/close.svg),退出相機。 -- 在任務欄上右鍵單擊 ![camera](../common/camera.svg),選擇 **關閉所有**,退出相機。 -- 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,退出相機。 - -## 圖標介紹 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
拍照拍照影片影片切換鏡頭切換鏡頭
展開展開工具欄摺疊摺疊工具欄延時延時拍攝
閃光燈開啟閃光燈濾鏡設置濾鏡曝光調節曝光度
- -> ![notes](../common/notes.svg) 說明:當連接多個鏡頭時,界面上才會顯示切換鏡頭按鈕 ![icon](../common/switch.png)。 - - -## 操作介紹 - -使用相機的前提是電腦自帶鏡頭或外接鏡頭。打開相機後,單擊 **拍照** 或 **影片** 切換模式,您還可以在 **設置 > 拍照設置** 中開啟鏡像鏡頭功能,將畫面左右翻轉。 - -> ![notes](../common/notes.svg) 說明:採用不同的解碼技術,其所支持的功能也會不同,請以實際界面為準。 - -### 拍照 - -打開相機後,默認進入拍照模式。單擊拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片文件會展示在界面。 - -image - - -### 錄製影片 - -在相機主界面,單擊 **影片**,進入影片模式。單擊錄製影片按鈕 ![transcribe](../common/record.svg) 進行錄製,錄製完成後單擊結束錄製按鈕 ![stop](../common/stop.svg),影片文件會展示在界面,也會保存在默認路徑下。 - -video - -### 管理圖片/影片 - -在相機主界面,右鍵單擊照片或影片文件,可選擇複製、刪除或打開文件夾。 - -- 複製:將選中的照片複製到其他路徑。 -- 刪除:將選中的照片刪除。 -- 打印:將選中的圖片進行打印。單擊 **打印** 後,跳轉到打印預覽界面,您可以進行相關設置後再打印。 - - > ![notes](../common/notes.svg) 說明:僅圖片文件支持打印功能,影片文件不會顯示打印按鈕。 -- 打開文件夾:打開照片或影片所在的文件夾。 - -right_menu - -## 主菜單 - -在主菜單中,您可以進行相機設置、切換窗口主題,查看幫助手冊等操作。 - -### 設置 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **設置**,您可以進行基本設置、拍照設置及輸出設置。 - - - 基本設置:設置照片和影片的默認存儲路徑,選擇構圖網格的樣式。 - - 拍照設置:設置音效、連拍次數及拍照延時時間,開啟或關閉鏡像鏡頭、閃光燈。 - - 輸出設置:顯示圖片的輸出格式,設置影片的輸出格式;設置照片和影片的輸出解像度。 - -### 主題 - -窗口主題包含淺色主題、深色主題和系統主題。 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **主題**,選擇一個主題顏色。 - -### 幫助 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **幫助**,查看幫助手冊,進一步了解和使用相機。 - -### 關於 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **關於**,查看相機的版本和介紹。 - -### 退出 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **退出**。 - diff --git a/src/assets/deepin-camera/camera/zh_HK/d_camera.md b/src/assets/deepin-camera/camera/zh_HK/d_camera.md index 8204c8804..0130ac922 100644 --- a/src/assets/deepin-camera/camera/zh_HK/d_camera.md +++ b/src/assets/deepin-camera/camera/zh_HK/d_camera.md @@ -2,26 +2,26 @@ ## 概述 -相機是一款簡單易用的鏡頭應用工具,可實現拍照、錄製影片等功能,支持多鏡頭切換。 +相機是一款簡單易用的攝像頭應用工具,可實現拍照、錄製影片等功能,支援多鏡頭切換。 ## 使用入門 -您可以通過以下方式運行或關閉相機,或者創建快捷方式。 +您可以透過以下方式執行或關閉相機,或者建立捷徑。 -### 運行相機 +### 執行相機 -1. 單擊任務欄上的啟動器圖標 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器界面。 -2. 上下滾動鼠標滾輪瀏覽或通過搜索找到,相機圖標 ![camera](../common/camera.svg),單擊運行。 -3. 右鍵單擊 ![camera](../common/camera.svg),您可以: - - 單擊 **傳送到桌面**,在桌面創建快捷方式。 - - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。 - - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用程序。 +1. 按一下工作列上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器介面。 +2. 滾動滑鼠或搜尋,找到相機圖示 ![camera](../common/camera.svg),按一下執行。 +3. 右鍵按一下 ![camera](../common/camera.svg),您可以: + - 按一下 **傳送到桌面**,在桌面建立捷徑。 + - 按一下 **釘選到工作列**,將應用程式固定到工作列。 + - 按一下 **開機自動啟動**,將應用程式加入到開機啟動項,在電腦開機時自動執行該應用程式。 ### 關閉相機 -- 在相機界面單擊 ![close](../common/close.svg),退出相機。 -- 在任務欄右鍵單擊 ![camera](../common/camera.svg),選擇 **關閉所有** 來退出相機。 -- 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出** 來退出相機。 +- 在相機介面按一下 ![close](../common/close.svg),退出相機。 +- 在工作列上右鍵按一下 ![camera](../common/camera.svg),選擇 **全部關閉**,退出相機。 +- 在相機介面按一下 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,退出相機。 ## 圖標介紹 @@ -47,78 +47,77 @@ 閃光燈 開啟閃光燈 濾鏡 - 設置濾鏡 + 設定濾鏡 曝光 調節曝光度 -> ![notes](../common/notes.svg) 說明:當連接多個鏡頭時,界面上才會顯示切換鏡頭按鈕 ![icon](../common/switch.png)。 - +> ![notes](../common/notes.svg) 說明:當連接多個鏡頭時,介面上才會顯示切換鏡頭按鈕 ![icon](../common/switch.png)。 ## 操作介紹 -使用相機的前提是電腦自帶鏡頭或外接鏡頭。打開相機後,單擊 **拍照** 或 **影片** 切換模式,您還可以在 **設置 > 拍照設置** 中開啟鏡像鏡頭功能,將畫面左右翻轉。 +使用相機的前提是電腦自帶鏡頭或外接鏡頭。開啟相機後,按一下 **拍照** 或 **影片** 切換模式,您還可以在 **設定 > 拍照設定** 中開啟鏡像鏡頭功能,將畫面左右翻轉。 -### 拍照 +> ![notes](../common/notes.svg) 說明:採用不同的解碼技術,其所支援的功能也會不同,請以實際介面為準。 -打開相機後,默認進入拍照模式。單擊拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片文件會展示在界面。 +### 拍照 -image +開啟相機後,預設進入拍照模式。按一下拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片檔案會展示在介面。 +image -### 錄製影片 +### 錄製影片 -在相機主界面,單擊 **影片**,進入影片模式。單擊錄製影片按鈕 ![transcribe](../common/record.svg) 進行錄製,錄製完成後單擊結束錄製按鈕 ![stop](../common/stop.svg),影片文件會展示在界面,也會保存在默認路徑下。 +在相機主介面,按一下 **影片**,進入影片模式。按一下錄製影片按鈕 transcribe 進行錄製,錄製完成後按一下結束錄製按鈕 stop,影片檔案會展示在介面,也會保存在預設路徑下。 video ### 管理圖片/影片 -在相機主界面,右鍵單擊照片或影片文件,可選擇複製、刪除或打開文件夾。 +在相機主介面,右鍵按一下圖片/影片檔案,可選擇複製、刪除、列印或開啟資料夾。 -- 複製:將選中的照片複製到其他路徑。 -- 刪除:將選中的照片刪除。 -- 打印:將選中的圖片進行打印。單擊 **打印** 後,跳轉到打印預覽界面,您可以進行相關設置後再打印。 +- 複製:將選中的圖片/影片複製到其他路徑。 +- 刪除:將選中的圖片/影片刪除。 +- 列印:將選中的圖片進行列印。按一下 **列印** 後,跳轉到列印預覽介面,您可以進行相關設定後再列印。 - > ![notes](../common/notes.svg) 說明:僅圖片文件支持打印功能,影片文件不會顯示打印按鈕。 -- 打開文件夾:打開照片或影片所在的文件夾。 + > ![notes](../common/notes.svg)說明:僅圖片檔案支援列印功能,影片檔案不會顯示列印按鈕。 + +- 開啟資料夾:開啟圖片/影片所在的資料夾。 right_menu -## 主菜單 +## 主選單 -在主菜單中,您可以進行相機設置、切換窗口主題,查看幫助手冊等操作。 +在主選單中,您可以進行相機設定、切換視窗主題,查看說明手冊等。 -### 設置 +### 設定 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **設置**,您可以進行基本設置、拍照設置及輸出設置。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **設定**,您可以進行基本設定、拍照設定及輸出設定。 - - 基本設置:設置照片和影片的默認存儲路徑,選擇構圖網格的樣式。 - - 拍照設置:設置音效、連拍次數及拍照延時時間,開啟或關閉鏡像鏡頭、閃光燈。 - - 輸出設置:顯示圖片和影片的輸出格式,設置輸出解像度。 + - 基本設定:設定相片和影片的預設儲存路徑,選擇構圖網格的樣式。 + - 拍照設定:設定音效、連拍次數及拍照延時時間,開啟或關閉鏡像鏡頭、閃光燈。 + - 輸出設定:顯示圖片的輸出格式,設定影片的輸出格式;設定相片和影片的輸出解析度。 ### 主題 -窗口主題包含淺色主題、深色主題和系統主題。 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **主題**,選擇一個主題顏色。 +視窗主題包含淺色主題、深色主題和系統主題。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **主題**,選擇一個主題顏色。 -### 幫助 +### 說明 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **幫助**,查看幫助手冊,進一步了解和使用相機。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **說明**,查看說明手冊,進一步了解和使用相機。 ### 關於 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **關於**,查看相機的版本和介紹。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **關於**,查看相機的版本和介紹。 ### 退出 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **退出**。 - +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **退出**。 \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/zh_HK/fig/d_output_settings.png b/src/assets/deepin-camera/camera/zh_HK/fig/d_output_settings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_HK/fig/d_settings.png b/src/assets/deepin-camera/camera/zh_HK/fig/d_settings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_HK/fig/right_menu.png b/src/assets/deepin-camera/camera/zh_HK/fig/right_menu.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_HK/p_camera.md b/src/assets/deepin-camera/camera/zh_HK/p_camera.md new file mode 100644 index 000000000..0130ac922 --- /dev/null +++ b/src/assets/deepin-camera/camera/zh_HK/p_camera.md @@ -0,0 +1,123 @@ +# 相機|deepin-camera| + +## 概述 + +相機是一款簡單易用的攝像頭應用工具,可實現拍照、錄製影片等功能,支援多鏡頭切換。 + +## 使用入門 + +您可以透過以下方式執行或關閉相機,或者建立捷徑。 + +### 執行相機 + +1. 按一下工作列上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器介面。 +2. 滾動滑鼠或搜尋,找到相機圖示 ![camera](../common/camera.svg),按一下執行。 +3. 右鍵按一下 ![camera](../common/camera.svg),您可以: + - 按一下 **傳送到桌面**,在桌面建立捷徑。 + - 按一下 **釘選到工作列**,將應用程式固定到工作列。 + - 按一下 **開機自動啟動**,將應用程式加入到開機啟動項,在電腦開機時自動執行該應用程式。 + +### 關閉相機 + +- 在相機介面按一下 ![close](../common/close.svg),退出相機。 +- 在工作列上右鍵按一下 ![camera](../common/camera.svg),選擇 **全部關閉**,退出相機。 +- 在相機介面按一下 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,退出相機。 + +## 圖標介紹 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
拍照拍照影片影片切換鏡頭切換鏡頭
展開展開工具欄摺疊摺疊工具欄延時延時拍攝
閃光燈開啟閃光燈濾鏡設定濾鏡曝光調節曝光度
+ +> ![notes](../common/notes.svg) 說明:當連接多個鏡頭時,介面上才會顯示切換鏡頭按鈕 ![icon](../common/switch.png)。 + +## 操作介紹 + +使用相機的前提是電腦自帶鏡頭或外接鏡頭。開啟相機後,按一下 **拍照** 或 **影片** 切換模式,您還可以在 **設定 > 拍照設定** 中開啟鏡像鏡頭功能,將畫面左右翻轉。 + +> ![notes](../common/notes.svg) 說明:採用不同的解碼技術,其所支援的功能也會不同,請以實際介面為準。 + +### 拍照 + +開啟相機後,預設進入拍照模式。按一下拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片檔案會展示在介面。 + +image + +### 錄製影片 + +在相機主介面,按一下 **影片**,進入影片模式。按一下錄製影片按鈕 transcribe 進行錄製,錄製完成後按一下結束錄製按鈕 stop,影片檔案會展示在介面,也會保存在預設路徑下。 + +video + +### 管理圖片/影片 + +在相機主介面,右鍵按一下圖片/影片檔案,可選擇複製、刪除、列印或開啟資料夾。 + +- 複製:將選中的圖片/影片複製到其他路徑。 +- 刪除:將選中的圖片/影片刪除。 +- 列印:將選中的圖片進行列印。按一下 **列印** 後,跳轉到列印預覽介面,您可以進行相關設定後再列印。 + + > ![notes](../common/notes.svg)說明:僅圖片檔案支援列印功能,影片檔案不會顯示列印按鈕。 + +- 開啟資料夾:開啟圖片/影片所在的資料夾。 + +right_menu + +## 主選單 + +在主選單中,您可以進行相機設定、切換視窗主題,查看說明手冊等。 + +### 設定 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **設定**,您可以進行基本設定、拍照設定及輸出設定。 + + - 基本設定:設定相片和影片的預設儲存路徑,選擇構圖網格的樣式。 + - 拍照設定:設定音效、連拍次數及拍照延時時間,開啟或關閉鏡像鏡頭、閃光燈。 + - 輸出設定:顯示圖片的輸出格式,設定影片的輸出格式;設定相片和影片的輸出解析度。 + +### 主題 + +視窗主題包含淺色主題、深色主題和系統主題。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **主題**,選擇一個主題顏色。 + +### 說明 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **說明**,查看說明手冊,進一步了解和使用相機。 + +### 關於 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **關於**,查看相機的版本和介紹。 + +### 退出 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **退出**。 \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/zh_TW/camera.md b/src/assets/deepin-camera/camera/zh_TW/camera.md deleted file mode 100644 index 3cad53aa1..000000000 --- a/src/assets/deepin-camera/camera/zh_TW/camera.md +++ /dev/null @@ -1,129 +0,0 @@ -# 相機|deepin-camera| - -## 概述 - -相機是一款簡單易用的攝影機應用程式,可實現拍照、錄製影片等功能,支援多攝影機切換。 - -## 使用入門 - -您可以透過以下方式執行或關閉相機,或者建立相機的捷徑。 - -### 執行相機 - -1. 單擊任務欄上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg) ,進入啟動器介面。 -2. 上下滾動滑鼠滾輪瀏覽或透過搜尋,找到「相機」圖示 ![camera](../common/camera.svg),單擊執行。 -3. 右鍵單擊 ![camera](../common/camera.svg) ,您可以: - - 單擊 **建立桌面捷徑**,在桌面建立捷徑。 - - 單擊 **釘選到Dock**,將應用程式固定到Dock。 - - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動執行該應用程式。 - -### 關閉相機 - -- 在相機介面,單擊 ![close](../common/close.svg),關閉相機。 -- 右鍵單擊任務欄上的 ![camera](../common/camera.svg),選擇 **全部關閉** 關閉相機。 -- 在相機介面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出** 關閉相機。 - -## 圖示介紹 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
拍照拍照影片影片切換攝影機切換攝影機
展開工具列展開工具列摺疊工具列摺疊工具列延時拍攝延時拍攝
閃光燈開啟閃光燈濾鏡設定濾鏡曝光調節曝光度
- - -> ![notes](../common/notes.svg) 說明:當連接多個攝影機時,介面上才會顯示切換攝影機按鈕 ![1](fig/switch.png)。 - -## 操作介紹 - -使用相機的前提是電腦內建攝影機或外接攝影機。打開相機後,單擊 **拍照** 或 **影片** 切換模式,您還可以在 **設定 > 拍照設定** 中開啟鏡像攝影機功能,將畫面左右翻轉。 - -> ![notes](../common/notes.svg) 說明:採用不同的解碼技術,其所支援的功能也會不同,請以實際介面為準。 - -### 拍照 - -打開相機後,預設進入拍照模式。單擊拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片文件會展示在介面。 - -![image](fig/image.png) - -### 錄製影片 - -在相機主介面,單擊 **影片**,進入影片模式。單擊錄製影片按鈕 ![transcribe](../common/record.svg) 進行錄製,錄製完成後單擊結束錄製按鈕 ![stop](../common/stop.svg),影片檔案會展示在介面,也會儲存在預設路徑下。 - -![video](fig/video.png) - -### 管理照片/影片 - -在相機主介面,右鍵單擊照片或影片檔案,可選擇複製、刪除、列印或開啟資料夾。 - -> ![notes](../common/notes.svg) 說明:僅圖片文件支援列印功能,影片文件則不會顯示列印按鈕。 - -- 複製:將選中的照片/影片複製到其他路徑。 - -- 刪除:將選中的照片/影片刪除。 - -- 列印:將選中的照片進行列印。單擊 **列印** 後,跳轉到列印預覽介面,您可以進行相關設定後再列印。 - -- 開啟資料夾:開啟照片或影片所在的資料夾。 - -![rightmenu](fig/rightmenu.png) - -## 主選單 - -在主選單中,您可以進行相機設定、切換窗口主題,查看說明手冊等操作。 - -### 設定 - -1. 在相機介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **設定**,您可以進行基本設定、拍照設定及輸出設定。 - - - 基本設定:設定照片及影片的儲存位置,選擇構圖網格樣式。 - - 拍照設定:設定音效、連拍次數、拍照延時時間、鏡像攝影機、閃光燈。 - - 輸出設定:顯示圖片的輸出格式,設定影片的輸出格式;設定照片和影片的輸出解析度。 - - -### 主題 - -窗口主題包含亮色主題、暗色主題和系統主題。 - -1. 在相機介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **主題**,選擇一個主題顏色。 - -### 說明 - -1. 在相機介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **說明**,查看相機的說明手冊,進一步了解和使用相機。 - -### 關於 - -1. 在相機介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **關於**,查看關於相機的版本和介紹。 - -### 退出 - -1. 在相機介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **退出**。 - diff --git a/src/assets/deepin-camera/camera/zh_TW/d_camera.md b/src/assets/deepin-camera/camera/zh_TW/d_camera.md index 64db98c2f..094599ea2 100644 --- a/src/assets/deepin-camera/camera/zh_TW/d_camera.md +++ b/src/assets/deepin-camera/camera/zh_TW/d_camera.md @@ -2,26 +2,26 @@ ## 概述 -相機是一款簡單易用的攝影機應用工具,可實現拍照、錄製影片等功能,支持多攝影機切換。 +相機是一款簡單易用的攝像頭應用工具,可實現拍照、錄製影片等功能,支援多鏡頭切換。 ## 使用入門 -您可以透過以下方式運行或關閉相機,或者創建捷徑。 +您可以透過以下方式執行或關閉相機,或者建立捷徑。 -### 運行相機 +### 執行相機 -1. 單擊任務欄上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg) 進入啟動器界面。 -2. 上下滾動滑鼠滾輪瀏覽或通過搜索找到「相機」按鈕 ![camera](../common/camera.svg),單擊開啟。 -3. 右鍵單擊 ![camera](../common/camera.svg) ,您可以: - - 單擊 **建立桌面捷徑**,在桌面創建捷徑。 - - 單擊 **釘選到Dock**,將應用程式固定到Dock。 - - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動運行該應用程式。 +1. 按一下工作列上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器介面。 +2. 滾動滑鼠或搜尋,找到相機圖示 ![camera](../common/camera.svg),按一下執行。 +3. 右鍵按一下 ![camera](../common/camera.svg),您可以: + - 按一下 **傳送到桌面**,在桌面建立捷徑。 + - 按一下 **釘選到工作列**,將應用程式固定到工作列。 + - 按一下 **開機自動啟動**,將應用程式加入到開機啟動項,在電腦開機時自動執行該應用程式。 ### 關閉相機 -- 在相機界面,單擊 ![close](../common/close.svg),關閉相機。 -- 右鍵單擊任務欄上的 ![camera](../common/camera.svg),選擇 **全部關閉** 關閉相機。 -- 在相機界面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出** 關閉相機。 +- 在相機介面按一下 ![close](../common/close.svg),退出相機。 +- 在工作列上右鍵按一下 ![camera](../common/camera.svg),選擇 **全部關閉**,退出相機。 +- 在相機介面按一下 ![icon_menu](../common/icon_menu.svg),選擇 **結束**,退出相機。 ## 圖示介紹 @@ -32,15 +32,15 @@ 拍照 影片 影片 - 切換攝影機 - 切換攝影機 + 切換鏡頭 + 切換鏡頭 - 展開工具列 + 展開 展開工具列 - 摺疊工具列 + 摺疊 摺疊工具列 - 延時拍攝 + 延時 延時拍攝 @@ -54,73 +54,70 @@ - -> ![notes](../common/notes.svg) 說明:當連接多個攝影機時,介面上才會顯示切換攝影機按鈕 ![1](fig/switch.png)。 +> ![notes](../common/notes.svg) 說明:當連接多個鏡頭時,介面上才會顯示切換鏡頭按鈕 ![icon](../common/switch.png)。 ## 操作介紹 -使用相機的前提是電腦內建攝影機或外接攝影機。打開相機後,單擊 **拍照** 或 **影片** 切換模式,您還可以在 **設定 > 拍照設定** 中開啟鏡像攝影機功能,將畫面左右翻轉。 +使用相機的前提是電腦內建鏡頭或外接鏡頭。開啟相機後,按一下 **拍照** 或 **影片** 切換模式,您還可以在 **設定 > 拍照設定** 中開啟鏡像鏡頭功能,將畫面左右翻轉。 -### 拍照 +> ![notes](../common/notes.svg) 說明:採用不同的解碼技術,其所支援的功能也會不同,請以實際介面為準。 -打開相機後,預設進入拍照模式。單擊拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片文件會展示在介面。 +### 拍照 -![image](fig/image.png) +開啟相機後,預設進入拍照模式。按一下拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片檔案會展示在介面。 -### 錄製影片 +image -在相機主介面,單擊 **影片**,進入影片模式。單擊錄製影片按鈕 ![transcribe](../common/record.svg) 進行錄製,錄製完成後單擊結束錄製按鈕 ![stop](../common/stop.svg),影片檔案會展示在介面,也會儲存在預設路徑下。 +### 錄製影片 -![video](fig/video.png) +在相機主介面,按一下 **影片**,進入影片模式。按一下錄製影片按鈕 transcribe 進行錄製,錄製完成後按一下結束錄製按鈕 stop,影片檔案會展示在介面,也會儲存在預設路徑下。 -### 管理照片/影片 +video -在相機主界面,右鍵單擊照片或影片檔案,可選擇複製、刪除、列印或開啟資料夾。 - > ![notes](../common/notes.svg) 說明:僅圖片文件支援列印功能,影片文件則不會顯示列印按鈕。 +### 管理圖片/影片 -- 複製:將選中的照片/影片複製到其他路徑。 +在相機主介面,右鍵按一下圖片/影片檔案,可選擇複製、刪除、列印或開啟資料夾。 -- 刪除:將選中的照片/影片刪除。 +- 複製:將選中的圖片/影片複製到其他路徑。 +- 刪除:將選中的圖片/影片刪除。 +- 列印:將選中的圖片進行列印。按一下 **列印** 後,跳轉到列印預覽介面,您可以進行相關設定後再列印。 -- 列印:將選中的照片進行列印。單擊 **列印** 後,跳轉到列印預覽介面,您可以進行相關設定後再列印。 + > ![notes](../common/notes.svg)說明:僅圖片檔案支援列印功能,影片檔案不會顯示列印按鈕。 -- 開啟資料夾:開啟照片或影片所在的資料夾。 +- 開啟資料夾:開啟圖片/影片所在的資料夾。 -![rightmenu](fig/rightmenu.png) +right_menu ## 主選單 -在主選單中,您可以進行相機設定、切換窗口主題,查看說明手冊等操作。 +在主選單中,您可以進行相機設定、切換視窗主題,檢視說明手冊等。 ### 設定 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **設定**,您可以進行基本設定、拍照設定及輸出設定。 - - 基本設定:設定照片及影片的儲存位置,選擇構圖網格樣式。 - - 拍照設定:設定音效、連拍次數、拍照延時時間、鏡像攝影機、閃光燈。 - - - 輸出設定:顯示照片/影片的輸出格式,設定輸出解析度。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **設定**,您可以進行基本設定、拍照設定及輸出設定。 + - 基本設定:設定相片和影片的預設儲存路徑,選擇構圖網格的樣式。 + - 拍照設定:設定音效、連拍次數及拍照延時時間,開啟或關閉鏡像鏡頭、閃光燈。 + - 輸出設定:顯示圖片的輸出格式,設定影片的輸出格式;設定相片和影片的輸出解析度。 ### 主題 -窗口主題包含亮色主題、暗色主題和系統主題。 - -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **主題**,選擇一個主題顏色。 +視窗主題包含淺色主題、深色主題和系統主題。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **主題**,選擇一個主題顏色。 ### 說明 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **說明**,查看相機的說明手冊,進一步了解和使用相機。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **說明**,檢視說明手冊,進一步了解和使用相機。 ### 關於 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **關於**,查看關於相機的版本和介紹。 - -### 退出 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **關於**,檢視相機的版本和介紹。 -1. 在相機界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **退出**。 +### 結束 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **結束**。 \ No newline at end of file diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/d_image.png b/src/assets/deepin-camera/camera/zh_TW/fig/d_image.png index 14f962da2..2b8aec4b2 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/d_image.png and b/src/assets/deepin-camera/camera/zh_TW/fig/d_image.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/d_outputsettings.png b/src/assets/deepin-camera/camera/zh_TW/fig/d_outputsettings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/d_rightmenu.png b/src/assets/deepin-camera/camera/zh_TW/fig/d_rightmenu.png index 1fde1b0ee..e698e5ceb 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/d_rightmenu.png and b/src/assets/deepin-camera/camera/zh_TW/fig/d_rightmenu.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/d_settings.png b/src/assets/deepin-camera/camera/zh_TW/fig/d_settings.png old mode 100755 new mode 100644 diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/d_video.png b/src/assets/deepin-camera/camera/zh_TW/fig/d_video.png index 9fd4d9379..81bd5e4e0 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/d_video.png and b/src/assets/deepin-camera/camera/zh_TW/fig/d_video.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/image.png b/src/assets/deepin-camera/camera/zh_TW/fig/image.png index 31eeaff63..7f849b646 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/image.png and b/src/assets/deepin-camera/camera/zh_TW/fig/image.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/right-menu.png b/src/assets/deepin-camera/camera/zh_TW/fig/right-menu.png index 84d25aa94..7986e6cfd 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/right-menu.png and b/src/assets/deepin-camera/camera/zh_TW/fig/right-menu.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/right_menu.png b/src/assets/deepin-camera/camera/zh_TW/fig/right_menu.png new file mode 100644 index 000000000..ebf6da1fa Binary files /dev/null and b/src/assets/deepin-camera/camera/zh_TW/fig/right_menu.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/rightmenu.png b/src/assets/deepin-camera/camera/zh_TW/fig/rightmenu.png index 0dd1ab737..ab3163631 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/rightmenu.png and b/src/assets/deepin-camera/camera/zh_TW/fig/rightmenu.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/fig/video.png b/src/assets/deepin-camera/camera/zh_TW/fig/video.png index 8e0839b10..4fcbc7183 100644 Binary files a/src/assets/deepin-camera/camera/zh_TW/fig/video.png and b/src/assets/deepin-camera/camera/zh_TW/fig/video.png differ diff --git a/src/assets/deepin-camera/camera/zh_TW/p_camera.md b/src/assets/deepin-camera/camera/zh_TW/p_camera.md new file mode 100644 index 000000000..094599ea2 --- /dev/null +++ b/src/assets/deepin-camera/camera/zh_TW/p_camera.md @@ -0,0 +1,123 @@ +# 相機|deepin-camera| + +## 概述 + +相機是一款簡單易用的攝像頭應用工具,可實現拍照、錄製影片等功能,支援多鏡頭切換。 + +## 使用入門 + +您可以透過以下方式執行或關閉相機,或者建立捷徑。 + +### 執行相機 + +1. 按一下工作列上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器介面。 +2. 滾動滑鼠或搜尋,找到相機圖示 ![camera](../common/camera.svg),按一下執行。 +3. 右鍵按一下 ![camera](../common/camera.svg),您可以: + - 按一下 **傳送到桌面**,在桌面建立捷徑。 + - 按一下 **釘選到工作列**,將應用程式固定到工作列。 + - 按一下 **開機自動啟動**,將應用程式加入到開機啟動項,在電腦開機時自動執行該應用程式。 + +### 關閉相機 + +- 在相機介面按一下 ![close](../common/close.svg),退出相機。 +- 在工作列上右鍵按一下 ![camera](../common/camera.svg),選擇 **全部關閉**,退出相機。 +- 在相機介面按一下 ![icon_menu](../common/icon_menu.svg),選擇 **結束**,退出相機。 + +## 圖示介紹 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
拍照拍照影片影片切換鏡頭切換鏡頭
展開展開工具列摺疊摺疊工具列延時延時拍攝
閃光燈開啟閃光燈濾鏡設定濾鏡曝光調節曝光度
+ +> ![notes](../common/notes.svg) 說明:當連接多個鏡頭時,介面上才會顯示切換鏡頭按鈕 ![icon](../common/switch.png)。 + +## 操作介紹 + +使用相機的前提是電腦內建鏡頭或外接鏡頭。開啟相機後,按一下 **拍照** 或 **影片** 切換模式,您還可以在 **設定 > 拍照設定** 中開啟鏡像鏡頭功能,將畫面左右翻轉。 + +> ![notes](../common/notes.svg) 說明:採用不同的解碼技術,其所支援的功能也會不同,請以實際介面為準。 + +### 拍照 + +開啟相機後,預設進入拍照模式。按一下拍照按鈕 ![photograph](../common/photograph.png),拍攝的圖片檔案會展示在介面。 + +image + +### 錄製影片 + +在相機主介面,按一下 **影片**,進入影片模式。按一下錄製影片按鈕 transcribe 進行錄製,錄製完成後按一下結束錄製按鈕 stop,影片檔案會展示在介面,也會儲存在預設路徑下。 + +video + +### 管理圖片/影片 + +在相機主介面,右鍵按一下圖片/影片檔案,可選擇複製、刪除、列印或開啟資料夾。 + +- 複製:將選中的圖片/影片複製到其他路徑。 +- 刪除:將選中的圖片/影片刪除。 +- 列印:將選中的圖片進行列印。按一下 **列印** 後,跳轉到列印預覽介面,您可以進行相關設定後再列印。 + + > ![notes](../common/notes.svg)說明:僅圖片檔案支援列印功能,影片檔案不會顯示列印按鈕。 + +- 開啟資料夾:開啟圖片/影片所在的資料夾。 + +right_menu + +## 主選單 + +在主選單中,您可以進行相機設定、切換視窗主題,檢視說明手冊等。 + +### 設定 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **設定**,您可以進行基本設定、拍照設定及輸出設定。 + + - 基本設定:設定相片和影片的預設儲存路徑,選擇構圖網格的樣式。 + - 拍照設定:設定音效、連拍次數及拍照延時時間,開啟或關閉鏡像鏡頭、閃光燈。 + - 輸出設定:顯示圖片的輸出格式,設定影片的輸出格式;設定相片和影片的輸出解析度。 + +### 主題 + +視窗主題包含淺色主題、深色主題和系統主題。 +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **主題**,選擇一個主題顏色。 + +### 說明 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **說明**,檢視說明手冊,進一步了解和使用相機。 + +### 關於 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **關於**,檢視相機的版本和介紹。 + +### 結束 + +1. 在相機介面,按一下 ![icon_menu](../common/icon_menu.svg)。 +2. 按一下 **結束**。 \ No newline at end of file diff --git a/src/assets/images/icons/dark/camera_switch_not_on_dark.svg b/src/assets/images/icons/dark/camera_switch_not_on_dark.svg new file mode 100644 index 000000000..724e054a1 --- /dev/null +++ b/src/assets/images/icons/dark/camera_switch_not_on_dark.svg @@ -0,0 +1,57 @@ + + + 插图 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/images/icons/light/camera_switch_not_on.svg b/src/assets/images/icons/light/camera_switch_not_on.svg new file mode 100644 index 000000000..724e054a1 --- /dev/null +++ b/src/assets/images/icons/light/camera_switch_not_on.svg @@ -0,0 +1,57 @@ + + + 插图 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/org.deepin.camera.encode.json b/src/assets/org.deepin.camera.encode.json index 64bad69a5..acc667024 100644 --- a/src/assets/org.deepin.camera.encode.json +++ b/src/assets/org.deepin.camera.encode.json @@ -1,16 +1,136 @@ { - "magic": "dsg.config.meta", - "version": "1.0", - "contents": { - "mp4EncodeMode": { - "value": -1, - "serial": 0, - "flags": ["global"], - "name": "pugx mp4 code mode", - "name[zh_CN]": "特殊编码模式", - "description": "pugx mp4 code mode", - "permissions": "readwrite", - "visibility": "private" - } - } -} \ No newline at end of file + "magic": "dsg.config.meta", + "version": "1.0", + "contents": { + "mp4EncodeMode": { + "value": -1, + "serial": 0, + "flags": ["global"], + "name": "pugx mp4 code mode", + "name[zh_CN]": "特殊编码模式", + "description": "pugx mp4 code mode", + "permissions": "readwrite", + "visibility": "private" + }, + "forceGles": { + "value": -1, + "serial": 0, + "flags": ["global"], + "name": "forc elgs show in wayland", + "name[zh_CN]": "在 wayland 下特殊显示模式", + "description": "special mode do use gles to show", + "permissions": "readwrite", + "visibility": "private" + }, + "projectID": { + "value": "", + "serial": 0, + "flags": ["global"], + "name": "project ID", + "name[zh_CN]": "不同项目下的定制内容", + "description": "Customized content under different projects", + "permissions": "readwrite", + "visibility": "private" + }, + "libVaDriverName": { + "value": "", + "serial": 0, + "flags": ["global"], + "name": "libva driver name", + "name[zh_CN]": "启用VAAPI硬件编解码的驱动名称,配置环境变量LIBVA_DRIVER_NAME,如LIBVA_DRIVER_NAME=zx", + "description": "Name of the VAAPI driver for enabling hardware codec", + "permissions": "readwrite", + "visibility": "private" + }, + "libVdpauDriver": { + "value": "", + "serial": 0, + "flags": ["global"], + "name": "vdpau driver", + "name[zh_CN]": "启用VDPAU硬件编解码的驱动名称,配置环境变量VDPAU_DRIVER,如VDPAU_DRIVER=nvidia_vdpau", + "description": "Name of the VDPAU driver for enabling hardware codec", + "permissions": "readwrite", + "visibility": "private" + }, + "supportCameraSwitch": { + "value": false, + "serial": 0, + "flags": ["global"], + "name": "support camera switch", + "name[zh_CN]": "是否带有摄像头开关", + "description": "Whether the device has a physical camera switch", + "permissions": "readwrite", + "visibility": "private" + }, + "previewNoDelay": { + "value": false, + "serial": 0, + "flags": ["global"], + "name": "preview no delay", + "name[zh_CN]": "是否预览无延迟", + "description": "is preview no delay or not", + "permissions": "readwrite", + "visibility": "private" + }, + "enableUsbGroup": { + "value": false, + "serial": 0, + "flags": ["global"], + "name": "enable USB group", + "name[zh_CN]": "是否启用USB摄像头分组", + "description": "Enable USB group", + "permissions": "readwrite", + "visibility": "private" + }, + "enable8kPreview": { + "value": false, + "serial": 0, + "flags": ["global"], + "name": "enable 8k preview", + "name[zh_CN]": "是否启用8K预览", + "description": "Enable 8k preview", + "permissions": "readwrite", + "visibility": "private" + }, + "deviceBlacklist": { + "value": [], + "serial": 0, + "flags": ["global"], + "name": "device blacklist", + "name[zh_CN]": "设备黑名单", + "description": "Set device blacklist, format: vid,pid,name", + "permissions": "readwrite", + "visibility": "private" + }, + "preferredResolution": { + "value": "", + "serial": 0, + "flags": ["global"], + "name": "preferred resolution", + "name[zh_CN]": "首选分辨率", + "description": "Set preferred resolution", + "permissions": "readwrite", + "visibility": "private" + }, + "isLowPerformanceDevice": { + "value": false, + "serial": 0, + "flags": ["global"], + "name": "is low performance device", + "name[zh_CN]": "是否是低性能设备", + "description": "Is low performance device", + "permissions": "readwrite", + "visibility": "private" + }, + "useRgbData": { + "value": -1, + "serial": 0, + "flags": ["global"], + "name": "use RGB data for preview", + "name[zh_CN]": "是否使用RGB数据进行预览显示,-1表示不设置,由系统自动判断;0表示强制关闭;1表示强制开启", + "description": "Force use RGB data for preview rendering. -1: not set (auto), 0: force disable, 1: force enable. When enabled, YUV frames will be converted to RGB format before display.", + "permissions": "readwrite", + "visibility": "private" + } + } +} diff --git a/src/assets/org.deepin.camera.json b/src/assets/org.deepin.camera.json new file mode 100644 index 000000000..54f5e39f4 --- /dev/null +++ b/src/assets/org.deepin.camera.json @@ -0,0 +1,17 @@ +{ + "magic": "dsg.config.meta", + "version": "1.0", + "contents": { + "log_rules": { + "value": "*.debug=false;*.info=false;org.deepin.camera*.warning=true", + "serial": 0, + "flags": ["global"], + "name": "log rules", + "name[zh_CN]": "日志规则", + "description": "log rules", + "description[zh_CN]": "日志规则", + "permissions": "readwrite", + "visibility": "public" + } + } +} diff --git a/src/com.deepin.Camera.service b/src/com.deepin.Camera.service index bcc39d012..1be34f45d 100644 --- a/src/com.deepin.Camera.service +++ b/src/com.deepin.Camera.service @@ -1,4 +1,3 @@ -$ cat /usr/share/dbus-1/services/com.deepin.Camera.service [D-BUS Service] Name=com.deepin.Camera -Exec=/usr/bin/qdbus --literal com.deepin.SessionManager /com/deepin/StartManager com.deepin.StartManager.Launch /usr/share/applications/deepin-camera.desktop +Exec=deepin-camera diff --git a/src/com.deepin.Camera.xml b/src/com.deepin.Camera.xml new file mode 100644 index 000000000..a0f9decab --- /dev/null +++ b/src/com.deepin.Camera.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/configs/json/org_deepin_camera_encode.hpp b/src/configs/json/org_deepin_camera_encode.hpp new file mode 100644 index 000000000..aad0b4cbb --- /dev/null +++ b/src/configs/json/org_deepin_camera_encode.hpp @@ -0,0 +1,174 @@ +// SPDX-FileCopyrightText: 2024 - 2025 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef ORG_DEEPIN_CAMERA_ENCODE_H +#define ORG_DEEPIN_CAMERA_ENCODE_H + +#include +#include +#include +#include +#include +#include + +class org_deepin_camera_encode : public QObject { + Q_OBJECT + + Q_PROPERTY(double mp4EncodeMode READ mp4EncodeMode WRITE setMp4EncodeMode NOTIFY mp4EncodeModeChanged) +public: + explicit org_deepin_camera_encode(QThread *thread, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr) + : QObject(parent) { + + if (!thread->isRunning()) { + qWarning() << QStringLiteral("Warning: The provided thread is not running."); + } + Q_ASSERT(QThread::currentThread() != thread); + auto worker = new QObject(); + worker->moveToThread(thread); + QMetaObject::invokeMethod(worker, [=]() { + auto config = DTK_CORE_NAMESPACE::DConfig::create(appId, name, subpath, nullptr); + if (!config) { + qWarning() << QStringLiteral("Failed to create DConfig instance."); + worker->deleteLater(); + return; + } + config->moveToThread(QThread::currentThread()); + initialize(config); + worker->deleteLater(); + }); + } + explicit org_deepin_camera_encode(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr) + : QObject(parent) { + + if (!thread->isRunning()) { + qWarning() << QStringLiteral("Warning: The provided thread is not running."); + } + Q_ASSERT(QThread::currentThread() != thread); + auto worker = new QObject(); + worker->moveToThread(thread); + QMetaObject::invokeMethod(worker, [=]() { + auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, appId, name, subpath, nullptr); + if (!config) { + qWarning() << QStringLiteral("Failed to create DConfig instance."); + worker->deleteLater(); + return; + } + config->moveToThread(QThread::currentThread()); + initialize(config); + worker->deleteLater(); + }); + } + explicit org_deepin_camera_encode(QThread *thread, const QString &name, const QString &subpath, QObject *parent = nullptr) + : QObject(parent) { + + if (!thread->isRunning()) { + qWarning() << QStringLiteral("Warning: The provided thread is not running."); + } + Q_ASSERT(QThread::currentThread() != thread); + auto worker = new QObject(); + worker->moveToThread(thread); + QMetaObject::invokeMethod(worker, [=]() { + auto config = DTK_CORE_NAMESPACE::DConfig::create(name, subpath, nullptr); + if (!config) { + qWarning() << QStringLiteral("Failed to create DConfig instance."); + worker->deleteLater(); + return; + } + config->moveToThread(QThread::currentThread()); + initialize(config); + worker->deleteLater(); + }); + } + explicit org_deepin_camera_encode(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent = nullptr) + : QObject(parent) { + + if (!thread->isRunning()) { + qWarning() << QStringLiteral("Warning: The provided thread is not running."); + } + Q_ASSERT(QThread::currentThread() != thread); + auto worker = new QObject(); + worker->moveToThread(thread); + QMetaObject::invokeMethod(worker, [=]() { + auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, name, subpath, nullptr); + if (!config) { + qWarning() << QStringLiteral("Failed to create DConfig instance."); + worker->deleteLater(); + return; + } + config->moveToThread(QThread::currentThread()); + initialize(config); + worker->deleteLater(); + }); + } + ~org_deepin_camera_encode() { + if (m_config.loadRelaxed()) { + m_config.loadRelaxed()->deleteLater(); + } + } + + double mp4EncodeMode() const { + return p_mp4EncodeMode; + } + void setMp4EncodeMode(const double &value) { + auto oldValue = p_mp4EncodeMode; + p_mp4EncodeMode = value; + markPropertySet(0); + if (auto config = m_config.loadRelaxed()) { + QMetaObject::invokeMethod(config, [this, value]() { + m_config.loadRelaxed()->setValue(QStringLiteral("mp4EncodeMode"), value); + }); + } + if (p_mp4EncodeMode != oldValue) { + Q_EMIT mp4EncodeModeChanged(); + } + } +Q_SIGNALS: + void mp4EncodeModeChanged(); +private: + void initialize(DTK_CORE_NAMESPACE::DConfig *config) { + Q_ASSERT(!m_config.loadRelaxed()); + m_config.storeRelaxed(config); + if (testPropertySet(0)) { + config->setValue(QStringLiteral("mp4EncodeMode"), QVariant::fromValue(p_mp4EncodeMode)); + } else { + updateValue(QStringLiteral("mp4EncodeMode"), QVariant::fromValue(p_mp4EncodeMode)); + } + + connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) { + updateValue(key); + }, Qt::DirectConnection); + } + void updateValue(const QString &key, const QVariant &fallback = QVariant()) { + Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread()); + const QVariant &value = m_config.loadRelaxed()->value(key, fallback); + if (key == QStringLiteral("mp4EncodeMode")) { + auto newValue = qvariant_cast(value); + QMetaObject::invokeMethod(this, [this, newValue]() { + if (p_mp4EncodeMode != newValue) { + p_mp4EncodeMode = newValue; + Q_EMIT mp4EncodeModeChanged(); + } + }); + return; + } + } + inline void markPropertySet(const int index) { + if (index < 32) { + m_propertySetStatus0.fetchAndOrOrdered(1 << (index - 0)); + return; + } + Q_UNREACHABLE(); + } + inline bool testPropertySet(const int index) const { + if (index < 32) { + return (m_propertySetStatus0.loadRelaxed() & (1 << (index - 0))); + } + Q_UNREACHABLE(); + } + QAtomicPointer m_config = nullptr; + double p_mp4EncodeMode { -1 }; + QAtomicInteger m_propertySetStatus0 = 0; +}; + +#endif // ORG_DEEPIN_CAMERA_ENCODE_H diff --git a/src/deepin-camera.desktop b/src/deepin-camera.desktop index 99dc3e3b1..428525471 100644 --- a/src/deepin-camera.desktop +++ b/src/deepin-camera.desktop @@ -10,6 +10,7 @@ Terminal=false Type=Application X-Deepin-TurboType=dtkwidget X-Deepin-Vendor=deepin +X-Deepin-Singleton=true X-MultipleArgs=false # Translations: @@ -30,6 +31,7 @@ Comment[hu]=A Kamera egy kép- és videofelvételi segédprogram, amely a szám Comment[it]=Camera è un'app di acquisizione immagini e video che sfrutta la camera integrata nel tuo dispositivo. Localizzazione italiana a cura di Massimo A. Carofano. Comment[ka]=კამერა არის ხელსაწყო სურათის და ვიდეოს გადასაღებად, კომპიუტერის ინტეგრირებული კამერის ანდ დამატებითი ვებ კამერის გამოყენებით Comment[ko]=카메라는 PC 카메라 또는 웹캠을 사용하는 이미지 및 비디오 캡처 유틸리티입니다. +Comment[lo]=ກ້ອງຖ່າຍຮູບແມ່ນເຄື່ອງມືຖ່າຍຮູບ ແລະ ບັນທຶກວິດີໂອໂດຍໃຊ້ກ້ອງຂອງຄອມພິວເຕີ ຫຼື ເວັບແຄມ Comment[ms]=Kamera ialah sebuah utiliti tangkapan imej dan video menggunakan kamera PC atau kamera sesawang anda. Comment[nl]=Met Camera kun je foto's en video's maken met je camera of webcam. Comment[pl]=Kamera to narzędzie do przechwytywania obrazów i wideo za pomocą kamery komputera lub kamery internetowej. @@ -62,6 +64,7 @@ GenericName[hu]=Kamera GenericName[it]=Camera GenericName[ka]=კამერა GenericName[ko]=카메라 +GenericName[lo]=ກ້ອງຖ່າຍຮູບ GenericName[ms]=Kamera GenericName[nl]=Camera GenericName[pl]=Kamera @@ -94,6 +97,7 @@ Name[hu]=Deepin® Kamera Name[it]=Deepin Camera Name[ka]=კამერა Name[ko]=Deepin 카메라 +Name[lo]=Deepin ກ້ອງຖ່າຍຮູບ Name[ms]=Kamera Deepin Name[nl]=Deepin Camera Name[pl]=Kamera Deepin @@ -107,7 +111,7 @@ Name[sr]=Дипин Камера Name[tr]=Deepin Kamera Name[ug]=Deepinكامىرا Name[uk]=Камера Deepin -Name[zh_CN]=深度相机 -Name[zh_HK]=Deepin 相機 -Name[zh_TW]=Deepin 相機 +Name[zh_CN]=相机 +Name[zh_HK]=相機 +Name[zh_TW]=相機 diff --git a/src/main.cpp b/src/main.cpp index 5fc4984f9..ad18c2044 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,36 +1,51 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later +#include "ddlog.h" +using namespace DDLog; extern "C" { #include "camview.h" +#include "v4l2_formats.h" } #include "mainwindow.h" #include "capplication.h" #include "cameraconfig.h" #include "acobjectlist.h" #include "dbus_adpator.h" +#include #ifdef DTKCORE_CLASS_DConfigFile #include #endif extern "C" { -#include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + #include +#else + #include +#endif } #include #include #include +#if QT_VERSION_MAJOR <= 5 #include +#endif + +#include "ddlog.h" +#include "logconfigread.h" #include #include +#include #include #include #include +#include #ifndef DEEPIN_CAMERA_PRO #include "config.h" @@ -43,135 +58,269 @@ DWIDGET_USE_NAMESPACE //判断是否采用wayland显示服务器 static bool CheckWayland() { + qCDebug(appLog) << "Function started: CheckWayland"; auto e = QProcessEnvironment::systemEnvironment(); QString XDG_SESSION_TYPE = e.value(QStringLiteral("XDG_SESSION_TYPE")); QString WAYLAND_DISPLAY = e.value(QStringLiteral("WAYLAND_DISPLAY")); if (XDG_SESSION_TYPE == QLatin1String("wayland") || WAYLAND_DISPLAY.contains(QLatin1String("wayland"), Qt::CaseInsensitive)) { + qCDebug(appLog) << "Condition check: Wayland environment detected"; return true; - } else - return false; + } + qCDebug(appLog) << "Condition check: Non-Wayland environment detected"; + return false; } static bool CheckFFmpegEnv() { + qCDebug(appLog) << "Function started: CheckFFmpegEnv"; QDir dir; QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); dir.setPath(path); QStringList list = dir.entryList(QStringList() << (QString("libavcodec") + "*"), QDir::NoDotAndDotDot | QDir::Files); - QString libName = nullptr; + QString libName = "libavcodec.so"; // set default name for load if not find in LibrariesPath +#if QT_VERSION_MAJOR > 5 + QRegularExpression re("libavcodec.so.*"); //Sometimes libavcodec.so may not exist, so find it through regular expression. + for (int i = 0; i < list.count(); i++) { + QRegularExpressionMatch match = re.match(list[i]); + if (match.hasMatch()) { + libName = list[i]; + qCDebug(appLog) << "Found matching library:" << libName; + break; + } + } +#else QRegExp re("libavcodec.so.*"); //Sometimes libavcodec.so may not exist, so find it through regular expression. for (int i = 0; i < list.count(); i++) { if (re.exactMatch(list[i])) { libName = list[i]; + qCDebug(appLog) << "Found matching library:" << libName; break; } } +#endif - if (libName != nullptr) { - QLibrary libavcodec; //检查编码器是否存在 - libavcodec.setFileName(libName); - qDebug() << "Whether the libavcodec is loaded successfully: " << libavcodec.load(); - typedef AVCodec *(*p_avcodec_find_encoder)(enum AVCodecID id); - p_avcodec_find_encoder m_avcodec_find_encoder = nullptr; - m_avcodec_find_encoder = reinterpret_cast(libavcodec.resolve("avcodec_find_encoder")); - - AVCodec *pCodec = nullptr; - if (m_avcodec_find_encoder) - pCodec = m_avcodec_find_encoder(AV_CODEC_ID_H264); + QLibrary libavcodec; //检查编码器是否存在 + libavcodec.setFileName(libName); + if (!libavcodec.load()) { + qCDebug(appLog) << "Condition check: Library loading failed"; + qCWarning(appLog) << QString("Not found libavcodec: %1").arg(libavcodec.errorString()); + return false; + } + qCDebug(appLog) << "The libavcodec is loaded successfully."; + typedef AVCodec *(*p_avcodec_find_encoder)(enum AVCodecID id); + p_avcodec_find_encoder m_avcodec_find_encoder = nullptr; + m_avcodec_find_encoder = reinterpret_cast(libavcodec.resolve("avcodec_find_encoder")); + + AVCodec *pCodec = nullptr; + if (m_avcodec_find_encoder) + pCodec = m_avcodec_find_encoder(AV_CODEC_ID_H264); + + if (pCodec) { + qCDebug(appLog) << "Video encoder exists. AVCodecID:" << AV_CODEC_ID_H264; + DataManager::instance()->setEncExists(true); + } else { + qCWarning(appLog) << "Can not find output video encoder! AVCodecID:" << AV_CODEC_ID_H264; + DataManager::instance()->setEncExists(false); + } - if (pCodec) { - qDebug() << "Video encoder exists. AVCodecID:" << AV_CODEC_ID_H264; - DataManager::instance()->setEncExists(true); - } else { - qWarning() << "Can not find output video encoder! AVCodecID:" << AV_CODEC_ID_H264; - DataManager::instance()->setEncExists(false); - } + qCDebug(appLog) << "Function completed: CheckFFmpegEnv"; + return true; +} - return true; - } - return false; +// 由于DDE在某些情况下会kill掉deepin-camera进程,同时埋点会认为deepin-camera出错,所以这里监听信号,正常退出 +// 添加信号处理函数 +static void handleSignal(int sig) +{ + qCWarning(appLog) << "Received signal:" << sig; + // 在HW机器、SW机器上,发现使用exit(0)退出会导致Qt某些函数空指针异常,从而导致崩溃,疑似在资源回收环节出了问题。所以我们使用QApplication::quit()更优雅地退出。 + QTimer::singleShot(0, qApp, []() { + QApplication::quit(); + }); + //exit(0); } int main(int argc, char *argv[]) { + // 初始化日志规则:读取环境变量和 DConfig 配置 + MLogger logger; + + qCInfo(appLog) << "Starting deepin-camera application..."; // Task 326583 不参与合成器崩溃重连 unsetenv("QT_WAYLAND_RECONNECT"); QAccessible::installFactory(accessibleFactory); bool bWayland = CheckWayland(); + qCInfo(appLog) << "Wayland status:" << (bWayland ? "enabled" : "disabled"); + bool bFFmpegEnv = CheckFFmpegEnv(); if (argc > 1) { + qCDebug(appLog) << "Condition check: Arguments found"; if (QString(argv[1]) == "-g") { bFFmpegEnv = false; - qDebug() << "当前为gstreamer测试环境.."; + qCDebug(appLog) << "Running in gstreamer test environment"; } } DataManager::instance()->setEncodeEnv(bFFmpegEnv ? FFmpeg_Env : GStreamer_Env); + qCInfo(appLog) << "Encoding environment:" << (bFFmpegEnv ? "FFmpeg" : "GStreamer"); //root login for this application if (!QString(qgetenv("XDG_CURRENT_DESKTOP")).toLower().startsWith("deepin")) { setenv("XDG_CURRENT_DESKTOP", "Deepin", 1); + qCDebug(appLog) << "Set XDG_CURRENT_DESKTOP to Deepin"; } if (bWayland) { - //默认走xdgv6,该库没有维护了,因此需要添加该代码 - qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell"); + qCDebug(appLog) << "Condition check: Wayland configuration required"; QSurfaceFormat format; format.setRenderableType(QSurfaceFormat::OpenGLES); format.setDefaultFormat(format); set_wayland_status(1); - - int mp4Encode = -1; + } + int mp4Encode = -1; #ifdef DTKCORE_CLASS_DConfigFile - //需要查询是否对PGUX设置MP4编码缓存特殊处理 - DConfig *dconfig = DConfig::create("org.deepin.camera", "org.deepin.camera.encode"); - if (dconfig && dconfig->isValid() && dconfig->keyList().contains("mp4EncodeMode")) { - mp4Encode = dconfig->value("mp4EncodeMode").toInt(); - set_pugx_status(mp4Encode); - } -#endif - qInfo() << "mp4EncodeMode value is:" << get_pugx_status(); - if (mp4Encode == -1) { - //判断是否是pgux - QStringList options; - options << QString(QStringLiteral("-c")); - options << QString(QStringLiteral("dmidecode -s system-product-name|awk '{print $NF}'")); - QProcess process; - process.start(QString(QStringLiteral("bash")), options); - process.waitForFinished(); - process.waitForReadyRead(); - QByteArray tempArray = process.readAllStandardOutput(); - char *charTemp = tempArray.data(); - QString str_output = QString(QLatin1String(charTemp)); - process.close(); - - if (str_output.contains("PGUX", Qt::CaseInsensitive)) { - mp4Encode = 1; - qDebug() << "this is PGUX"; - } else { - mp4Encode = 0; + //需要查询是否对X机型设置MP4编码缓存特殊处理 + DConfig *dconfig = DConfig::create("org.deepin.camera", "org.deepin.camera.encode"); + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("mp4EncodeMode")) { + mp4Encode = dconfig->value("mp4EncodeMode").toInt(); + set_pugx_status(mp4Encode); + } + + int forceGles = -1; + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("forceGles")) { + forceGles = dconfig->value("forceGles").toInt(); + set_forceGles(forceGles); + } + + QString projectId = ""; + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("projectID")) { + projectId = dconfig->value("projectID").toString(); + set_project_id(projectId.toUtf8().constData()); + } + + QString libVaDriverName = ""; + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("libVaDriverName")) { + libVaDriverName = dconfig->value("libVaDriverName").toString(); + set_libva_driver_name(libVaDriverName.toUtf8().constData()); + } + + QString libVdpauDriverName = ""; + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("libVdpauDriver")) { + libVdpauDriverName = dconfig->value("libVdpauDriver").toString(); + set_libvdpau_driver_name(libVdpauDriverName.toUtf8().constData()); + } + + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("supportCameraSwitch")) { + DataManager::instance()->setIsSupportCameraSwitch(dconfig->value("supportCameraSwitch").toBool()); + } + + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("previewNoDelay")) { + DataManager::instance()->setPreviewNoDelay(dconfig->value("previewNoDelay", false).toBool()); + } + + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("enableUsbGroup")) { + bool enable = dconfig->value("enableUsbGroup").toBool(); + qCInfo(appLog) << "enable USB group:" << enable; + DataManager::instance()->setEnableUsbGroup(enable); + } + + // 是否开启8K预览通过DConfig控制,目前要求开启8K预览的厂家是希沃 + // 希沃的8K分辨率是8192x2772,希沃在8K预览的时候表现正常,在录像的时候表现异常,所以在开启8K预览的时候我们会禁用录像功能 + // 8K预览功能默认关闭,因为多个厂家的摄像头在8K预览的时候表现异常 + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("enable8kPreview")) { + bool enable = dconfig->value("enable8kPreview").toBool(); + qCInfo(appLog) << "enable 8K preview:" << enable; + DataManager::instance()->setEnable8kPreview(enable); + set_enable_8k_preview(enable ? 1 : 0); + } + + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("deviceBlacklist")) { + QStringList deviceBlacklist = dconfig->value("deviceBlacklist").toStringList(); + qCInfo(appLog) << "device blacklist:" << deviceBlacklist; + DataManager::instance()->setDeviceBlacklist(deviceBlacklist); + } + + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("preferredResolution")) { + QString preferredResolution = dconfig->value("preferredResolution").toString(); + qCInfo(appLog) << "preferred resolution:" << preferredResolution; + if (!preferredResolution.isEmpty()) { + DataManager::instance()->setPreferredResolution(preferredResolution); + QSize size = DataManager::instance()->getPreferredResolution(); + if (!size.isNull()) { + set_preferred_resolution(size.width(), size.height()); } - qInfo() << "process find mp4EncodeMode value is:" << get_pugx_status(); } + } - set_pugx_status(mp4Encode); - qInfo() << "last mp4EncodeMode value is:" << get_pugx_status(); + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("useRgbData")) { + int useRgbData = dconfig->value("useRgbData").toInt(); + if (useRgbData != -1 && useRgbData != 0 && useRgbData != 1) { + qCWarning(appLog) << "Invalid useRgbData value in config:" << useRgbData << "- mapping to default value -1 (auto)"; + useRgbData = -1; + } + qCInfo(appLog) << "use RGB data for preview:" << useRgbData; + DataManager::instance()->setUseRgbData(useRgbData); + } + + if (!libVaDriverName.isEmpty()) { + qputenv("LIBVA_DRIVER_NAME", libVaDriverName.toLocal8Bit()); } + if (!libVdpauDriverName.isEmpty()) { + qputenv("VDPAU_DRIVER", libVdpauDriverName.toLocal8Bit()); + } +#endif + qCInfo(appLog) << "mp4EncodeMode value is:" << get_pugx_status(); + qCInfo(appLog) << "projectID value is:" << get_project_id(); + qCInfo(appLog) << "libVaDriverName value is:" << get_libva_driver_name(); + qCInfo(appLog) << "libVdpauDriverName value is:" << get_libvdpau_driver_name(); + qCInfo(appLog) << "LIBVA_DRIVER_NAME value is:" << qgetenv("LIBVA_DRIVER_NAME"); + qCInfo(appLog) << "VDPAU_DRIVER value is:" << qgetenv("VDPAU_DRIVER"); + if (mp4Encode == -1) { + //判断是否是X机型 + QStringList options; + options << QString(QStringLiteral("-c")); + options << QString(QStringLiteral("dmidecode -t 11 | grep 'String 4' | awk '{print $NF}' && " + "dmidecode -s system-product-name|awk '{print $NF}'")); + QProcess process; + process.start(QString(QStringLiteral("bash")), options); + process.waitForFinished(); + process.waitForReadyRead(); + QByteArray tempArray = process.readAllStandardOutput(); + char *charTemp = tempArray.data(); + QString str_output = QString(QLatin1String(charTemp)); + process.close(); + + if (str_output.contains("PGUX", Qt::CaseInsensitive)) { + mp4Encode = 1; + qCDebug(appLog) << "this is PGUX"; + } else { + mp4Encode = 0; + } + qCInfo(appLog) << "process find mp4EncodeMode value is:" << get_pugx_status(); + } + + set_pugx_status(mp4Encode); + qCInfo(appLog) << "last mp4EncodeMode value is:" << get_pugx_status(); + +#if QT_VERSION_MAJOR > 5 + QElapsedTimer time; +#else QTime time; +#endif time.start(); QString lutDir = LUT_DIR; initFilters(lutDir.toStdString().c_str()); - qDebug() << QString("initFilters cost %1 ms").arg(time.elapsed()); - + qCDebug(appLog) << "LUT_DIR: " << lutDir; + qCDebug(appLog) << QString("Filter initialization completed in %1 ms").arg(time.elapsed()); CApplication a(argc, argv); - //gst_init(&argc, &argv); + // 注册信号处理函数 + // 放在此处,是为了确保Application已经创建了实例 + signal(SIGTERM, handleSignal); // kill默认发送的信号 qApp->setObjectName("deepin-camera"); #ifndef __mips__ qApp->setAttribute(Qt::AA_UseHighDpiPixmaps); - // overwrite DApplication default value qApp->setAttribute(Qt::AA_ForceRasterWidgets, false); #endif @@ -185,51 +334,64 @@ int main(int argc, char *argv[]) qApp->setApplicationDisplayName(QObject::tr("Camera")); //设置产品名称 qApp->setProductName(QObject::tr("Camera")); + //日志 DLogManager::registerConsoleAppender(); DLogManager::registerFileAppender(); - qInfo() << "LogFile:" << DLogManager::getlogFilePath(); + qCInfo(appLog) << "Log system initialized. Log file:" << DLogManager::getlogFilePath(); //版本 qApp->setApplicationVersion(DApplication::buildVersion(VERSION)); QIcon myIcon = QIcon::fromTheme("deepin-camera"); qApp->setWindowIcon(myIcon); qApp->setProductIcon(myIcon);//08月21获悉已添加到系统,故更改为从系统获取 + qCDebug(appLog) << "Application version:" << DApplication::buildVersion(VERSION); //应用描述 qApp->setApplicationDescription(QObject::tr("Camera is an image and video capture utility using your PC camera or webcam.")); dc::Settings::get().init(); + qCDebug(appLog) << "Application settings initialized"; +#if QT_VERSION_MAJOR <= 5 DApplicationSettings saveTheme; +#endif if (!qApp->setSingleInstance("deepin-camera")) { - qDebug() << "another deepin camera instance has started"; + qCWarning(appLog) << "Another deepin camera instance is already running"; QDBusInterface iface("com.deepin.camera", QDir::separator(), "com.deepin.camera"); if (iface.isValid()) { - qDebug() << "deepin-camera raise"; + qCDebug(appLog) << "Attempting to raise existing instance"; iface.asyncCall("Raise"); } + qCDebug(appLog) << "Function completed: main (exit due to existing instance)"; exit(0); } CMainWindow w; a.setMainWindow(&w); + qCDebug(appLog) << "Main window created and set"; Dtk::Widget::moveToCenter(&w); w.setWayland(bWayland); //判断是否是平板环境 - if (CamApp->isPanelEnvironment()) + if (CamApp->isPanelEnvironment()) { w.showMaximized(); - else + qCDebug(appLog) << "Running in panel environment, showing maximized window"; + } else { w.setMinimumSize(CMainWindow::minWindowWidth, CMainWindow::minWindowHeight); + qCDebug(appLog) << "Running in desktop environment, showing normal window"; + } w.show(); w.loadAfterShow(); + qCInfo(appLog) << "Main window displayed and initialized"; ApplicationAdaptor adaptor(&w); - QDBusConnection::sessionBus().registerService("com.deepin.camera"); - QDBusConnection::sessionBus().registerObject(QDir::separator(), &w); + QDBusConnection::sessionBus().registerService("com.deepin.Camera"); + QDBusConnection::sessionBus().registerObject("/com/deepin/camera", &w); + qCDebug(appLog) << "DBus service and object registered"; + qCInfo(appLog) << "Application startup completed successfully"; return qApp->exec(); } diff --git a/src/src/LPF_V4L2.c b/src/src/LPF_V4L2.c index a91fd4193..a6a180b41 100644 --- a/src/src/LPF_V4L2.c +++ b/src/src/LPF_V4L2.c @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -18,6 +18,7 @@ extern "C" { #include "audio.h" #include "core_io.h" #include "colorspaces.h" +#include "v4l2_formats.h" int camInit(const char *devicename) { @@ -49,11 +50,12 @@ int camInit(const char *devicename) free(device_name); /*加载配置文件*/ config_load(config_file); - /*用option更新配置文件*/ - config_update(my_options); /*获取配置项数据*/ config_t *my_config = config_get(); - debug_level = my_options->verbosity; + debug_level = my_config->verbosity; + my_options->verbosity = my_config->verbosity; + /*用option更新配置文件*/ + config_update(my_options); int audio = AUDIO_PORTAUDIO; @@ -209,7 +211,18 @@ int camInit(const char *devicename) v4l2core_prepare_new_format(my_vd, (int)my_config->format); if ((strcmp(my_config->device_name, devlist->list_devices[my_vd->this_device].name) == 0) && (strcmp(my_config->device_location, my_vd->videodevice) == 0)) { - v4l2core_prepare_new_resolution(my_vd, my_config->width, my_config->height); + // DConfig preferredResolution 优先于本地配置文件中的分辨率 + if (get_preferred_resolution_width() > 0 && get_preferred_resolution_height() > 0) { + v4l2core_prepare_new_resolution(my_vd, + get_preferred_resolution_width(), + get_preferred_resolution_height()); + my_config->width = get_my_width(); + my_config->height = get_my_height(); + } else { + v4l2core_prepare_new_resolution(my_vd, my_config->width, my_config->height); + my_config->width = get_my_width(); + my_config->height = get_my_height(); + } ret = v4l2core_update_old_format(my_vd, my_config->width, my_config->height, v4l2core_get_requested_frame_format(my_vd)); } else { v4l2core_prepare_valid_resolution(my_vd); diff --git a/src/src/Settings.cpp b/src/src/Settings.cpp index cd6d58edc..921cbd571 100644 --- a/src/src/Settings.cpp +++ b/src/src/Settings.cpp @@ -1,8 +1,13 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later +#include "ddlog.h" +using namespace DDLog; +extern "C" { +#include "v4l2_formats.h" +} #include "Settings.h" #include "camview.h" #include "gviewv4l2core.h" @@ -28,39 +33,48 @@ Settings::Settings() m_backend(nullptr), m_settings(nullptr) { - + qCDebug(appLog) << "Initializing Settings instance"; } void Settings::init() { + qCDebug(appLog) << "Initializing Settings"; m_configPath.clear(); m_configPath.append(QString("%1/%2/%3/config.conf") .arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)) .arg(qApp->organizationName()) .arg(qApp->applicationName())); - qInfo() << "configPath" << m_configPath; + qCInfo(appLog) << "Loading config from path:" << m_configPath; m_backend = new QSettingBackend(m_configPath); - if (CamApp->isPanelEnvironment()) + if (CamApp->isPanelEnvironment()) { + qCDebug(appLog) << "Loading panel environment settings"; m_settings = DSettings::fromJsonFile(":/resource/panel_settings.json"); - else + } else { + qCDebug(appLog) << "Loading normal environment settings"; m_settings = DSettings::fromJsonFile(":/resource/settings.json"); + } QStringList videoFormatList; if (DataManager::instance()->encodeEnv() == FFmpeg_Env) { + qCDebug(appLog) << "Using FFmpeg encoding environment"; if (DataManager::instance()->encExists()) { + qCDebug(appLog) << "FFmpeg encoder exists, loading camera configuration"; GlobalUtils::loadCameraConf(); if (!GlobalUtils::isLowPerformanceBoard()) { + qCDebug(appLog) << "High performance board detected, using mp4 and webm formats"; videoFormatList << tr("mp4") << tr("webm"); } else { + qCDebug(appLog) << "Low performance board detected, using webm and mp4 formats"; videoFormatList << tr("webm") << tr("mp4"); } - } else { + qCDebug(appLog) << "FFmpeg encoder not found, using webm format only"; videoFormatList << tr("webm"); m_settings->setOption("outsetting.outformat.vidformat", 0); } } else { + qCDebug(appLog) << "Using non-FFmpeg encoding environment, using webm format only"; videoFormatList << "webm"; m_settings->setOption("outsetting.outformat.vidformat", 0); } @@ -70,25 +84,29 @@ void Settings::init() connect(m_settings, &DSettings::valueChanged, this, &Settings::onValueChanged); - qInfo() << "keys" << m_settings->keys(); + qCInfo(appLog) << "Available settings keys:" << m_settings->keys(); setNewResolutionList(); } QVariant Settings::getOption(const QString &opt) { + qCDebug(appLog) << "Getting option:" << opt; return m_settings->getOption(opt); } void Settings::setOption(const QString &opt, const QVariant &v) { + qCDebug(appLog) << "Setting option:" << opt << "to value:" << v; m_settings->setOption(opt, v); } void Settings::setNewResolutionList() { + qCDebug(appLog) << "Setting up new resolution list"; auto resolutionmodeFamily = m_settings->option("outsetting.resolutionsetting.resolution"); if (get_v4l2_device_handler() != nullptr) { + qCDebug(appLog) << "V4L2 device handler found, getting resolution list"; //格式索引 int format_index = v4l2core_get_frame_format_index( get_v4l2_device_handler(), @@ -101,6 +119,8 @@ void Settings::setNewResolutionList() v4l2core_get_frame_width(get_v4l2_device_handler()), v4l2core_get_frame_height(get_v4l2_device_handler())); + qCDebug(appLog) << "Format index:" << format_index << "Resolution index:" << resolu_index; + //获取当前摄像头的格式表 v4l2_stream_formats_t *list_stream_formats = v4l2core_get_formats_list(get_v4l2_device_handler()); @@ -111,22 +131,23 @@ void Settings::setNewResolutionList() //当前分辨率下标 if (format_index >= 0 && resolu_index >= 0) { + qCDebug(appLog) << "Processing available resolutions"; for (int i = 0 ; i < list_stream_formats[format_index].numb_res; i++) { - if ((list_stream_formats[format_index].list_stream_cap[i].width > 0 - && list_stream_formats[format_index].list_stream_cap[i].height > 0) && - (list_stream_formats[format_index].list_stream_cap[i].width < 7680 - && list_stream_formats[format_index].list_stream_cap[i].height < 4320) && - ((list_stream_formats[format_index].list_stream_cap[i].width % 8) == 0 - && (list_stream_formats[format_index].list_stream_cap[i].width % 16) == 0 - && (list_stream_formats[format_index].list_stream_cap[i].height % 8) == 0)) { + int w = list_stream_formats[format_index].list_stream_cap[i].width; + int h = list_stream_formats[format_index].list_stream_cap[i].height; + if (is_valid_resolution(w, h)) { //加入分辨率的字符串 - QString res_str = QString("%1x%2").arg(list_stream_formats[format_index].list_stream_cap[i].width).arg(list_stream_formats[format_index].list_stream_cap[i].height); + QString res_str = QString("%1x%2").arg(w).arg(h); //去重 - if (resolutionDatabase.contains(res_str) == false) + if (resolutionDatabase.contains(res_str) == false) { resolutionDatabase.append(res_str); - + qCDebug(appLog) << "Added resolution:" << res_str; + } } } + + // Sort resolutions + qCDebug(appLog) << "Sorting resolutions"; int defres = 0; int tempostion = 0; int len = resolutionDatabase.size() - 1; @@ -144,20 +165,19 @@ void Settings::setNewResolutionList() flag = 0; tempostion = j; } - } len = tempostion; - if (flag == 1) continue; - } + // Find default resolution for (int i = 0; i < resolutionDatabase.size(); i++) { QStringList resolutiontemp = resolutionDatabase[i].split("x"); if ((v4l2core_get_frame_width(get_v4l2_device_handler()) == resolutiontemp[0].toInt()) && (v4l2core_get_frame_height(get_v4l2_device_handler()) == resolutiontemp[1].toInt())) { defres = i; //set selected resolution index + qCDebug(appLog) << "Found default resolution at index:" << defres; break; } } @@ -167,6 +187,7 @@ void Settings::setNewResolutionList() //设置当前分辨率的索引 m_settings->setOption(QString("outsetting.resolutionsetting.resolution"), defres); } else { + qCWarning(appLog) << "Invalid format or resolution index, setting default resolution"; resolutionDatabase.clear(); resolutionDatabase.append(QString(tr("None"))); m_settings->setOption(QString("outsetting.resolutionsetting.resolution"), 0); @@ -174,21 +195,24 @@ void Settings::setNewResolutionList() } } else { //初始化分辨率字符串表 + qCDebug(appLog) << "No V4L2 device handler, using QCamera resolutions"; int defres = 0; QStringList resolutionDatabase = resolutionmodeFamily->data("items").toStringList(); if (DataManager::instance()->encodeEnv() == QCamera_Env && !Camera::instance()->getSupportResolutions().isEmpty()) { + qCDebug(appLog) << "Using QCamera supported resolutions"; resolutionDatabase = Camera::instance()->getSupportResolutions(); for (int i = 0; i < resolutionDatabase.size(); i++) { QStringList resolutiontemp = resolutionDatabase[i].split("x"); - if ((Camera::instance()->getCameraResolution().width() == resolutiontemp[0].toInt()) && Camera::instance()->getCameraResolution().height() == resolutiontemp[1].toInt()) { defres = i; //设置分辨率下拉菜单当前索引 + qCDebug(appLog) << "Found default QCamera resolution at index:" << defres; break; } } } else { + qCDebug(appLog) << "No supported resolutions found, using default"; if (resolutionDatabase.size() > 0) resolutionmodeFamily->data("items").clear(); @@ -200,64 +224,75 @@ void Settings::setNewResolutionList() } m_settings->sync(); + qCDebug(appLog) << "Resolution list setup complete"; } void Settings::setPathOption(const QString &opt, const QVariant &v) { + qCDebug(appLog) << "Setting path option:" << opt << "to:" << v; m_settings->setOption(QString("base.save.%1").arg(opt), v); m_settings->sync(); } void Settings::setBackOption(const QString &opt, const QVariant &v) { + qCDebug(appLog) << "Setting backend option:" << opt << "to:" << v; m_backend->setOption(opt,v); m_backend->sync(); } QVariant Settings::getBackOption(const QString &opt) { + qCDebug(appLog) << "Getting backend option:" << opt; return m_backend->getOption(opt); } void Settings::onValueChanged(const QString & key, const QVariant & value) { + qCDebug(appLog) << "Settings value changed:" << key << "to:" << value; if (key.startsWith("outsetting.resolutionsetting.resolution")) { auto mode_opt = m_settings->option("outsetting.resolutionsetting.resolution"); - if (value >= 0 && mode_opt->data("items").toStringList().size() > value.toInt()) { + if (value.toInt() >= 0 && mode_opt->data("items").toStringList().size() > value.toInt()) { QString mode = mode_opt->data("items").toStringList()[value.toInt()]; + qCInfo(appLog) << "Resolution changed to:" << mode; emit resolutionchanged(mode); } } if (key.startsWith("base.photogrid.photogrids")) { auto grid_opt1 = m_settings->option("base.photogrid.photogrids"); - if (value >= 0 && grid_opt1->data("items").toStringList().size() > value.toInt()) { + if (value.toInt() >= 0 && grid_opt1->data("items").toStringList().size() > value.toInt()) { + qCInfo(appLog) << "Grid type changed to:" << value.toInt(); emit gridTypeChanged(value.toInt()); } } if (key.startsWith("photosetting.photosdelay.photodelays")) { auto mode_opt1 = m_settings->option("photosetting.photosdelay.photodelays"); - if (value >= 0 && mode_opt1->data("items").toStringList().size() > value.toInt()) { + if (value.toInt() >= 0 && mode_opt1->data("items").toStringList().size() > value.toInt()) { QString mode1 = mode_opt1->data("items").toStringList()[value.toInt()]; + qCInfo(appLog) << "Delay time changed to:" << mode1; emit delayTimeChanged(mode1); } } if (key.startsWith("photosetting.mirrorMode.mirrorMode")){ bool bMirror = m_settings->getOption("photosetting.mirrorMode.mirrorMode").toBool(); + qCInfo(appLog) << "Mirror mode changed to:" << bMirror; emit mirrorModeChanged(bMirror); } if (key.startsWith("photosetting.Flashlight.Flashlight")){ bool bLight = m_settings->getOption("photosetting.Flashlight.Flashlight").toBool(); + qCInfo(appLog) << "Flashlight changed to:" << bLight; emit flashLightChanged(bLight); } if (key.startsWith("outsetting.outformat.vidformat")) { QPointer formatOpt = m_settings->option("outsetting.outformat.vidformat"); - if (value >= 0 && formatOpt->data("items").toStringList().size() > value.toInt()) { + if (value.toInt() >= 0 && formatOpt->data("items").toStringList().size() > value.toInt()) { QString videoFormat = formatOpt->data("items").toStringList()[value.toInt()]; + qCInfo(appLog) << "Video format changed to:" << videoFormat; emit videoFormatChanged(videoFormat); } } @@ -265,6 +300,7 @@ void Settings::onValueChanged(const QString & key, const QVariant & value) Settings::~Settings() { + qCDebug(appLog) << "Cleaning up Settings instance"; if (m_backend) { delete m_backend; m_backend = nullptr; diff --git a/src/src/audioprocessingthread.cpp b/src/src/audioprocessingthread.cpp index 64041f191..e01a8ea57 100644 --- a/src/src/audioprocessingthread.cpp +++ b/src/src/audioprocessingthread.cpp @@ -1,48 +1,56 @@ -// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2021 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "audioprocessingthread.h" +#include "ddlog.h" +using namespace DDLog; #define FRAME_SIZE 512 AudioProcessingThread::AudioProcessingThread() { + qCDebug(appLog) << "Initializing AudioProcessingThread"; m_auidoBuffer = nullptr; m_data = nullptr; - m_datasize = 0; - init(); } void AudioProcessingThread::stop() { + qCDebug(appLog) << "Stopping audio processing thread"; m_stopped = 1; } void AudioProcessingThread::init() { + qCDebug(appLog) << "Initializing audio processing thread state"; m_stopped = 0; } void AudioProcessingThread::run() { + qCDebug(appLog) << "Starting audio processing thread"; uint datasize = 0; audio_context_t *audio_ctx = get_audio_context(); if(!audio_ctx) { - qDebug("deepin-camera: no audio context: skiping audio processing\n"); + qCWarning(appLog) << "No audio context available: skipping audio processing"; return; } //初始化音频样本获取缓存大小 audio_set_cap_buffer_size(audio_ctx, FRAME_SIZE * audio_get_channels(audio_ctx)); + qCDebug(appLog) << "Audio capture buffer size set to:" << FRAME_SIZE * audio_get_channels(audio_ctx); + audio_start(audio_ctx); + qCDebug(appLog) << "Audio capture started"; datasize = audio_ctx->capture_buff_size * sizeof(sample_t); + qCDebug(appLog) << "Audio data size:" << datasize << "bytes"; /* * alloc the buffer after audio_start @@ -54,6 +62,7 @@ void AudioProcessingThread::run() m_auidoBuffer = audio_get_buffer(audio_ctx); uint sample_type = GV_SAMPLE_TYPE_FLOAT; + qCDebug(appLog) << "Using sample type: FLOAT"; while (m_stopped == 0) { int ret = audio_get_next_buffer(audio_ctx, m_auidoBuffer, sample_type, get_audio_fx_mask()); @@ -69,6 +78,7 @@ void AudioProcessingThread::run() } else if (ret == 0) { if (m_datasize != datasize) { + qCDebug(appLog) << "Resizing audio data buffer from" << m_datasize << "to" << datasize << "bytes"; m_datasize = datasize; if (m_data != nullptr) { delete [] m_data; @@ -80,24 +90,28 @@ void AudioProcessingThread::run() memcpy(m_data, m_auidoBuffer->data, datasize); m_rwMtxData.lock(); - emit sendAudioProcessing(m_data, datasize); - m_rwMtxData.unlock(); } + else { + qCWarning(appLog) << "Error getting next audio buffer, return code:" << ret; + } } + qCDebug(appLog) << "Stopping audio capture and cleaning up resources"; audio_stop(audio_ctx); audio_delete_buffer(m_auidoBuffer); + qCInfo(appLog) << "Audio processing thread stopped"; return; } AudioProcessingThread::~AudioProcessingThread() { + qCDebug(appLog) << "Destroying AudioProcessingThread"; if (m_data) { delete [] m_data; m_data = nullptr; } - qDebug() << "~AudioProcessingThread"; + qCDebug(appLog) << "AudioProcessingThread destroyed"; } diff --git a/src/src/basepub/datamanager.cpp b/src/src/basepub/datamanager.cpp index 4fbbd3c65..43ebff690 100644 --- a/src/src/basepub/datamanager.cpp +++ b/src/src/basepub/datamanager.cpp @@ -1,8 +1,14 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later +#include "ddlog.h" +using namespace DDLog; +extern "C" { +#include "v4l2_formats.h" +} + #include "datamanager.h" #include "../capplication.h" @@ -10,36 +16,43 @@ DataManager *DataManager::m_dataManager = nullptr; QString &DataManager::getstrFileName() { + // qDebug() << "Function started: getstrFileName"; return m_strFileName; } enum DeviceStatus DataManager::getdevStatus() { + // qDebug() << "Function started: getdevStatus"; return m_devStatus; } void DataManager::setdevStatus(enum DeviceStatus devStatus) { + // qDebug() << "Function started: setdevStatus"; m_devStatus = devStatus; } void DataManager::setNowTabIndex(uint tabindex) { + // qDebug() << "Function started: setNowTabIndex"; m_tabIndexNow = tabindex; } uint DataManager::getNowTabIndex() { + // qDebug() << "Function started: getNowTabIndex"; return m_tabIndexNow; } void DataManager::setEncodeEnv(EncodeEnv env) { + // qDebug() << "Function started: setEncodeEnv"; m_encodeEnv = env; } EncodeEnv DataManager::encodeEnv() { + // qDebug() << "Function started: encodeEnv"; #ifdef UNITTEST return FFmpeg_Env; #endif @@ -48,23 +61,119 @@ EncodeEnv DataManager::encodeEnv() void DataManager::setEncExists(bool status) { + // qDebug() << "Function started: setEncExists"; m_H264EncoderExists = status; } bool DataManager::encExists(){ + // qDebug() << "Function started: encExists"; return m_H264EncoderExists; } +void DataManager::setDeviceBlacklist(const QStringList &blacklist) +{ + // 无论是否为空,都先清空现有黑名单 + m_deviceBlacklistSet.clear(); + if (blacklist.isEmpty()) { + qCInfo(appLog) << "Empty blacklist provided"; + return; + } + + // 每一条黑名单项的格式都是 vid,pid,name + // 其中vid和pid都是4位十六进制数,name是设备名称 + // 后续匹配操作的时候,我们会忽略大小写 + for (const QString &item : blacklist) { + QStringList parts = item.split(","); + if (parts.size() != 3) { + qCWarning(appLog) << "Drop blacklist item(format error):" << item; + continue; + } + + // 验证VID和PID是否为4位十六进制数 + static const QRegularExpression hexPattern("^[0-9a-fA-F]{4}$"); + if (!hexPattern.match(parts[0]).hasMatch() || !hexPattern.match(parts[1]).hasMatch()) { + qCWarning(appLog) << "Drop blacklist item(invalid VID/PID):" << item; + continue; + } + + // 验证设备名称不为空,且长度不超过100个字符 + if (parts[2].trimmed().isEmpty() || parts[2].size() > 100) { + qCWarning(appLog) << "Drop blacklist item(empty device name OR too long):" << item; + continue; + } + + qCInfo(appLog) << "Add blacklist item:" << item; + m_deviceBlacklistSet.insert(item.toLower()); + } +}; + +bool DataManager::isDeviceValid(const QString &vid, const QString &pid, const QString &name) +{ + // 参数验证 + if (vid.isEmpty() || pid.isEmpty() || name.isEmpty()) { + return true; // 空参数视为有效,避免误判 + } + + QString key = vid.toLower() + "," + pid.toLower() + "," + name.toLower(); + return !m_deviceBlacklistSet.contains(key); +} + +void DataManager::setPreferredResolution(const QString &resolution) +{ + if (resolution.isEmpty()) { + qCInfo(appLog) << "Preferred resolution is empty"; + return; + } + + QStringList parts = resolution.split("x"); + if (parts.size() != 2) { + qCWarning(appLog) << "Invalid resolution format:" << resolution << "Expected format: WIDTHxHEIGHT"; + return; + } + + bool widthOk, heightOk; + int width = parts[0].toInt(&widthOk); + int height = parts[1].toInt(&heightOk); + + if (!widthOk || !heightOk || width <= 0 || height <= 0) { + qCWarning(appLog) << "Invalid resolution values:" << resolution; + return; + } + + // 添加合理的上限检查,例如16K + static const int MAX_RESOLUTION = 16384; + if (width > MAX_RESOLUTION || height > MAX_RESOLUTION) { + qCWarning(appLog) << "Resolution exceeds maximum limit:" << resolution; + return; + } + + if (!is_valid_resolution(width, height)) { + qCWarning(appLog) << "Resolution does not meet validation requirements:" << resolution; + return; + } + + m_preferredResolution = QSize(width, height); +} + +QSize DataManager::getPreferredResolution() +{ + return m_preferredResolution; +} + DataManager *DataManager::instance() { + // qDebug() << "Function started: instance"; if (m_dataManager == nullptr) { + // qDebug() << "Condition check: Creating new DataManager instance"; m_dataManager = new DataManager; } + // qDebug() << "Function completed: instance"; return m_dataManager; } DataManager::DataManager() { + // qDebug() << "Function started: DataManager constructor"; m_bTabEnter = false; m_tabIndex = 0; m_tabIndexNow = 0; @@ -73,5 +182,7 @@ DataManager::DataManager() m_encodeEnv = GStreamer_Env; m_devStatus = DeviceStatus::NOCAM; m_H264EncoderExists = false; + m_preferredResolution = QSize(0, 0); + // qDebug() << "Function completed: DataManager constructor"; } diff --git a/src/src/basepub/datamanager.h b/src/src/basepub/datamanager.h index e2c6c16d3..09f2cadb2 100644 --- a/src/src/basepub/datamanager.h +++ b/src/src/basepub/datamanager.h @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -8,6 +8,7 @@ #include #include +#include enum GridType { @@ -143,6 +144,85 @@ class DataManager: public QObject void setEncExists(bool status); bool encExists(); + /** + * @brief 设置是否带有摄像头开关 + * @param isTrue + */ + void setIsSupportCameraSwitch(bool isTrue) { m_isSupportCameraSwitch = isTrue; }; + /** + * @brief 获取是否带有摄像头开关 + * @return + */ + bool isSupportCameraSwitch() { return m_isSupportCameraSwitch; }; + + /** + * @brief 设置是否预览无延迟 + * @param isTrue + */ + void setPreviewNoDelay(bool enable) { m_isPreviewNoDelay = enable; }; + /** + * @brief 获取是否预览无延迟 + * @return + */ + bool isPreviewNoDelay() const { return m_isPreviewNoDelay; }; + + /** + * @brief 设置是否启用USB摄像头分组 + * @param enable + */ + void setEnableUsbGroup(bool enable) { m_enableUsbGroup = enable; }; + /** + * @brief 获取是否启用USB摄像头分组 + * @return + */ + bool isEnableUsbGroup() const { return m_enableUsbGroup; }; + + /** + * @brief 设置是否启用8K预览 + * @param enable + */ + void setEnable8kPreview(bool enable) { m_enable8kPreview = enable; }; + + /** + * @brief 获取是否启用8K预览 + * @return + */ + bool isEnable8kPreview() const { return m_enable8kPreview; }; + + /** + * @brief 设置Camera设备黑名单 + * @param blacklist + */ + void setDeviceBlacklist(const QStringList &blacklist); + /** + * @brief 检查当前设备是否有效 + * @return + */ + bool isDeviceValid(const QString &vid, const QString &pid, const QString &name); + + /** + * @brief 设置首选分辨率 + * @param resolution 分辨率字符串,格式如 "1920x1080" + */ + void setPreferredResolution(const QString &resolution); + + /** + * @brief 获取首选分辨率 + * @return 分辨率 + */ + QSize getPreferredResolution(); + + /** + * @brief 设置RGB数据预览模式 + * @param mode -1:不设置(自动), 0:强制关闭, 1:强制开启 + */ + void setUseRgbData(int mode) { m_useRgbData = mode; }; + + /** + * @brief 获取RGB数据预览模式 + * @return -1:不设置(自动), 0:强制关闭, 1:强制开启 + */ + int getUseRgbData() const { return m_useRgbData; }; private: DataManager(); static DataManager *m_dataManager; @@ -152,5 +232,12 @@ class DataManager: public QObject EncodeEnv m_encodeEnv; volatile enum DeviceStatus m_devStatus; bool m_H264EncoderExists; + bool m_isSupportCameraSwitch = false; // 是否带有摄像头开关 + bool m_isPreviewNoDelay = false; // 是否预览无延迟 + bool m_enableUsbGroup = false; // 是否启用USB摄像头分组 + bool m_enable8kPreview = false; // 是否启用8K预览 + QSet m_deviceBlacklistSet; // 设备黑名单 + QSize m_preferredResolution; // 首选分辨率 + int m_useRgbData = -1; // RGB数据预览模式:-1不设置(自动), 0强制关闭, 1强制开启 }; #endif // DATAMANAGER_H diff --git a/src/src/basepub/load_libs.c b/src/src/basepub/load_libs.c index 34559c9bd..fe0a1b276 100644 --- a/src/src/basepub/load_libs.c +++ b/src/src/basepub/load_libs.c @@ -121,6 +121,8 @@ static LoadLibs *newClass(void) PrintError(); pLibs->m_avcodec_receive_packet = (uos_avcodec_receive_packet)dlsym(handle, "avcodec_receive_packet"); PrintError(); + pLibs->m_avcodec_get_hw_config = (uos_avcodec_get_hw_config)dlsym(handle, "avcodec_get_hw_config"); + PrintError(); pLibs->m_av_packet_free = (uos_av_packet_free)dlsym(handle, "av_packet_free"); PrintError(); pLibs->m_avcodec_fill_audio_frame = (uos_avcodec_fill_audio_frame)dlsym(handle, "avcodec_fill_audio_frame"); @@ -342,6 +344,8 @@ static LoadAvutil *newAvutil(void) PrintError(); Avutil->m_av_get_media_type_string = (uos_av_get_media_type_string)dlsym(handle5, "av_get_media_type_string"); PrintError(); + Avutil->m_av_get_pix_fmt_name = (uos_av_get_pix_fmt_name)dlsym(handle5, "av_get_pix_fmt_name"); + PrintError(); Avutil->m_av_image_get_buffer_size = (uos_av_image_get_buffer_size)dlsym(handle5, "av_image_get_buffer_size"); PrintError(); //----vaapi---- @@ -436,6 +440,8 @@ static LoadUdev *newUdev(void) PrintError(); pUdev->m_udev_monitor_receive_device = (uos_udev_monitor_receive_device)dlsym(handle, "udev_monitor_receive_device"); PrintError(); + pUdev->m_udev_device_get_subsystem = (uos_udev_device_get_subsystem)dlsym(handle, "udev_device_get_subsystem"); + PrintError(); pUdev->m_udev_device_get_devtype = (uos_udev_device_get_devtype)dlsym(handle, "udev_device_get_devtype"); PrintError(); pUdev->m_udev_device_get_action = (uos_udev_device_get_action)dlsym(handle, "udev_device_get_action"); diff --git a/src/src/basepub/load_libs.h b/src/src/basepub/load_libs.h index e890a8415..3ce2e4bc9 100644 --- a/src/src/basepub/load_libs.h +++ b/src/src/basepub/load_libs.h @@ -45,6 +45,8 @@ typedef int (*uos_avcodec_send_packet)(AVCodecContext *avctx, const AVPacket *av typedef int (*uos_avcodec_receive_frame)(AVCodecContext *avctx, AVFrame *frame); //int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt); typedef int (*uos_avcodec_receive_packet)(AVCodecContext *avctx, AVPacket *avpkt); +//const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index); +typedef const AVCodecHWConfig *(*uos_avcodec_get_hw_config)(const AVCodec *codec, int index); //void av_packet_free(AVPacket **pkt); typedef void (*uos_av_packet_free)(AVPacket **pkt); //int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,enum AVSampleFormat sample_fmt, const uint8_t *buf,int buf_size, int align); @@ -128,6 +130,7 @@ typedef struct _LoadLibs { uos_avcodec_send_packet m_avcodec_send_packet; uos_avcodec_receive_frame m_avcodec_receive_frame; uos_avcodec_receive_packet m_avcodec_receive_packet; + uos_avcodec_get_hw_config m_avcodec_get_hw_config; uos_av_packet_free m_av_packet_free; uos_avcodec_fill_audio_frame m_avcodec_fill_audio_frame; uos_av_packet_unref m_av_packet_unref; @@ -235,6 +238,8 @@ typedef int (*uos_av_samples_get_buffer_size)(int *linesize, int nb_channels, in enum AVSampleFormat sample_fmt, int align); //const char *av_get_media_type_string(enum AVMediaType media_type); typedef const char *(*uos_av_get_media_type_string)(enum AVMediaType media_type); +//const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt); +typedef const char *(*uos_av_get_pix_fmt_name)(enum AVPixelFormat pix_fmt); //int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align); typedef int (*uos_av_image_get_buffer_size)(enum AVPixelFormat pix_fmt, int width, int height, int align); @@ -254,6 +259,7 @@ typedef struct _LoadAvutil { uos_av_free m_av_free; uos_av_samples_get_buffer_size m_av_samples_get_buffer_size; uos_av_get_media_type_string m_av_get_media_type_string;// + uos_av_get_pix_fmt_name m_av_get_pix_fmt_name; uos_av_image_get_buffer_size m_av_image_get_buffer_size; //----VAAPI------ uos_av_hwdevice_ctx_create m_av_hwdevice_ctx_create; diff --git a/src/src/camera.cpp b/src/src/camera.cpp index 5883e717e..7b1f66edd 100755 --- a/src/src/camera.cpp +++ b/src/src/camera.cpp @@ -1,12 +1,17 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #define TMPPATH "/tmp/tmp.jpg" +#include "ddlog.h" +using namespace DDLog; #include "camera.h" +#if QT_VERSION_MAJOR > 5 +#else #include "videosurface.h" +#endif #include "datamanager.h" #ifdef __cplusplus @@ -22,7 +27,9 @@ extern "C" { #include #include +#if QT_VERSION_MAJOR <= 5 #include +#endif #include #define MAXLINE 100 @@ -32,55 +39,71 @@ Camera *Camera::m_instance = nullptr; static _cam_config_t camConfig = {1920, 1080, NULL, NULL, NULL, NULL, NULL, NULL, 1, 30}; Camera *Camera::instance() { + // qDebug() << "Function started: Camera::instance"; if (m_instance == nullptr) { + // qDebug() << "Condition check: Creating new Camera instance"; m_instance = new Camera; } + // qDebug() << "Function completed: Camera::instance"; return m_instance; } void Camera::release() { + // qDebug() << "Releasing Camera instance"; delete m_instance; m_instance = nullptr; } Camera::~Camera() { + // qDebug() << "Destroying Camera instance"; if (camConfig.device_name) { + // qDebug() << "Condition check: Freeing device_name"; free(camConfig.device_name); camConfig.device_name = nullptr; } if (camConfig.device_location) { + // qDebug() << "Condition check: Freeing device_location"; free(camConfig.device_location); camConfig.device_location = nullptr; } if (camConfig.video_path) { + // qDebug() << "Condition check: Freeing video_path"; free(camConfig.video_path); camConfig.video_path = nullptr; } if (camConfig.video_name) { + // qDebug() << "Condition check: Freeing video_name"; free(camConfig.video_name); camConfig.video_name = nullptr; } if (camConfig.photo_path) { + // qDebug() << "Condition check: Freeing photo_path"; free(camConfig.photo_path); camConfig.photo_path = nullptr; } if (camConfig.photo_name) { + // qDebug() << "Condition check: Freeing photo_name"; free(camConfig.photo_name); camConfig.photo_name = nullptr; } + // qDebug() << "Camera instance destroyed"; } Camera::Camera() : m_camera(nullptr) , m_mediaRecoder(nullptr) +#if QT_VERSION_MAJOR > 5 +#else , m_imageCapture(nullptr) , m_videoSurface(nullptr) , m_curDevName("") +#endif , m_bReadyRecord(false) , m_bRecording(false) { + qCDebug(appLog) << "Initializing Camera"; parseConfig(); initMember(); } @@ -88,96 +111,176 @@ Camera::Camera() void Camera::initMember() { // 连接相机surface,能够发送每帧QImage数据到外部 + qCDebug(appLog) << "Initializing camera members"; +#if QT_VERSION_MAJOR > 5 + qCDebug(appLog) << "Condition check: Qt6 detected, using QVideoSink"; +#else + qCDebug(appLog) << "Condition check: Qt5 detected, using VideoSurface"; m_videoSurface = new VideoSurface(this); connect(m_videoSurface, &VideoSurface::presentImage, this, &Camera::presentImage); +#endif // 初始设备名为空,默认启动config中的摄像头设备,若config设备名为空,则启动defaultCamera switchCamera(); + qCDebug(appLog) << "Function completed: Camera::initMember"; } void Camera::switchCamera() { + qCDebug(appLog) << "Switching camera"; refreshCamDevList(); +#if QT_VERSION_MAJOR > 5 + QCameraDevice nextDevice; + + if (!m_cameraDeviceList.isEmpty()) { + qCDebug(appLog) << "Condition check: Camera device list not empty"; + int nCurIndex = m_cameraDeviceList.indexOf(m_curDevice); + nCurIndex = (nCurIndex + 1) % m_cameraDeviceList.size(); + nextDevice = m_cameraDeviceList[nCurIndex]; + qCDebug(appLog) << "Switching to next camera device:" << nextDevice.description(); + } + nextDevice = QMediaDevices::defaultVideoInput(); + startCamera(nextDevice); +#else QString nextDevName; if (!m_cameraDevList.isEmpty()) { + qCDebug(appLog) << "Condition check: Camera device list not empty"; int nCurIndex = m_cameraDevList.indexOf(m_curDevName); nCurIndex = (nCurIndex + 1) % m_cameraDevList.size(); nextDevName = m_cameraDevList[nCurIndex]; + qCDebug(appLog) << "Switching to next camera device:" << nextDevName; } - if (nextDevName.isEmpty()) + if (nextDevName.isEmpty()) { + qCDebug(appLog) << "Condition check: No camera device selected, using config"; nextDevName = camConfig.device_location; + } - if (nextDevName.isEmpty()) + if (nextDevName.isEmpty()) { + qCDebug(appLog) << "Condition check: No device in config, using default"; nextDevName = QCameraInfo::defaultCamera().deviceName(); - + qCDebug(appLog) << "Using default camera device:" << nextDevName; + } startCamera(nextDevName); +#endif + qCDebug(appLog) << "Function completed: Camera::switchCamera"; } void Camera::refreshCamera() { + qCDebug(appLog) << "Refreshing camera"; refreshCamDevList(); // 设备链表找不到当前设备,发送设备断开信号 +#if QT_VERSION_MAJOR > 5 + if (!m_curDevice.isNull() && m_cameraDeviceList.indexOf(m_curDevice) == -1) { + qCWarning(appLog) << "Current camera device disconnected"; + m_curDevice = QCameraDevice(); + emit currentCameraDisConnected(); + } +#else if (!m_curDevName.isEmpty() && m_cameraDevList.indexOf(m_curDevName) == -1) { + qCWarning(appLog) << "Current camera device disconnected:" << m_curDevName; m_curDevName = ""; emit currentCameraDisConnected(); } +#endif // 若没有摄像头工作,则重启摄像头 restartCamera(); + qCDebug(appLog) << "Function completed: Camera::refreshCamera"; } +#include // 重启摄像头 void Camera::restartCamera() { + qCDebug(appLog) << "Restarting camera"; +#if QT_VERSION_MAJOR > 5 + if (!m_camera) { + qCDebug(appLog) << "Condition check: No camera instance exists"; + QList availableCams = QMediaDevices::videoInputs(); + if ((availableCams.isEmpty() || (m_camera && availableCams.indexOf(m_camera->cameraDevice()) != -1)) +#if QT_VERSION_MAJOR > 5 + && !m_cameraDeviceList.isEmpty()) { +#else + && !m_cameraDevList.isEmpty()) { +#endif + qCWarning(appLog) << "No available cameras found"; + emit cameraCannotUsed(); + return; + } +#else if (!m_camera || m_camera->status() == QCamera::UnloadedStatus) { + qCDebug(appLog) << "Condition check: Camera needs restart"; QList availableCams = QCameraInfo::availableCameras(); if ((availableCams.isEmpty() || (m_camera && availableCams.indexOf(QCameraInfo(*m_camera)) != -1)) - && !m_cameraDevList.isEmpty()) { + && !m_cameraDevList.isEmpty()) { + qCWarning(appLog) << "No available cameras found"; emit cameraCannotUsed(); return; } +#endif } - if (DataManager::instance()->getdevStatus() == CAM_CANUSE) + if (DataManager::instance()->getdevStatus() == CAM_CANUSE) { + qCDebug(appLog) << "Camera is already in use"; return; + } +#if QT_VERSION_MAJOR > 5 + startCamera(QMediaDevices::defaultVideoInput()); +#else startCamera(QCameraInfo::defaultCamera().deviceName()); +#endif DataManager::instance()->setdevStatus(CAM_CANUSE); - + qCInfo(appLog) << "Camera restarted successfully"; emit cameraDevRestarted(); + qCDebug(appLog) << "Function completed: Camera::restartCamera"; } void Camera::refreshCamDevList() { + qCDebug(appLog) << "Refreshing camera device list"; +#if QT_VERSION_MAJOR > 5 + m_cameraDeviceList.clear(); + m_cameraDeviceList = QMediaDevices::videoInputs(); + qCDebug(appLog) << "Found" << m_cameraDeviceList.size() << "camera devices"; +#else m_cameraDevList.clear(); v4l2_device_list_t *devlist = get_device_list(); for (int i = 0; i < devlist->num_devices; i++) m_cameraDevList.push_back(devlist->list_devices[i].device); + qCDebug(appLog) << "Found" << m_cameraDevList.size() << "camera devices"; +#endif } +#if QT_VERSION_MAJOR <= 5 void Camera::onCameraStatusChanged(QCamera::Status status) { + qCDebug(appLog) << "Camera status changed to:" << status; if (m_mediaRecoder) { + qCDebug(appLog) << "Media recorder exists, checking status"; if (m_bReadyRecord && status == QCamera::ActiveStatus) { m_mediaRecoder->record(); m_bReadyRecord = false; } } } +#endif QStringList Camera::getSupportResolutions() { + qCDebug(appLog) << "Getting supported resolutions"; QStringList resolutionsList; QList supportResolutionList = getSupportResolutionsSize(); if (supportResolutionList.isEmpty()) - qInfo() << "Support Resolution is Empty!"; + qCWarning(appLog) << "No supported resolutions found"; int size = supportResolutionList.size(); resolutionsList.clear(); @@ -186,30 +289,46 @@ QStringList Camera::getSupportResolutions() resolutionsList.append(resol); } + qCDebug(appLog) << "Supported resolutions:" << resolutionsList; return resolutionsList; } QList Camera::getSupportResolutionsSize() { + qCDebug(appLog) << "Function started: Camera::getSupportResolutionsSize"; QList resolutions; +#if QT_VERSION_MAJOR > 5 + if (m_camera) { + qCDebug(appLog) << "Condition check: Camera instance exists"; + resolutions = m_camera->cameraDevice().photoResolutions(); + } +#else if (m_imageCapture) resolutions = m_imageCapture->supportedResolutions(); +#endif + qCDebug(appLog) << "Function completed: Camera::getSupportResolutionsSize"; return resolutions; } // 设置相机分辨率 void Camera::setCameraResolution(QSize size) { + qCDebug(appLog) << "Setting camera resolution to:" << size; +#if QT_VERSION_MAJOR > 5 + //TODO +#else // 设置图片捕获器分辨率到相机 if (m_imageCapture) { + qCDebug(appLog) << "Condition check: Setting image capture resolution"; QImageEncoderSettings imageSettings = m_imageCapture->encodingSettings(); imageSettings.setResolution(size); m_imageCapture->setEncodingSettings(imageSettings); } - // 设置视频分辨率到相机 + // 设置视频分辨率到相机 if (m_mediaRecoder) { + qCDebug(appLog) << "Condition check: Setting media recorder resolution"; QAudioEncoderSettings audioSettings = m_mediaRecoder->audioSettings(); QVideoEncoderSettings videoSettings = m_mediaRecoder->videoSettings(); videoSettings.setCodec("video/x-vp8"); @@ -217,35 +336,52 @@ void Camera::setCameraResolution(QSize size) m_mediaRecoder->setEncodingSettings(audioSettings, videoSettings, "video/webm"); } - // 设置分辨率到相机 + // 设置分辨率到相机 if (m_camera) { + qCDebug(appLog) << "Condition check: Setting camera viewfinder resolution"; QCameraViewfinderSettings viewfinderSettings = m_camera->viewfinderSettings(); viewfinderSettings.setResolution(size); m_camera->setViewfinderSettings(viewfinderSettings); } +#endif // 同步有变更的分辨率到config camConfig.width = size.rwidth(); camConfig.height = size.rheight(); saveConfig(); + qCDebug(appLog) << "Camera resolution set successfully"; } QSize Camera::getCameraResolution() { + qCDebug(appLog) << "Getting camera resolution"; return QSize(camConfig.width,camConfig.height); } +#if QT_VERSION_MAJOR > 5 +void Camera::startCamera(const QCameraDevice &device) +#else void Camera::startCamera(const QString &devName) +#endif { // 存在上一相机,先停止 - if (m_camera) + qCDebug(appLog) << "Starting camera"; + if (m_camera) { + qCDebug(appLog) << "Stopping existing camera"; stopCamera(); + } +#if QT_VERSION_MAJOR > 5 + m_camera = new QCamera(device); + m_videoSink = new QVideoSink(this); + m_curDevice = device; + qCDebug(appLog) << "Started camera device:" << device.description(); +#else m_camera = new QCamera(devName.toStdString().c_str()); QCameraInfo cameraInfo(*m_camera); - m_curDevName = devName; - connect(m_camera, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(onCameraStatusChanged(QCamera::Status))); + m_curDevName = devName; + qCDebug(appLog) << "Started camera device:" << m_curDevName; m_imageCapture = new QCameraImageCapture(m_camera); m_mediaRecoder = new QMediaRecorder(m_camera); @@ -260,7 +396,7 @@ void Camera::startCamera(const QString &devName) m_camera->start(); - // 同步设备名称到config + // 同步设备名称到config if (camConfig.device_name) { free(camConfig.device_name); camConfig.device_name = nullptr; @@ -277,112 +413,156 @@ void Camera::startCamera(const QString &devName) // 当前设备与config设备名不同,重置分辨率到最大值,并同步到config文件 QString configDevName = QString(camConfig.device_location); if (m_curDevName != configDevName - || (m_curDevName.isEmpty() && m_curDevName == configDevName)) { + || (m_curDevName.isEmpty() && m_curDevName == configDevName)) { if (!supportList.isEmpty()) { + qCDebug(appLog) << "Resetting resolution to maximum supported:" << supportList.last(); camConfig.width = supportList.last().rwidth(); camConfig.height = supportList.last().rheight(); } } - // 若当前摄像头不支持该分辨率,重置为当前摄像头最大分辨率 + // 若当前摄像头不支持该分辨率,重置为当前摄像头最大分辨率 if (!supportList.isEmpty()) { bool bResetResolution = true; for (int i = 0; i < supportList.size(); i++) { if (supportList[i].width() == camConfig.width && - supportList[i].height() == camConfig.height) { + supportList[i].height() == camConfig.height) { bResetResolution = false; break; } } if (bResetResolution) { + qCDebug(appLog) << "Current resolution not supported, resetting to:" << supportList.last(); camConfig.width = supportList.last().width(); camConfig.height = supportList.last().height(); } } - // 同步config分辨率到相机,并保存到文件 + // 同步config分辨率到相机,并保存到文件 setCameraResolution(QSize(camConfig.width, camConfig.height)); - // 发送相机名称变更信号 + // 发送相机名称变更信号 emit cameraSwitched(cameraInfo.description()); +#endif } void Camera::stopCamera() { + qCDebug(appLog) << "Stopping camera"; if (m_camera) { +#if QT_VERSION_MAJOR <= 5 connect(m_camera, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(onCameraStatusChanged(QCamera::Status))); +#endif m_camera->stop(); m_camera->deleteLater(); m_camera = nullptr; } +#if QT_VERSION_MAJOR > 5 +#else if (m_imageCapture) { + qCDebug(appLog) << "Condition check: Image capture instance exists"; m_imageCapture->deleteLater(); m_imageCapture = nullptr; } +#endif if (m_mediaRecoder) { + qCDebug(appLog) << "Condition check: Media recorder instance exists"; m_mediaRecoder->deleteLater(); m_mediaRecoder = nullptr; } + qCDebug(appLog) << "Camera stopped successfully"; } void Camera::setVideoOutPutPath(QString &path) { + qCDebug(appLog) << "Setting video output path:" << path; if (m_mediaRecoder) m_mediaRecoder->setOutputLocation(QUrl::fromLocalFile(path)); } void Camera::startRecoder() { + qCDebug(appLog) << "Starting recorder"; +#if QT_VERSION_MAJOR > 5 +#else m_bReadyRecord = true; if (m_camera && m_camera->captureMode() != QCamera::CaptureVideo) { + qCDebug(appLog) << "Condition check: Setting camera to video capture mode"; m_camera->setCaptureMode(QCamera::CaptureVideo); } m_bRecording = true; + qCDebug(appLog) << "Recorder started successfully"; +#endif } void Camera::stopRecoder() { + qCDebug(appLog) << "Stopping recorder"; +#if QT_VERSION_MAJOR > 5 +#else if (m_mediaRecoder) m_mediaRecoder->stop(); if (m_camera && m_camera->captureMode() != QCamera::CaptureStillImage) m_camera->setCaptureMode(QCamera::CaptureStillImage); m_bRecording = false; + qCDebug(appLog) << "Recorder stopped successfully"; +#endif } qint64 Camera::getRecoderTime() { + qCDebug(appLog) << "Function started: getRecoderTime"; qint64 nRecTime = 0; if (m_mediaRecoder) nRecTime = m_mediaRecoder->duration(); + qCDebug(appLog) << "Function completed: getRecoderTime:" << nRecTime; return nRecTime; } +#if QT_VERSION_MAJOR > 5 +QMediaRecorder::RecorderState Camera::getRecoderState() +{ + qCDebug(appLog) << "Function started: Camera::getRecoderState"; + QMediaRecorder::RecorderState recState = QMediaRecorder::StoppedState; + if (m_mediaRecoder) + recState = m_mediaRecoder->recorderState(); + + qCDebug(appLog) << "Function completed: Camera::getRecoderState"; + return recState; +} +#else QMediaRecorder::State Camera::getRecoderState() { + qCDebug(appLog) << "Function started: Camera::getRecoderState"; QMediaRecorder::State recState = QMediaRecorder::StoppedState; if (m_mediaRecoder) recState = m_mediaRecoder->state(); + qCDebug(appLog) << "Function completed: Camera::getRecoderState"; return recState; } +#endif bool Camera::isRecording() { + // qDebug() << "Function started: Camera::isRecording"; return m_bRecording; } bool Camera::isReadyRecord() { + // qDebug() << "Function started: Camera::isReadyRecord"; return m_bReadyRecord; } int Camera::parseConfig() { + // qDebug() << "Parsing camera configuration"; char *config_path = smart_cat(getenv("HOME"), '/', ".config/deepin/deepin-camera"); mkdir(config_path, 0777); char *config_file = smart_cat(config_path, '/', "deepin-camera"); @@ -396,10 +576,12 @@ int Camera::parseConfig() /*open file for read*/ if((fp = fopen(config_file,"r")) == NULL) { + // qDebug() << "Condition check: Failed to open config file"; free(config_file); - fprintf(stderr, "deepin-camera: couldn't open %s for read: %s\n", config_path, strerror(errno)); + qCWarning(appLog) << "Could not open config file for reading:" << strerror(errno); return -1; } + while(fgets(bufr, MAXLINE, fp) != NULL) { line++; @@ -413,6 +595,7 @@ int Camera::parseConfig() int size = strlen(bufp); if(size < 1 || *bufp == '#') { + // qDebug() << "Condition check: Skipping empty or commented line" << line; continue; } @@ -436,7 +619,7 @@ int Camera::parseConfig() /*skip invalid lines */ if(!token || !value || strlen(token) < 1 || strlen(value) < 1) { - fprintf(stderr, "deepin-camera: (config) skiping invalid config entry at line %i\n", line); + qCWarning(appLog) << "Skipping invalid config entry at line" << line; if(token) free(token); if(value) @@ -446,14 +629,18 @@ int Camera::parseConfig() /*check tokens*/ if(strcmp(token, "width") == 0) { + qCDebug(appLog) << "Condition check: Setting width"; camConfig.width = (int) strtoul(value, NULL, 10); } else if(strcmp(token, "height") == 0) { + qCDebug(appLog) << "Condition check: Setting height"; camConfig.height = (int) strtoul(value, NULL, 10); } else if(strcmp(token, "device_name") == 0 && strlen(value) > 0) { + qCDebug(appLog) << "Condition check: Setting device_name"; if(camConfig.device_name) free(camConfig.device_name); camConfig.device_name = strdup(value); } else if(strcmp(token, "device_location") == 0 && strlen(value) > 0) { + qCDebug(appLog) << "Condition check: Setting device_location"; if(camConfig.device_location) free(camConfig.device_location); camConfig.device_location = strdup(value); @@ -466,13 +653,14 @@ int Camera::parseConfig() } free(config_file); - fclose(fp); + qCDebug(appLog) << "Configuration parsed successfully"; return 0; } int Camera::saveConfig() { + qCDebug(appLog) << "Saving camera configuration"; QString config_file = QString(getenv("HOME")) + QDir::separator() + QString(".config") + QDir::separator() + QString("deepin") + QDir::separator() + QString("deepin-camera") + QDir::separator() + QString("deepin-camera"); @@ -482,7 +670,7 @@ int Camera::saveConfig() /*open file for write*/ if((fp = fopen(filename,"w")) == NULL) { - fprintf(stderr, "deepin-camera: couldn't open %s for write: %s\n", filename, strerror(errno)); + qCWarning(appLog) << "Could not open config file for writing:" << strerror(errno); free(filename); return -1; } @@ -519,15 +707,15 @@ int Camera::saveConfig() /* flush stream buffers to filesystem */ fflush(fp); - free(filename); /* close file after fsync (sync file data to disk) */ if (fsync(fileno(fp)) || fclose(fp)) { - fprintf(stderr, "deeepin_camera: error writing configuration data to file: %s\n", strerror(errno)); + qCWarning(appLog) << "Error writing configuration data to file:" << strerror(errno); return -1; } + qCDebug(appLog) << "Configuration saved successfully"; return 0; } diff --git a/src/src/camera.h b/src/src/camera.h index 145d2cb83..4e852e108 100644 --- a/src/src/camera.h +++ b/src/src/camera.h @@ -9,9 +9,15 @@ #include #include #include -#include #include +#if QT_VERSION_MAJOR > 5 +#include +#include +#include +#else +#include #include +#endif typedef struct _cam_config_t { int width; /*width*/ @@ -25,7 +31,10 @@ typedef struct _cam_config_t { int fps_num; int fps_denom; } cam_config; +#if QT_VERSION_MAJOR > 5 +#else class VideoSurface; +#endif class Camera : public QObject { Q_OBJECT @@ -69,7 +78,11 @@ class Camera : public QObject /** * @brief startCamera 开始当前相机 */ +#if QT_VERSION_MAJOR > 5 + void startCamera(const QCameraDevice& device); +#else void startCamera(const QString& devName); +#endif /** * @brief stopCamera 停止当前相机 @@ -94,7 +107,11 @@ class Camera : public QObject qint64 getRecoderTime(); +#if QT_VERSION_MAJOR > 5 + QMediaRecorder::RecorderState getRecoderState(); +#else QMediaRecorder::State getRecoderState(); +#endif bool isRecording(); @@ -124,10 +141,12 @@ public slots: */ void refreshCamDevList(); +#if QT_VERSION_MAJOR <= 5 /** * @brief onCameraStatusChanged 相机状态监听 */ void onCameraStatusChanged(QCamera::Status status); +#endif signals: // 发送摄像头每帧画面 @@ -152,12 +171,18 @@ public slots: static Camera *m_instance; QCamera *m_camera; QMediaRecorder *m_mediaRecoder; +#if QT_VERSION_MAJOR > 5 + QVideoSink *m_videoSink; + QCameraDevice m_curDevice; + QList m_cameraDeviceList; +#else QCameraImageCapture *m_imageCapture; - VideoSurface *m_videoSurface; - - QString m_curDevName; // 当前摄像头设备名 QCameraViewfinderSettings m_viewfinderSettings; + QString m_curDevName; // 当前摄像头设备名 QList m_cameraDevList; // 摄像头设备名列表 + VideoSurface *m_videoSurface; +#endif + bool m_bReadyRecord; bool m_bRecording; diff --git a/src/src/capplication.cpp b/src/src/capplication.cpp index 67177bd33..2ebcad7f6 100644 --- a/src/src/capplication.cpp +++ b/src/src/capplication.cpp @@ -1,15 +1,18 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "capplication.h" +#include "ddlog.h" +using namespace DDLog; CApplication *CApplication::cameraCore = nullptr; CApplication::CApplication(int &argc, char **argv) : QtSingleApplication(argc, argv) { + qCDebug(appLog) << "Function started: CApplication constructor"; m_mainwindow = nullptr; #ifndef TABLE_ENVIRONMENT m_bpanel = false; @@ -17,39 +20,47 @@ CApplication::CApplication(int &argc, char **argv) m_bpanel = true; #endif - if (cameraCore == nullptr) + if (cameraCore == nullptr) { + qCDebug(appLog) << "Condition check: Setting cameraCore instance"; cameraCore = this; + } dApplication()->installEventFilter(this); dApplication()->setQuitOnLastWindowClosed(true); Dtk::Core::DVtableHook::overrideVfptrFun(dApplication(), &DApplication::handleQuitAction, CamApp, &CApplication::QuitAction); + qCDebug(appLog) << "Function completed: CApplication constructor"; } CApplication *CApplication::CamApplication() { + // qDebug() << "Function started: CamApplication"; return CApplication::cameraCore; } void CApplication::setMainWindow(CMainWindow *window) { + // qDebug() << "Function started: setMainWindow"; if (!m_mainwindow) m_mainwindow = window; } bool CApplication::isPanelEnvironment() { + // qDebug() << "Function started: isPanelEnvironment"; return m_bpanel; } CMainWindow *CApplication::getMainWindow() { + // qDebug() << "Function started: getMainWindow"; return m_mainwindow; } void CApplication::QuitAction() { + // qDebug() << "Function started: QuitAction"; emit CamApp->popupConfirmDialog(); } diff --git a/src/src/circlepushbutton.cpp b/src/src/circlepushbutton.cpp index cf1474891..a5832a5ac 100644 --- a/src/src/circlepushbutton.cpp +++ b/src/src/circlepushbutton.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,9 +11,12 @@ #include #include #include +#include "ddlog.h" +using namespace DDLog; circlePushButton::circlePushButton(QWidget *parent): QPushButton(parent), m_radius(20) { + // qDebug() << "Initializing CirclePushButton with radius:" << m_radius; m_color.setRgb(0, 0, 0, m_opacity); m_hover = false; @@ -25,36 +28,48 @@ circlePushButton::circlePushButton(QWidget *parent): QPushButton(parent), m_radi m_hoverSvg = nullptr; m_pressSvg = nullptr; setButtonRadius(m_radius); + // qDebug() << "Function completed: circlePushButton constructor"; } void circlePushButton::setbackground(QColor color) { + // qDebug() << "Setting background color to:" << color; m_color = color; } void circlePushButton::setPixmap(QString normalPath, QString hoverPath, QString pressPath) { + // qDebug() << "Setting button pixmaps - Normal:" << normalPath << "Hover:" << hoverPath << "Press:" << pressPath; m_normalSvg = QSharedPointer(new QSvgRenderer(normalPath)); m_hoverSvg = QSharedPointer(new QSvgRenderer(hoverPath)); m_pressSvg = QSharedPointer(new QSvgRenderer(pressPath)); + // qDebug() << "Function completed: setPixmap"; } void circlePushButton::setSelected(bool selected) { + // qDebug() << "Setting button selected state to:" << selected; m_isSelected = selected; update(); + // qDebug() << "Function completed: setSelected"; } bool circlePushButton::getButtonState() { + // qDebug() << "Function started: getButtonState"; return m_isSelected; } void circlePushButton::paintEvent(QPaintEvent *event) { + // qDebug() << "Function started: paintEvent"; Q_UNUSED(event); QPainter painter(this); +#if QT_VERSION_MAJOR > 5 + painter.setRenderHints(QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#else painter.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#endif int distance = 2; int tmpWidth = width(); @@ -70,6 +85,7 @@ void circlePushButton::paintEvent(QPaintEvent *event) QColor highlight = Dtk::Gui::DGuiApplicationHelper::instance()->applicationPalette().highlight().color(); //绘制点击效果 if (m_mousePress) { + // qDebug() << "Drawing gray rectangle"; QRect grayRect = this->rect(); grayRect.setTopLeft(QPoint(2, 2)); grayRect.setSize(QSize(36, 36)); @@ -78,6 +94,7 @@ void circlePushButton::paintEvent(QPaintEvent *event) painter.setPen(Qt::NoPen); painter.drawEllipse(grayRect); } else if (m_hover) { + // qDebug() << "Drawing focus blue rectangle"; QRect focusBlue = this->rect(); focusBlue.setTopLeft(QPoint(1, 1)); focusBlue.setSize(QSize(tmpWidth - 2, tmpHeight - 2)); @@ -94,6 +111,7 @@ void circlePushButton::paintEvent(QPaintEvent *event) painter.setPen(QPen(QColor(Qt::white))); painter.drawEllipse(focusWhite); } else if (m_isSelected && !m_disableSelect) { + // qDebug() << "Drawing selected rectangle"; QRect selectedRect = this->rect(); selectedRect.setTopLeft(QPoint(2, 2)); selectedRect.setSize(QSize(36, 36)); @@ -103,6 +121,7 @@ void circlePushButton::paintEvent(QPaintEvent *event) } if (m_isNewNotification) { + // qDebug() << "Drawing new notification rectangle"; rect.setTopLeft(QPoint(rect.width() - 9, 1)); rect.setSize(QSize(8, 8)); painter.setPen(QPen(Qt::white, 1)); @@ -115,6 +134,7 @@ void circlePushButton::paintEvent(QPaintEvent *event) painter.rotate(m_rotate); painter.translate(-width() / 2, -height() / 2); if (m_disableSelect) {//禁用悬浮只绘制选中与正常 + // qDebug() << "Drawing disable select rectangle"; // painter.setViewport(QRect(-width() / 2, -height() / 2, width(), height())); if (m_mousePress) { painter.setOpacity(m_iconOpacity); @@ -129,97 +149,141 @@ void circlePushButton::paintEvent(QPaintEvent *event) //设置绘制的图案 if (!m_mousePress && m_isSelected) { + // qDebug() << "Drawing hover selected rectangle"; painter.setOpacity(m_iconOpacity); m_hoverSvg->render(&painter); } else if (!m_mousePress && !m_isSelected) { + // qDebug() << "Drawing normal rectangle"; painter.setOpacity(m_iconOpacity); m_normalSvg->render(&painter); } else { + // qDebug() << "Drawing press rectangle"; painter.setOpacity(m_iconOpacity); m_pressSvg->render(&painter); } painter.restore(); + // qDebug() << "Function completed: paintEvent"; } +#if QT_VERSION_MAJOR > 5 +void circlePushButton::enterEvent(QEnterEvent *event) +#else void circlePushButton::enterEvent(QEvent *event) +#endif { + // qDebug() << "Function started: enterEvent"; Q_UNUSED(event); + // qDebug() << "Setting hover state to true"; m_hover = true; update(); + // qDebug() << "Function completed: enterEvent"; } void circlePushButton::focusInEvent(QFocusEvent *event) { + // qDebug() << "Function started: focusInEvent"; Q_UNUSED(event); + // qDebug() << "Setting hover state to true (focus in)"; m_hover = true; update(); + // qDebug() << "Function completed: focusInEvent"; } void circlePushButton::focusOutEvent(QFocusEvent *event) { + // qDebug() << "Function started: focusOutEvent"; Q_UNUSED(event); + // qDebug() << "Setting hover state to false (focus out)"; m_hover = false; update(); + // qDebug() << "Function completed: focusOutEvent"; } void circlePushButton::hideEvent(QHideEvent *event) { + // qDebug() << "Function started: hideEvent"; QWidget* fw = QApplication::focusWidget(); - if (fw == this) + // qDebug() << "Current focus widget:" << (fw ? "exists" : "null"); + if (fw == this) { + // qDebug() << "Condition check: Widget has focus, clearing focus"; this->clearFocus(); + } QPushButton::hideEvent(event); + // qDebug() << "Function completed: hideEvent"; } bool circlePushButton::focusNextPrevChild(bool next) { + // qDebug() << "Function started: focusNextPrevChild"; Q_UNUSED(next); - return QPushButton::focusNextPrevChild(next); + // qDebug() << "Calling parent focusNextPrevChild"; + bool result = QPushButton::focusNextPrevChild(next); + // qDebug() << "Function completed: focusNextPrevChild"; + return result; } void circlePushButton::leaveEvent(QEvent *event) { + // qDebug() << "Function started: leaveEvent"; Q_UNUSED(event); + // qDebug() << "Setting hover state to false (mouse left)"; m_hover = false; m_mousePress = false; update(); + // qDebug() << "Function completed: leaveEvent"; } void circlePushButton::mousePressEvent(QMouseEvent *event) { + // qDebug() << "Function started: mousePressEvent"; Q_UNUSED(event); + // qDebug() << "Setting mouse press state to true"; m_mousePress = true; + // qDebug() << "Toggling selection state"; setSelected(!m_isSelected); update(); QPushButton::mousePressEvent(event); + // qDebug() << "Function completed: mousePressEvent"; } void circlePushButton::mouseMoveEvent(QMouseEvent *event) { - //解决bug 在按钮中可拖动相机界面,https://pms.uniontech.com/zentao/bug-view-100647.html + // qDebug() << "Function started: mouseMoveEvent"; + //解决bug 在按钮中可拖动相机界面,bug 100647 Q_UNUSED(event); + // qDebug() << "Ignoring mouse move event to prevent dragging"; + // qDebug() << "Function completed: mouseMoveEvent"; return; } void circlePushButton::mouseReleaseEvent(QMouseEvent *event) { + // qDebug() << "Function started: mouseReleaseEvent"; Q_UNUSED(event); + // qDebug() << "Setting mouse press state to false"; m_mousePress = false; update(); QPushButton::mouseReleaseEvent(event); + // qDebug() << "Function completed: mouseReleaseEvent"; } void circlePushButton::setButtonRadius(int radius) { - if (radius <= 0) + // qDebug() << "Function started: setButtonRadius"; + if (radius <= 0) { + qCWarning(appLog) << "Invalid button radius:" << radius; return; + } + // qDebug() << "Setting button radius to:" << radius; m_radius = radius; resize(2 * m_radius, 2 * m_radius); } void circlePushButton::copyPixmap(const circlePushButton &other) { + // qDebug() << "Copying pixmaps from another button"; m_normalSvg = other.m_normalSvg; m_hoverSvg = other.m_hoverSvg; m_pressSvg = other.m_pressSvg; @@ -227,36 +291,39 @@ void circlePushButton::copyPixmap(const circlePushButton &other) void circlePushButton::setDisableSelect(bool disable) { + // qDebug() << "Setting disable select to:" << disable; m_disableSelect = disable; } void circlePushButton::setOpacity(int opacity) { + // qDebug() << "Setting button opacity to:" << opacity; m_opacity = opacity; m_color.setAlpha(opacity); - qDebug() << opacity; update(); } void circlePushButton::setIconOpacity(qreal opacity) { + // qDebug() << "Setting icon opacity to:" << opacity; m_iconOpacity = opacity; - qDebug() << m_iconOpacity; update(); } void circlePushButton::setRotate(int rotate) { + // qDebug() << "Setting button rotation to:" << rotate; m_rotate = rotate; update(); } -void circlePushButton::setNewNotification (const bool set_new) +void circlePushButton::setNewNotification(const bool set_new) { + // qDebug() << "Setting new notification to:" << set_new; m_isNewNotification = set_new; } circlePushButton::~circlePushButton() { - + // qDebug() << "Destroying CirclePushButton"; } diff --git a/src/src/circlepushbutton.h b/src/src/circlepushbutton.h index 08acfb23f..8d50454da 100644 --- a/src/src/circlepushbutton.h +++ b/src/src/circlepushbutton.h @@ -7,7 +7,11 @@ #define CIRCLEPUSHBUTTON_H #include +#if QT_VERSION_MAJOR <= 5 #include +#else +#include +#endif class QColor; class QSvgRenderer; @@ -115,7 +119,11 @@ public slots: * @brief enterEvent 鼠标进入事件 * @param event 事件参数 */ +#if QT_VERSION_MAJOR > 5 + void enterEvent(QEnterEvent *event) override; +#else void enterEvent(QEvent *event) override; +#endif /** * @brief focusInEvent 焦点进入事件 diff --git a/src/src/closedialog.cpp b/src/src/closedialog.cpp index f2e5a88fa..0bd589a43 100644 --- a/src/src/closedialog.cpp +++ b/src/src/closedialog.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,8 +11,14 @@ #include #include +#if QT_VERSION_MAJOR > 5 +#include +#else #include +#endif #include +#include "ddlog.h" +using namespace DDLog; DWIDGET_USE_NAMESPACE @@ -21,6 +27,7 @@ typedef DLabel QLbtoDLabel; CloseDialog::CloseDialog(QWidget *parent, QString strText) : DDialog(parent), m_leftNamebtn(tr("Cancel")), m_rightNamebtn(tr("Close")) { + qCDebug(appLog) << "Function started: CloseDialog constructor"; this->setIcon(QIcon(":/images/icons/warning.svg")); setFixedSize(380, 140); m_widget = new DWidget(this); @@ -58,4 +65,6 @@ CloseDialog::CloseDialog(QWidget *parent, QString strText) DWindowCloseButton *windowCloseBtn = findChild("DTitlebarDWindowCloseButton"); setTabOrder(windowCloseBtn, cancelBtn); setTabOrder(cancelBtn, closeBtn); + + qCDebug(appLog) << "Function completed: CloseDialog constructor"; } diff --git a/src/src/dbus_adpator.cpp b/src/src/dbus_adpator.cpp index 7677ddde8..d4a9b958a 100644 --- a/src/src/dbus_adpator.cpp +++ b/src/src/dbus_adpator.cpp @@ -4,18 +4,144 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include "dbus_adpator.h" +#include "videowidget.h" +#include "photorecordbtn.h" +#include "datamanager.h" ApplicationAdaptor::ApplicationAdaptor(CMainWindow *mw) : QDBusAbstractAdaptor(mw), m_mw(mw) { + if (m_mw) { + connect(m_mw->getVideoWidget(), &videowidget::reflushSnapshotLabel, [=](const QString &filePath) { + QMetaObject::invokeMethod(this, "emitPhotoTaken", Qt::QueuedConnection, Q_ARG(QString, filePath)); + }); + + connect(m_mw->getVideoWidget(), &videowidget::updateRecordState, [=](int state) { + if (state == 2) { + QString fileName = DataManager::instance()->getstrFileName(); + if (!fileName.isEmpty()) { + QString videoPath = m_mw->getVideoWidget()->getSaveVdFolder(); + QString filePath = videoPath + "/" + fileName; + QMetaObject::invokeMethod(this, "emitRecordingStarted", Qt::QueuedConnection, Q_ARG(QString, filePath)); + } + } + else if (state == 0) { + QString fileName = DataManager::instance()->getstrFileName(); + if (!fileName.isEmpty()) { + QString videoPath = m_mw->getVideoWidget()->getSaveVdFolder(); + QString filePath = videoPath + "/" + fileName; + QMetaObject::invokeMethod(this, "emitRecordingStopped", Qt::QueuedConnection, Q_ARG(QString, filePath)); + } + } + }); + } +} + +bool ApplicationAdaptor::showWindow() +{ + if (m_mw) { + m_mw->showNormal(); + m_mw->activateWindow(); + return true; + } + return false; +} + +bool ApplicationAdaptor::hideWindow() +{ + if (m_mw) { + m_mw->hide(); + return true; + } + return false; +} + +bool ApplicationAdaptor::raiseWindow() +{ + if (m_mw) { + m_mw->showNormal(); + m_mw->raise(); + m_mw->activateWindow(); + return true; + } + return false; +} + +bool ApplicationAdaptor::quitWindow() +{ + if (m_mw) { + m_mw->close(); + return true; + } + return false; +} + +bool ApplicationAdaptor::takePhoto() +{ + if (m_mw) { + m_mw->onSwitchPhotoBtnClked(); + videowidget *videoWidget = m_mw->getVideoWidget(); + if (videoWidget) { + videoWidget->onTakePic(true); + return true; + } + } + return false; +} + +bool ApplicationAdaptor::startRecording() +{ + if (m_mw) { + m_mw->onSwitchRecordBtnClked(); + videowidget *videoWidget = m_mw->getVideoWidget(); + if (videoWidget) { + if (!videoWidget->getCapStatus()) { + videoWidget->onTakeVideo(); + return true; + } + } + } + return false; +} + +bool ApplicationAdaptor::stopRecording() +{ + if (m_mw) { + videowidget *videoWidget = m_mw->getVideoWidget(); + if (videoWidget) { + if (videoWidget->getCapStatus()) { + videoWidget->onEndBtnClicked(); + return true; + } + } + } + return false; +} + +bool ApplicationAdaptor::getRecordingStatus() +{ + if (m_mw) { + videowidget *videoWidget = m_mw->getVideoWidget(); + if (videoWidget) { + return videoWidget->getCapStatus(); + } + } + return false; +} + +void ApplicationAdaptor::emitPhotoTaken(const QString &filePath) +{ + emit photoTaken(filePath); +} + +void ApplicationAdaptor::emitRecordingStarted(const QString &filePath) +{ + emit recordingStarted(filePath); } -void ApplicationAdaptor::Raise() +void ApplicationAdaptor::emitRecordingStopped(const QString &filePath) { - qDebug() << "raise window from dbus"; - m_mw->showNormal(); - m_mw->raise(); - m_mw->activateWindow(); + emit recordingStopped(filePath); } ApplicationAdaptor::~ApplicationAdaptor() diff --git a/src/src/dbus_adpator.h b/src/src/dbus_adpator.h index b01e2281d..ca668a8e2 100644 --- a/src/src/dbus_adpator.h +++ b/src/src/dbus_adpator.h @@ -20,15 +20,82 @@ class ApplicationAdaptor: public QDBusAbstractAdaptor public: explicit ApplicationAdaptor(CMainWindow *mw = nullptr); - Q_CLASSINFO("D-Bus Interface", "com.deepin.camera") + Q_CLASSINFO("D-Bus Interface", "com.deepin.Camera") ~ApplicationAdaptor(); public slots: /** - * @brief Raise 升起窗口信号 + * @brief showWindow 显示窗口 */ - void Raise(); + bool showWindow(); + + /** + * @brief hideWindow 隐藏窗口 + */ + bool hideWindow(); + + /** + * @brief raiseWindow 提升窗口 + */ + bool raiseWindow(); + + /** + * @brief quitWindow 退出窗口 + */ + bool quitWindow(); + + /** + * @brief takePhoto 拍照 + */ + bool takePhoto(); + + /** + * @brief startRecording 开始录像 + */ + bool startRecording(); + + /** + * @brief stopRecording 停止录像 + */ + bool stopRecording(); + + /** + * @brief getRecordingStatus 获取录像状态 + */ + bool getRecordingStatus(); + +Q_SIGNALS: + /** + * @brief recordingStatusChanged 录像状态改变信号 + */ + void recordingStatusChanged(bool isRecording); + + /** + * @brief photoTaken 拍照完成信号 + */ + void photoTaken(const QString &filePath); + + /** + * @brief recordingStarted 录像开始信号 + */ + void recordingStarted(const QString &filePath); + + /** + * @brief recordingStopped 录像停止信号 + */ + void recordingStopped(const QString &filePath); + +private slots: + /** + * @brief emitPhotoTaken Emit photoTaken signal in the main thread + * @param filePath The path of the taken photo + */ + void emitPhotoTaken(const QString &filePath); + + void emitRecordingStarted(const QString &filePath); + + void emitRecordingStopped(const QString &filePath); private: CMainWindow *m_mw; diff --git a/src/src/ddlog.h b/src/src/ddlog.h new file mode 100644 index 000000000..6a06b4686 --- /dev/null +++ b/src/src/ddlog.h @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef DDLOG_H +#define DDLOG_H + +#include +#include + +DCORE_USE_NAMESPACE + +namespace DDLog { +inline Q_LOGGING_CATEGORY(appLog, "org.deepin.camera") +} + +#endif // DDLOG_H diff --git a/src/src/devnummonitor.cpp b/src/src/devnummonitor.cpp index a6757894c..e9974b2f2 100644 --- a/src/src/devnummonitor.cpp +++ b/src/src/devnummonitor.cpp @@ -1,11 +1,13 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "devnummonitor.h" #include +#include "ddlog.h" +using namespace DDLog; extern "C" { @@ -15,6 +17,7 @@ extern "C" DevNumMonitor::DevNumMonitor() { + qCDebug(appLog) << "Initializing DevNumMonitor"; m_noDevice = false; m_pTimer = nullptr; } @@ -25,10 +28,12 @@ DevNumMonitor::DevNumMonitor() */ void DevNumMonitor::startCheck() { + qCDebug(appLog) << "Starting device number monitoring"; m_pTimer = new QTimer; m_pTimer->setInterval(500); connect(m_pTimer, &QTimer::timeout, this, &DevNumMonitor::timeOutSlot); m_pTimer->start(); + qCDebug(appLog) << "Device monitoring timer started with 500ms interval"; } //void DevNumMonitor::run() @@ -44,35 +49,45 @@ void DevNumMonitor::startCheck() void DevNumMonitor::timeOutSlot() { - check_device_list_events(get_v4l2_device_handler()); + // 检查设备列表变化事件 + if (check_device_list_events(get_v4l2_device_handler())) { + emit deviceListChanged(); + } + + int deviceCount = get_device_list()->num_devices; - if (get_device_list()->num_devices <= 1) { + if (deviceCount <= 1) { emit seltBtnStateDisable(); - if (get_device_list()->num_devices < 1) { - //没有设备发送信号 + + if (deviceCount < 1) { if (!m_noDevice) { + qCWarning(appLog) << "No camera devices found"; emit noDeviceFound(); m_noDevice = true; } - qDebug() << "There is no camera connected!"; } else { + if (m_noDevice) { + v4l2_dev_sys_data_t *v4l2_devices = get_device_list()->list_devices; + if (v4l2_devices) { + qCWarning(appLog) << "Device found:" << v4l2_devices[0].device << v4l2_devices[0].name; + } + } m_noDevice = false; emit existDevice(); - qDebug() << "There is a camera connected!"; } } else { m_noDevice = false; emit existDevice(); //显示切换按钮 emit seltBtnStateEnable(); - qDebug() << "There are two or more cameras connected!"; } - } DevNumMonitor::~DevNumMonitor() { + qCDebug(appLog) << "Destroying DevNumMonitor"; if (nullptr != m_pTimer) { + qCDebug(appLog) << "Stopping and cleaning up monitoring timer"; m_pTimer->stop(); m_pTimer->deleteLater(); m_pTimer = nullptr; diff --git a/src/src/devnummonitor.h b/src/src/devnummonitor.h index 1176ffbc3..3300607aa 100644 --- a/src/src/devnummonitor.h +++ b/src/src/devnummonitor.h @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 -2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -60,6 +60,11 @@ class DevNumMonitor: public QObject */ void existDevice(); + /** + * @brief deviceListChanged 相机设备列表改变信号 + */ + void deviceListChanged(); + protected: /** * @brief run 运行 diff --git a/src/src/eventlogutils.cpp b/src/src/eventlogutils.cpp index cccf2ecff..dc308d023 100644 --- a/src/src/eventlogutils.cpp +++ b/src/src/eventlogutils.cpp @@ -13,14 +13,18 @@ EventLogUtils *EventLogUtils::m_instance(nullptr); EventLogUtils &EventLogUtils::get() { + // qDebug() << "Function started: get"; if (m_instance == nullptr) { + // qDebug() << "Condition check: Creating new EventLogUtils instance"; m_instance = new EventLogUtils; } + // qDebug() << "Function completed: get"; return *m_instance; } EventLogUtils::EventLogUtils() { + // qDebug() << "Function started: EventLogUtils constructor"; QLibrary library("libdeepin-event-log.so"); init =reinterpret_cast(library.resolve("Initialize")); @@ -30,13 +34,16 @@ EventLogUtils::EventLogUtils() return; init("deepin-camera", true); + // qDebug() << "Function completed: EventLogUtils constructor"; } void EventLogUtils::writeLogs(QJsonObject &data) { + // qDebug() << "Function started: writeLogs"; if (writeEventLog == nullptr) return; //std::string str = QJsonDocument(data).toJson(QJsonDocument::Compact).toStdString(); writeEventLog(QJsonDocument(data).toJson(QJsonDocument::Compact).toStdString()); + // qDebug() << "Function completed: writeLogs"; } diff --git a/src/src/exposureslider.cpp b/src/src/exposureslider.cpp index dc443962b..3e5d93e94 100644 --- a/src/src/exposureslider.cpp +++ b/src/src/exposureslider.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -14,6 +14,10 @@ #include #include +#include +#include "ddlog.h" +using namespace DDLog; + #define WIDTH 40 #define HEIGHT 192 #define ANIMATION_DURATION 50 @@ -26,6 +30,7 @@ ExposureSlider::ExposureSlider(QWidget *parent) : QWidget(parent) ,m_curValue(0) ,m_opacity(102) //UI默认 { + qCDebug(appLog) << "Initializing ExposureSlider"; resize(WIDTH, HEIGHT); QVBoxLayout *vLayout = new QVBoxLayout(this); vLayout->setContentsMargins(0, 0, 0, 0); @@ -43,12 +48,15 @@ ExposureSlider::ExposureSlider(QWidget *parent) : QWidget(parent) m_pLabShowValue->setAlignment(Qt::AlignCenter); m_pLabShowValue->setText("0"); m_pLabShowValue->setFixedWidth(30); + // qDebug() << "Created value display label"; + //颜色不随主题变化 QPalette pa = m_pLabShowValue->palette(); pa.setColor(QPalette::BrightText, Qt::white); m_pLabShowValue->setPalette(pa); //字体大小不随系统变化 connect(qApp, &QGuiApplication::fontChanged, this, [=](){ + qCDebug(appLog) << "Updating font settings for value display"; QFont font("SourceHanSansSC"); font.setPixelSize(15); font.setWeight(QFont::Medium); @@ -60,6 +68,8 @@ ExposureSlider::ExposureSlider(QWidget *parent) : QWidget(parent) vLayout->setSpacing(2); m_slider = new DSlider(Qt::Vertical, this); + m_slider->setObjectName("ExposureSlider"); + m_slider->setAccessibleName("ExposureSlider"); m_slider->setFixedHeight(150); m_slider->setIconSize(QSize(15, 15)); m_slider->slider()->setRange(-100, 100); @@ -74,16 +84,19 @@ ExposureSlider::ExposureSlider(QWidget *parent) : QWidget(parent) m_pLabShowValue->hide(); m_slider->hide(); + qCDebug(appLog) << "ExposureSlider initialization completed"; } void ExposureSlider::setOpacity(int opacity) { + qCDebug(appLog) << "Setting slider opacity to:" << opacity; m_opacity = opacity; update(); } void ExposureSlider::showContent(bool show, bool isShortCut) { + qCDebug(appLog) << "Showing exposure slider content:" << show << "isShortCut:" << isShortCut; QGraphicsOpacityEffect *effectSlider = new QGraphicsOpacityEffect(m_slider); m_slider->setGraphicsEffect(effectSlider); QPropertyAnimation *opacity = new QPropertyAnimation(effectSlider, "opacity", this); @@ -101,14 +114,15 @@ void ExposureSlider::showContent(bool show, bool isShortCut) pGroup->addAnimation(opacity1); if (show) { + qCDebug(appLog) << "Condition check: Showing content (fade in)"; opacity->setStartValue(0); opacity->setEndValue(1); opacity1->setStartValue(0); opacity1->setEndValue(1); connect(pGroup, &QParallelAnimationGroup::finished, this, [=](){ - if (isShortCut) //键盘触发,需在此处理焦点 - m_slider->slider()->setFocus(); + qCDebug(appLog) << "Animation finished, handling cleanup"; + m_slider->slider()->setFocus(); pGroup->deleteLater(); }); @@ -116,6 +130,7 @@ void ExposureSlider::showContent(bool show, bool isShortCut) m_slider->show(); pGroup->start(); } else { + qCDebug(appLog) << "Condition check: Hiding content (fade out)"; opacity->setStartValue(1); opacity->setEndValue(0); opacity1->setStartValue(1); @@ -123,6 +138,7 @@ void ExposureSlider::showContent(bool show, bool isShortCut) connect(pGroup, &QParallelAnimationGroup::finished, this, &ExposureSlider::contentHided); connect(pGroup, &QParallelAnimationGroup::finished, this, [=](){ + qCDebug(appLog) << "Animation finished, hiding widgets"; m_pLabShowValue->hide(); m_slider->hide(); pGroup->deleteLater(); @@ -130,13 +146,18 @@ void ExposureSlider::showContent(bool show, bool isShortCut) pGroup->start(); } - + qCDebug(appLog) << "Function completed: showContent"; } void ExposureSlider::paintEvent(QPaintEvent *event) { + // qDebug() << "Function started: paintEvent"; QPainter painter(this); +#if QT_VERSION_MAJOR > 5 + painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); +#else painter.setRenderHint(QPainter::HighQualityAntialiasing, true); +#endif QRectF topRect(rect().topLeft(), QSize(WIDTH, WIDTH)); QRectF centerRect(rect().topLeft() + QPoint(0, WIDTH / 2.0), QSize(WIDTH, HEIGHT - WIDTH)); @@ -153,6 +174,7 @@ void ExposureSlider::paintEvent(QPaintEvent *event) painter.fillPath(path, QBrush(QColor(0, 0, 0, m_opacity))); if (m_curValue) { + // qDebug() << "Drawing circle"; QRectF rect = this->rect(); rect.setTopLeft(QPoint(29, rect.height() / 2 + 10)); rect.setSize(QSize(4, 4)); @@ -160,50 +182,69 @@ void ExposureSlider::paintEvent(QPaintEvent *event) painter.setBrush(QBrush(QColor(255, 255, 255, 0.8 * 255))); painter.drawEllipse(rect); } + // qDebug() << "Function completed: paintEvent"; } void ExposureSlider::wheelEvent(QWheelEvent *event) { + // qDebug() << "Function started: wheelEvent"; if (m_curValue >= m_valueMax) m_curValue = m_valueMax; - if (m_curValue <= m_valueMin) + if (m_curValue <= m_valueMin) { + // qDebug() << "Condition check: At minimum value, capping"; m_curValue = m_valueMin; + } m_curValue += event->angleDelta().y() / 120; m_slider->setValue(m_curValue); + // qDebug() << "Function completed: wheelEvent"; } void ExposureSlider::keyReleaseEvent(QKeyEvent *event) { + // qDebug() << "Function started: keyReleaseEvent"; switch (event->key()) { case Qt::Key_Down: { - if (m_curValue <= m_valueMin) + // qDebug() << "Condition check: Down key pressed"; + if (m_curValue <= m_valueMin) { + // qDebug() << "Already at minimum value:" << m_valueMin; return; + } m_curValue -= 1; m_slider->setValue(m_curValue); break; } case Qt::Key_Up: { - if (m_curValue >= m_valueMax) + // qDebug() << "Condition check: Up key pressed"; + if (m_curValue >= m_valueMax) { + // qDebug() << "Already at maximum value:" << m_valueMax; return; + } m_curValue += 1; m_slider->setValue(m_curValue); break; } case Qt::Key_Return: { - if (!m_slider->slider()->hasFocus()) + // qDebug() << "Condition check: Return key pressed"; + if (!m_slider->slider()->hasFocus()) { + // qDebug() << "Return key ignored - slider not focused"; return; + } + // qDebug() << "Enter button clicked"; emit enterBtnClicked(true); break; } } QWidget::keyReleaseEvent(event); + // qDebug() << "Function completed: keyReleaseEvent"; } bool ExposureSlider::eventFilter(QObject *obj, QEvent *e) { + // qDebug() << "Function started: eventFilter"; if (obj == m_slider->slider() && e->type() == QEvent::Hide) { + // qDebug() << "Condition check: Slider hide event detected"; QWidget* fw = QApplication::focusWidget(); if (fw == m_slider->slider()) m_slider->slider()->clearFocus(); @@ -213,17 +254,19 @@ bool ExposureSlider::eventFilter(QObject *obj, QEvent *e) void ExposureSlider::onValueChanged(int value) { - if (value > m_valueMax || value < m_valueMin) + // qDebug() << "Function started: onValueChanged"; + if (value > m_valueMax || value < m_valueMin) { + // qDebug() << "Value out of range:" << value << "min:" << m_valueMin << "max:" << m_valueMax; return; + } m_curValue = value; - m_pLabShowValue->setText(QString("%1").arg(value)); - update(); + // qDebug() << "Function completed: onValueChanged"; } ExposureSlider::~ExposureSlider() { - + // qDebug() << "Destroying ExposureSlider"; } diff --git a/src/src/filterpreviewbutton.cpp b/src/src/filterpreviewbutton.cpp index 8dae1b30b..cb403a8ac 100644 --- a/src/src/filterpreviewbutton.cpp +++ b/src/src/filterpreviewbutton.cpp @@ -1,18 +1,29 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "filterpreviewbutton.h" +#include "ddlog.h" +using namespace DDLog; extern "C" { -#include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + #include +#else + #include +#endif } #include #include +#if QT_VERSION_MAJOR <= 5 #include +#else +#include +DGUI_USE_NAMESPACE +#endif DWIDGET_USE_NAMESPACE; @@ -23,9 +34,13 @@ DWIDGET_USE_NAMESPACE; filterPreviewButton::filterPreviewButton(QWidget *parent, efilterType filter/* = filter_Normal*/): QWidget(parent) , m_filterType(filter) { + qCDebug(appLog) << "Function started: filterPreviewButton constructor"; + QString objName = filterName_CUBE(filter); - if (objName.isEmpty()) + if (objName.isEmpty()) { + qCDebug(appLog) << "Condition check: Filter name empty, using 'normal'"; objName = "normal"; + } setObjectName(objName); m_color.setRgb(44, 44, 44); @@ -36,54 +51,76 @@ filterPreviewButton::filterPreviewButton(QWidget *parent, efilterType filter/* = m_disableSelect = false; setWindowOpacity(0.1); + // 按钮只画中央 40x40 图像与描边,5px 边距不绘制。未设透明时 Qt 把按钮当 + // 不透明处理,边距区不会与下层视频混合,残留首帧像素形成冻结边带。设为 + // 透明后边距透出视频,与 2px 间隙行为一致。 + setAttribute(Qt::WA_TranslucentBackground, true); + setAutoFillBackground(false); resize(BUTTON_SIZE, BUTTON_SIZE); + + qCDebug(appLog) << "Function completed: filterPreviewButton constructor"; } void filterPreviewButton::setbackground(QColor color) { + // qDebug() << "Setting button background color:" << color; m_color = color; } void filterPreviewButton::setImage(QImage *img) { + // qDebug() << "Function started: setImage"; Q_ASSERT(img); - if (isHidden() && !img->isNull()) + if (isHidden() && !img->isNull()) { + // qDebug() << "Condition check: Widget hidden and image not null, skipping"; return; + } uint8_t* frame = img->bits(); int width = img->width(); int height = img->height(); QString filterName_CUBE = filterPreviewButton::filterName_CUBE(m_filterType); - if (!filterName_CUBE.isEmpty()) + if (!filterName_CUBE.isEmpty()) { + // qDebug() << "Applying filter:" << filterName_CUBE; imageFilter24(frame, width, height, filterName_CUBE.toStdString().c_str(), 100); + } m_pixmap = QPixmap::fromImage(QImage(frame, width, height, QImage::Format_RGB888)); update(); + // qDebug() << "Function completed: setImage"; } void filterPreviewButton::setSelected(bool selected) { + // qDebug() << "Setting button selected state to:" << selected; m_isSelected = selected; update(); } bool filterPreviewButton::isSelected() { + // qDebug() << "Function started: isSelected: " << m_isSelected; return m_isSelected; } void filterPreviewButton::setButtonRadius(int radius) { + // qDebug() << "Setting button radius to:" << radius; m_radius = radius; update(); } void filterPreviewButton::paintEvent(QPaintEvent *event) { + // qDebug() << "Function started: paintEvent"; Q_UNUSED(event); QPainter painter(this); +#if QT_VERSION_MAJOR > 5 + painter.setRenderHints(QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#else painter.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#endif QRect imageRect = QRect(MARGIN, MARGIN, IMAGE_SIZE, IMAGE_SIZE); @@ -92,11 +129,13 @@ void filterPreviewButton::paintEvent(QPaintEvent *event) //绘制滤镜预览图 if (!m_pixmap.isNull()) { + // qDebug() << "Drawing pixmap"; painter.save(); painter.setClipPath(roundPixmapRectPath); painter.drawPixmap(imageRect, m_pixmap); painter.restore(); } else { + // qDebug() << "Drawing color"; painter.fillPath(roundPixmapRectPath, QBrush(QColor(m_color))); } @@ -115,6 +154,7 @@ void filterPreviewButton::paintEvent(QPaintEvent *event) //绘制点击效果 QRect grayRect = imageRect; if (m_mousePress) { + // qDebug() << "Drawing mouse press effect"; if (m_pixmap.isNull()) painter.setBrush(QBrush(QColor(0, 0, 0, 255 * 1))); else @@ -122,6 +162,7 @@ void filterPreviewButton::paintEvent(QPaintEvent *event) painter.setPen(Qt::NoPen); painter.drawRoundedRect(grayRect, m_radius, m_radius); } else if (m_hover) { + // qDebug() << "Drawing hover effect"; if (m_pixmap.isNull()) painter.setBrush(QBrush(QColor(0, 0, 0, 255 * 0))); else @@ -133,6 +174,7 @@ void filterPreviewButton::paintEvent(QPaintEvent *event) QRect focusWhite = imageRect; QRect focusBlue = imageRect.adjusted(-2, -2, 2, 2); if (m_hover || m_isSelected && !m_disableSelect) { + // qDebug() << "Drawing focus effect"; painter.setPen(QPen(QColor(Qt::white), m_radius / 4)); painter.drawRoundedRect(focusWhite, m_radius, m_radius); @@ -144,10 +186,16 @@ void filterPreviewButton::paintEvent(QPaintEvent *event) } QWidget::paintEvent(event); + // qDebug() << "Function completed: paintEvent"; } +#if QT_VERSION_MAJOR > 5 +void filterPreviewButton::enterEvent(QEnterEvent *event) +#else void filterPreviewButton::enterEvent(QEvent *event) +#endif { + // qDebug() << "Function started: enterEvent"; Q_UNUSED(event); this->setFocus(); m_hover = true; @@ -156,6 +204,7 @@ void filterPreviewButton::enterEvent(QEvent *event) void filterPreviewButton::focusInEvent(QFocusEvent *event) { + // qDebug() << "Function started: focusInEvent"; Q_UNUSED(event); m_hover = true; update(); @@ -163,6 +212,7 @@ void filterPreviewButton::focusInEvent(QFocusEvent *event) void filterPreviewButton::focusOutEvent(QFocusEvent *event) { + // qDebug() << "Function started: focusOutEvent"; Q_UNUSED(event); m_hover = false; update(); @@ -170,6 +220,7 @@ void filterPreviewButton::focusOutEvent(QFocusEvent *event) void filterPreviewButton::leaveEvent(QEvent *event) { + // qDebug() << "Function started: leaveEvent"; Q_UNUSED(event); this->clearFocus(); m_hover = false; @@ -179,6 +230,7 @@ void filterPreviewButton::leaveEvent(QEvent *event) void filterPreviewButton::mousePressEvent(QMouseEvent *event) { + // qDebug() << "Function started: mousePressEvent"; Q_UNUSED(event); m_mousePress = true; setSelected(true); @@ -188,27 +240,32 @@ void filterPreviewButton::mousePressEvent(QMouseEvent *event) void filterPreviewButton::mouseMoveEvent(QMouseEvent *event) { - //解决bug 在按钮中可拖动相机界面,https://pms.uniontech.com/zentao/bug-view-100647.html + // qDebug() << "Function started: mouseMoveEvent"; + //解决bug 在按钮中可拖动相机界面,bug 100647 Q_UNUSED(event); return; } void filterPreviewButton::mouseReleaseEvent(QMouseEvent *event) { + // qDebug() << "Function started: mouseReleaseEvent"; Q_UNUSED(event); m_mousePress = false; update(); emit clicked(false); DWidget::mouseReleaseEvent(event); + // qDebug() << "Function completed: mouseReleaseEvent"; } void filterPreviewButton::setDisableSelect(bool disable) { + // qDebug() << "Setting disable select to:" << disable; m_disableSelect = disable; } void filterPreviewButton::setOpacity(int opacity) { + // qDebug() << "Setting button opacity to:" << opacity; m_opacity = opacity; m_color.setAlpha(opacity); update(); @@ -216,82 +273,105 @@ void filterPreviewButton::setOpacity(int opacity) efilterType filterPreviewButton::getFiltertype() { + // qDebug() << "Function started: getFiltertype"; return m_filterType; } filterPreviewButton::~filterPreviewButton() { - + // qDebug() << "Destroying filter preview button"; } QString filterPreviewButton::filterName(efilterType type) { + // qDebug() << "Function started: filterName"; QString name = tr("Normal"); switch (type) { case filter_Normal: + qCDebug(appLog) << "Condition check: Normal filter"; name = tr("Normal"); break; case filter_Vivid: + qCDebug(appLog) << "Condition check: Vivid filter"; name = tr("Vivid"); break; case filter_Warm: + qCDebug(appLog) << "Condition check: Warm filter"; name = tr("Warm"); break; case filter_Cold: + qCDebug(appLog) << "Condition check: Cold filter"; name = tr("Cold"); break; case filter_Retro: + qCDebug(appLog) << "Condition check: Retro filter"; name = tr("Retro"); break; case filter_Film: + qCDebug(appLog) << "Condition check: Film filter"; name = tr("Film"); break; case filter_Gray: + qCDebug(appLog) << "Condition check: Gray filter"; name = tr("Gray"); break; case filter_BAndW: + qCDebug(appLog) << "Condition check: B&W filter"; name = tr("B&W"); break; default: + qCDebug(appLog) << "Condition check: Unknown filter type, using Normal"; name = tr("Normal"); break; } + qCDebug(appLog) << "Function completed: filterName:" << name; return name; } QString filterPreviewButton::filterName_CUBE(efilterType type) { + // qDebug() << "Function started: filterName_CUBE"; QString name = ""; switch (type) { case filter_Normal: + qCDebug(appLog) << "Condition check: Normal filter (no CUBE)"; name = ""; break; case filter_Vivid: + qCDebug(appLog) << "Condition check: Vivid filter"; name = "bright"; break; case filter_Warm: + qCDebug(appLog) << "Condition check: Warm filter"; name = "warm"; break; case filter_Cold: + qCDebug(appLog) << "Condition check: Cold filter"; name = "cold"; break; case filter_Retro: + qCDebug(appLog) << "Condition check: Retro filter"; name = "classic"; break; case filter_Film: + qCDebug(appLog) << "Condition check: Film filter"; name = "print"; break; case filter_Gray: + qCDebug(appLog) << "Condition check: Gray filter"; name = "gray"; break; case filter_BAndW: + qCDebug(appLog) << "Condition check: B&W filter"; name = "black"; break; default: + qCDebug(appLog) << "Condition check: Unknown filter type, using empty"; name = ""; break; } + qCDebug(appLog) << "Function completed: filterName_CUBE:" << name; return name; } diff --git a/src/src/filterpreviewbutton.h b/src/src/filterpreviewbutton.h index 8b4cfbe7e..7fe212dad 100644 --- a/src/src/filterpreviewbutton.h +++ b/src/src/filterpreviewbutton.h @@ -104,7 +104,11 @@ public slots: * @brief enterEvent 鼠标进入事件 * @param event 事件参数 */ +#if QT_VERSION_MAJOR > 5 + void enterEvent(QEnterEvent *event) override; +#else void enterEvent(QEvent *event) override; +#endif /** * @brief focusInEvent 焦点进入事件 diff --git a/src/src/globalutils.cpp b/src/src/globalutils.cpp index 24aa73906..ff23298e3 100644 --- a/src/src/globalutils.cpp +++ b/src/src/globalutils.cpp @@ -1,21 +1,33 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "globalutils.h" +#include + #include #include #include #include #include +#include "ddlog.h" +using namespace DDLog; + +DCORE_USE_NAMESPACE + +#ifdef DTKCORE_CLASS_DConfigFile +#include +#include +#endif // 相机配置文件 const QString CAMERA_CONF_PATH = "/usr/share/deepin-camera/camera.conf"; #define LOW_PERFORMANCE_BOARD "LowPerformanceBoard" QStringList GlobalUtils::m_LowPerformanceBoards = QStringList(); +bool GlobalUtils::m_IsLowPerformanceDevice = false; struct DMIInfo { QString biosManufacturer; @@ -30,11 +42,13 @@ struct DMIInfo { QString sysSerialNumber; QString sysUUID; }; + Q_DECLARE_METATYPE(DMIInfo) // Marshall the MyStructure data into a D-Bus argument QDBusArgument &operator<<(QDBusArgument &argument, const DMIInfo &mystruct) { + // qDebug() << "Marshall the MyStructure data into a D-Bus argument"; argument.beginStructure(); argument << mystruct.biosManufacturer << mystruct.biosVersion << mystruct.biosRelease << mystruct.productName << mystruct.serialNumber << mystruct.Manufacturer << mystruct.version << mystruct.sysProductName @@ -46,6 +60,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const DMIInfo &mystruct) // Retrieve the MyStructure data from the D-Bus argument const QDBusArgument &operator>>(const QDBusArgument &argument, DMIInfo &mystruct) { + // qDebug() << "Retrieving MyStructure data from D-Bus argument"; argument.beginStructure(); argument >> mystruct.biosManufacturer >> mystruct.biosVersion >> mystruct.biosRelease >> mystruct.productName >> mystruct.serialNumber >> mystruct.Manufacturer >> mystruct.version >> mystruct.sysProductName @@ -56,34 +71,73 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, DMIInfo &mystruct bool GlobalUtils::isLowPerformanceBoard() { + // qDebug() << "Checking for low performance board"; +#ifdef DTKCORE_CLASS_DConfigFile + if (m_IsLowPerformanceDevice) { + return true; + } +#endif + qDBusRegisterMetaType(); - QDBusInterface *monitorInterface = new QDBusInterface("com.deepin.system.SystemInfo", "/com/deepin/system/SystemInfo", "org.freedesktop.DBus.Properties", QDBusConnection::systemBus()); - if (!monitorInterface->isValid()) + + QString systemInfoService = "com.deepin.system.SystemInfo"; + QString systemInfoPath = "/com/deepin/system/SystemInfo"; + QString systemInfoInterface = "com.deepin.system.SystemInfo"; + auto ver = DSysInfo::majorVersion().toInt(); + if (ver > 20) { + qCDebug(appLog) << "Condition check: System version > 20, using newer D-Bus interface"; + systemInfoService = "org.deepin.dde.SystemInfo1"; + systemInfoPath = "/org/deepin/dde/SystemInfo1"; + systemInfoInterface = "org.deepin.dde.SystemInfo1"; + } + + QDBusInterface *monitorInterface = new QDBusInterface(systemInfoService, systemInfoPath, "org.freedesktop.DBus.Properties", QDBusConnection::systemBus()); + if (!monitorInterface->isValid()) { + qCWarning(appLog) << "Failed to connect to system info D-Bus interface"; return false; + } DMIInfo dmiInfo; - QDBusReply replay = monitorInterface->call("Get", "com.deepin.system.SystemInfo", "DMIInfo"); + QDBusReply replay = monitorInterface->call("Get", systemInfoInterface, "DMIInfo"); replay.value().variant().value() >> dmiInfo; - qDebug() << __func__ << "dmiInfo.productName: " << dmiInfo.productName; + qCDebug(appLog) << "System DMI info - Product Name:" << dmiInfo.productName; + qCDebug(appLog) << "System DMI info - Manufacturer:" << dmiInfo.Manufacturer; + qCDebug(appLog) << "System DMI info - Version:" << dmiInfo.version; // BXC 600F/NZ2750、CC GWMNDA1GL1等主板不能满足mp4封装的性能要求,因此需要特殊适配 for (auto board : m_LowPerformanceBoards) { - if (dmiInfo.productName.contains(board)) + if (dmiInfo.productName.contains(board)) { + qCInfo(appLog) << "Detected low performance board:" << board; return true; + } } + qCDebug(appLog) << "No low performance board detected"; return false; } void GlobalUtils::loadCameraConf() { + qCDebug(appLog) << "Loading camera configuration from:" << CAMERA_CONF_PATH; QSettings conf(CAMERA_CONF_PATH, QSettings::IniFormat); QVariant value = conf.value(LOW_PERFORMANCE_BOARD); if (value.isValid()) { + qCDebug(appLog) << "Condition check: Configuration value valid"; m_LowPerformanceBoards = value.toStringList(); } else { + qCWarning(appLog) << "No low performance boards configuration found in" << CAMERA_CONF_PATH; m_LowPerformanceBoards = QStringList(); } + +#ifdef DTKCORE_CLASS_DConfigFile + m_IsLowPerformanceDevice = false; + std::unique_ptr dconfig( + DTK_CORE_NAMESPACE::DConfig::create("org.deepin.camera", "org.deepin.camera.encode")); + if (dconfig && dconfig->isValid() && dconfig->keyList().contains("isLowPerformanceDevice")) { + m_IsLowPerformanceDevice = dconfig->value("isLowPerformanceDevice").toBool(); + } +#endif + qCDebug(appLog) << "Function completed: loadCameraConf"; } diff --git a/src/src/globalutils.h b/src/src/globalutils.h index 51e021d44..dfbaf95d7 100644 --- a/src/src/globalutils.h +++ b/src/src/globalutils.h @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -19,6 +19,7 @@ class GlobalUtils private: static QStringList m_LowPerformanceBoards; + static bool m_IsLowPerformanceDevice; }; #endif // GLOBALUTILS_H diff --git a/src/src/gridline.cpp b/src/src/gridline.cpp index 8ada2257a..eb586bc53 100644 --- a/src/src/gridline.cpp +++ b/src/src/gridline.cpp @@ -13,25 +13,31 @@ const QColor gridLineColor = QColor(255, 255, 255, 0.5 * 255);// 网格线颜色 GridLineItem::GridLineItem(QGraphicsItem *parent) : QGraphicsItem (parent) { - + // qDebug() << "Function started: GridLineItem constructor"; } void GridLineItem::setGridType(GridType type) { - if (type == m_gridType) + // qDebug() << "Function started: setGridType"; + if (type == m_gridType) { + // qDebug() << "Condition check: Grid type unchanged, skipping update"; return; + } m_gridType = type; update(); + // qDebug() << "Function completed: setGridType"; } QRectF GridLineItem::boundingRect() const { + // qDebug() << "Function started: boundingRect"; return m_boundingRect; } void GridLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + // qDebug() << "Function started: GridLineItem::paint"; // 画布大小-1,保证网格线显示在画面内 m_boundingRect = scene()->sceneRect().adjusted(0, 0, -1, -1); @@ -62,31 +68,39 @@ void GridLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter->drawLine(VLine); } painter->restore(); + // qDebug() << "Function completed: GridLineItem::paint"; } GridLineWidget::GridLineWidget(QWidget *parent) : QWidget(parent) { + // qDebug() << "Function started: GridLineWidget constructor"; m_videowidget = qobject_cast(parent); } void GridLineWidget::setGridType(GridType type) { + // qDebug() << "Function started: setGridType"; m_gridType = type; update(); } void GridLineWidget::paintEvent(QPaintEvent *e) { + // qDebug() << "Function started: paintEvent"; QRect rtGrid = rect(); //if the video frame area is zero, it will not be repainted, //otherwize it will be repainted outside the video frame. - if (m_videowidget->getFrameRect().isNull()) + if (m_videowidget->getFrameRect().isNull()) { + // qDebug() << "Condition check: Video frame rect is null, skipping paint"; return; + } - if (m_videowidget) + if (m_videowidget) { + // qDebug() << "Condition check: Video widget exists"; // 画面大小-1,是为了保证网格线等分距离与网格线图元等分距离相等,这样能保证两种网格线能重合显示,避免视觉上网格线微移情况 rtGrid = m_videowidget->getFrameRect().adjusted(0, 0, -1, -1); + } QPainter painter(this); QPen pen; @@ -98,8 +112,10 @@ void GridLineWidget::paintEvent(QPaintEvent *e) painter.restore(); painter.setPen(pen); - if (Grid_None == m_gridType) + if (Grid_None == m_gridType) { + // qDebug() << "Condition check: Grid type none, skipping paint"; return; + } // 绘制网格线 painter.save(); @@ -113,4 +129,5 @@ void GridLineWidget::paintEvent(QPaintEvent *e) painter.drawLine(VLine); } painter.restore(); + // qDebug() << "Function completed: paintEvent"; } diff --git a/src/src/gstvideowriter.cpp b/src/src/gstvideowriter.cpp index c96c8b017..2a4b61bb5 100644 --- a/src/src/gstvideowriter.cpp +++ b/src/src/gstvideowriter.cpp @@ -1,9 +1,12 @@ -// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2021 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "gstvideowriter.h" +#include +#include "ddlog.h" +using namespace DDLog; extern "C" { #include #include "v4l2_core.h" @@ -12,7 +15,11 @@ extern "C" { #include "audio.h" } +#if QT_VERSION_MAJOR > 5 +#include +#else #include +#endif GST_DEBUG_CATEGORY(appsrc_pipeline_debug); @@ -23,8 +30,10 @@ static mvideo_gst_message_parse_error g_mvideo_gst_message_parse_error = nullptr static gboolean bus_message(GstBus * bus, GstMessage * message, GstVideoWriter * app) { + // qDebug() << "Function started: bus_message"; switch (message->type) { case GST_MESSAGE_ERROR: { + // qDebug() << "Condition check: GST_MESSAGE_ERROR received"; GError *err = NULL; gchar *dbg_info = NULL; @@ -45,6 +54,7 @@ bus_message(GstBus * bus, GstMessage * message, GstVideoWriter * app) break; } case GST_MESSAGE_EOS: { + // qDebug() << "Condition check: GST_MESSAGE_EOS received"; // 结束录制任务 g_main_loop_quit(app->getGloop()); // 停止管道 @@ -52,9 +62,11 @@ bus_message(GstBus * bus, GstMessage * message, GstVideoWriter * app) break; } default: + // qDebug() << "Condition check: Unhandled message type, ignoring"; break; } + // qDebug() << "Function completed: bus_message"; return TRUE; } @@ -72,6 +84,7 @@ GstVideoWriter::GstVideoWriter(const QString& videoPath): , m_filesink(nullptr) , m_bus(nullptr) { + // qDebug() << "Function started: GstVideoWriter constructor"; QLibrary gstreamerLibrary(libPath("libgstreamer-1.0.so")); QLibrary gstreamerAppLibrary(libPath("libgstapp-1.0.so")); @@ -96,10 +109,12 @@ GstVideoWriter::GstVideoWriter(const QString& videoPath): g_mvideo_gst_message_parse_error = (mvideo_gst_message_parse_error) gstreamerLibrary.resolve("gst_message_parse_error"); init(); + // qDebug() << "Function completed: GstVideoWriter constructor"; } GstVideoWriter::~GstVideoWriter() { + // qDebug() << "Function started: GstVideoWriter destructor"; g_mvideo_gst_object_unref(m_pipeline); g_mvideo_gst_object_unref(m_appsrc); g_mvideo_gst_object_unref(m_audsrc); @@ -107,118 +122,157 @@ GstVideoWriter::~GstVideoWriter() g_mvideo_gst_object_unref(m_filesink); g_mvideo_gst_object_unref(m_bus); g_main_loop_unref(m_gloop); + // qDebug() << "Function completed: GstVideoWriter destructor"; } void GstVideoWriter::start() { + qCDebug(appLog) << "Function started: start"; // 设置视频帧数据格式 loadAppSrcCaps(); #if defined(__mips__) || defined(__aarch64__) // mips/arm下,牺牲了成像质量 + qCDebug(appLog) << "Condition check: MIPS/ARM architecture detected, adjusting quantizer"; if (m_nWidth >= 1920) { + qCDebug(appLog) << "Condition check: High resolution (>=1920), setting quantizer to 30"; setQuantizer(30); } else if (m_nWidth >= 1280) { + qCDebug(appLog) << "Condition check: Medium resolution (>=1280), setting quantizer to 10"; setQuantizer(10); } - else + else { + qCDebug(appLog) << "Condition check: Low resolution, setting quantizer to 5"; setQuantizer(5); + } #endif // 启动管道 + qCDebug(appLog) << "Starting GStreamer pipeline"; g_mvideo_gst_element_set_state(m_pipeline, GST_STATE_PLAYING); // 将录制任务放到线程中运行,bus回调收到eos信号,结束录制任务 + qCDebug(appLog) << "Running main loop in separate thread"; QtConcurrent::run(g_main_loop_run, m_gloop); + qCDebug(appLog) << "Function completed: start"; } void GstVideoWriter::stop() { + qCDebug(appLog) << "Function started: stop"; GstFlowReturn ret; // 停止音频流 - if (m_audsrc) + if (m_audsrc) { + qCDebug(appLog) << "Condition check: Stopping audio stream"; g_signal_emit_by_name(m_audsrc, "end-of-stream", &ret); + } // 停止视频流 - if (m_appsrc) + if (m_appsrc) { + qCDebug(appLog) << "Condition check: Stopping video stream"; g_signal_emit_by_name(m_appsrc, "end-of-stream", &ret); + } + qCDebug(appLog) << "Function completed: stop"; } void GstVideoWriter::setVideoPath(const QString &videoPath) { + qCDebug(appLog) << "Function started: setVideoPath"; if (!videoPath.isEmpty() && m_videoPath != videoPath) m_videoPath = videoPath; if (m_filesink) g_object_set(m_filesink, "location", videoPath.toStdString().c_str(), NULL); + qCDebug(appLog) << "Function completed: setVideoPath"; } void GstVideoWriter::setQuantizer(uint quantizer) { + qCDebug(appLog) << "Function started: setQuantizer"; m_nQuantizer = quantizer; if (m_vp8enc) g_object_set(m_vp8enc, "min-quantizer", m_nQuantizer, NULL); + qCDebug(appLog) << "Function completed: setQuantizer"; } bool GstVideoWriter::writeFrame(uchar *rgb, uint size) { + qCDebug(appLog) << "Function started: writeFrame"; GstFlowReturn ret = GST_FLOW_CUSTOM_ERROR; guint8 *ptr = (guint8 *)g_malloc(size * sizeof(uchar)); if (ptr) { + qCDebug(appLog) << "Condition check: Memory allocation successful"; memcpy(ptr, rgb, size); GstBuffer *buffer = g_mvideo_gst_buffer_new_wrapped((void*)ptr, size); //设置时间戳 - if (m_pipeline) + if (m_pipeline) { + qCDebug(appLog) << "Condition check: Setting timestamp for video buffer"; GST_BUFFER_PTS(buffer) = g_mvideo_gst_clock_get_time(m_pipeline->clock) - m_pipeline->base_time; + } //注入视频帧数据 - if (m_appsrc) + if (m_appsrc) { + qCDebug(appLog) << "Condition check: Pushing video buffer to app source"; g_signal_emit_by_name(m_appsrc, "push-buffer", buffer, &ret); + } g_mvideo_gst_mini_object_unref(GST_MINI_OBJECT_CAST(buffer)); } + qCDebug(appLog) << "Function completed: writeFrame, result:" << (ret == GST_FLOW_OK ? "success" : "failed"); return ret == GST_FLOW_OK; } bool GstVideoWriter::writeAudio(uchar *audio, uint size) { + qCDebug(appLog) << "Function started: writeAudio"; GstFlowReturn ret = GST_FLOW_CUSTOM_ERROR; guint8 *ptr = (guint8 *)g_malloc(size * sizeof(uchar)); if (ptr) { + qCDebug(appLog) << "Condition check: Memory allocation successful"; memcpy(ptr, audio, size); GstBuffer *buffer = g_mvideo_gst_buffer_new_wrapped((void*)ptr, size); // 设置时间戳 - if (m_pipeline) + if (m_pipeline) { + qCDebug(appLog) << "Condition check: Setting timestamp for audio buffer"; GST_BUFFER_PTS(buffer) = g_mvideo_gst_clock_get_time(m_pipeline->clock) - m_pipeline->base_time; + } // 注入音频帧数据 if (m_audsrc) { + qCDebug(appLog) << "Condition check: Pushing audio buffer to audio source"; g_signal_emit_by_name(m_audsrc, "push-buffer", buffer, &ret); } g_mvideo_gst_mini_object_unref(GST_MINI_OBJECT_CAST(buffer)); } + qCDebug(appLog) << "Function completed: writeAudio, result:" << (ret == GST_FLOW_OK ? "success" : "failed"); return ret == GST_FLOW_OK; } float GstVideoWriter::getRecrodTime() { + qCDebug(appLog) << "Function started: getRecrodTime"; float pts = 0; - if (m_pipeline) + if (m_pipeline) { + qCDebug(appLog) << "Condition check: Pipeline exists, getting timestamp"; pts = g_mvideo_gst_clock_get_time(m_pipeline->clock) - m_pipeline->base_time; + } - return pts / 1000 / 1000 / 1000; + float result = pts / 1000 / 1000 / 1000; + qCDebug(appLog) << "Function completed: getRecrodTime, result:" << result << "seconds"; + return result; } void GstVideoWriter::init() { + qCDebug(appLog) << "Function started: init"; g_mvideo_gst_init(nullptr, nullptr); // 使用vp8编码录制视频裸流数据、使用vorbis编码录制音频裸流数据 QString pipDesc = QString("webmmux name=mux ! filesink name=filename " @@ -238,12 +292,15 @@ void GstVideoWriter::init() m_vp8enc = g_mvideo_gst_bin_get_by_name(getGstBin(m_pipeline), "encoder"); m_bus = g_mvideo_gst_pipeline_get_bus(getGstPipline(m_pipeline)); - if (m_bus) + if (m_bus) { + qCDebug(appLog) << "Condition check: Bus exists, adding message watch"; g_mvideo_gst_bus_add_watch(m_bus, (GstBusFunc)bus_message, this); + } /* 设置视频src属性 */ m_appsrc = g_mvideo_gst_bin_get_by_name(getGstBin(m_pipeline), "source"); if (m_appsrc) { + qCDebug(appLog) << "Condition check: Video app source exists, configuring properties"; loadAppSrcCaps(); g_object_set(m_appsrc, "format", GST_FORMAT_TIME, NULL); g_object_set(m_appsrc, "is-live", TRUE, NULL); @@ -252,6 +309,7 @@ void GstVideoWriter::init() /* 设置音频src属性 */ m_audsrc = g_mvideo_gst_bin_get_by_name(getGstBin(m_pipeline), "audiosource"); if (m_audsrc) { + qCDebug(appLog) << "Condition check: Audio app source exists, configuring properties"; GstCaps *audiocaps = g_mvideo_gst_caps_new_simple("audio/x-raw", "format", G_TYPE_STRING, "F32LE", "layout", G_TYPE_STRING, "interleaved", @@ -262,14 +320,18 @@ void GstVideoWriter::init() g_object_set(m_audsrc, "format", GST_FORMAT_TIME, NULL); g_object_set(m_audsrc, "is-live", TRUE, NULL); } + + qCDebug(appLog) << "Function completed: init"; } void GstVideoWriter::loadAppSrcCaps() { + qCDebug(appLog) << "Function started: loadAppSrcCaps"; // 获取当前相机分辨率 m_nWidth = v4l2core_get_frame_width(get_v4l2_device_handler()); m_nHeight = v4l2core_get_frame_height(get_v4l2_device_handler()); if (m_nWidth > 0 && m_nHeight > 0 && m_appsrc) { + qCDebug(appLog) << "Condition check: Valid resolution and app source exist, setting caps"; GstCaps *caps = g_mvideo_gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "RGB", "width", G_TYPE_INT, m_nWidth, @@ -278,37 +340,49 @@ void GstVideoWriter::loadAppSrcCaps() NULL); g_mvideo_gst_app_src_set_caps(getGstAppSrc(m_appsrc), caps); } + + qCDebug(appLog) << "Function completed: loadAppSrcCaps"; } QString GstVideoWriter::libPath(const QString &strlib) { + // qDebug() << "Function started: libPath"; QDir dir; QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); dir.setPath(path); QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib if (list.contains(strlib)) { + // qDebug() << "Condition check: Exact library name found in list, return: " << strlib; return strlib; } else { + // qDebug() << "Condition check: Exact library name not found, sorting available libraries"; list.sort(); } - if(list.size() > 0) + if(list.size() > 0) { + // qDebug() << "Condition check: Libraries found, returning latest version: " << list.last(); return list.last(); - else - return QString(); + } + + // Qt LibrariesPath 不包含,返回默认名称 + // qDebug() << "Condition check: No libraries found, returning default name: " << strlib; + return strlib; } GstBin *GstVideoWriter::getGstBin(GstElement *element) { + // qDebug() << "Function started: getGstBin"; return (GstBin *)g_type_check_instance_cast((GTypeInstance *)element, g_mvideo_gst_bin_get_type()); } GstPipeline* GstVideoWriter::getGstPipline(GstElement *element) { + // qDebug() << "Function started: getGstPipline"; return (GstPipeline*) g_type_check_instance_cast((GTypeInstance *)element, g_mvideo_gst_pipeline_get_type()); } GstAppSrc* GstVideoWriter::getGstAppSrc(GstElement *element) { + // qDebug() << "Function started: getGstAppSrc"; return (GstAppSrc*) g_type_check_instance_cast((GTypeInstance *)element, g_mvideo_gst_app_src_get_type()); } diff --git a/src/src/imageitem.cpp b/src/src/imageitem.cpp index a47da7f6b..32835ce05 100644 --- a/src/src/imageitem.cpp +++ b/src/src/imageitem.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -10,7 +10,10 @@ #include #include +#if QT_VERSION_MAJOR <= 5 #include +#endif +#include #include #include @@ -22,8 +25,12 @@ #include #include #include - +#include +#include +#include #include +#include "ddlog.h" +using namespace DDLog; extern "C" { #include @@ -33,10 +40,13 @@ extern "C" { #include "load_libs.h" } +DCORE_USE_NAMESPACE + QShortcutEx::QShortcutEx(const QKeySequence& key, QWidget *parent, const char *member, const char *ambiguousMember, Qt::ShortcutContext context):QShortcut (key, parent, member, ambiguousMember, context) { + // qDebug() << "Function started: QShortcutEx constructor"; setAutoRepeat(false); } @@ -44,6 +54,7 @@ ImageItem::ImageItem(QWidget *parent) : DLabel(parent), m_bFocus(false) { + // qDebug() << "Function started: ImageItem constructor"; m_bVideo = false; m_actPrint = nullptr; m_pAniWidget = new AnimationWidget(QPixmap(), this); @@ -56,6 +67,8 @@ ImageItem::ImageItem(QWidget *parent) initShortcut(); m_menu = new QMenu(this); + m_menu->setObjectName("ImageItemMenu"); + m_menu->setAccessibleName("ImageItemMenu"); m_actCopy = new QAction(this); m_actCopy->setObjectName("CopyAction"); @@ -93,7 +106,7 @@ ImageItem::ImageItem(QWidget *parent) m_menu->exec(QCursor::pos()); } #endif - qDebug() << "Click the right mouse to open the thumbnail menu bar"; + qCDebug(appLog) << "Click the right mouse to open the thumbnail menu bar"; }); connect(m_actCopy, &QAction::triggered, this, &ImageItem::onCopy); connect(m_actOpenFolder, &QAction::triggered, this, &ImageItem::onOpenFolder); @@ -103,16 +116,19 @@ ImageItem::ImageItem(QWidget *parent) }, Qt::QueuedConnection); m_lastDelTime = QDateTime::currentDateTime(); + // qDebug() << "Function completed: ImageItem constructor"; } void ImageItem::updatePicPath(const QString &filePath) { + qCDebug(appLog) << "Updating picture path:" << filePath; m_path = filePath; QPixmap pix; QFileInfo fileInfo(filePath); if (fileInfo.suffix() == "webm" || fileInfo.suffix() == "mp4") { m_bVideo = true; + qCDebug(appLog) << "Processing video file:" << filePath; if (DataManager::instance()->encodeEnv() == FFmpeg_Env) { video_thumbnailer *m_video_thumbnailer = getLoadLibsInstance()->m_video_thumbnailer(); image_data *m_image_data = getLoadLibsInstance()->m_video_thumbnailer_create_image_data(); @@ -125,7 +141,7 @@ void ImageItem::updatePicPath(const QString &filePath) pix = QPixmap::fromImage(img); malloc_trim(0); } catch (...) { - qWarning() << "generateThumbnail failed"; + qCWarning(appLog) << "Failed to generate video thumbnail for:" << filePath; } getLoadLibsInstance()->m_video_thumbnailer_destroy_image_data(m_image_data); @@ -136,21 +152,28 @@ void ImageItem::updatePicPath(const QString &filePath) } } else if (fileInfo.suffix() == "jpg") { m_bVideo = false; + qCInfo(appLog) << "Processing image file:" << filePath; QImage img(filePath); + if (img.isNull()) { + img.load(filePath); + } img = img.scaled(THUMBNAIL_PIXMAP_SIZE, THUMBNAIL_PIXMAP_SIZE, Qt::KeepAspectRatioByExpanding); pix = QPixmap::fromImage(img); malloc_trim(0); } else { + qCWarning(appLog) << "Unsupported file format:" << fileInfo.suffix(); pix = QPixmap(); } QTimer::singleShot(500, this, [ = ]() { updatePic(pix); pix.scaled(this->size(), Qt::KeepAspectRatio); }); + qCDebug(appLog) << "Function completed: updatePicPath"; } void ImageItem::updatePic(QPixmap pixmap) { + qCDebug(appLog) << "Function started: updatePic"; m_pAniWidget->setVisible(true); m_pAniWidget->setPixmap(pixmap); @@ -169,10 +192,12 @@ void ImageItem::updatePic(QPixmap pixmap) update(); m_pAniWidget->setVisible(false); }); + qCDebug(appLog) << "Function completed: updatePic"; } void ImageItem::paintEvent(QPaintEvent *event) { + // qDebug() << "Function started: ImageItem::paintEvent"; Q_UNUSED(event); QPainter painter(this); QRect pixmapRect = rect(); @@ -180,7 +205,11 @@ void ImageItem::paintEvent(QPaintEvent *event) QFileInfo fileinfo(m_path); QString str = fileinfo.suffix(); +#if QT_VERSION_MAJOR > 5 + painter.setRenderHints(QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#else painter.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#endif pixmapRect.setX(rect().x() + 1); pixmapRect.setY(rect().y() + 1); @@ -213,86 +242,111 @@ void ImageItem::paintEvent(QPaintEvent *event) painter.setBrush(Qt::transparent); painter.setPen(QColor(255, 255, 255, 0.2 * 255)); painter.drawPath(inside); + // qDebug() << "Function completed: ImageItem::paintEvent"; } static bool mouseDblClick = false; void ImageItem::mousePressEvent(QMouseEvent *event) { + // qDebug() << "Function started: ImageItem::mousePressEvent"; if (event->type() == QEvent::MouseButtonDblClick) { + // qDebug() << "ImageItem::mousePressEvent: Enter if branch (mouse double click)"; mouseDblClick = true; return; //不响应双击事件 } + // qDebug() << "ImageItem::mousePressEvent: Setting mouse double click to false"; mouseDblClick = false; DLabel::mousePressEvent(event); + // qDebug() << "Function completed: ImageItem::mousePressEvent"; } void ImageItem::mouseMoveEvent(QMouseEvent *event) { - //解决bug 在缩略图中可拖动相机界面,https://pms.uniontech.com/zentao/bug-view-100647.html + // qDebug() << "Function started: ImageItem::mouseMoveEvent"; + //解决bug 在缩略图中可拖动相机界面,bug 100647 Q_UNUSED(event); + // qDebug() << "Function completed: ImageItem::mouseMoveEvent"; return; } void ImageItem::mouseReleaseEvent(QMouseEvent *event) { + // qDebug() << "Function started: ImageItem::mouseReleaseEvent"; if (event->type() == QEvent::MouseButtonDblClick || mouseDblClick) { + // qDebug() << "ImageItem::mouseReleaseEvent: Enter if branch (mouse double click, returning early)"; return; //不响应双击事件 } - if (!rect().contains(event->pos())) + if (!rect().contains(event->pos())) { + // qDebug() << "ImageItem::mouseReleaseEvent: Enter if branch (position not in rect, returning early)"; return; + } if (event->button() == Qt::LeftButton) { + // qDebug() << "ImageItem::mouseReleaseEvent: Enter if branch (left button clicked)"; openFile(); } + // qDebug() << "Function completed: ImageItem::mouseReleaseEvent"; return; } void ImageItem::focusInEvent(QFocusEvent *event) { + // qDebug() << "Function started: ImageItem::focusInEvent"; Q_UNUSED(event); m_bFocus = true; update(); + // qDebug() << "Function completed: ImageItem::focusInEvent"; } void ImageItem::focusOutEvent(QFocusEvent *event) { + // qDebug() << "Function started: ImageItem::focusOutEvent"; Q_UNUSED(event); m_bFocus = false; update(); + // qDebug() << "Function completed: ImageItem::focusOutEvent"; } void ImageItem::onShowMenu() { + qCDebug(appLog) << "Function started: onShowMenu"; QPoint centerpos(width() / 2, height() / 2); QPoint screen_centerpos = mapToGlobal(centerpos); if (m_bVideo) { + qCDebug(appLog) << "ImageItem::onShowMenu: Enter if branch (video mode, removing print action)"; m_menu->removeAction(m_actPrint); } else { + qCDebug(appLog) << "ImageItem::onShowMenu: Enter else branch (image mode, inserting print action)"; m_menu->insertAction(m_actOpenFolder, m_actPrint); } #ifndef UNITTEST if (!m_path.isEmpty()) { + qCDebug(appLog) << "ImageItem::onShowMenu: Enter if branch (path not empty, executing menu)"; m_menu->exec(screen_centerpos); } #endif + qCDebug(appLog) << "Function completed: onShowMenu"; } void ImageItem::onOpenFolder() { + qCDebug(appLog) << "Function started: onOpenFolder"; if (!m_path.isEmpty() && m_path == '~') { + qCDebug(appLog) << "ImageItem::onOpenFolder: Enter if branch (path is home shortcut)"; //这里不能直接使用strFolder调replace函数 m_path.replace(0, 1, QDir::homePath()); } QString path = QFileInfo(m_path).absolutePath(); Dtk::Widget::DDesktopServices::showFolder(path); - qDebug() << "Click the right mouse or press the shortcut to open the folder"; + qCDebug(appLog) << "Click the right mouse or press the shortcut to open the folder"; } void ImageItem::initShortcut() { + qCDebug(appLog) << "Function started: initShortcut"; QShortcutEx *shortcutCopy = new QShortcutEx(QKeySequence("ctrl+c"), this); shortcutCopy->setObjectName(SHORTCUT_COPY); connect(shortcutCopy, SIGNAL(activated()), this, SLOT(onCopy())); @@ -312,81 +366,120 @@ void ImageItem::initShortcut() QShortcutEx *shortcutPrint = new QShortcutEx(QKeySequence("Ctrl+P"), this); shortcutPrint->setObjectName(SHORTCUT_PRINT); connect(shortcutPrint, SIGNAL(activated()), this, SLOT(onPrint())); + qCDebug(appLog) << "Function completed: initShortcut"; } void ImageItem::openFile() { - QFileInfo fileInfo(m_path); - QString program("dde-file-manager"); //dbus调用失败,通过文管打开 - QStringList arguments; - if (m_path.isEmpty()) { + qCDebug(appLog) << "Function started: openFile"; + const QString filePath = m_path; + QFileInfo fileInfo(filePath); + if (filePath.isEmpty()) { + qCWarning(appLog) << "Cannot open file: path is empty"; return; } bool ret = false; QProcess *myProcess = new QProcess(this); - -#ifdef OS_BUILD_V23 - //玲珑环境下无法通过QProcess方式打开应用,通过DBus打开 - if (fileInfo.suffix() == "jpg") { - //用看图打开 - QDBusMessage message = QDBusMessage::createMethodCall("com.deepin.imageViewer", - "/", - "com.deepin.imageViewer", - "openImageFile"); - message << m_path; - QDBusMessage retMessage = QDBusConnection::sessionBus().call(message); - - if (retMessage.type() != QDBusMessage::ErrorMessage) { - ret = true; - qDebug() << "[dbus] Open it with deepin-image-viewer"; + auto openWithBackup = [filePath, fileInfo, myProcess]() { + QString program; + QStringList arguments; + bool opened = false; + + qCDebug(appLog) << "Using backup method to open file"; + if (fileInfo.suffix() == "jpg") { + program = "deepin-image-viewer"; //用看图打开 + arguments << filePath; + qCDebug(appLog) << "Attempting to open image with deepin-image-viewer"; } else { - qWarning() << retMessage.errorMessage(); + program = "deepin-movie"; //用影院打开 + arguments << filePath; + qCDebug(appLog) << "Attempting to open video with deepin-movie"; } - } else { - //用影院打开 - QDBusMessage message = QDBusMessage::createMethodCall("com.deepin.movie", - "/", - "com.deepin.movie", - "openFile"); - message << m_path; - QDBusMessage retMessage = QDBusConnection::sessionBus().call(message); - - if (retMessage.type() != QDBusMessage::ErrorMessage) { + opened = myProcess->startDetached(program, arguments); + + if (!opened) { //打开失败,调用文管选择"打开方式"窗口 + qCWarning(appLog) << "Failed to open file with default applications, trying file manager"; + arguments.clear(); + program = "dde-file-manager"; + arguments << "-o" << filePath; + opened = myProcess->startDetached(program, arguments); + } + + return opened; + }; + + // check if os edition on v23 or later + static const int kMinOsEdition = 23; + const int osMajor = DSysInfo::majorVersion().toInt(); + + if (osMajor >= kMinOsEdition) { + qCInfo(appLog) << "Using DBus to open file on OS v23+"; + //玲珑环境下无法通过QProcess方式打开应用,通过DBus打开 + if (fileInfo.suffix() == "jpg") { + //用看图打开 + QDBusMessage message = + QDBusMessage::createMethodCall("com.deepin.imageViewer", "/", "com.deepin.imageViewer", "openImageFile"); + //看图内部按 URL 列表匹配文件,需传 file:// 形式路径 + message << QUrl::fromLocalFile(filePath).toString(); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(QDBusConnection::sessionBus().asyncCall(message), this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [watcher, openWithBackup]() { + const QDBusMessage retMessage = watcher->reply(); + bool ok = false; + if (retMessage.type() != QDBusMessage::ErrorMessage) { + ok = retMessage.arguments().value(0).toBool(); + } + if (ok) { + qCDebug(appLog) << "Successfully opened image with deepin-image-viewer via DBus"; + } else { + qCWarning(appLog) << "Failed to open image with deepin-image-viewer via DBus:" << retMessage.errorMessage(); + openWithBackup(); + } + watcher->deleteLater(); + }); ret = true; - qDebug() << "[dbus] Open it with deepin-movie"; } else { - qWarning() << retMessage.errorMessage(); - } - } + //用影院打开 +#if 0 + program = "ll-cli"; + arguments << "run" + << "org.deepin.movie" + << "--" + << "deepin-movie" << m_path; + qCDebug(appLog) << "[process] Open it with deepin-movie (ll-cli)"; + ret = myProcess->startDetached(program, arguments); #else - if (fileInfo.suffix() == "jpg") { - program = "deepin-image-viewer"; //用看图打开 - arguments << m_path; - qDebug() << "[process] Open it with deepin-image-viewer"; - } else { - program = "deepin-movie"; //用影院打开 - arguments << m_path; - qDebug() << "[process] Open it with deepin-movie"; - } - ret = myProcess->startDetached(program, arguments); + QDBusMessage message = QDBusMessage::createMethodCall("com.deepin.movie", "/", "com.deepin.movie", "openFile"); + //与图片分支保持一致,传 file:// 形式路径 + message << QUrl::fromLocalFile(filePath).toString(); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(QDBusConnection::sessionBus().asyncCall(message), this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [watcher, openWithBackup]() { + const QDBusMessage retMessage = watcher->reply(); + if (retMessage.type() != QDBusMessage::ErrorMessage) { + qCDebug(appLog) << "Successfully opened video with deepin-movie via DBus"; + } else { + qCWarning(appLog) << "Failed to open video with deepin-movie via DBus:" << retMessage.errorMessage(); + openWithBackup(); + } + watcher->deleteLater(); + }); + ret = true; #endif - qInfo() << m_path; + } + } + + // try backup way + if (!ret) + ret = openWithBackup(); if (CamApp->isPanelEnvironment()) CamApp->getMainWindow()->showMinimized(); - - if (!ret) { //打开失败,调用文管选择“打开方式”窗口 - qWarning() << "QProcess startDetached error"; - arguments.clear(); - program = "dde-file-manager"; - arguments << "-o" << m_path; - ret = myProcess->startDetached(program, arguments); - } + qCDebug(appLog) << "Function completed: openFile"; } void ImageItem::onCopy() { + qCDebug(appLog) << "Function started: onCopy"; QStringList paths; paths << m_path; @@ -411,186 +504,180 @@ void ImageItem::onCopy() newMimeData->setData("x-special/gnome-copied-files", gnomeFormat); cb->setMimeData(newMimeData, QClipboard::Clipboard); + qCDebug(appLog) << "Function completed: onCopy"; } void ImageItem::onShortcutDel() { - qDebug() << "onShortcutDel"; + qCDebug(appLog) << "Delete shortcut triggered"; //改用datetime,避免跨天之后判断错误 QDateTime timeNow = QDateTime::currentDateTime(); if (m_lastDelTime.msecsTo(timeNow) < 100) { - qDebug() << "del too fast"; - qInfo() << timeNow; - qInfo() << m_lastDelTime; + qCWarning(appLog) << "Delete operation too frequent, ignoring"; return; } m_lastDelTime = timeNow; emit trashFile(m_path); + qCDebug(appLog) << "Function completed: onShortcutDel"; } void ImageItem::onPrint() { + qCDebug(appLog) << "Function started: onPrint"; if (!m_bVideo) { + qCDebug(appLog) << "ImageItem::onPrint: Enter if branch (not video, showing print dialog)"; showPrintDialog(QStringList(m_path), this); } + qCDebug(appLog) << "Function completed: onPrint"; } void ImageItem::showPrintDialog(const QStringList &paths, QWidget *parent) { + qCDebug(appLog) << "Opening print dialog for" << paths.size() << "files"; m_imgs.clear(); - QStringList tempExsitPaths;//保存存在的图片路径 - tempExsitPaths.clear(); + QStringList tempExistPaths; + // 加载有效图片并记录存在的路径 for (const QString &path : paths) { QImage img(path); - if (!img.isNull()) + if (!img.isNull()) { m_imgs << img; - tempExsitPaths << paths; + tempExistPaths << path; // 修复原代码中错误的 paths 赋值 + } } -#ifndef UNITTEST DPrintPreviewDialog printDialog(parent); printDialog.setObjectName(PRINT_DIALOG); printDialog.setAccessibleName(PRINT_DIALOG); - //适配打印接口2.0,dtk大于 5.4.7 版才合入最新的2.0打印控件接口 -#if (DTK_VERSION_MAJOR > 5 \ - || (DTK_VERSION_MAJOR >=5 && DTK_VERSION_MINOR > 4) \ - || (DTK_VERSION_MAJOR >= 5 && DTK_VERSION_MINOR >= 4 && DTK_VERSION_PATCH >= 10))//5.4.7暂时没有合入 - - if (DApplication::runtimeDtkVersion() >= DTK_VERSION_CHECK(5, 4, 10, 0)) { - bool suc = printDialog.setAsynPreview(m_imgs.size());//设置总页数,异步方式 - //单张照片设置名称,可能多选照片,但能成功加载的可能只有一张,或从相册中选中的原图片不存在 - if (tempExsitPaths.size() == 1) { - // 提供包含后缀的文件全名,由打印模块自己处理后缀 - QString docName = QString(QFileInfo(tempExsitPaths.at(0)).completeBaseName()); - docName += ".pdf"; - printDialog.setDocName(docName); - }//else 多张照片不设置名称,默认使用print模块的print.pdf - - if (suc) //异步 - connect(&printDialog, SIGNAL(paintRequested(DPrinter *, const QVector &)), - this, SLOT(paintRequestedAsyn(DPrinter *, const QVector &))); - else //同步 - connect(&printDialog, SIGNAL(paintRequested(DPrinter *)), - this, SLOT(paintRequestSync(DPrinter *))); + + // 版本兼容处理 + const bool useNewAPI = ( +#if (DTK_VERSION_MAJOR > 5 || (DTK_VERSION_MAJOR ==5 && (DTK_VERSION_MINOR > 4 || (DTK_VERSION_MINOR ==4 && DTK_VERSION_PATCH >=10)))) + DApplication::runtimeDtkVersion() >= DTK_VERSION_CHECK(5, 4, 10, 0) +#else + false +#endif + ); + + // 设置文档名称 + if (tempExistPaths.size() == 1) { + QFileInfo fi(tempExistPaths.first()); + printDialog.setDocName(fi.completeBaseName() + ".pdf"); + } + + // 连接打印信号 + if (useNewAPI && printDialog.setAsynPreview(m_imgs.size())) { + qCDebug(appLog) << "Using async preview for printing"; + connect(&printDialog, SIGNAL(paintRequested(DPrinter *, const QVector &)), + this, SLOT(paintRequestedAsyn(DPrinter *, const QVector &))); } else { + qCDebug(appLog) << "Using sync preview for printing"; connect(&printDialog, SIGNAL(paintRequested(DPrinter *)), this, SLOT(paintRequestSync(DPrinter *))); } -#else - connect(&printDialog, SIGNAL(paintRequested(DPrinter *)), - this, SLOT(paintRequestSync(DPrinter *))); -#endif + +#ifndef UNITTEST printDialog.exec(); +#else + printDialog.show(); #endif + qCDebug(appLog) << "Function completed: showPrintDialog"; } -#ifndef UNITTEST -#if (DTK_VERSION_MAJOR > 5 \ - || (DTK_VERSION_MAJOR >=5 && DTK_VERSION_MINOR > 4) \ - || (DTK_VERSION_MAJOR >= 5 && DTK_VERSION_MINOR >= 4 && DTK_VERSION_PATCH >= 10))//5.4.7暂时没有合入 -void ImageItem::paintRequestedAsyn(DPrinter *_printer, const QVector &pageRange) +// 公共绘图方法 +void ImageItem::drawImageOnPage(DPrinter *printer, const QImage &img) { - QPainter painter(_printer); - qDebug() << pageRange.count(); - int index = 0; - for (int page : pageRange) { - if (page < m_imgs.count() + 1) { - QImage img = m_imgs.at(page - 1); - if (!img.isNull()) { - painter.setRenderHint(QPainter::Antialiasing); - painter.setRenderHint(QPainter::SmoothPixmapTransform); - QRect wRect = _printer->pageRect(); - QImage tmpMap; - - if (img.width() > wRect.width() || img.height() > wRect.height()) - tmpMap = img.scaled(wRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); - else - tmpMap = img; - - QRectF drawRectF = QRectF(qreal(wRect.width() - tmpMap.width()) / 2, - qreal(wRect.height() - tmpMap.height()) / 2, - tmpMap.width(), tmpMap.height()); - - painter.drawImage(QRectF(drawRectF.x(), drawRectF.y(), tmpMap.width(), - tmpMap.height()), tmpMap); - } - if (index < pageRange.size() - 1) { - _printer->newPage(); - index++; - } - } - } + // qDebug() << "Function started: drawImageOnPage"; + QPainter painter(printer); + painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); + const QRectF wRect = printer->pageRect(QPrinter::DevicePixel); + + // 计算最佳缩放比例 + const qreal widthRatio = wRect.width() / img.width(); + const qreal heightRatio = wRect.height() / img.height(); + const qreal ratio = qMin(widthRatio, heightRatio); + + // 计算绘制位置 + const QSizeF scaledSize = img.size() * ratio; + const QPointF position( + (wRect.width() - scaledSize.width()) / 2, + (wRect.height() - scaledSize.height()) / 2 + ); + + painter.drawImage(QRectF(position, scaledSize), img); + painter.end(); + // qDebug() << "Function completed: drawImageOnPage"; } -#endif -void ImageItem::paintRequestSync(DPrinter *_printer) +void ImageItem::paintRequestedAsyn(DPrinter *printer, const QVector &pageRange) { - int currentIndex = 0; - QPainter painter(_printer); - for (QImage img : m_imgs) { - - if (!img.isNull()) { - painter.setRenderHint(QPainter::Antialiasing); - painter.setRenderHint(QPainter::SmoothPixmapTransform); - QRect wRect = _printer->pageRect(); - QImage tmpMap; - - if (img.width() > wRect.width() || img.height() > wRect.height()) - tmpMap = img.scaled(wRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); - else - tmpMap = img; - - QRectF drawRectF = QRectF(qreal(wRect.width() - tmpMap.width()) / 2, - qreal(wRect.height() - tmpMap.height()) / 2, - tmpMap.width(), tmpMap.height()); - painter.drawImage(QRectF(drawRectF.x(), drawRectF.y(), tmpMap.width(), - tmpMap.height()), tmpMap); + // qDebug() << "Async paint pages:" << pageRange.size(); + + for (int i = 0; i < pageRange.size(); ++i) { + const int page = pageRange[i]; + if (page >= 1 && page <= m_imgs.size()) { + drawImageOnPage(printer, m_imgs.at(page-1)); + if (i != pageRange.size()-1) { + printer->newPage(); + } } + } + // qDebug() << "Function completed: paintRequestedAsyn"; +} - //不应该将多个相同的图片过滤掉 - if (currentIndex != m_imgs.count() - 1) { - _printer->newPage(); - currentIndex++; +void ImageItem::paintRequestSync(DPrinter *printer) +{ + // qDebug() << "Function started: paintRequestSync"; + for (int i = 0; i < m_imgs.size(); ++i) { + drawImageOnPage(printer, m_imgs.at(i)); + if (i != m_imgs.size()-1) { + printer->newPage(); } } - - painter.end(); + // qDebug() << "Function completed: paintRequestSync"; } -#endif void AnimationWidget::paintEvent(QPaintEvent *e) { + // qDebug() << "Function started: AnimationWidget::paintEvent"; Q_UNUSED(e); QRect pixmapRect = rect(); QPainter painter(this); QPainterPath path; +#if QT_VERSION_MAJOR > 5 + painter.setRenderHints(QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#else painter.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform | QPainter::Antialiasing); +#endif path.addRoundedRect(pixmapRect, width(), height()); painter.fillPath(path, QBrush(m_animatePix)); + // qDebug() << "Function completed: AnimationWidget::paintEvent"; } AnimationWidget::AnimationWidget(QPixmap pixmap, QWidget *parent) : m_animatePix(pixmap) { + // qDebug() << "Function started: AnimationWidget constructor"; this->setParent(parent); setMargin(0); setContentsMargins(0, 0, 0, 0); resize(THUMBNAIL_PIXMAP_SIZE, THUMBNAIL_PIXMAP_SIZE); + // qDebug() << "Function completed: AnimationWidget constructor"; } AnimationWidget::~AnimationWidget() { - + // qDebug() << "Function started: AnimationWidget destructor"; } ImageItem::~ImageItem() { + // qDebug() << "Function started: ImageItem destructor"; delete m_pAniWidget; m_pAniWidget = nullptr; - + // qDebug() << "Function completed: ImageItem destructor"; } diff --git a/src/src/imageitem.h b/src/src/imageitem.h index ba892c99c..3b070ec82 100644 --- a/src/src/imageitem.h +++ b/src/src/imageitem.h @@ -171,24 +171,19 @@ public slots: void focusOutEvent(QFocusEvent *event) override; private slots: -#ifndef UNITTEST -#if (DTK_VERSION_MAJOR > 5 \ - || (DTK_VERSION_MAJOR >=5 && DTK_VERSION_MINOR > 4) \ - || (DTK_VERSION_MAJOR >= 5 && DTK_VERSION_MINOR >= 4 && DTK_VERSION_PATCH >= 10))//5.4.7暂时没有合入 /** * @brief paintRequestedAsyn 同步打印 * @param _printer 打印机 * @param pageRange 页数 */ void paintRequestedAsyn(DPrinter *_printer, const QVector &pageRange); -#endif /** * @brief paintRequestSync 异步打印 * @param _printer 打印机 */ void paintRequestSync(DPrinter *_printer); -#endif + private: /** * @brief initShortcut 初始化快捷键 @@ -200,6 +195,8 @@ private slots: */ void showPrintDialog(const QStringList &paths, QWidget *parent); + void drawImageOnPage(DPrinter *printer, const QImage &img); + private: bool m_bVideo;//是否视频 QList m_imgs;//需要打印的图片 diff --git a/src/src/logconfigread.cpp b/src/src/logconfigread.cpp new file mode 100644 index 000000000..9b260a8e9 --- /dev/null +++ b/src/src/logconfigread.cpp @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "logconfigread.h" +#include "ddlog.h" +#include "dtkcore_global.h" +#include "qglobal.h" +#include +#include +#include + +DCORE_USE_NAMESPACE +using namespace DDLog; + +MLogger::MLogger(QObject *parent) + : QObject(parent), m_rules(""), m_config(nullptr) { + QByteArray logRules = qgetenv("QT_LOGGING_RULES"); + // qunsetenv 之前一定不要有任何日志打印,否则取消环境变量设置不会生效 + qunsetenv("QT_LOGGING_RULES"); + // 保存环境变量中的规则 + m_rules = logRules; + // 从 DConfig 读取日志规则 + m_config = DConfig::create("org.deepin.camera", "org.deepin.camera"); + if (m_config && m_config->isValid()) { + logRules = m_config->value("log_rules").toByteArray(); + appendRules(logRules); + // 监听 DConfig 变化,动态更新日志规则 + connect(m_config, &DConfig::valueChanged, this, [this](const QString &key) { + if (key == "log_rules") { + setRules(m_config->value(key).toByteArray()); + } + }); + } + // DConfig 不可用时兜底:环境变量中的规则仍然生效 + setRules(m_rules); +} + +MLogger::~MLogger() { + if (m_config) { + m_config->deleteLater(); + } +} + +void MLogger::setRules(const QString &rules) { + auto tmpRules = rules; + m_rules = tmpRules.replace(";", "\n"); + QLoggingCategory::setFilterRules(m_rules); +} + +void MLogger::appendRules(const QString &rules) { + QString tmpRules = rules; + tmpRules = tmpRules.replace(";", "\n"); + auto tmplist = tmpRules.split('\n'); + for (int i = 0; i < tmplist.count(); i++) { + if (m_rules.contains(tmplist.at(i))) { + tmplist.removeAt(i); + i--; + } + } + if (tmplist.isEmpty()) { + return; + } + m_rules.isEmpty() ? m_rules = tmplist.join("\n") + : m_rules += "\n" + tmplist.join("\n"); +} diff --git a/src/src/logconfigread.h b/src/src/logconfigread.h new file mode 100644 index 000000000..dffee4527 --- /dev/null +++ b/src/src/logconfigread.h @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef LOGCONFIGREAD_H +#define LOGCONFIGREAD_H + +#include +#include + +DCORE_BEGIN_NAMESPACE +class DConfig; +DCORE_END_NAMESPACE + +class MLogger : public QObject { + Q_OBJECT +public: + explicit MLogger(QObject *parent = nullptr); + ~MLogger(); + + inline QString rules() const { return m_rules; } + void setRules(const QString &rules); + +private: + void appendRules(const QString &rules); + +private: + QString m_rules; + Dtk::Core::DConfig *m_config; +}; + +#endif // LOGCONFIGREAD_H diff --git a/src/src/mainwindow.cpp b/src/src/mainwindow.cpp old mode 100644 new mode 100755 index 57cba7182..0366c9e3b --- a/src/src/mainwindow.cpp +++ b/src/src/mainwindow.cpp @@ -1,8 +1,13 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later +#include "ddlog.h" +using namespace DDLog; +extern "C" { +#include "v4l2_formats.h" +} #include "mainwindow.h" #include "capplication.h" #include "v4l2_core.h" @@ -37,6 +42,7 @@ #include #include #include +#include #include #include @@ -45,6 +51,7 @@ #include #include #include +#include #include #include @@ -62,7 +69,7 @@ const int CMainWindow::minWindowHeight = 510; const int rightOffset = 10; const int SwitchcameraDiam = 40; //切换摄像头直径 -const int photeRecordDiam = 64; +const int photoRecordDiam = 64; const int snapLabelDiam = 52; const int switchBtnWidth = 50; const int switchBtnHeight = 26; @@ -74,21 +81,30 @@ const int pathEditWidth = 285; const int defaultWindowWidth = 800; const int defaultWindowHeight = 600; +static DSuggestButton *g_selectPohtoBt = nullptr; +static DSuggestButton *g_selectVideoBt = nullptr; +static QSpacerItem *g_pohtospace = nullptr; +static QSpacerItem *g_videospace = nullptr; + static void workaround_updateStyle(QWidget *parent, const QString &theme) { + // qDebug() << "Function started: workaround_updateStyle"; parent->setStyle(QStyleFactory::create(theme)); for (auto obj : parent->children()) { QWidget *tmp_widget = qobject_cast(obj); if (tmp_widget) { + // qDebug() << "Updating style for child widget:" << tmp_widget->objectName(); workaround_updateStyle(tmp_widget, theme); } } + // qDebug() << "Function completed: workaround_updateStyle"; } static QString ElideText(const QString &text, const QSize &size, QTextOption::WrapMode wordWrap, const QFont &font, Qt::TextElideMode mode, int lineHeight, int lastLineWidth) { + // qDebug() << "Function started: ElideText"; int tmpheight = 0; QTextLayout textLayout(text); QString textlinestr = nullptr; @@ -117,7 +133,6 @@ static QString ElideText(const QString &text, const QSize &size, if (tmptextline.isValid()) textlinestr.append("\n"); - } textLayout.endLayout(); @@ -125,11 +140,13 @@ static QString ElideText(const QString &text, const QSize &size, if (textLayout.lineCount() == 1) textlinestr = fontMetrics.elidedText(textlinestr, mode, lastLineWidth); + // qDebug() << "Function completed: ElideText"; return textlinestr; } static QWidget *createFormatLabelOptionHandle(QObject *opt) { + // qDebug() << "Function started: createFormatLabelOptionHandle"; DTK_CORE_NAMESPACE::DSettingsOption *option = qobject_cast(opt); DLabel *lab = new DLabel(); DWidget *main = new DWidget(); @@ -140,19 +157,16 @@ static QWidget *createFormatLabelOptionHandle(QObject *opt) main->setLayout(layout); main->setContentsMargins(0, 0, 0, 0); main->setMinimumWidth(240); - main->setMinimumHeight(20); + //main->setMinimumHeight(20); layout->addWidget(lab); layout->setContentsMargins(0, 0, 0, 0); layout->setAlignment(Qt::AlignVCenter); lab->setObjectName(OPTION_FORMAT_LABER); lab->setAccessibleName(OPTION_FORMAT_LABER); - lab->setMinimumHeight(20); + //lab->setMinimumHeight(20); lab->setText(option->value().toString()); - QFont ft("SourceHanSansSC"); - ft.setPixelSize(15); - ft.setWeight(QFont::Medium); - lab->setFont(ft); + DFontSizeManager::instance()->bind(lab, DFontSizeManager::T6); lab->setAlignment(Qt::AlignVCenter); lab->show(); optionWidget->setObjectName(OPTION_FRAME); @@ -161,23 +175,35 @@ static QWidget *createFormatLabelOptionHandle(QObject *opt) optionLayout->setSpacing(0); DLabel *dLabel = new DLabel(QObject::tr(option->name().toStdString().c_str())); - dLabel->setMinimumHeight(20); + //dLabel->setMinimumHeight(20); dLabel->setAlignment(Qt::AlignVCenter); optionLayout->addRow(dLabel, main); optionWidget->setContentsMargins(0, 0, 0, 0); workaround_updateStyle(optionWidget, "light"); + // qDebug() << "Function completed: createFormatLabelOptionHandle"; return optionWidget; } static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) { + // qDebug() << "Function started: createPicSelectableLineEditOptionHandle"; DTK_CORE_NAMESPACE::DSettingsOption *option = qobject_cast(opt); option->setObjectName(PIC_OPTION); - DLineEdit *picPathLineEdit = new DLineEdit;//文本框 + DLineEdit *picPathLineEdit = new DLineEdit; //文本框 DWidget *main = new DWidget; QHBoxLayout *horboxlayout = new QHBoxLayout; - DSuggestButton *icon = new DSuggestButton(main); + g_selectPohtoBt = new DSuggestButton(main); +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + g_pohtospace = new QSpacerItem(8, 8); + } else { + g_pohtospace = new QSpacerItem(0, 0); + } +#else + g_pohtospace = new QSpacerItem(0, 0); +#endif + QWidget *optionWidget = new QWidget; QFormLayout *optionLayout = new QFormLayout(optionWidget); DDialog *optinvaliddialog = new DDialog(optionWidget); @@ -190,15 +216,11 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) main->setContentsMargins(0, 0, 0, 0); horboxlayout->setAlignment(Qt::AlignTop); horboxlayout->setContentsMargins(0, 0, 0, 0); - QFont ft("SourceHanSansSC"); - ft.setPixelSize(14); - ft.setWeight(QFont::Medium); - picPathLineEdit->setFont(ft); - - icon->setAutoDefault(false); - icon->setObjectName(BUTTON_OPTION_PIC_LINE_EDIT); - icon->setAccessibleName(BUTTON_OPTION_PIC_LINE_EDIT); - picPathLineEdit->setFixedHeight(37); + DFontSizeManager::instance()->bind(picPathLineEdit, DFontSizeManager::T6); + g_selectPohtoBt->setAutoDefault(false); + g_selectPohtoBt->setObjectName(BUTTON_OPTION_PIC_LINE_EDIT); + g_selectPohtoBt->setAccessibleName(BUTTON_OPTION_PIC_LINE_EDIT); + //picPathLineEdit->setFixedHeight(37); picPathLineEdit->setObjectName(OPTION_PIC_SELECTABLE_LINE_EDIT); picPathLineEdit->setAccessibleName(OPTION_PIC_SELECTABLE_LINE_EDIT); //获取当前设置的照片保存路径 @@ -210,22 +232,21 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) //路径不存在 if (!curPicSettingPathdir.exists()) { - picPathLineEdit->setText(option->defaultValue().toString());//更改文本框为默认路径~/Pictures/Camera + picPathLineEdit->setText(option->defaultValue().toString()); //更改文本框为默认路径~/Pictures/Camera curPicSettingPath = option->defaultValue().toString(); if (curPicSettingPath.contains(relativeHomePath)) curPicSettingPath.replace(0, 1, QDir::homePath()); - } - else - picPathLineEdit->setText(option->value().toString());//更改文本框为设置的路径 + } else + picPathLineEdit->setText(option->value().toString()); //更改文本框为设置的路径 lastPicPath = curPicSettingPath; QFontMetrics tem_fontmetrics = picPathLineEdit->fontMetrics(); - QString picStrElideText = ElideText(picPathLineEdit->text(), {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, + QString picStrElideText = ElideText(picPathLineEdit->text(), { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); picPathLineEdit->setText(picStrElideText); - option->connect(picPathLineEdit, &DLineEdit::focusChanged, [ = ](bool on) { + option->connect(picPathLineEdit, &DLineEdit::focusChanged, [=](bool on) { if (on) { QString settingPicPathValue = option->value().toString(); @@ -235,27 +256,38 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) QDir dir(settingPicPathValue); if (!dir.exists()) - picPathLineEdit->setText(option->defaultValue().toString());//更改文本框为默认路径~/Pictures/Camera + picPathLineEdit->setText(option->defaultValue().toString()); //更改文本框为默认路径~/Pictures/Camera else - picPathLineEdit->setText(option->value().toString());//更改文本框为设置的路径 + picPathLineEdit->setText(option->value().toString()); //更改文本框为设置的路径 } }); - icon->setIcon(DStyleHelper(icon->style()).standardIcon(DStyle::SP_SelectElement, nullptr)); - icon->setIconSize(QSize(24, 24)); - icon->setFixedSize(41, 37); - + g_selectPohtoBt->setIcon(DStyleHelper(g_selectPohtoBt->style()).standardIcon(DStyle::SP_SelectElement, nullptr)); + g_selectPohtoBt->setIconSize(QSize(24, 24)); + //icon->setFixedSize(41, 37); +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + g_selectPohtoBt->setFixedSize(28, 24); + } else { + g_selectPohtoBt->setFixedSize(41, 37); + } +#else + g_selectPohtoBt->setFixedSize(41, 37); +#endif horboxlayout->addWidget(picPathLineEdit); - horboxlayout->addWidget(icon); + horboxlayout->addItem(g_pohtospace); + horboxlayout->addWidget(g_selectPohtoBt); optionWidget->setObjectName(OPTION_FRAME); optionWidget->setAccessibleName(OPTION_FRAME); - optionWidget->setFixedHeight(37); + //optionWidget->setFixedHeight(37); optionLayout->setContentsMargins(0, 0, 0, 0); optionLayout->setSpacing(0); optionLayout->setVerticalSpacing(0); +#if QT_VERSION_MAJOR <= 5 optionLayout->setMargin(0); +#endif main->setMinimumWidth(240); DLabel *lab = new DLabel(QObject::tr(option->name().toStdString().c_str())); @@ -273,7 +305,7 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) *@brief 照片文本框路径是否正确 *@param name:图片保存路径, alert:提示 */ - auto validate = [ = ](QString name, bool alert = true) -> bool { + auto validate = [=](QString name, bool alert = true) -> bool { Q_UNUSED(alert); name = name.trimmed(); @@ -286,8 +318,7 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) QFileInfo fileinfo(name); QDir dir(name); - if (fileinfo.exists()) - { + if (fileinfo.exists()) { QString picStr("/home/"); if (!fileinfo.isDir()) return false; @@ -298,8 +329,7 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) if (!fileinfo.isReadable() || !fileinfo.isWritable()) return false; - } else - { + } else { if (relativeHomePath.contains(name)) return false; @@ -317,8 +347,7 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) /** *@brief 打开照片文件夹按钮槽函数 */ - option->connect(icon, &DPushButton::clicked, [ = ]() { - + option->connect(g_selectPohtoBt, &DPushButton::clicked, [=]() { QString selectPicSavePath; QString tmplastpicpath = lastPicPath; @@ -330,7 +359,7 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) if (!dir.exists()) { //设置文本框为新的路径 tmplastpicpath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) - + QDir::separator() + "Camera"; + + QDir::separator() + "Camera"; QDir defaultdir(tmplastpicpath); if (!defaultdir.exists()) @@ -350,13 +379,13 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) if (validate(selectPicSavePath, false)) { option->setValue(selectPicSavePath); QFontMetrics tem_fontmetrics = picPathLineEdit->fontMetrics(); - QString elideText = ElideText(picPathLineEdit->text(), {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, - picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); + QString elideText = ElideText(picPathLineEdit->text(), { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, + picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); picPathLineEdit->setText(elideText); } QString qlastPath = Settings::get().getOption("base.save.picdatapath").toString(); - qDebug() << QString("-----------------qlastPath: %1").arg(qlastPath); + qCDebug(appLog) << QString("-----------------qlastPath: %1").arg(qlastPath); QFileInfo fm(selectPicSavePath); @@ -367,13 +396,12 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) /** *@brief 照片文本框编辑完成槽函数 */ - option->connect(picPathLineEdit, &DLineEdit::editingFinished, option, [ = ]() { - + option->connect(picPathLineEdit, &DLineEdit::editingFinished, option, [=]() { QString curPicEditStr = picPathLineEdit->text(); QDir dir(curPicEditStr); //获取当前文本框路径 - QString curPicElidePath = ElideText(curPicEditStr, {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, - picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); + QString curPicElidePath = ElideText(curPicEditStr, { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, + picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); if (!validate(curPicEditStr, false)) { QFileInfo fn(dir.path()); @@ -407,7 +435,7 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) } }); - option->connect(picPathLineEdit, &DLineEdit::textEdited, option, [ = ](const QString & newStr) { + option->connect(picPathLineEdit, &DLineEdit::textEdited, option, [=](const QString &newStr) { validate(newStr); }); @@ -415,29 +443,41 @@ static QWidget *createPicSelectableLineEditOptionHandle(QObject *opt) *@brief 照片后台设置参数更改槽函数 */ option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, picPathLineEdit, - [ = ](const QVariant & value) { - auto pi = ElideText(value.toString(), {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, - picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); - picPathLineEdit->setText(pi); - qDebug() << "picPathLineEdit text:" << picPathLineEdit->text() << endl; - lastPicPath = value.toString(); - option->setValue(value.toString()); - qDebug() << "save pic last path:" << value.toString() << endl; - picPathLineEdit->update(); - }); - - return optionWidget; + [=](const QVariant &value) { + auto pi = ElideText(value.toString(), { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, + picPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); + picPathLineEdit->setText(pi); + qCDebug(appLog) << "picPathLineEdit text:" << picPathLineEdit->text(); + lastPicPath = value.toString(); + option->setValue(value.toString()); + qCDebug(appLog) << "save pic last path:" << value.toString(); + picPathLineEdit->update(); + }); + + // qDebug() << "Function completed: createPicSelectableLineEditOptionHandle"; + return optionWidget; } static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) { + // qDebug() << "Function started: createVdSelectableLineEditOptionHandle"; DTK_CORE_NAMESPACE::DSettingsOption *option = qobject_cast(opt); option->setObjectName(VIDEO_OPTION); DLineEdit *videoPathLineEdit = new DLineEdit; DWidget *main = new DWidget; QHBoxLayout *horboxlayout = new QHBoxLayout; - DSuggestButton *icon = new DSuggestButton(main); + g_selectVideoBt = new DSuggestButton(main); +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + g_videospace = new QSpacerItem(8, 8); + } else { + g_videospace = new QSpacerItem(0, 0); + } +#else + g_videospace = new QSpacerItem(0, 0); +#endif + QWidget *optionWidget = new QWidget; QFormLayout *optionLayout = new QFormLayout(optionWidget); DDialog *optinvaliddialog = new DDialog(optionWidget); @@ -449,14 +489,11 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) main->setContentsMargins(0, 0, 0, 0); horboxlayout->setAlignment(Qt::AlignTop); horboxlayout->setContentsMargins(0, 0, 0, 0); - QFont ft("SourceHanSansSC"); - ft.setPixelSize(14); - ft.setWeight(QFont::Medium); - videoPathLineEdit->setFont(ft); - icon->setAutoDefault(false); - icon->setObjectName(BUTTON_OPTION_VIDEO_LINE_EDIT); - icon->setAccessibleName(BUTTON_OPTION_VIDEO_LINE_EDIT); - videoPathLineEdit->setFixedHeight(37); + DFontSizeManager::instance()->bind(videoPathLineEdit, DFontSizeManager::T6); + g_selectVideoBt->setAutoDefault(false); + g_selectVideoBt->setObjectName(BUTTON_OPTION_VIDEO_LINE_EDIT); + g_selectVideoBt->setAccessibleName(BUTTON_OPTION_VIDEO_LINE_EDIT); + //videoPathLineEdit->setFixedHeight(37); videoPathLineEdit->setObjectName(OPTION_VIDEO_SELECTABLE_LINE_EDIT); videoPathLineEdit->setAccessibleName(OPTION_VIDEO_SELECTABLE_LINE_EDIT); QString curVideoSettingPath = option->value().toString(); @@ -467,22 +504,21 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) //路径不存在 if (!curVideoSettingPathdir.exists()) { - videoPathLineEdit->setText(option->defaultValue().toString());//更改文本框为默认路径~/Videos/Camera + videoPathLineEdit->setText(option->defaultValue().toString()); //更改文本框为默认路径~/Videos/Camera curVideoSettingPath = option->defaultValue().toString(); if (curVideoSettingPath.contains(relativeHomePath)) curVideoSettingPath.replace(0, 1, QDir::homePath()); - } - else - videoPathLineEdit->setText(option->value().toString());//更改文本框为设置的路径 + } else + videoPathLineEdit->setText(option->value().toString()); //更改文本框为设置的路径 lastVideoPath = curVideoSettingPath; QFontMetrics tem_fontmetrics = videoPathLineEdit->fontMetrics(); - QString vdStrElideText = ElideText(videoPathLineEdit->text(), {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, - videoPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); + QString vdStrElideText = ElideText(videoPathLineEdit->text(), { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, + videoPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); videoPathLineEdit->setText(vdStrElideText); - option->connect(videoPathLineEdit, &DLineEdit::focusChanged, [ = ](bool on) { + option->connect(videoPathLineEdit, &DLineEdit::focusChanged, [=](bool on) { if (on) { QString settingVideoPathValue = option->value().toString(); @@ -498,16 +534,25 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) } }); - icon->setIcon(DStyleHelper(icon->style()).standardIcon(DStyle::SP_SelectElement, nullptr)); - icon->setIconSize(QSize(24, 24)); - icon->setFixedSize(41, 37); + g_selectVideoBt->setIcon(DStyleHelper(g_selectVideoBt->style()).standardIcon(DStyle::SP_SelectElement, nullptr)); + g_selectVideoBt->setIconSize(QSize(24, 24)); +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + g_selectVideoBt->setFixedSize(28, 24); + } else { + g_selectVideoBt->setFixedSize(41, 37); + } +#else + g_selectVideoBt->setFixedSize(41, 37); +#endif horboxlayout->addWidget(videoPathLineEdit); - horboxlayout->addWidget(icon); + horboxlayout->addItem(g_videospace); + horboxlayout->addWidget(g_selectVideoBt); optionWidget->setObjectName(OPTION_FRAME); optionWidget->setAccessibleName(OPTION_FRAME); optionLayout->setContentsMargins(0, 0, 0, 0); optionLayout->setSpacing(0); - optionWidget->setFixedHeight(37); + //optionWidget->setFixedHeight(37); main->setMinimumWidth(240); DLabel *lab = new DLabel(QObject::tr(option->name().toStdString().c_str())); lab->setAlignment(Qt::AlignVCenter); @@ -524,7 +569,7 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) *@brief 视频文本框路径是否正确 *@param name:视频保存路径, alert:提示 */ - auto validate = [ = ](QString name, bool alert = true) -> bool { + auto validate = [=](QString name, bool alert = true) -> bool { Q_UNUSED(alert); name = name.trimmed(); @@ -537,8 +582,7 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) QFileInfo fileinfo(name); QDir dir(name); - if (fileinfo.exists()) - { + if (fileinfo.exists()) { QString homeStr("/home/"); if (!fileinfo.isDir()) return false; @@ -549,8 +593,7 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) if (!fileinfo.isReadable() || !fileinfo.isWritable()) return false; - } else - { + } else { if (relativeHomePath.contains(name)) return false; @@ -568,8 +611,7 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) /** *@brief 打开视频文件夹按钮槽函数 */ - option->connect(icon, &DPushButton::clicked, [ = ]() { - + option->connect(g_selectVideoBt, &DPushButton::clicked, [=]() { QString selectVideoSavePath; QString tmplastvdcpath = lastVideoPath; @@ -581,7 +623,7 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) if (!dir.exists()) { //设置文本框为新的路径 tmplastvdcpath = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation) - + QDir::separator() + "Camera"; + + QDir::separator() + "Camera"; QDir defaultdir(tmplastvdcpath); if (!defaultdir.exists()) { @@ -604,8 +646,8 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) if (validate(selectVideoSavePath, false)) { option->setValue(selectVideoSavePath); QFontMetrics tem_fontmetrics = videoPathLineEdit->fontMetrics(); - QString elideText = ElideText(videoPathLineEdit->text(), {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, - videoPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); + QString elideText = ElideText(videoPathLineEdit->text(), { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, + videoPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); videoPathLineEdit->setText(elideText); } @@ -613,14 +655,12 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) if ((!fm.isReadable() || !fm.isWritable()) && !selectVideoSavePath.isEmpty()) optinvaliddialog->show(); - }); /** *@brief 视频文本框编辑完成槽函数 */ - option->connect(videoPathLineEdit, &DLineEdit::editingFinished, option, [ = ]() { - + option->connect(videoPathLineEdit, &DLineEdit::editingFinished, option, [=]() { QString curVideoEditStr = videoPathLineEdit->text(); // 视频保存路径暂时不能设置到smb网盘路径(会卡死在fwrite),临时处理方案:重置回默认路径 @@ -629,8 +669,8 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) QDir dir(curVideoEditStr); // 获取当前文本路径 - QString curVdElidePath = ElideText(curVideoEditStr, {pathEditWidth, tem_fontmetrics.height()}, QTextOption::WrapAnywhere, - videoPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); + QString curVdElidePath = ElideText(curVideoEditStr, { pathEditWidth, tem_fontmetrics.height() }, QTextOption::WrapAnywhere, + videoPathLineEdit->font(), Qt::ElideMiddle, tem_fontmetrics.height(), pathEditWidth); if (!validate(curVideoEditStr, false)) { QFileInfo fn(dir.path()); @@ -664,7 +704,7 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) } }); - option->connect(videoPathLineEdit, &DLineEdit::textEdited, option, [ = ](const QString & newStr) { + option->connect(videoPathLineEdit, &DLineEdit::textEdited, option, [=](const QString &newStr) { validate(newStr); }); @@ -672,35 +712,37 @@ static QWidget *createVdSelectableLineEditOptionHandle(QObject *opt) *@brief 视频后台设置参数更改槽函数 */ option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, videoPathLineEdit, - [ = ](const QVariant & value) { - auto pi = ElideText(value.toString(), {pathEditWidth, tem_fontmetrics.height()}, - QTextOption::WrapAnywhere, videoPathLineEdit->font(), Qt::ElideMiddle, - tem_fontmetrics.height(), pathEditWidth); - videoPathLineEdit->setText(pi); - qDebug() << "picPathLineEdit text:" << videoPathLineEdit->text() << endl; - lastVideoPath = value.toString(); - option->setValue(value.toString()); - qDebug() << "save video last path:" << value.toString() << endl; - videoPathLineEdit->update(); - }); - - return optionWidget; + [=](const QVariant &value) { + auto pi = ElideText(value.toString(), { pathEditWidth, tem_fontmetrics.height() }, + QTextOption::WrapAnywhere, videoPathLineEdit->font(), Qt::ElideMiddle, + tem_fontmetrics.height(), pathEditWidth); + videoPathLineEdit->setText(pi); + qCDebug(appLog) << "picPathLineEdit text:" << videoPathLineEdit->text(); + lastVideoPath = value.toString(); + option->setValue(value.toString()); + qCDebug(appLog) << "save video last path:" << value.toString(); + videoPathLineEdit->update(); + }); + + // qDebug() << "Function completed: createVdSelectableLineEditOptionHandle"; + return optionWidget; } QString CMainWindow::lastOpenedPath(QStandardPaths::StandardLocation standard) { + // qDebug() << "Function started: lastOpenedPath"; QString lastPath; if (standard == QStandardPaths::MoviesLocation) { lastPath = Settings::get().getOption("base.save.vddatapath").toString(); if (lastPath.compare(Settings::get().settings()->option("base.save.vddatapath")->defaultValue().toString()) == 0) lastPath = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation) - + QDir::separator() + "Camera"; + + QDir::separator() + "Camera"; } else { lastPath = Settings::get().getOption("base.save.picdatapath").toString(); if (lastPath.compare(Settings::get().settings()->option("base.save.picdatapath")->defaultValue().toString()) == 0) lastPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) - + QDir::separator() + "Camera"; + + QDir::separator() + "Camera"; } // 包含主目录相对路径,QDir不能识别,必须转为绝对路径 @@ -713,18 +755,18 @@ QString CMainWindow::lastOpenedPath(QStandardPaths::StandardLocation standard) if (lastPath.isEmpty() || !lastDir.exists()) { if (standard == QStandardPaths::MoviesLocation) { lastPath = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation) - + QDir::separator() + "Camera"; + + QDir::separator() + "Camera"; } else { lastPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) - + QDir::separator() + "Camera"; + + QDir::separator() + "Camera"; } QDir dirNew(lastPath); if (!dirNew.exists()) { if (!dirNew.mkdir(lastPath)) { - qWarning() << "make dir error:" << lastPath; - lastPath = QDir::currentPath();//这是错误的路径,但肯定存在 - qDebug() << "now lastVdPath is:" << lastPath; + qCWarning(appLog) << "make dir error:" << lastPath; + lastPath = QDir::currentPath(); //这是错误的路径,但肯定存在 + qCDebug(appLog) << "now lastVdPath is:" << lastPath; } } } @@ -733,11 +775,13 @@ QString CMainWindow::lastOpenedPath(QStandardPaths::StandardLocation standard) QString str = QDir::homePath(); lastPath.replace(0, 1, str); } + // qDebug() << "Function completed: lastOpenedPath"; return lastPath; } void CMainWindow::setWayland(bool bTrue) { + // qDebug() << "Function started: setWayland"; m_bWayland = bTrue; } @@ -749,6 +793,7 @@ CMainWindow::CMainWindow(QWidget *parent) m_bUIinit(false), m_windowStateThread(nullptr) { + qCDebug(appLog) << "Function started: CMainWindow constructor"; m_cameraSwitchBtn = nullptr; m_photoRecordBtn = nullptr; m_modeSwitchBox = nullptr; @@ -765,6 +810,7 @@ CMainWindow::CMainWindow(QWidget *parent) m_SpaceKeyInterval = QDateTime::currentMSecsSinceEpoch(); this->setObjectName(MAIN_WINDOW); this->setAccessibleName(MAIN_WINDOW); + setTitlebarShadowEnabled(false); titlebar()->deleteLater(); setupTitlebar(); @@ -772,23 +818,27 @@ CMainWindow::CMainWindow(QWidget *parent) //修复在性能较差的电脑上启动闪烁白框 initUI(); + qCDebug(appLog) << "Function completed: CMainWindow constructor"; } void CMainWindow::slotPopupSettingsDialog() { + qCDebug(appLog) << "Function started: slotPopupSettingsDialog"; #ifndef UNITTEST settingDialog(); m_SetDialog->exec(); settingDialogDel(); #endif + qCDebug(appLog) << "Function completed: slotPopupSettingsDialog"; } QString CMainWindow::libPath(const QString &strlib) { - QDir dir; - QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); + // qDebug() << "Function started: libPath"; + QDir dir; + QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); dir.setPath(path); - QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib + QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib if (list.contains(strlib)) return strlib; @@ -797,11 +847,14 @@ QString CMainWindow::libPath(const QString &strlib) if (list.size() > 0) return list.last(); - return ""; + // qDebug() << "Function completed: libPath"; + // Qt LibrariesPath 不包含,返回默认名称 + return strlib; } void CMainWindow::reflushSnapshotLabel() { + // qDebug() << "Function started: reflushSnapshotLabel"; QFileInfoList picPathList; QFileInfoList videoPathList; QString lastFilePath = ""; @@ -809,10 +862,10 @@ void CMainWindow::reflushSnapshotLabel() getMediaFileInfoList(m_videoPath, videoPathList); getMediaFileInfoList(m_picPath, picPathList); if (!videoPathList.isEmpty() - && picPathList.isEmpty()) { + && picPathList.isEmpty()) { lastFilePath = videoPathList[0].filePath(); } else if (videoPathList.isEmpty() - && ! picPathList.isEmpty()) { + && !picPathList.isEmpty()) { lastFilePath = picPathList[0].filePath(); } else if (!videoPathList.isEmpty() && !picPathList.isEmpty()) { @@ -822,11 +875,14 @@ void CMainWindow::reflushSnapshotLabel() } } m_snapshotLabel->updatePicPath(lastFilePath); + // qDebug() << "Function completed: reflushSnapshotLabel"; } void CMainWindow::getMediaFileInfoList(const QString &path, QFileInfoList &fileList) { + qCDebug(appLog) << "Function started: getMediaFileInfoList"; if (path.isEmpty()) { + qCDebug(appLog) << "path is empty, return."; return; } @@ -834,14 +890,17 @@ void CMainWindow::getMediaFileInfoList(const QString &path, QFileInfoList &fileL QStringList filters; filters << QString("*.jpg") << QString("*.mp4") << QString("*.webm"); dir.setNameFilters(filters); - dir.setSorting(QDir::Time /*| QDir::Reversed*/); //按时间逆序排序 + dir.setSorting(QDir::Time /*| QDir::Reversed*/); //按时间逆序排序 if (dir.exists()) { + qCDebug(appLog) << "dir exists, get file list."; fileList = dir.entryInfoList(); } + qCDebug(appLog) << "Function completed: getMediaFileInfoList"; } void CMainWindow::initDynamicLibPath() { + qCDebug(appLog) << "Function started: initDynamicLibPath"; LoadLibNames tmp; QByteArray avcodec = libPath("libavcodec.so").toLatin1(); tmp.chAvcodec = avcodec.data(); @@ -864,12 +923,14 @@ void CMainWindow::initDynamicLibPath() QByteArray swresample = libPath("libswresample.so").toLatin1(); tmp.chSwresample = swresample.data(); setLibNames(tmp); + qCDebug(appLog) << "Function completed: initDynamicLibPath"; } void CMainWindow::initBlockShutdown() { + qCDebug(appLog) << "Function started: initBlockShutdown"; if (!m_arg.isEmpty() || m_reply.value().isValid()) { - qInfo() << "m_reply.value().isValid():" << m_reply.value().isValid(); + qCInfo(appLog) << "m_reply.value().isValid():" << m_reply.value().isValid(); return; } @@ -878,10 +939,10 @@ void CMainWindow::initBlockShutdown() "org.freedesktop.login1.Manager", QDBusConnection::systemBus()); - m_arg << QString("shutdown") // what - << qApp->productName() // who - << QObject::tr("File not saved") // why - << QString("block"); // mode + m_arg << QString("shutdown") // what + << qApp->productName() // who + << QObject::tr("File not saved") // why + << QString("block"); // mode m_reply = m_pLoginManager->callWithArgumentList(QDBus::Block, "Inhibit", m_arg); @@ -892,14 +953,16 @@ void CMainWindow::initBlockShutdown() if (m_reply.isValid()) { QDBusReply tmp = m_reply; m_reply = QDBusReply(); - qDebug() << "init Nublock shutdown."; + qCDebug(appLog) << "init Unblock shutdown."; } + qCDebug(appLog) << "Function completed: initBlockShutdown"; } void CMainWindow::initBlockSleep() { + qCDebug(appLog) << "Function started: initBlockSleep"; if (!m_argSleep.isEmpty() || m_replySleep.value().isValid()) { - qInfo() << "m_reply.value().isValid():" << m_replySleep.value().isValid(); + qCInfo(appLog) << "m_reply.value().isValid():" << m_replySleep.value().isValid(); return; } @@ -908,10 +971,10 @@ void CMainWindow::initBlockSleep() "org.freedesktop.login1.Manager", QDBusConnection::systemBus()); - m_argSleep << QString("sleep") // what - << qApp->productName() // who - << QObject::tr("File not saved") // why - << QString("block"); // mode + m_argSleep << QString("sleep") // what + << qApp->productName() // who + << QObject::tr("File not saved") // why + << QString("block"); // mode m_replySleep = m_pLoginMgrSleep->callWithArgumentList(QDBus::Block, "Inhibit", m_argSleep); @@ -922,13 +985,14 @@ void CMainWindow::initBlockSleep() if (m_replySleep.isValid()) { QDBusReply tmp = m_replySleep; m_replySleep = QDBusReply(); - qDebug() << "init Nublock sleep."; + qCDebug(appLog) << "init Unblock sleep."; } - + qCDebug(appLog) << "Function completed: initBlockSleep"; } void CMainWindow::initTabOrder() { + qCDebug(appLog) << "Function started: initTabOrder"; m_windowMinBtn = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowMinButton"); m_windowoptionButton = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowOptionButton"); m_windowMaxBtn = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowMaxButton"); @@ -944,10 +1008,12 @@ void CMainWindow::initTabOrder() setTabOrder(m_windowMinBtn, m_windowMaxBtn); setTabOrder(m_windowMaxBtn, m_windowCloseBtn); setTabOrder(m_windowCloseBtn, m_takePhotoSettingArea); + qCDebug(appLog) << "Function completed: initTabOrder"; } void CMainWindow::initEventFilter() { + qCDebug(appLog) << "Function started: initEventFilter"; /** * @brief windowMinBtn 最小化按钮 */ @@ -985,10 +1051,12 @@ void CMainWindow::initEventFilter() if (m_videoPre) m_videoPre->installEventFilter(this); + qCDebug(appLog) << "Function completed: initEventFilter"; } void CMainWindow::initShortcut() { + qCDebug(appLog) << "Function started: initShortcut"; QShortcutEx *scViewShortcut = new QShortcutEx(QKeySequence("Ctrl+Shift+/"), this); QShortcutEx *scSpaceShortcut = new QShortcutEx(Qt::Key_Space, this); QShortcutEx *scEnterShortcut = new QShortcutEx(Qt::Key_Return, this); @@ -1005,8 +1073,8 @@ void CMainWindow::initShortcut() scViewShortcut->setObjectName(SHORTCUT_VIEW); scSpaceShortcut->setObjectName(SHORTCUT_SPACE); - connect(scViewShortcut, &QShortcut::activated, this, [ = ] { - qDebug() << "receive Ctrl+Shift+/"; + connect(scViewShortcut, &QShortcut::activated, this, [=] { + qCDebug(appLog) << "receive Ctrl+Shift+/"; QRect rect = window()->geometry(); QPoint pos(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2); Shortcut sc; @@ -1020,14 +1088,13 @@ void CMainWindow::initShortcut() #endif }); - connect(scSpaceShortcut, &QShortcut::activated, this, [ = ] { + connect(scSpaceShortcut, &QShortcut::activated, this, [=] { if (QDateTime::currentMSecsSinceEpoch() < m_SpaceKeyInterval) //获取录制按钮第一次点击时间(ms) m_SpaceKeyInterval = QDateTime::currentMSecsSinceEpoch(); //第二次点击时间与第一次时间差 - if (QDateTime::currentMSecsSinceEpoch() - m_SpaceKeyInterval > 300) - { + if (QDateTime::currentMSecsSinceEpoch() - m_SpaceKeyInterval > 300) { m_SpaceKeyInterval = QDateTime::currentMSecsSinceEpoch(); onPhotoRecordBtnClked(); m_takePhotoSettingArea->closeAllGroup(); @@ -1035,14 +1102,13 @@ void CMainWindow::initShortcut() }); //根据tab焦点进行Enter键操作 - connect(scEnterShortcut, &QShortcut::activated, this, [ = ] { + connect(scEnterShortcut, &QShortcut::activated, this, [=] { DWindowMinButton *windowMinBtn = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowMinButton"); DWindowOptionButton *windowoptionButton = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowOptionButton"); DWindowMaxButton *windowMaxBtn = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowMaxButton"); DWindowCloseButton *windowCloseBtn = m_pTitlebar->titlebar()->findChild("DTitlebarDWindowCloseButton"); QWidget *focuswidget = focusWidget(); - /** *@brief 判断当前的焦点窗口在哪个控件上,通过enter键触发对应的点击操作 */ @@ -1064,11 +1130,12 @@ void CMainWindow::initShortcut() else return; }); - + qCDebug(appLog) << "Function completed: initShortcut"; } void CMainWindow::settingDialog() { + qCDebug(appLog) << "Function started: settingDialog"; m_SetDialog = new DSettingsDialog(this); m_SetDialog->setFixedSize(820, 600); m_SetDialog->widgetFactory()->registerWidget("selectableEditpic", createPicSelectableLineEditOptionHandle); @@ -1081,19 +1148,17 @@ void CMainWindow::settingDialog() auto resolutionmodeFamily = Settings::get().settings()->option("outsetting.resolutionsetting.resolution"); - - if (get_v4l2_device_handler() != nullptr) { //格式索引 int format_index = v4l2core_get_frame_format_index( - get_v4l2_device_handler(), - v4l2core_get_requested_frame_format(get_v4l2_device_handler())); + get_v4l2_device_handler(), + v4l2core_get_requested_frame_format(get_v4l2_device_handler())); //分辨率索引 int resolu_index = v4l2core_get_format_resolution_index( - get_v4l2_device_handler(), - format_index, - v4l2core_get_frame_width(get_v4l2_device_handler()), - v4l2core_get_frame_height(get_v4l2_device_handler())); + get_v4l2_device_handler(), + format_index, + v4l2core_get_frame_width(get_v4l2_device_handler()), + v4l2core_get_frame_height(get_v4l2_device_handler())); //获取当前摄像头的格式表 v4l2_stream_formats_t *list_stream_formats = v4l2core_get_formats_list(get_v4l2_device_handler()); @@ -1106,16 +1171,11 @@ void CMainWindow::settingDialog() //format_index = -1 &&resolu_index = -1 表示设备被占用或者不存在 for (int i = 0 ; i < list_stream_formats[format_index].numb_res; i++) { - - if ((list_stream_formats[format_index].list_stream_cap[i].width > 0 - && list_stream_formats[format_index].list_stream_cap[i].height > 0) && - (list_stream_formats[format_index].list_stream_cap[i].width < 7680 - && list_stream_formats[format_index].list_stream_cap[i].height < 4320) && - ((list_stream_formats[format_index].list_stream_cap[i].width % 8) == 0 - && (list_stream_formats[format_index].list_stream_cap[i].width % 16) == 0 - && (list_stream_formats[format_index].list_stream_cap[i].height % 8) == 0)) { + int w = list_stream_formats[format_index].list_stream_cap[i].width; + int h = list_stream_formats[format_index].list_stream_cap[i].height; + if (is_valid_resolution(w, h)) { //加入分辨率的字符串 - QString res_str = QString("%1x%2").arg(list_stream_formats[format_index].list_stream_cap[i].width).arg(list_stream_formats[format_index].list_stream_cap[i].height); + QString res_str = QString("%1x%2").arg(w).arg(h); //去重 if (resolutionDatabase.contains(res_str) == false) @@ -1129,12 +1189,11 @@ void CMainWindow::settingDialog() for (int i = 0; i < resolutionDatabase.size() - 1; i++) { int flag = 1; - for (int j = 0 ; j < len; j++) { + for (int j = 0; j < len; j++) { QStringList resolutiontemp1 = resolutionDatabase[j].split("x"); QStringList resolutiontemp2 = resolutionDatabase[j + 1].split("x"); - if ((resolutiontemp1[0].toInt() < resolutiontemp2[0].toInt()) || - (resolutiontemp1[0].toInt() == resolutiontemp2[0].toInt() && (resolutiontemp1[1].toInt() < resolutiontemp2[1].toInt()))) { + if ((resolutiontemp1[0].toInt() < resolutiontemp2[0].toInt()) || (resolutiontemp1[0].toInt() == resolutiontemp2[0].toInt() && (resolutiontemp1[1].toInt() < resolutiontemp2[1].toInt()))) { QString resolutionstr = resolutionDatabase[j + 1]; resolutionDatabase[j + 1] = resolutionDatabase[j]; resolutionDatabase[j] = resolutionstr; @@ -1146,18 +1205,15 @@ void CMainWindow::settingDialog() if (flag == 1) continue; - } for (int i = 0; i < resolutionDatabase.size(); i++) { QStringList resolutiontemp = resolutionDatabase[i].split("x"); - if ((v4l2core_get_frame_width(get_v4l2_device_handler()) == resolutiontemp[0].toInt()) && - (v4l2core_get_frame_height(get_v4l2_device_handler()) == resolutiontemp[1].toInt())) { - defres = i; //设置分辨率下拉菜单当前索引 + if ((v4l2core_get_frame_width(get_v4l2_device_handler()) == resolutiontemp[0].toInt()) && (v4l2core_get_frame_height(get_v4l2_device_handler()) == resolutiontemp[1].toInt())) { + defres = i; //设置分辨率下拉菜单当前索引 break; } - } resolutionmodeFamily->setData("items", resolutionDatabase); @@ -1178,9 +1234,8 @@ void CMainWindow::settingDialog() for (int i = 0; i < resolutionDatabase.size(); i++) { QStringList resolutiontemp = resolutionDatabase[i].split("x"); - if ((Camera::instance()->getCameraResolution().width() == resolutiontemp[0].toInt()) && - Camera::instance()->getCameraResolution().height() == resolutiontemp[1].toInt()) { - defres = i; //设置分辨率下拉菜单当前索引 + if ((Camera::instance()->getCameraResolution().width() == resolutiontemp[0].toInt()) && Camera::instance()->getCameraResolution().height() == resolutiontemp[1].toInt()) { + defres = i; //设置分辨率下拉菜单当前索引 break; } } @@ -1201,18 +1256,23 @@ void CMainWindow::settingDialog() QPushButton *resetbtn = m_SetDialog->findChild("SettingsContentReset"); resetbtn->setDefault(false); resetbtn->setAutoDefault(false); + qCDebug(appLog) << "Function completed: settingDialog"; } void CMainWindow::settingDialogDel() { + // qDebug() << "Function started: settingDialogDel"; if (m_SetDialog) { + // qDebug() << "delete m_SetDialog"; delete m_SetDialog; m_SetDialog = nullptr; } + // qDebug() << "Function completed: settingDialogDel"; } void CMainWindow::loadAfterShow() { + qCDebug(appLog) << "Function started: loadAfterShow"; encodeenv = DataManager::instance()->encodeEnv(); initDynamicLibPath(); initShortcut(); @@ -1227,8 +1287,8 @@ void CMainWindow::loadAfterShow() initConnection(); //后续修改为标准Qt用法 QString strCache = QString(getenv("HOME")) + QDir::separator() + QString(".cache") - + QDir::separator() + QString("deepin") + QDir::separator() - + QString("deepin-camera") + QDir::separator(); + + QDir::separator() + QString("deepin") + QDir::separator() + + QString("deepin-camera") + QDir::separator(); QDir dir; dir.mkpath(strCache); initRightButtons(); @@ -1241,6 +1301,7 @@ void CMainWindow::loadAfterShow() if(DataManager::instance()->encodeEnv() != QCamera_Env) { connect(m_devnumMonitor, SIGNAL(existDevice()), m_videoPre, SLOT(onRestartDevices()));//重启设备 connect(m_devnumMonitor, SIGNAL(noDeviceFound()), m_videoPre, SLOT(onRestartDevices()));//重启设备 + connect(m_devnumMonitor, SIGNAL(deviceListChanged()), m_videoPre, SLOT(updateValidDevices())); // 更新可用设备列表 } else if (DataManager::instance()->encodeEnv() == QCamera_Env) { initCameraConnection(); } @@ -1254,18 +1315,26 @@ void CMainWindow::loadAfterShow() m_windowStateThread = new windowStateThread(m_bWayland, this); connect(m_windowStateThread, &windowStateThread::someWindowFullScreen, this, &CMainWindow::onStopPhotoAndRecord); - QJsonObject obj{ + QTimer::singleShot(100, this, [=](){ + resize(this->size() + QSize(1, 1)); + resize(this->size() + QSize(-1, -1)); + }); + + QJsonObject obj { {"tid", EventLogUtils::Start}, {"mode", 1}, {"version", VERSION}, {"camera_connected", DataManager::instance()->getdevStatus() ? true : false} }; EventLogUtils::get().writeLogs(obj); + qCDebug(appLog) << "Function completed: loadAfterShow"; } void CMainWindow::updateBlockSystem(bool bTrue) { + qCDebug(appLog) << "Function started: updateBlockSystem"; if (!CamApp->isPanelEnvironment()) { + // qDebug() << "Condition check: !CamApp->isPanelEnvironment(), initBlockShutdown"; initBlockShutdown(); if (bTrue) { @@ -1273,10 +1342,11 @@ void CMainWindow::updateBlockSystem(bool bTrue) } else { QDBusReply tmp = m_reply; m_reply = QDBusReply(); - qDebug() << "Nublock shutdown."; + qCDebug(appLog) << "Unblock shutdown."; } } if (m_bWayland) { + // qDebug() << "Condition check: m_bWayland, initBlockSleep"; initBlockSleep(); if (bTrue) { @@ -1284,21 +1354,25 @@ void CMainWindow::updateBlockSystem(bool bTrue) } else { QDBusReply tmp = m_replySleep; m_replySleep = QDBusReply(); - qDebug() << "Nublock sleep."; + qCDebug(appLog) << "Unblock sleep."; } } + qCDebug(appLog) << "Function completed: updateBlockSystem"; } void CMainWindow::onNoCam() { + qCDebug(appLog) << "Function started: onNoCam"; m_pTitlebar->titlebar()->setBackgroundTransparent(false); m_pTitlebar->slotThemeTypeChanged(); showChildWidget(); onEnableSettings(true); + qCDebug(appLog) << "Function completed: onNoCam"; } void CMainWindow::stopCancelContinuousRecording(bool bTrue) { + qCDebug(appLog) << "Function started: stopCancelContinuousRecording"; if (bTrue) { onStopPhotoAndRecord(); } @@ -1306,17 +1380,19 @@ void CMainWindow::stopCancelContinuousRecording(bool bTrue) void CMainWindow::onDirectoryChanged(const QString &filePath) { + qCDebug(appLog) << "Function started: onDirectoryChanged"; Q_UNUSED(filePath); // 转为绝对路径进行比较 QString relativeHomePath = QString("~") + QDir::separator(); QString videoPath = Settings::get().getOption("base.save.vddatapath").toString(); QString picPath = Settings::get().getOption("base.save.picdatapath").toString(); if (videoPath.contains(relativeHomePath)) - videoPath.replace(0, 1, QDir::homePath()); + videoPath.replace(0, 1, QDir::homePath()); if (picPath.contains(relativeHomePath)) picPath.replace(0, 1, QDir::homePath()); - QDir dir(videoPath); + QDir dir(videoPath); if (!dir.exists()) { + qCInfo(appLog) << "Video directory does not exist, creating default path"; QString videoDefaultPath = lastOpenedPath(QStandardPaths::MoviesLocation); if (videoDefaultPath != videoPath) { QDir setVideoDir(videoDefaultPath); @@ -1346,6 +1422,7 @@ void CMainWindow::onDirectoryChanged(const QString &filePath) dir = QDir(picPath); if (!dir.exists()) { + qCInfo(appLog) << "Picture directory does not exist, creating default path"; QString picDefaultPath = lastOpenedPath(QStandardPaths::PicturesLocation); if (picDefaultPath != picPath) { QDir setPicDir(picDefaultPath); @@ -1374,112 +1451,142 @@ void CMainWindow::onDirectoryChanged(const QString &filePath) } reflushSnapshotLabel(); + qCDebug(appLog) << "Function completed: onDirectoryChanged"; } void CMainWindow::onSwitchCameraSuccess(const QString &cameraName) { + qCDebug(appLog) << "Function started: onSwitchCameraSuccess"; QStringList tmpList = cameraName.split(":"); if (!tmpList.isEmpty()) { m_labelCameraName->setText(tmpList[0]); } +#if QT_VERSION_MAJOR > 5 + int width = m_labelCameraName->fontMetrics().boundingRect(tmpList[0]).width(); +#else int width = m_labelCameraName->fontMetrics().width(tmpList[0]); +#endif m_labelCameraName->setFixedWidth(width); m_labelCameraName->show(); m_filterName->hide(); m_showCameraNameTimer->start(); + showChildWidget(); + qCDebug(appLog) << "Function completed: onSwitchCameraSuccess"; } void CMainWindow::onTimeoutLock(const QString &serviceName, QVariantMap key2value, QStringList) { - qDebug() << serviceName << key2value << endl; + qCDebug(appLog) << serviceName << key2value; //仅wayland需要锁屏结束录制并停止使用摄像头,从锁屏恢复重新开启摄像头 //wayland下只需要停止录像,不需要停止线程,需要在锁屏状态下继续处理摄像头状态 -// if (m_bWayland) { + // if (m_bWayland) { -// if (key2value.value("Locked").value()) { -// qDebug() << "locked"; + // if (key2value.value("Locked").value()) { + // qDebug() << "locked"; -// onStopPhotoAndRecord(); + // onStopPhotoAndRecord(); -// m_videoPre->m_imgPrcThread->stop(); + // m_videoPre->m_imgPrcThread->stop(); -// v4l2_dev_t *vd = get_v4l2_device_handler(); -// qDebug() << "lock end"; -// } else { -// qDebug() << "restart use camera cause ScreenBlack or PoweerLock"; -// //打开摄像头 -// m_videoPre->onChangeDev(); -// qDebug() << "v4l2core_start_stream OK"; -// } + // v4l2_dev_t *vd = get_v4l2_device_handler(); + // qDebug() << "lock end"; + // } else { + // qDebug() << "restart use camera cause ScreenBlack or PoweerLock"; + // //打开摄像头 + // m_videoPre->onChangeDev(); + // qDebug() << "v4l2core_start_stream OK"; + // } -// } else { //锁屏结束连拍 - if (key2value.value("Locked").value()) { - onStopPhotoAndRecord(); - } -// } + // } else { //锁屏结束连拍 + if (key2value.value("Locked").value()) { + onStopPhotoAndRecord(); + } + // } + // 锁屏时,停用摄像头,因为用户可能需要人脸解锁。解锁后,恢复使用摄像头。 + m_videoPre->onLockedScreen(key2value.value("Locked").value()); + qCDebug(appLog) << "Function completed: onTimeoutLock"; } void CMainWindow::onTrashFile(const QString &fileName) { + qCDebug(appLog) << "Deleting file:" << fileName; QFile file(fileName); if (!file.exists()) { + qCWarning(appLog) << "File does not exist:" << fileName; return; } - file.remove(); + if (!file.remove()) { + qCWarning(appLog) << "Failed to delete file:" << fileName; + } //删除文件后,filewatcher会自动刷新缩略图 } void CMainWindow::onSwitchPhotoBtnClked() { + qCDebug(appLog) << "Function started: onSwitchPhotoBtnClked"; m_photoRecordBtn->setState(true); m_photoRecordBtn->setToolTip(tr("Photo")); m_takePhotoSettingArea->setState(true); m_videoPre->setState(true); locateRightButtons(); + qCDebug(appLog) << "Function completed: onSwitchPhotoBtnClked"; } void CMainWindow::onSwitchRecordBtnClked() { + qCDebug(appLog) << "Function started: onSwitchRecordBtnClked"; m_photoRecordBtn->setState(false); m_photoRecordBtn->setToolTip(tr("Video")); m_takePhotoSettingArea->setState(false); m_videoPre->setState(false); locateRightButtons(); + qCDebug(appLog) << "Function completed: onSwitchRecordBtnClked"; } void CMainWindow::onModeSwitchBoxValueChanged(int type) { + qCDebug(appLog) << "Function started: onModeSwitchBoxValueChanged"; if (type == ActType::ActTakePic) { + qCDebug(appLog) << "type is ActType::ActTakePic, onSwitchPhotoBtnClked"; onSwitchPhotoBtnClked(); } else if (type == ActType::ActTakeVideo) { + qCDebug(appLog) << "type is ActType::ActTakeVideo, onSwitchRecordBtnClked"; onSwitchRecordBtnClked(); } else { + qCDebug(appLog) << "type is not ActType::ActTakePic or ActType::ActTakeVideo, return."; return; } + qCDebug(appLog) << "Function completed: onModeSwitchBoxValueChanged"; } void CMainWindow::onPhotoRecordBtnClked() { + qCDebug(appLog) << "Function started: onPhotoRecordBtnClked"; QJsonObject obj { - {"tid", m_photoRecordBtn->photoState() ? EventLogUtils::StartPhoto : EventLogUtils::StartRecording}, - {"version", VERSION}, - {"camera_connected", DataManager::instance()->getdevStatus() ? true : false} + { "tid", m_photoRecordBtn->photoState() ? EventLogUtils::StartPhoto : EventLogUtils::StartRecording }, + { "version", VERSION }, + { "camera_connected", DataManager::instance()->getdevStatus() ? true : false } }; - if(!m_bRecording) + if (!m_bRecording) EventLogUtils::get().writeLogs(obj); //没有摄像机,不进行任何操作 if (NOCAM == DataManager::instance()->getdevStatus()) { + qCWarning(appLog) << "No camera available, ignoring photo/record request"; return; } + //拍照模式下 if (true == m_photoRecordBtn->photoState()) { + qCDebug(appLog) << "Photo mode activated"; //正在拍照 if (photoNormal != m_photoState) { + qCDebug(appLog) << "Taking photo"; m_videoPre->onTakePic(false); } else { int nContinuous = Settings::get().getOption("photosetting.photosnumber.takephotos").toInt(); if (nContinuous > 1) { + qCInfo(appLog) << "Starting continuous photo mode with" << nContinuous << "shots"; // 仅在连拍模式下才开启窗口状态监听线程 if (!m_windowStateThread->isRunning() && !m_bWayland) { m_windowStateThread->start(); @@ -1487,55 +1594,66 @@ void CMainWindow::onPhotoRecordBtnClked() } m_videoPre->onTakePic(true); } - } else { //录像模式下 + } else { //录像模式下 if (true == m_bRecording) { + qCDebug(appLog) << "Stopping video recording"; m_videoPre->onEndBtnClicked(); } else { QFileInfo fi(m_videoPath); - if (!fi.isWritable()) + if (!fi.isWritable()) { + qCWarning(appLog) << "Video save path is not writable:" << m_videoPath; return; + } + qCDebug(appLog) << "Starting video recording"; m_videoPre->onTakeVideo(); if (!m_windowStateThread->isRunning() && !m_bWayland) { m_windowStateThread->start(); } } } + qCDebug(appLog) << "Function completed: onPhotoRecordBtnClked"; } void CMainWindow::onShowCameraNameTimer() { + qCDebug(appLog) << "Function started: onShowCameraNameTimer"; m_showCameraNameTimer->stop(); m_labelCameraName->hide(); if (m_bShowFilterName) m_filterName->show(); + qCDebug(appLog) << "Function completed: onShowCameraNameTimer"; } void CMainWindow::onUpdateRecordState(int state) { + qCDebug(appLog) << "Recording state changed to:" << state; m_photoRecordBtn->setRecordState(state); m_bRecording = (photoRecordBtn::Normal != state); m_actionSettings->setEnabled(!m_bRecording); showChildWidget(); if (false == m_bRecording - && m_windowStateThread->isRunning() && !m_bWayland) { + && m_windowStateThread->isRunning() && !m_bWayland) { m_windowStateThread->requestInterruption(); } + qCDebug(appLog) << "Function completed: onUpdateRecordState"; } void CMainWindow::onUpdatePhotoState(int state) { + qCDebug(appLog) << "Photo state changed to:" << state; m_actionSettings->setEnabled(photoNormal == state); m_photoState = state; showChildWidget(); if (photoNormal == state - && m_windowStateThread->isRunning() && !m_bWayland) { + && m_windowStateThread->isRunning() && !m_bWayland) { m_windowStateThread->requestInterruption(); } } void CMainWindow::onStopPhotoAndRecord() { + qCDebug(appLog) << "Stopping all photo and recording operations"; if (photoNormal != m_photoState) { m_videoPre->onTakePic(false); } @@ -1546,13 +1664,17 @@ void CMainWindow::onStopPhotoAndRecord() void CMainWindow::onMirrorStateChanged(bool bMirror) { + qCDebug(appLog) << "Function started: onMirrorStateChanged"; if (m_videoPre) { + qCDebug(appLog) << "Setting horizontal mirror to:" << bMirror; m_videoPre->setHorizontalMirror(bMirror); } + qCDebug(appLog) << "Function completed: onMirrorStateChanged"; } void CMainWindow::onSetFlash(bool bFlashOn) { + qCDebug(appLog) << "Function started: onSetFlash"; if (m_videoPre) { m_videoPre->setFlash(bFlashOn); } @@ -1562,60 +1684,79 @@ void CMainWindow::onSetFlash(bool bFlashOn) if (bFlashOn != m_takePhotoSettingArea->flashLight()) { m_takePhotoSettingArea->setFlashlight(bFlashOn); } + qCDebug(appLog) << "Function completed: onSetFlash"; } void CMainWindow::onKeyUp() { + qCDebug(appLog) << "Function started: onKeyUp"; QWidget *pWidget = focusWidget(); if (m_cameraSwitchBtn == pWidget - || m_takePhotoSettingArea == pWidget) { + || m_takePhotoSettingArea == pWidget) { + qCDebug(appLog) << "m_cameraSwitchBtn == pWidget or m_takePhotoSettingArea == pWidget, set focus to m_windowoptionButton"; m_windowoptionButton->setFocus(); } else if (m_photoRecordBtn == pWidget) { if (m_cameraSwitchBtn->isHidden()) { + qCDebug(appLog) << "m_cameraSwitchBtn->isHidden(), set focus to m_windowoptionButton"; m_windowoptionButton->setFocus(); } else { + qCDebug(appLog) << "m_cameraSwitchBtn->isHidden() is false, set focus to m_cameraSwitchBtn"; m_cameraSwitchBtn->setFocus(); } } + qCDebug(appLog) << "Function completed: onKeyUp"; } void CMainWindow::onKeyDown() { + qCDebug(appLog) << "Function started: onKeyDown"; QWidget *pWidget = focusWidget(); if (m_windowMinBtn == pWidget - || m_windowoptionButton == pWidget - || m_windowMaxBtn == pWidget - || m_windowCloseBtn == pWidget) { + || m_windowoptionButton == pWidget + || m_windowMaxBtn == pWidget + || m_windowCloseBtn == pWidget) { if (m_cameraSwitchBtn->isHidden()) { + qCDebug(appLog) << "m_cameraSwitchBtn->isHidden(), set focus to m_photoRecordBtn"; m_photoRecordBtn->setFocus(); } else { + qCDebug(appLog) << "m_cameraSwitchBtn->isHidden() is false, set focus to m_cameraSwitchBtn"; m_cameraSwitchBtn->setFocus(); } } else if (m_cameraSwitchBtn == pWidget) { + qCDebug(appLog) << "m_cameraSwitchBtn == pWidget, set focus to m_photoRecordBtn"; m_photoRecordBtn->setFocus(); } else if (m_photoRecordBtn == pWidget) { + qCDebug(appLog) << "m_photoRecordBtn == pWidget, set focus to m_snapshotLabel"; m_snapshotLabel->setFocus(); } + qCDebug(appLog) << "Function completed: onKeyDown"; } void CMainWindow::onKeyLeft() { + qCDebug(appLog) << "Function started: onKeyLeft"; QWidget *pWidget = focusWidget(); if (m_cameraSwitchBtn == pWidget - || m_photoRecordBtn == pWidget - || m_snapshotLabel == pWidget) { + || m_photoRecordBtn == pWidget + || m_snapshotLabel == pWidget) { + qCDebug(appLog) << "m_cameraSwitchBtn == pWidget or m_photoRecordBtn == pWidget or m_snapshotLabel == pWidget, set focus to m_takePhotoSettingArea"; m_takePhotoSettingArea->setFocus(); } else if (m_windowCloseBtn == pWidget) { + qCDebug(appLog) << "m_windowCloseBtn == pWidget, set focus to m_windowMaxBtn"; m_windowMaxBtn->setFocus(); } else if (m_windowMaxBtn == pWidget) { + qCDebug(appLog) << "m_windowMaxBtn == pWidget, set focus to m_windowMinBtn"; m_windowMinBtn->setFocus(); } else if (m_windowMinBtn == pWidget) { + qCDebug(appLog) << "m_windowMinBtn == pWidget, set focus to m_windowoptionButton"; m_windowoptionButton->setFocus(); } + qCDebug(appLog) << "Function completed: onKeyLeft"; } void CMainWindow::onkeyRight() { + qCDebug(appLog) << "Function started: onkeyRight"; QWidget *pWidget = focusWidget(); if (m_windowoptionButton == pWidget) { m_windowMinBtn->setFocus(); @@ -1625,46 +1766,55 @@ void CMainWindow::onkeyRight() m_windowCloseBtn->setFocus(); } else if (m_takePhotoSettingArea == pWidget) { if (m_cameraSwitchBtn->isHidden()) { + qCDebug(appLog) << "m_cameraSwitchBtn->isHidden(), set focus to m_photoRecordBtn"; m_photoRecordBtn->setFocus(); } else { + qCDebug(appLog) << "m_cameraSwitchBtn->isHidden() is false, set focus to m_cameraSwitchBtn"; m_cameraSwitchBtn->setFocus(); } } + qCDebug(appLog) << "Function completed: onkeyRight"; } void CMainWindow::onFilterChanged(efilterType type) { + qCDebug(appLog) << "Function started: onFilterChanged"; if (m_videoPre) { m_videoPre->setFilterType(type); } + qCDebug(appLog) << "Function completed: onFilterChanged"; } void CMainWindow::onShowFilterName(bool bShow) { + qCDebug(appLog) << "Function started: onShowFilterName"; m_filterName->setVisible(bShow); m_bShowFilterName = bShow; + qCDebug(appLog) << "Function completed: onShowFilterName"; } -void CMainWindow::onSetFilterName(const QString& name) +void CMainWindow::onSetFilterName(const QString &name) { + qCDebug(appLog) << "Function started: onSetFilterName"; m_filterName->setText(name); } void CMainWindow::initUI() { + qCDebug(appLog) << "Initializing main window UI"; m_videoPre = new videowidget(this); QPalette paletteTime = m_videoPre->palette(); m_videoPre->setObjectName(VIDEO_PREVIEW_WIDGET); m_videoPre->setAccessibleName(VIDEO_PREVIEW_WIDGET); setCentralWidget(m_videoPre); - paletteTime.setBrush(QPalette::Dark, QColor(0, 0, 0, 51)); //深色 + paletteTime.setBrush(QPalette::Dark, QColor(0, 0, 0, 51)); //深色 m_videoPre->setPalette(paletteTime); m_filterName = new QLabel(this); m_filterName->hide(); m_filterName->setFixedSize(labelFilterNameWidth, labelFilterNameHeight); QPalette paletteFilterName = m_filterName->palette(); - paletteFilterName.setColor(QPalette::Background, QColor(0, 0, 0, 0)); + paletteFilterName.setColor(QPalette::Window, QColor(0, 0, 0, 0)); paletteFilterName.setColor(QPalette::WindowText, QColor(255, 255, 255, 255)); m_filterName->setAutoFillBackground(true); m_filterName->setPalette(paletteFilterName); @@ -1676,14 +1826,14 @@ void CMainWindow::initUI() m_filterName->move((defaultWindowWidth - labelFilterNameWidth) / 2, defaultWindowHeight - 20 - labelFilterNameHeight); QGraphicsDropShadowEffect *shadow_effect1 = new QGraphicsDropShadowEffect(this); - shadow_effect1->setOffset(0, 0); //阴影的偏移量 - shadow_effect1->setColor(QColor(33, 33, 33)); //阴影的颜色 - shadow_effect1->setBlurRadius(15); // 阴影圆角的大小 + shadow_effect1->setOffset(0, 0); //阴影的偏移量 + shadow_effect1->setColor(QColor(33, 33, 33)); //阴影的颜色 + shadow_effect1->setBlurRadius(15); // 阴影圆角的大小 m_filterName->setGraphicsEffect(shadow_effect1); m_takePhotoSettingArea = new takePhotoSettingAreaWidget(this); - connect(m_takePhotoSettingArea, &takePhotoSettingAreaWidget::sngSetDelayTakePhoto, this, [ = ](int delaytime) { + connect(m_takePhotoSettingArea, &takePhotoSettingAreaWidget::sngSetDelayTakePhoto, this, [=](int delaytime) { m_videoPre->setInterval(delaytime); int setIndex = 0; @@ -1694,7 +1844,7 @@ void CMainWindow::initUI() auto curIndex = dc::Settings::get().settings()->getOption(QString("photosetting.photosdelay.photodelays")); - if (curIndex.toInt() != setIndex)//防止循环设置 + if (curIndex.toInt() != setIndex) //防止循环设置 dc::Settings::get().settings()->setOption(QString("photosetting.photosdelay.photodelays"), setIndex); }); connect(m_takePhotoSettingArea, &takePhotoSettingAreaWidget::sngSetFlashlight, this, &CMainWindow::onSetFlash); @@ -1706,8 +1856,7 @@ void CMainWindow::initUI() connect(&dc::Settings::get(), SIGNAL(flashLightChanged(bool)), this, SLOT(onSetFlash(bool))); //切换镜像 connect(&Settings::get(), SIGNAL(mirrorModeChanged(bool)), this, SLOT(onMirrorStateChanged(bool))); - connect(&Settings::get(), &Settings::delayTimeChanged, this, [ = ](const QString & str) { - + connect(&Settings::get(), &Settings::delayTimeChanged, this, [=](const QString &str) { int delayTime = 0; if (str == "3s") { delayTime = 3; @@ -1722,7 +1871,7 @@ void CMainWindow::initUI() m_takePhotoSettingArea->moveToParentLeft(); m_takePhotoSettingArea->setVisible(true); - m_videoPath = lastOpenedPath(QStandardPaths::MoviesLocation);//如果路径不存在会自动使用并创建默认路径 + m_videoPath = lastOpenedPath(QStandardPaths::MoviesLocation); //如果路径不存在会自动使用并创建默认路径 m_picPath = lastOpenedPath(QStandardPaths::PicturesLocation); m_fileWatcher.addPath(m_videoPath); @@ -1734,22 +1883,26 @@ void CMainWindow::initUI() m_showCameraNameTimer->setInterval(2000); m_labelCameraName->setFixedSize(labelCameraNameWidth, labelCameraNameHeight); QPalette paletteName = m_labelCameraName->palette(); - paletteName.setColor(QPalette::Background, QColor(0, 0, 0, 0)); //深色 + paletteName.setColor(QPalette::Window, QColor(0, 0, 0, 0)); //深色 paletteName.setColor(QPalette::WindowText, QColor(255, 255, 255, 255)); m_labelCameraName->setAutoFillBackground(true); m_labelCameraName->setPalette(paletteName); QFont ft; ft.setFamily("SourceHanSansSC, SourceHanSansSC-Normal"); +#if QT_VERSION_MAJOR > 5 + ft.setWeight(QFont::Thin); +#else ft.setWeight(20); +#endif ft.setPointSize(14); m_labelCameraName->setFont(ft); m_labelCameraName->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); m_labelCameraName->move((width() - labelCameraNameWidth) / 2, height() - 20 - labelCameraNameHeight); QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this); - shadow_effect->setOffset(0, 0); //阴影的偏移量 - shadow_effect->setColor(QColor(33, 33, 33)); //阴影的颜色 - shadow_effect->setBlurRadius(15); // 阴影圆角的大小 + shadow_effect->setOffset(0, 0); //阴影的偏移量 + shadow_effect->setColor(QColor(33, 33, 33)); //阴影的颜色 + shadow_effect->setBlurRadius(15); // 阴影圆角的大小 m_labelCameraName->setGraphicsEffect(shadow_effect); QDir dirVd(m_videoPath); @@ -1770,7 +1923,7 @@ void CMainWindow::initUI() int nDelayTime = Settings::get().getOption("photosetting.photosdelay.photodelays").toInt(); bool soundphoto = Settings::get().getOption("photosetting.audiosetting.soundswitchbtn").toBool(); - switch (nContinuous) {//连拍次数 + switch (nContinuous) { //连拍次数 case 1: nContinuous = 4; break; @@ -1782,7 +1935,7 @@ void CMainWindow::initUI() break; } - switch (nDelayTime) {//延迟时间 + switch (nDelayTime) { //延迟时间 case 1: nDelayTime = 3; break; @@ -1808,21 +1961,58 @@ void CMainWindow::initUI() m_takePhotoSettingArea->setDelayTime(nDelayTime); m_takePhotoSettingArea->setFlashlight(dc::Settings::get().getOption("photosetting.Flashlight.Flashlight").toBool()); +#ifdef DTKWIDGET_CLASS_DSizeMode + // 紧凑模式信号处理 + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &CMainWindow::updateSizeMode); + updateSizeMode(); +#endif + m_bUIinit = true; + qCDebug(appLog) << "Main window UI initialization completed"; +} + +void CMainWindow::updateSizeMode() +{ + if (g_selectPohtoBt && g_selectVideoBt && g_pohtospace && g_videospace) { +#ifdef DTKWIDGET_CLASS_DSizeMode + + if (DGuiApplicationHelper::isCompactMode()) { + g_selectPohtoBt->setFixedSize(28, 24); + g_selectVideoBt->setFixedSize(28, 24); + g_pohtospace->changeSize(8, 10); + g_videospace->changeSize(8, 10); + } else { + g_selectPohtoBt->setFixedSize(41, 37); + g_selectVideoBt->setFixedSize(41, 37); + g_pohtospace->changeSize(0, 0); + g_videospace->changeSize(0, 0); + } + +#else + g_selectPohtoBt->setFixedSize(41, 37); + g_selectVideoBt->setFixedSize(41, 37); + g_pohtospace->changeSize(0, 0); + g_videospace->changeSize(0, 0); +#endif + } + qCDebug(appLog) << "Function completed: updateSizeMode"; } void CMainWindow::initTitleBar() { + qCDebug(appLog) << "Function started: initTitleBar"; m_pTitlebar->titlebar()->setIcon(QIcon::fromTheme("deepin-camera")); m_pTitlebar->raise(); m_pTitlebar->titlebar()->raise(); + qCDebug(appLog) << "Function completed: initTitleBar"; } void CMainWindow::initConnection() { - connect(CamApp, &CApplication::popupConfirmDialog, this, [ = ] { - if (m_videoPre->getCapStatus()) - { + qCDebug(appLog) << "Initializing main window connections"; + connect(CamApp, &CApplication::popupConfirmDialog, this, [=] { + if (m_videoPre->getCapStatus()) { + qCDebug(appLog) << "Video recording in progress, showing close confirmation dialog"; CloseDialog closeDlg(this, tr("Video recording is in progress. Close the window?")); #ifdef UNITTEST closeDlg.show(); @@ -1832,13 +2022,16 @@ void CMainWindow::initConnection() int ret = closeDlg.exec(); if (ret == 1) { + qCDebug(appLog) << "User confirmed closing during recording, stopping recording"; m_videoPre->onEndBtnClicked(); usleep(200); qApp->quit(); } #endif - } else + } else { + qCDebug(appLog) << "No recording in progress, closing application"; qApp->quit(); + } }); //设置按钮信号 @@ -1865,8 +2058,9 @@ void CMainWindow::initConnection() connect(m_videoPre, SIGNAL(noCam()), this, SLOT(onNoCam())); //相机被抢占了,结束拍照、录制 connect(m_videoPre, SIGNAL(noCamAvailable()), this, SLOT(onNoCam())); - connect(m_videoPre, &videowidget::camAvailable, this, [=](){ + connect(m_videoPre, &videowidget::camAvailable, this, [=]() { m_pTitlebar->titlebar()->setBackgroundTransparent(true); + m_pTitlebar->slotThemeTypeChanged(); }); //设置新的分辨率 connect(m_videoPre, SIGNAL(sigDeviceChange()), &Settings::get(), SLOT(setNewResolutionList())); @@ -1876,45 +2070,58 @@ void CMainWindow::initConnection() connect(m_videoPre, SIGNAL(updatePhotoState(int)), this, SLOT(onUpdatePhotoState(int))); // 更新滤镜预览帧图片 - connect(m_videoPre, SIGNAL(updateFilterImage(QImage*)), m_takePhotoSettingArea, SLOT(onUpdateFilterImage(QImage*))); + connect(m_videoPre, SIGNAL(updateFilterImage(QImage *)), m_takePhotoSettingArea, SLOT(onUpdateFilterImage(QImage *))); connect(m_videoPre, &videowidget::reflushSnapshotLabel, this, &CMainWindow::reflushSnapshotLabel); connect(m_showCameraNameTimer, SIGNAL(timeout()), this, SLOT(onShowCameraNameTimer())); + QString sessionManagerService = "com.deepin.SessionManager"; + QString sessionManagerPath = "/com/deepin/SessionManager"; + QString timedateService = "com.deepin.daemon.Timedate"; + QString timedatePath = "/com/deepin/daemon/Timedate"; + QString timedateInterface = "com.deepin.daemon.Timedate"; + auto ver = DSysInfo::majorVersion().toInt(); + if (ver > 20) { + sessionManagerService = "org.deepin.dde.SessionManager1"; + sessionManagerPath = "/org/deepin/dde/SessionManager1"; + timedateService = "org.deepin.dde.Timedate1"; + timedatePath = "/org/deepin/dde/Timedate1"; + timedateInterface = "org.deepin.dde.Timedate1"; + } + //连拍在锁屏、熄屏情况下都要结束,与平台无关 - QDBusConnection::sessionBus().connect("com.deepin.SessionManager", "/com/deepin/SessionManager", + if (!QDBusConnection::sessionBus().connect(sessionManagerService, sessionManagerPath, "org.freedesktop.DBus.Properties", "PropertiesChanged", this, - SLOT(onTimeoutLock(QString, QVariantMap, QStringList))); - + SLOT(onTimeoutLock(QString, QVariantMap, QStringList)))) { + qCWarning(appLog) << "Failed to connect to session manager service"; + } //控制中心更改了本地时间,及时更新当前时间 //避免时间往前切换过后,需要点击两次才能结束录制 -#ifdef OS_BUILD_V23 - QDBusConnection::sessionBus().connect("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", - "org.deepin.daemon.Timedate1", "TimeUpdate", this, - SLOT(onLocalTimeChanged())); -#else - QDBusConnection::sessionBus().connect("com.deepin.daemon.Timedate", "/com/deepin/daemon/Timedate", - "com.deepin.daemon.Timedate", "TimeUpdate", this, - SLOT(onLocalTimeChanged())); -#endif + if (!QDBusConnection::sessionBus().connect(timedateService, timedatePath, + timedateInterface, "TimeUpdate", this, + SLOT(onLocalTimeChanged()))) { + qCWarning(appLog) << "Failed to connect to timedate service"; + } QDBusConnection::systemBus().connect("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "PrepareForSleep", this, SLOT(stopCancelContinuousRecording(bool))); QDBusConnection::systemBus().connect("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", "PrepareForShutdown", this, SLOT(stopCancelContinuousRecording(bool))); + qCDebug(appLog) << "Main window connections initialized"; } void CMainWindow::initCameraConnection() { + qCDebug(appLog) << "Function started: initCameraConnection"; connect(m_devnumMonitor, &DevNumMonitor::existDevice, Camera::instance(), &Camera::refreshCamera); connect(Camera::instance(), SIGNAL(cameraSwitched(const QString &)), this, SLOT(onSwitchCameraSuccess(const QString &))); // 摄像头重连,刷新设置页分辨率下拉框内容 connect(Camera::instance(), SIGNAL(cameraDevRestarted()), &Settings::get(), SLOT(setNewResolutionList())); // 当前无摄像头设备,给出无摄像头提示 - connect(m_devnumMonitor, &DevNumMonitor::noDeviceFound, this, [=](){ + connect(m_devnumMonitor, &DevNumMonitor::noDeviceFound, this, [=]() { Camera::instance()->stopCamera(); DataManager::instance()->setdevStatus(NOCAM); m_videoPre->showNocam(); @@ -1922,21 +2129,23 @@ void CMainWindow::initCameraConnection() m_takePhotoSettingArea->onUpdateFilterImage(&image); }); // 当前设备断开连接,给出无摄像头提示 - connect(Camera::instance(), &Camera::currentCameraDisConnected, this, [=](){ + connect(Camera::instance(), &Camera::currentCameraDisConnected, this, [=]() { Camera::instance()->stopCamera(); DataManager::instance()->setdevStatus(NOCAM); m_videoPre->showNocam(); QImage image; m_takePhotoSettingArea->onUpdateFilterImage(&image); }); - connect(Camera::instance(), &Camera::cameraCannotUsed, this, [=](){ + connect(Camera::instance(), &Camera::cameraCannotUsed, this, [=]() { DataManager::instance()->setdevStatus(CAM_CANNOT_USE); m_videoPre->showCamUsed(); }); + qCDebug(appLog) << "Function completed: initCameraConnection"; } void CMainWindow::initRightButtons() { + qCDebug(appLog) << "Function started: initRightButtons"; m_cameraSwitchBtn = new SwitchCameraBtn(this); m_cameraSwitchBtn->setFixedSize(SwitchcameraDiam, SwitchcameraDiam); m_cameraSwitchBtn->setObjectName(CAMERA_SWITCH_BTN); @@ -1944,7 +2153,7 @@ void CMainWindow::initRightButtons() m_cameraSwitchBtn->setToolTip(tr("Switch Cameras")); m_photoRecordBtn = new photoRecordBtn(this); - m_photoRecordBtn->setFixedSize(photeRecordDiam, photeRecordDiam); + m_photoRecordBtn->setFixedSize(photoRecordDiam, photoRecordDiam); m_photoRecordBtn->setObjectName(BUTTON_PICTURE_VIDEO); m_photoRecordBtn->setAccessibleName(BUTTON_PICTURE_VIDEO); m_photoRecordBtn->setToolTip(tr("Photo")); @@ -1982,17 +2191,19 @@ void CMainWindow::initRightButtons() //摄像头切换成功信号 connect(m_videoPre, SIGNAL(switchCameraSuccess(const QString &)), this, SLOT(onSwitchCameraSuccess(const QString &))); locateRightButtons(); + qCDebug(appLog) << "Function completed: initRightButtons"; } void CMainWindow::locateRightButtons() { + qCDebug(appLog) << "Function started: locateRightButtons"; if (nullptr == m_photoRecordBtn) { return; } - int buttonCenterX = width() - rightOffset - photeRecordDiam / 2; + int buttonCenterX = width() - rightOffset - photoRecordDiam / 2; int buttonCenterY = height() / 2; - int photoRecordLeftX = buttonCenterX - photeRecordDiam / 2; - int photoRecordLeftY = buttonCenterY - photeRecordDiam / 2; + int photoRecordLeftX = buttonCenterX - photoRecordDiam / 2; + int photoRecordLeftY = buttonCenterY - photoRecordDiam / 2; m_photoRecordBtn->move(photoRecordLeftX, photoRecordLeftY); int switchCameraOffset = height() / 15; @@ -2001,38 +2212,50 @@ void CMainWindow::locateRightButtons() m_cameraSwitchBtn->move(switchCameraX, switchCameraY); int switchBtnX = buttonCenterX - switchBtnWidth / 2; - int switchBtnY = photoRecordLeftY + photeRecordDiam; + int switchBtnY = photoRecordLeftY + photoRecordDiam; m_modeSwitchBox->move(switchBtnX, switchBtnY); int snapLabelOffset = height() / 10; int snapLabelX = buttonCenterX - snapLabelDiam / 2; int snapLabelY = switchBtnY + switchBtnHeight * 2 + snapLabelOffset; m_snapshotLabel->move(snapLabelX, snapLabelY); + qCDebug(appLog) << "Function completed: locateRightButtons"; } void CMainWindow::setSelBtnHide() { + qCDebug(appLog) << "Function started: setSelBtnHide"; m_bSwitchCameraShowEnable = false; if (!m_cameraSwitchBtn->isHidden()) { showChildWidget(); } + qCDebug(appLog) << "Function completed: setSelBtnHide"; } void CMainWindow::onLocalTimeChanged() { + qCDebug(appLog) << "Function started: onLocalTimeChanged"; m_SpaceKeyInterval = QDateTime::currentMSecsSinceEpoch(); } void CMainWindow::setSelBtnShow() { + qCDebug(appLog) << "Function started: setSelBtnShow"; + // 有效设备个数小于等于1,不显示切换按钮 + if (m_videoPre->getValidDeviceNum() <= 1) { + return; + } + m_bSwitchCameraShowEnable = true; if (m_cameraSwitchBtn->isHidden()) { showChildWidget(); } + qCDebug(appLog) << "Function completed: setSelBtnShow"; } void CMainWindow::setupTitlebar() { + qCDebug(appLog) << "Function started: setupTitlebar"; m_pTitlebar = new Titlebar(this); m_titlemenu = new DMenu(this); m_actionSettings = new QAction(tr("Settings"), this); @@ -2050,10 +2273,12 @@ void CMainWindow::setupTitlebar() m_pTitlebar->move(0, 0); m_pTitlebar->setFixedHeight(50); + qCDebug(appLog) << "Function completed: setupTitlebar"; } void CMainWindow::resizeEvent(QResizeEvent *event) { + // qDebug() << "Function started: resizeEvent"; Q_UNUSED(event); if (m_labelCameraName && m_bUIinit) { m_labelCameraName->move((width() - labelCameraNameWidth) / 2, height() - 20 - labelCameraNameHeight); @@ -2068,16 +2293,18 @@ void CMainWindow::resizeEvent(QResizeEvent *event) m_pTitlebar->setFixedWidth(this->size().width()); m_pTitlebar->titlebar()->setFixedWidth(this->size().width()); - QTimer::singleShot(1, this, [ = ] { + QTimer::singleShot(1, this, [=] { if (nullptr != m_takePhotoSettingArea) { m_takePhotoSettingArea->moveToParentLeft(); m_takePhotoSettingArea->resizeScrollHeight(height() - minWindowHeight); } }); + // qDebug() << "Function completed: resizeEvent"; } void CMainWindow::closeEvent(QCloseEvent *event) { + // qDebug() << "Function started: closeEvent"; if (m_videoPre->getCapStatus()) { CloseDialog closeDlg(this, tr("Video recording is in progress. Close the window?")); closeDlg.setObjectName(CLOSE_DIALOG); @@ -2103,25 +2330,30 @@ void CMainWindow::closeEvent(QCloseEvent *event) } #endif } + // qDebug() << "Function completed: closeEvent"; } void CMainWindow::changeEvent(QEvent *event) { + // qDebug() << "Function started: changeEvent"; Q_UNUSED(event); if (windowState() & Qt::WindowMinimized) { onStopPhotoAndRecord(); } + // qDebug() << "Function completed: changeEvent"; } void CMainWindow::onSettingsDlgClose() { + qCDebug(appLog) << "Function started: onSettingsDlgClose"; bool bPathChanged = false; QString setVideoPath = lastOpenedPath(QStandardPaths::MoviesLocation); - QString setPicPath = lastOpenedPath(QStandardPaths::PicturesLocation); + QString setPicPath = lastOpenedPath(QStandardPaths::PicturesLocation); //判断图片路径是否改变 - if (m_picPath != setPicPath) { //图片路径修改了 + if (m_picPath != setPicPath) { //图片路径修改了 + qCDebug(appLog) << "the picture path is changed"; QDir setPicDir(setPicPath); QDir lastPicDir(m_picPath); setPicDir.cdUp(); @@ -2143,6 +2375,7 @@ void CMainWindow::onSettingsDlgClose() } if (m_videoPath != setVideoPath) { + qCDebug(appLog) << "the video path is changed"; QDir setVideoDir(setVideoPath); QDir lastVideoDir(m_videoPath); setVideoDir.cdUp(); @@ -2163,7 +2396,6 @@ void CMainWindow::onSettingsDlgClose() bPathChanged = true; } - int nContinuous = Settings::get().getOption("photosetting.photosnumber.takephotos").toInt(); int nDelayTime = Settings::get().getOption("photosetting.photosdelay.photodelays").toInt(); bool soundphoto = Settings::get().getOption("photosetting.audiosetting.soundswitchbtn").toBool(); @@ -2209,47 +2441,53 @@ void CMainWindow::onSettingsDlgClose() void CMainWindow::onEnableSettings(bool bTrue) { + qCDebug(appLog) << "Function started: onEnableSettings"; m_actionSettings->setEnabled(bTrue); } void CMainWindow::onTakePicDone() { + qCDebug(appLog) << "Function started: onTakePicOnce"; onEnableSettings(true); } void CMainWindow::onTakePicOnce() { - qDebug() << "onTakePicOnce"; + qCDebug(appLog) << "onTakePicOnce"; } void CMainWindow::onTakePicCancel() { + qCDebug(appLog) << "Function started: onTakePicCancel"; onEnableSettings(true); } void CMainWindow::onTakeVdDone() { + qCDebug(appLog) << "Function started: onTakeVdDone"; onEnableSettings(true); - QTimer::singleShot(200, this, [ = ] { + QTimer::singleShot(200, this, [=] { QString strFileName = m_videoPath + QDir::separator() + DataManager::instance()->getstrFileName(); QFile file(strFileName); if (!file.exists()) usleep(200000); - }); - qDebug() << "Taking video completed!"; + qCDebug(appLog) << "Taking video completed!"; reflushSnapshotLabel(); + qCDebug(appLog) << "Function completed: onTakeVdDone"; } void CMainWindow::onTakeVdCancel() //保存视频完成,通过已有的文件检测实现缩略图恢复,这里不需要额外处理 { + qCDebug(appLog) << "Function started: onTakeVdCancel"; onEnableSettings(true); } bool CMainWindow::eventFilter(QObject *obj, QEvent *e) { + // qDebug() << "Function started: eventFilter"; /** * @brief 关注焦点进入事件和鼠标点击事件。 * 焦点进入:设置对应控件索引序号。 @@ -2283,8 +2521,9 @@ bool CMainWindow::eventFilter(QObject *obj, QEvent *e) DataManager::instance()->m_tabIndex = 0; m_pTitlebar->setFocus(); } else { - QWidget::eventFilter(obj, e);//调用父类事件过滤器 + QWidget::eventFilter(obj, e); //调用父类事件过滤器 } + // qDebug() << "Function completed: eventFilter"; return QWidget::eventFilter(obj, e); } @@ -2298,8 +2537,10 @@ bool CMainWindow::eventFilter(QObject *obj, QEvent *e) void CMainWindow::showChildWidget() { + qCDebug(appLog) << "Function started: showChildWidget"; //正在拍照过程中 if (photoNormal != m_photoState) { + qCDebug(appLog) << "正在拍照过程中"; showWidget(m_cameraSwitchBtn, false); showWidget(m_snapshotLabel, false); showWidget(m_modeSwitchBox, false); @@ -2308,7 +2549,8 @@ void CMainWindow::showChildWidget() showWidget(m_filterName, false); return; } - if (m_bRecording) { //正在录像 + if (m_bRecording) { //正在录像 + qCDebug(appLog) << "正在录像"; showWidget(m_cameraSwitchBtn, false); showWidget(m_snapshotLabel, false); showWidget(m_modeSwitchBox, false); @@ -2316,17 +2558,23 @@ void CMainWindow::showChildWidget() showWidget(m_photoRecordBtn, true); return; } + + // 8k分辨率时不显示录像功能 + bool isResolutionTooHigh = checkResolutionTooHigh(); showWidget(m_snapshotLabel, true); showWidget(m_cameraSwitchBtn, m_bSwitchCameraShowEnable); - showWidget(m_modeSwitchBox, true); + showWidget(m_modeSwitchBox, !isResolutionTooHigh); showWidget(m_photoRecordBtn, true); showWidget(m_takePhotoSettingArea, true); showWidget(m_filterName, m_bShowFilterName); + qCDebug(appLog) << "Function completed: showChildWidget"; } void CMainWindow::showWidget(DWidget *widget, bool bShow) { + qCDebug(appLog) << "Function started: showWidget"; if (widget) { + qCDebug(appLog) << "widget"; if (!bShow) { widget->hide(); } @@ -2335,23 +2583,43 @@ void CMainWindow::showWidget(DWidget *widget, bool bShow) widget->show(); } } + qCDebug(appLog) << "Function completed: showWidget"; +} + +bool CMainWindow::checkResolutionTooHigh() const +{ + int currentWidth = 0; + int currentHeight = 0; + v4l2_dev_t *fd = get_v4l2_device_handler(); + if (fd) { + currentWidth = v4l2core_get_frame_width(fd); + currentHeight = v4l2core_get_frame_height(fd); + } + bool isTrue = currentWidth > MAX_WIDTH_LIMIT || currentHeight > MAX_HEIGHT_LIMIT; + qCInfo(appLog) << __func__ << isTrue << currentWidth << "x" << currentHeight; + + return isTrue; } CMainWindow::~CMainWindow() { + // qDebug() << "Function started: CMainWindow destructor"; if (m_devnumMonitor) { + // qDebug() << "m_devnumMonitor"; m_devnumMonitor->deleteLater(); m_devnumMonitor = nullptr; } if (m_videoPre) { + // qDebug() << "m_videoPre"; m_videoPre->deleteLater(); m_videoPre = nullptr; } if (m_windowStateThread) { + // qDebug() << "m_windowStateThread"; m_windowStateThread->requestInterruption(); m_windowStateThread->wait(); m_windowStateThread->deleteLater(); } - qDebug() << "stop_encoder_thread"; + // qDebug() << "stop_encoder_thread"; } diff --git a/src/src/mainwindow.h b/src/src/mainwindow.h index d76d46a31..b253486a9 100644 --- a/src/src/mainwindow.h +++ b/src/src/mainwindow.h @@ -201,6 +201,11 @@ class CMainWindow : public DMainWindow */ void getMediaFileInfoList(const QString &path, QFileInfoList &fileList); + /** + * @brief 检测分辨率是否太高,8K分辨率不显示录像功能 + */ + bool checkResolutionTooHigh() const; + private slots: /** * @brief setSelBtnHide 设置切换相机按钮隐藏 @@ -293,6 +298,7 @@ private slots: */ void onTrashFile(const QString &fileName); +public slots: /** * @brief onSwitchPhotoBtnClked 拍照按钮点击 */ @@ -309,6 +315,7 @@ private slots: */ void onModeSwitchBoxValueChanged(int); +private slots: /** * @brief onPhotoRecordBtnClked 拍照/录像按钮点击事件 */ @@ -385,6 +392,10 @@ private slots: * @param name 待设置的滤镜名称 */ void onSetFilterName(const QString& name); + /** + * @brief updateSizeMode 紧凑模式信号 + */ + void updateSizeMode(); protected: @@ -415,6 +426,12 @@ private slots: public: static const int minWindowWidth;//最小窗口宽度 static const int minWindowHeight;//最小窗口高度 + + /** + * @brief getVideoWidget 获取视频预览组件 + * @return 视频预览组件指针 + */ + videowidget* getVideoWidget() { return m_videoPre; } private: enum ActType m_nActTpye; diff --git a/src/src/majorimageprocessingthread.cpp b/src/src/majorimageprocessingthread.cpp index 1aef0dc39..3dd1a9207 100644 --- a/src/src/majorimageprocessingthread.cpp +++ b/src/src/majorimageprocessingthread.cpp @@ -1,14 +1,20 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "majorimageprocessingthread.h" #include "datamanager.h" #include "camera.h" +#include "ddlog.h" +using namespace DDLog; extern "C" { -#include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + #include +#else + #include +#endif } #include @@ -19,7 +25,7 @@ DCORE_USE_NAMESPACE MajorImageProcessingThread::MajorImageProcessingThread():m_bHorizontalMirror(false) { - m_yuvPtr = nullptr; + qCDebug(appLog) << "Initializing MajorImageProcessingThread"; m_rgbPtr = nullptr; m_bRecording = false; m_nVdWidth = 0; @@ -34,11 +40,13 @@ MajorImageProcessingThread::MajorImageProcessingThread():m_bHorizontalMirror(fal void MajorImageProcessingThread::stop() { + qCDebug(appLog) << __func__; m_stopped = 1; } void MajorImageProcessingThread::init() { + qCDebug(appLog) << "Initializing thread state"; m_stopped = 0; m_majorindex = -1; m_frame = nullptr; @@ -51,21 +59,25 @@ void MajorImageProcessingThread::init() void MajorImageProcessingThread::setFilter(QString filter) { + // qDebug() << "Setting filter:" << filter; m_filter = filter; } void MajorImageProcessingThread::setExposure(int exposure) { + // qDebug() << "Setting exposure value:" << exposure; m_exposure = exposure; } int MajorImageProcessingThread::getRecCount() { + // qDebug() << "Getting recording count:" << m_nCount; return m_nCount; } void MajorImageProcessingThread::ImageHorizontalMirror(const uint8_t* src, uint8_t* dst, int width, int height) { + qCDebug(appLog) << "Function started: ImageHorizontalMirror"; /* yu12 y1 y2 y3 y4 y4 y3 y2 y1 @@ -89,15 +101,18 @@ void MajorImageProcessingThread::ImageHorizontalMirror(const uint8_t* src, uint8 uvLineStartIndex += width; } } + qCDebug(appLog) << "Function completed: ImageHorizontalMirror"; } void MajorImageProcessingThread::processingImage(QImage& img) { + qCDebug(appLog) << "Processing image, size:" << img.size() << "format:" << img.format(); // 镜像 if (!m_bHorizontalMirror) img = img.mirrored(true,false); if (m_bPhoto) { + qCDebug(appLog) << "Processing image in photo mode"; img = img.convertToFormat(QImage::Format_RGB888); // 滤镜预览 @@ -105,6 +120,7 @@ void MajorImageProcessingThread::processingImage(QImage& img) emit SendFilterImageProcessing(&m_filterImg); if (!m_filter.isEmpty() || m_exposure) { + qCDebug(appLog) << "Applying filter:" << m_filter << "and exposure:" << m_exposure; // 滤镜效果渲染 uint8_t *rgb = img.bits(); if (!m_filter.isEmpty()) @@ -116,16 +132,18 @@ void MajorImageProcessingThread::processingImage(QImage& img) /*拍照*/ if (m_bTake) { + qCDebug(appLog) << "Processing photo in photo mode"; int nRet = -1; if (!img.isNull()) { if (img.save(m_strPath, "JPG")) { nRet = 0; - emit sigReflushSnapshotLabel(); + qCInfo(appLog) << "Successfully saved photo to:" << m_strPath; + emit sigReflushSnapshotLabel(m_strPath); } } if (nRet < 0) { - qWarning() << "保存照片失败"; + qCWarning(appLog) << "Failed to save photo to:" << m_strPath; } m_bTake = false; @@ -134,11 +152,14 @@ void MajorImageProcessingThread::processingImage(QImage& img) } emit SendMajorImageProcessing(&img, 0); + qCDebug(appLog) << "Function completed: processingImage"; } void MajorImageProcessingThread::run() { + qCInfo(appLog) << "Starting MajorImageProcessingThread run loop"; if (m_eEncodeEnv != QCamera_Env) { + qCDebug(appLog) << "Processing video frame in video mode"; m_videoDevice = get_v4l2_device_handler(); v4l2core_start_stream(m_videoDevice); int framedely = 0; @@ -148,6 +169,7 @@ void MajorImageProcessingThread::run() uint8_t* pOldYuvFrame = nullptr; while (m_stopped == 0) { if (get_resolution_status()) { + // qDebug() << "Resolution change detected, updating format"; //reset request_format_update(0); v4l2core_stop_stream(m_videoDevice); @@ -158,6 +180,7 @@ void MajorImageProcessingThread::run() int ret = v4l2core_update_current_format(m_videoDevice); if (ret != E_OK) { + qCWarning(appLog) << "Failed to set defined stream format, trying first listed format"; fprintf(stderr, "camera: could not set the defined stream format\n"); fprintf(stderr, "camera: trying first listed stream format\n"); @@ -166,13 +189,14 @@ void MajorImageProcessingThread::run() ret = v4l2core_update_current_format(m_videoDevice); if (ret != E_OK) { + qCritical() << "Failed to set first listed stream format, stopping thread"; fprintf(stderr, "camera: also could not set the first listed stream format\n"); stop(); } - } v4l2core_start_stream(m_videoDevice); + // qDebug() << "Stream restarted with new format"; //保存新的分辨率//后续修改为标准Qt用法 QString config_file = QString(getenv("HOME")) + QDir::separator() + QString(".config") + QDir::separator() + QString("deepin") + @@ -188,37 +212,50 @@ void MajorImageProcessingThread::run() v4l2_device_list_t *devlist = get_device_list(); set_device_name(devlist->list_devices[get_v4l2_device_handler()->this_device].name); config_save(config_file.toLatin1().data()); + // qDebug() << "Saved new resolution config:" << my_config->width << "x" << my_config->height; } m_result = -1; - m_frame = v4l2core_get_decoded_frame(m_videoDevice); + if (config_get()->verbosity > 0) { + static QElapsedTimer decodeTimer; + static int decodeCount = 0; + if (decodeCount % LOGGING_INTERVAL == LOGGING_INTERVAL - 1) { + decodeTimer.start(); + m_frame = v4l2core_get_decoded_frame(m_videoDevice); + qCDebug(appLog) << "v4l2 decoded time:" << decodeTimer.elapsed() << "ms"; + decodeCount = 0; + } else { + m_frame = v4l2core_get_decoded_frame(m_videoDevice); + decodeCount++; + } + } else { + m_frame = v4l2core_get_decoded_frame(m_videoDevice); + } if (m_frame == nullptr) { framedely++; if (framedely == MAX_DELAYED_FRAMES) { + // qWarning() << "Reached maximum delayed frames, stopping thread"; m_stopped = 1; //发送设备中断信号 emit reachMaxDelayedFrames(); m_filterImg = QImage(); emit SendFilterImageProcessing(&m_filterImg); - // close_v4l2_device_handler(); } continue; } QImage jpgImage; if (FFmpeg_Env == m_eEncodeEnv) { + // qDebug() << "Processing video frame in FFmpeg environment"; // FFmpeg环境下,解码后的帧数据为yu12格式 if (m_nVdWidth != static_cast(m_frame->width) || m_nVdHeight != static_cast(m_frame->height)) { m_nVdWidth = static_cast(m_frame->width); m_nVdHeight = static_cast(m_frame->height); - if (m_yuvPtr != nullptr) { - delete [] m_yuvPtr; - m_yuvPtr = nullptr; - } + m_yuvPtr.reset(); yuvsize = m_nVdWidth * m_nVdHeight * 3 / 2; - m_yuvPtr = new uchar[yuvsize]; + m_yuvPtr = std::shared_ptr(new uchar[yuvsize]); if (m_rgbPtr != nullptr) { free(m_rgbPtr); m_rgbPtr = nullptr; @@ -231,13 +268,14 @@ void MajorImageProcessingThread::run() } if (m_bHorizontalMirror) { - ImageHorizontalMirror(m_frame->yuv_frame, m_yuvPtr,m_frame->width,m_frame->height); + ImageHorizontalMirror(m_frame->yuv_frame, m_yuvPtr.get(), m_frame->width, m_frame->height); } else { - memcpy(m_yuvPtr, m_frame->yuv_frame, yuvsize); + memcpy(m_yuvPtr.get(), m_frame->yuv_frame, yuvsize); } pOldYuvFrame = m_frame->yuv_frame; - m_frame->yuv_frame = m_yuvPtr; + m_frame->yuv_frame = m_yuvPtr.get(); } else if (GStreamer_Env == m_eEncodeEnv) { + // qDebug() << "Processing video frame in GStreamer environment"; // GStreamer环境下,获取的帧数据为jpg格式,需要转换为rgb格式,GStreamer底层才能处理 QByteArray temp; temp.append((const char *)m_frame->raw_frame, m_frame->raw_frame_max_size); @@ -252,9 +290,6 @@ void MajorImageProcessingThread::run() #if defined(_loongarch) || defined(__loongarch__) || defined(__loongarch64) || defined (__mips__) bUseRgb = true; #endif - if(DSysInfo::majorVersion() == "23") { - bUseRgb = true; - } if (get_wayland_status()) bUseRgb = true; @@ -265,7 +300,16 @@ void MajorImageProcessingThread::run() if (GStreamer_Env == m_eEncodeEnv) bUseRgb = true; + // DConfig配置控制RGB数据使用模式,-1表示不设置(由系统自动判断),0表示强制关闭,1表示强制开启 + int useRgbData = DataManager::instance()->getUseRgbData(); + if (useRgbData == 1) { + bUseRgb = true; + } else if (useRgbData == 0) { + bUseRgb = false; + } + if (bUseRgb || (m_bPhoto && m_filtersGroupDislay)) { + // qDebug() << "Processing video frame in rgb mode"; if (m_nVdWidth != static_cast(m_frame->width) || m_nVdHeight != static_cast(m_frame->height)) { m_nVdWidth = static_cast(m_frame->width); m_nVdHeight = static_cast(m_frame->height); @@ -294,6 +338,7 @@ void MajorImageProcessingThread::run() // 拍照状态下,曝光和滤镜功能才有效 if (m_bPhoto) { + // qDebug() << "Processing photo in photo mode"; // 滤镜效果渲染 if (!m_filter.isEmpty()) imageFilter24(m_rgbPtr, m_frame->width, m_frame->height, m_filter.toStdString().c_str(), 100); @@ -305,7 +350,7 @@ void MajorImageProcessingThread::run() /*录像*/ if (video_capture_get_save_video()) { - + // qDebug() << "Processing video frame for recording"; if (get_myvideo_bebin_timer() == 0) set_myvideo_begin_timer(v4l2core_time_get_timestamp()); @@ -327,19 +372,24 @@ void MajorImageProcessingThread::run() size = static_cast(m_frame->raw_frame_size); break; } - } /*把帧加入编码队列*/ if (!get_capture_pause()) { + // qDebug() << "Processing video frame for recording"; //设置时间戳 set_video_timestamptmp(static_cast(m_frame->timestamp)); + if (m_firstPts == 0) { m_firstPts = m_frame->timestamp; + // qDebug() << "First video frame timestamp:" << m_firstPts; } m_nCount = (m_frame->timestamp - m_firstPts) / 1000000000; + + lasttimestamp = m_frame->timestamp; encoder_add_video_frame(input_frame, size, static_cast(m_frame->timestamp), m_frame->isKeyframe); } else { + // qDebug() << "Processing video frame for recording"; //设置暂停时长 timespausestamp = get_video_timestamptmp(); if (timespausestamp == 0) { @@ -347,7 +397,6 @@ void MajorImageProcessingThread::run() } else { set_video_pause_timestamp(static_cast(m_frame->timestamp) - timespausestamp); } - } /* @@ -357,6 +406,7 @@ void MajorImageProcessingThread::run() */ double time_sched = encoder_buff_scheduler(ENCODER_SCHED_LIN, 0.5, 250); if (time_sched > 0) { + // qDebug() << "Processing video frame for recording"; switch (v4l2core_get_requested_frame_format(m_videoDevice)) { case V4L2_PIX_FMT_H264: { uint32_t framerate = static_cast(lround(time_sched * 1E6)); /*nanosec*/ @@ -370,13 +420,13 @@ void MajorImageProcessingThread::run() break; } } - } - } else if (m_bRecording) { + // qDebug() << "Processing video frame for recording"; // GStreamer环境下,发送rgb格式帧数据到视频写入器,完成后续视频编码任务 emit sigRecordFrame(m_rgbPtr, rgbsize); } else { + // qDebug() << "Processing video frame for recording"; m_nCount = 0; m_firstPts = 0; } @@ -387,21 +437,22 @@ void MajorImageProcessingThread::run() /*拍照*/ if (m_bTake) { + // qDebug() << "Processing photo capture"; int nRet = -1; if (((!m_filter.isEmpty() || m_exposure) && imgTmp) || GStreamer_Env == m_eEncodeEnv) { + // qDebug() << "Processing photo capture"; if (imgTmp->save(m_strPath, "JPG")) { nRet = 0; - emit sigReflushSnapshotLabel(); // + qCInfo(appLog) << "Successfully saved photo to:" << m_strPath; + emit sigReflushSnapshotLabel(m_strPath); } } else if (FFmpeg_Env == m_eEncodeEnv) { - //nRet = v4l2core_save_image(m_frame, m_strPath.toStdString().c_str(), IMG_FMT_JPG); - + // qDebug() << "Processing photo capture"; uint8_t *rgbPtr = nullptr; uint nVdWidth = static_cast(m_frame->width); uint nVdHeight = static_cast(m_frame->height); - rgbsize = nVdWidth * nVdHeight * 3; rgbPtr = static_cast(calloc(rgbsize, sizeof(uint8_t))); @@ -411,7 +462,8 @@ void MajorImageProcessingThread::run() saveImg = new QImage(rgbPtr, m_frame->width, m_frame->height, QImage::Format_RGB888); if (saveImg->save(m_strPath, "JPG")) { nRet = 0; - emit sigReflushSnapshotLabel(); + qCInfo(appLog) << "Successfully saved photo to:" << m_strPath; + emit sigReflushSnapshotLabel(m_strPath); } if (saveImg) delete saveImg; @@ -423,7 +475,7 @@ void MajorImageProcessingThread::run() } if (nRet < 0) { - qWarning() << "保存照片失败"; + qCWarning(appLog) << "Failed to save photo to:" << m_strPath; } m_bTake = false; @@ -466,27 +518,29 @@ void MajorImageProcessingThread::run() #ifdef UNITTEST break; #endif - //保证画面流畅的前提下降低刷新率 - msleep(33); + // 保证画面流畅的前提下降低刷新率 + // 无延迟模式下可能增加CPU/GPU负载,某些客户要求更加实时的效果会使用此配置。 + static bool noDelay = DataManager::instance()->isPreviewNoDelay(); + if (!noDelay && m_nVdWidth <= 1920) { + msleep(33); + } } + // qDebug() << "Stopping video stream"; v4l2core_stop_stream(m_videoDevice); } } MajorImageProcessingThread::~MajorImageProcessingThread() { - - if (m_yuvPtr) { - delete [] m_yuvPtr; - m_yuvPtr = nullptr; - } + m_yuvPtr.reset(); if (m_rgbPtr) { + // qDebug() << "Cleaning up MajorImageProcessingThread resources"; free(m_rgbPtr); m_rgbPtr = nullptr; } config_clean(); - qDebug() << "~MajorImageProcessingThread"; + // qDebug() << "MajorImageProcessingThread cleanup complete"; } diff --git a/src/src/majorimageprocessingthread.h b/src/src/majorimageprocessingthread.h index 109df5610..e5930e912 100644 --- a/src/src/majorimageprocessingthread.h +++ b/src/src/majorimageprocessingthread.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include "datamanager.h" @@ -127,16 +129,16 @@ class MajorImageProcessingThread : public QThread /** * @brief sigReflushSnapshotLabel 发送刷新照片预览图信号 */ - void sigReflushSnapshotLabel(); + void sigReflushSnapshotLabel(const QString &filePath); #ifndef __mips__ /** * @brief sigYUVFrame YUV框架信号 - * @param yuv YUV + * @param yuv YUV数据(shared_ptr持有所有权,跨线程安全) * @param width 宽度 * @param height 高度 */ - void sigYUVFrame(uchar *yuv, uint width, uint height); + void sigYUVFrame(std::shared_ptr yuv, uint width, uint height); /** * @brief sigRenderYuv 发送Yuv信号 @@ -179,7 +181,7 @@ public slots: QAtomicInt m_stopped; v4l2_dev_t *m_videoDevice; v4l2_frame_buff_t *m_frame; - uint8_t *m_yuvPtr;// yu12视频帧数据 + std::shared_ptr m_yuvPtr;// yu12视频帧数据(shared_ptr管理生命周期) uint8_t *m_rgbPtr;// rgb视频帧数据 bool m_bPhoto = true; //相机当前状态,默认为拍照状态 @@ -191,6 +193,8 @@ public slots: int m_nCount; uint64_t m_firstPts; + uint64_t lasttimestamp; + QImage m_Img; //mips、wayland下使用该变量 QImage m_filterImg; //滤镜预览类使用 大小40*40 QImage m_jpgImage; // 从v4l2获取的jpg格式的视频帧图片 diff --git a/src/src/photorecordbtn.cpp b/src/src/photorecordbtn.cpp index 6fc059689..03033a8e9 100644 --- a/src/src/photorecordbtn.cpp +++ b/src/src/photorecordbtn.cpp @@ -5,12 +5,15 @@ #include "photorecordbtn.h" +#if QT_VERSION_MAJOR <= 5 #include +#else +#include +#endif #include #include #include -#include #include photoRecordBtn::photoRecordBtn(QWidget *parent/* = nullptr*/) @@ -20,16 +23,21 @@ photoRecordBtn::photoRecordBtn(QWidget *parent/* = nullptr*/) m_bPress(false), m_recordState(Normal) { - + // qDebug() << "Function started: photoRecordBtn constructor"; } void photoRecordBtn::paintEvent(QPaintEvent *event) { + // qDebug() << "Function started: paintEvent"; Q_UNUSED(event); QPainter painter(this); +#if QT_VERSION_MAJOR <= 5 painter.setRenderHint(QPainter::HighQualityAntialiasing, true); +#else + painter.setRenderHint(QPainter::Antialiasing, true); +#endif painter.setBrush(Qt::NoBrush); QPainterPath path; @@ -55,10 +63,13 @@ void photoRecordBtn::paintEvent(QPaintEvent *event) if (!m_bPhoto) { + // qDebug() << "Entering if (!m_bPhoto)"; if (Normal == m_recordState){ + // qDebug() << "Entering if (Normal == m_recordState)"; rect.setTopLeft(QPoint(11, 11)); rect.setSize(QSize(42, 42)); if (m_bPress) { + // qDebug() << "Entering if (m_bPress)"; rect.setTopLeft(QPoint(13, 13)); rect.setSize(QSize(38,38)); } @@ -66,6 +77,7 @@ void photoRecordBtn::paintEvent(QPaintEvent *event) painter.setBrush(QBrush(QColor(0xff,0x57,0x36,0xff))); painter.drawEllipse(rect); } else if (preRecord == m_recordState){ + // qDebug() << "Entering if (preRecord == m_recordState)"; rect.setTopLeft(QPoint(20, 20)); rect.setSize(QSize(24, 24)); painter.setPen(Qt::NoPen); @@ -78,6 +90,7 @@ void photoRecordBtn::paintEvent(QPaintEvent *event) painter.setBrush(QBrush(QColor(255,255,255,0xff))); painter.drawRoundedRect(rect,4,4); } else if (Recording == m_recordState){ + // qDebug() << "Entering if (Recording == m_recordState)"; rect.setTopLeft(QPoint(11, 11)); rect.setSize(QSize(42, 42)); painter.setPen(Qt::NoPen); @@ -92,9 +105,11 @@ void photoRecordBtn::paintEvent(QPaintEvent *event) } } else { + // qDebug() << "Entering else"; rect.setTopLeft(QPoint(11, 11)); rect.setSize(QSize(42, 42)); if (m_bPress) { + // qDebug() << "Entering if (m_bPress)"; rect.setTopLeft(QPoint(13, 13)); rect.setSize(QSize(38,38)); } @@ -102,66 +117,93 @@ void photoRecordBtn::paintEvent(QPaintEvent *event) painter.setBrush(QBrush(QColor(Qt::white))); painter.drawEllipse(rect); } + // qDebug() << "Function completed: photoRecordBtn::paintEvent"; } +#if QT_VERSION_MAJOR > 5 +void photoRecordBtn::enterEvent(QEnterEvent *event) +#else void photoRecordBtn::enterEvent(QEvent *event) +#endif { + // qDebug() << "Function started: photoRecordBtn::enterEvent"; Q_UNUSED(event); m_bFocus = true; update(); + // qDebug() << "Function completed: photoRecordBtn::enterEvent"; } void photoRecordBtn::leaveEvent(QEvent *event) { + // qDebug() << "Function started: photoRecordBtn::leaveEvent"; Q_UNUSED(event); m_bFocus = false; update(); + // qDebug() << "Function completed: photoRecordBtn::leaveEvent"; } void photoRecordBtn::mousePressEvent(QMouseEvent *event) { - if (event->type() == QEvent::MouseButtonDblClick) + // qDebug() << "Function started: photoRecordBtn::mousePressEvent"; + if (event->type() == QEvent::MouseButtonDblClick) { + // qDebug() << "photoRecordBtn::mousePressEvent: Enter if branch (mouse double click, returning early)"; return; //不响应双击事件 + } + // qDebug() << "photoRecordBtn::mousePressEvent: Setting focus to false and press to true"; m_bFocus = false; m_bPress = true; update(); + // qDebug() << "Function completed: photoRecordBtn::mousePressEvent"; } void photoRecordBtn::mouseMoveEvent(QMouseEvent *event) { - //解决bug 在按钮中可拖动相机界面,https://pms.uniontech.com/zentao/bug-view-100647.html + // qDebug() << "Function started: photoRecordBtn::mouseMoveEvent"; + //解决bug 在按钮中可拖动相机界面,bug 100647 Q_UNUSED(event); + // qDebug() << "Function completed: photoRecordBtn::mouseMoveEvent"; return; } void photoRecordBtn::mouseReleaseEvent(QMouseEvent *event) { + // qDebug() << "Function started: photoRecordBtn::mouseReleaseEvent"; m_bPress = false; - if (event->type() == QEvent::MouseButtonDblClick) + if (event->type() == QEvent::MouseButtonDblClick) { + // qDebug() << "photoRecordBtn::mouseReleaseEvent: Enter if branch (mouse double click, returning early)"; return; //不响应双击事件 + } - if (!rect().contains(event->pos())) + if (!rect().contains(event->pos())) { + // qDebug() << "photoRecordBtn::mouseReleaseEvent: Enter if branch (position not in rect, returning early)"; return; + } + // qDebug() << "photoRecordBtn::mouseReleaseEvent: Setting focus to true and emitting clicked signal"; m_bFocus= true; update(); emit clicked(); + // qDebug() << "Function completed: photoRecordBtn::mouseReleaseEvent"; } void photoRecordBtn::focusInEvent(QFocusEvent *event) { + // qDebug() << "Function started: photoRecordBtn::focusInEvent"; Q_UNUSED(event); m_bFocus= true; update(); + // qDebug() << "Function completed: photoRecordBtn::focusInEvent"; } void photoRecordBtn::focusOutEvent(QFocusEvent *event) { + // qDebug() << "Function started: photoRecordBtn::focusOutEvent"; Q_UNUSED(event); m_bFocus= false; update(); + // qDebug() << "Function completed: photoRecordBtn::focusOutEvent"; } diff --git a/src/src/photorecordbtn.h b/src/src/photorecordbtn.h index 26a18f490..79069ba4c 100644 --- a/src/src/photorecordbtn.h +++ b/src/src/photorecordbtn.h @@ -42,7 +42,11 @@ class photoRecordBtn : public QWidget void clicked(); protected: void paintEvent(QPaintEvent *event) override; +#if QT_VERSION_MAJOR > 5 + void enterEvent(QEnterEvent *event) override; +#else void enterEvent(QEvent *event) override; +#endif void leaveEvent(QEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; diff --git a/src/src/previewopenglwidget.cpp b/src/src/previewopenglwidget.cpp index 40b5c2390..6fe6d711a 100644 --- a/src/src/previewopenglwidget.cpp +++ b/src/src/previewopenglwidget.cpp @@ -1,54 +1,145 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "previewopenglwidget.h" +#if QT_VERSION_MAJOR > 5 +#include +#include +#else #include #include +#endif #include +#include "ddlog.h" +using namespace DDLog; + +namespace { + +constexpr const char *kCompatDefs = + "#if __VERSION__ < 130\n" + " #define IN attribute\n" + " #define OUT varying\n" + " #define FRAG_COLOR gl_FragColor\n" + " #define TEXTURE texture2D\n" + "#else\n" + " #define IN in\n" + " #define OUT out\n" + " #define FRAG_COLOR fragColor\n" + " #define TEXTURE texture\n" + "#endif\n"; + +constexpr const char *kVsrcLegacy = + "attribute vec4 vertexIn; " + "attribute vec2 textureIn; " + "varying vec2 textureOut; " + "void main(void) " + "{ " + " gl_Position = vertexIn;" + " textureOut = textureIn;" + "}"; + +constexpr const char *kVsrcModern = + "#version 150 core\n" + "in vec4 vertexIn;\n" + "in vec2 textureIn;\n" + "out vec2 textureOut;\n" + "void main(void)\n" + "{\n" + " gl_Position = vertexIn;\n" + " textureOut = textureIn;\n" + "}\n"; + +constexpr const char *kFsrcBody = + "uniform sampler2D tex_y; \n" + "uniform sampler2D tex_u; \n" + "uniform sampler2D tex_v; \n" + "void main(void) \n" + "{ \n" + " vec3 yuv; \n" + " vec3 rgb; \n" + " yuv.x = TEXTURE(tex_y, textureOut).r; \n" + " yuv.y = TEXTURE(tex_u, textureOut).r - 0.5;\n" + " yuv.z = TEXTURE(tex_v, textureOut).r - 0.5;\n" + " rgb = mat3( 1, 1, 1, \n" + " 0, -0.39465, 2.03211, \n" + " 1.13983, -0.58060, 0) * yuv; \n" + " FRAG_COLOR = vec4(rgb, 1); \n" + "}\n"; + +QByteArray makeLegacyFragmentShader(bool gles) +{ + QByteArray src; + src.reserve(512); + if (gles) { + src.append("precision mediump float;\n"); + } + src.append(kCompatDefs); + src.append("varying vec2 textureOut;\n"); + src.append(kFsrcBody); + return src; +} + +QByteArray makeModernFragmentShader() +{ + QByteArray src; + src.reserve(640); + src.append("#version 150 core\n"); + src.append("in vec2 textureOut;\n"); + src.append("out vec4 fragColor;\n"); + src.append(kFsrcBody); + return src; +} + +} // namespace PreviewOpenglWidget::PreviewOpenglWidget(QWidget *parent) : QOpenGLWidget(parent) { + qCDebug(appLog) << "Function started: PreviewOpenglWidget constructor"; m_textureY = nullptr; m_textureU = nullptr; m_textureV = nullptr; - m_yuvPtr = nullptr; m_program = nullptr; m_videoWidth = 0; m_videoHeight = 0; + qCDebug(appLog) << "Function completed: PreviewOpenglWidget constructor"; } int PreviewOpenglWidget::getFrameHeight() { + // qDebug() << "Function started: getFrameHeight"; return static_cast(m_videoHeight); } int PreviewOpenglWidget::getFrameWidth() { + // qDebug() << "Function started: getFrameWidth"; return static_cast(m_videoWidth); } #ifndef __mips__ -void PreviewOpenglWidget::slotShowYuv(uchar *ptr, uint width, uint height) +void PreviewOpenglWidget::slotShowYuv(std::shared_ptr frame, uint width, uint height) { - m_Rendermutex.lock(); - m_videoWidth = width; - m_videoHeight = height; - m_yuvPtr = ptr;//数据拷贝挪到major类 - - if (m_yuvPtr) - update(); - - m_Rendermutex.unlock(); + if (!frame) { + return; + } + { + QMutexLocker locker(&m_Rendermutex); + m_videoWidth = width; + m_videoHeight = height; + m_yuvFrame = std::move(frame); + } + update(); } #endif void PreviewOpenglWidget::initializeGL() { + qCDebug(appLog) << "Function started: initializeGL"; makeCurrent(); initializeOpenGLFunctions(); @@ -67,74 +158,57 @@ void PreviewOpenglWidget::initializeGL() 1.0f, 1.0f, }; + m_vao.create(); + m_vao.bind(); m_vbo.create(); m_vbo.bind(); m_vbo.allocate(vertices, sizeof(vertices)); - const char *vsrc = - "attribute vec4 vertexIn; \ - attribute vec2 textureIn; \ - varying vec2 textureOut; \ - void main(void) \ - { \ - gl_Position = vertexIn; \ - textureOut = textureIn; \ - }"; - - const char *fsrc; - - if (get_wayland_status() == 0) { - fsrc = "varying vec2 textureOut; \ - uniform sampler2D tex_y; \ - uniform sampler2D tex_u; \ - uniform sampler2D tex_v; \ - void main(void) \ - { \ - vec3 yuv; \ - vec3 rgb; \ - yuv.x = texture2D(tex_y, textureOut).r; \ - yuv.y = texture2D(tex_u, textureOut).r - 0.5; \ - yuv.z = texture2D(tex_v, textureOut).r - 0.5; \ - rgb = mat3( 1, 1, 1, \ - 0, -0.39465, 2.03211, \ - 1.13983, -0.58060, 0) * yuv; \ - gl_FragColor = vec4(rgb, 1); \ - }"; - } else { - fsrc = "#ifdef GL_ES \ - precision mediump float; \ - #endif \ - varying vec2 textureOut; \ - uniform sampler2D tex_y; \ - uniform sampler2D tex_u; \ - uniform sampler2D tex_v; \ - void main(void) \ - { \ - vec3 yuv; \ - vec3 rgb; \ - yuv.x = texture2D(tex_y, textureOut).r; \ - yuv.y = texture2D(tex_u, textureOut).r - 0.5; \ - yuv.z = texture2D(tex_v, textureOut).r - 0.5; \ - rgb = mat3( 1, 1, 1, \ - 0, -0.39465, 2.03211, \ - 1.13983, -0.58060, 0) * yuv; \ - gl_FragColor = vec4(rgb, 1); \ - }"; - } - m_program = new QOpenGLShaderProgram(this); m_textureY = new QOpenGLTexture(QOpenGLTexture::Target2D); m_textureU = new QOpenGLTexture(QOpenGLTexture::Target2D); m_textureV = new QOpenGLTexture(QOpenGLTexture::Target2D); - m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, vsrc); - m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, fsrc); - m_program->link(); + auto bindAttribs = [this] { + m_program->bindAttributeLocation("vertexIn", VERTEXIN); + m_program->bindAttributeLocation("textureIn", TEXTUREIN); + }; + auto tryLink = [&](const char *vsrc, const QByteArray &fsrc) { + bindAttribs(); + return m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, vsrc) + && m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, fsrc) + && m_program->link(); + }; + + bool programOk = false; + if (1 == is_forceGles()) { + programOk = tryLink(kVsrcLegacy, makeLegacyFragmentShader(true)); + if (!programOk) { + qCWarning(appLog) << "PreviewOpenglWidget: GLES shader failed, fallback to legacy GLSL:" << m_program->log(); + delete m_program; + m_program = new QOpenGLShaderProgram(this); + programOk = tryLink(kVsrcLegacy, makeLegacyFragmentShader(false)); + } + } else { + programOk = tryLink(kVsrcModern, makeModernFragmentShader()); + if (!programOk) { + qCWarning(appLog) << "PreviewOpenglWidget: core-profile shader failed, fallback to legacy GLSL:" << m_program->log(); + delete m_program; + m_program = new QOpenGLShaderProgram(this); + programOk = tryLink(kVsrcLegacy, makeLegacyFragmentShader(false)); + } + } + if (!programOk) { + qCWarning(appLog) << "PreviewOpenglWidget: shader program link failed:" << m_program->log(); + } + m_program->bind(); m_program->enableAttributeArray(VERTEXIN); m_program->enableAttributeArray(TEXTUREIN); - m_program->setAttributeBuffer(VERTEXIN, GL_FLOAT, 0, 2, 2 * sizeof(GLfloat)); - m_program->setAttributeBuffer(TEXTUREIN, GL_FLOAT, 8 * sizeof(GLfloat), 2, 2 * sizeof(GLfloat)); + constexpr int kVertexOffset = 0; + constexpr int kTexOffset = 8 * sizeof(GLfloat); + m_program->setAttributeBuffer(VERTEXIN, GL_FLOAT, kVertexOffset, 2, 2 * sizeof(GLfloat)); + m_program->setAttributeBuffer(TEXTUREIN, GL_FLOAT, kTexOffset, 2, 2 * sizeof(GLfloat)); m_textureUniformY = static_cast(m_program->uniformLocation("tex_y")); m_textureUniformU = static_cast(m_program->uniformLocation("tex_u")); @@ -146,66 +220,92 @@ void PreviewOpenglWidget::initializeGL() m_idY = m_textureY->textureId(); m_idU = m_textureU->textureId(); m_idV = m_textureV->textureId(); - glClearColor(0.0, 0.0, 0.0, 0.0); + + //纹理过滤与环绕参数只需在初始化时设置一次,避免每帧重复下发造成卡顿 + GLuint texIds[] = {m_idY, m_idU, m_idV}; + for (GLuint id : texIds) { + glBindTexture(GL_TEXTURE_2D, id); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + glBindTexture(GL_TEXTURE_2D, 0); + + glClearColor(0.0, 0.0, 0.0, 1.0); + qCDebug(appLog) << "Function completed: initializeGL"; } void PreviewOpenglWidget::resizeGL(int w, int h) { + // qDebug() << "Function started: resizeGL"; glViewport(0, 0, w, h); - update(); + // qDebug() << "Function completed: resizeGL"; } void PreviewOpenglWidget::paintGL() { - if (m_yuvPtr == nullptr) - return; - - glActiveTexture(GL_TEXTURE0); //激活纹理单元GL_TEXTURE0,系统里面的 - glBindTexture(GL_TEXTURE_2D, m_idY); //绑定y分量纹理对象id到激活的纹理单元 - - //使用内存中的数据创建真正的y分量纹理数据,https://blog.csdn.net/xipiaoyouzi/article/details/53584798 纹理参数解析 - glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, static_cast(m_videoWidth), static_cast(m_videoHeight), 0, GL_RED, GL_UNSIGNED_BYTE, m_yuvPtr); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - glActiveTexture(GL_TEXTURE1); //激活纹理单元GL_TEXTURE1 + std::shared_ptr localFrame; + uint localWidth = 0; + uint localHeight = 0; + { + QMutexLocker locker(&m_Rendermutex); + if (!m_yuvFrame) { + return; + } + localFrame = m_yuvFrame; + localWidth = m_videoWidth; + localHeight = m_videoHeight; + } + uchar *localYuvPtr = localFrame.get(); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + bool bReBuildImage = false; + if(m_imgSize != QSize(localWidth, localHeight)) { + bReBuildImage = true; + m_imgSize = QSize(localWidth, localHeight); + } + + m_vao.bind(); + m_program->bind(); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, m_idY); + + if( bReBuildImage ) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, static_cast(localWidth), static_cast(localHeight), 0, GL_RED, GL_UNSIGNED_BYTE, 0); + } + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, static_cast(localWidth), static_cast(localHeight), GL_RED, GL_UNSIGNED_BYTE, localYuvPtr); + + glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, m_idU); - //使用内存中的数据创建真正的u分量纹理数据 - glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, m_videoWidth >> 1, m_videoHeight >> 1, 0, GL_RED, GL_UNSIGNED_BYTE, m_yuvPtr + m_videoWidth * m_videoHeight); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + if( bReBuildImage ) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, localWidth >> 1, localHeight >> 1, 0, GL_RED, GL_UNSIGNED_BYTE, 0); + } + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, localWidth >> 1, localHeight >> 1, GL_RED, GL_UNSIGNED_BYTE, localYuvPtr + localWidth * localHeight); - glActiveTexture(GL_TEXTURE2); //激活纹理单元GL_TEXTURE2 + glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, m_idV); - //使用内存中的数据创建真正的v分量纹理数据 - glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, m_videoWidth >> 1, m_videoHeight >> 1, 0, GL_RED, GL_UNSIGNED_BYTE, m_yuvPtr + m_videoWidth * m_videoHeight * 5 / 4); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + if( bReBuildImage ) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, localWidth >> 1, localHeight >> 1, 0, GL_RED, GL_UNSIGNED_BYTE, 0); + } + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, localWidth >> 1, localHeight >> 1, GL_RED, GL_UNSIGNED_BYTE, localYuvPtr + localWidth * localHeight * 5 / 4); - //指定y纹理要使用新值 glUniform1i(static_cast(m_textureUniformY), 0); - - //指定u纹理要使用新值 glUniform1i(static_cast(m_textureUniformU), 1); - - //指定v纹理要使用新值 glUniform1i(static_cast(m_textureUniformV), 2); - //使用顶点数组方式绘制图形 glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } PreviewOpenglWidget::~PreviewOpenglWidget() { + makeCurrent(); + m_vao.destroy(); m_vbo.destroy(); if (m_textureY) { @@ -226,5 +326,9 @@ PreviewOpenglWidget::~PreviewOpenglWidget() m_textureV = nullptr; } + if (m_program) { + delete m_program; + m_program = nullptr; + } doneCurrent(); } diff --git a/src/src/previewopenglwidget.h b/src/src/previewopenglwidget.h index 1fb0789b6..224f282fd 100644 --- a/src/src/previewopenglwidget.h +++ b/src/src/previewopenglwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -10,10 +10,20 @@ #include #include +#include #include -#include #include +#if QT_VERSION_MAJOR > 5 +#include +#include +#include +#include +#include +#else +#include #include +#include +#endif QT_FORWARD_DECLARE_CLASS(QOpenGLShaderProgram) QT_FORWARD_DECLARE_CLASS(QOpenGLTexture) @@ -42,11 +52,11 @@ public slots: #ifndef __mips__ /** * @brief slotShowYuv 显示一帧Yuv图像 - * @param ptr 数据 + * @param frame YUV数据(shared_ptr持有所有权,保证paintGL期间数据有效) * @param width 宽度 * @param height 高度 */ - void slotShowYuv(uchar *ptr, uint width, uint height); + void slotShowYuv(std::shared_ptr frame, uint width, uint height); #endif protected: @@ -70,6 +80,7 @@ public slots: private: QMutex m_Rendermutex; QOpenGLBuffer m_vbo; + QOpenGLVertexArrayObject m_vao; QOpenGLShaderProgram *m_program; @@ -90,7 +101,8 @@ public slots: uint m_videoWidth; uint m_videoHeight; - uchar *m_yuvPtr; + std::shared_ptr m_yuvFrame; + QSize m_imgSize; }; #endif // PREVIEWOPENGLWIDGET_H diff --git a/src/src/qtsingleapplication/qtsingleapplication.cpp b/src/src/qtsingleapplication/qtsingleapplication.cpp index 1a5eca955..bac180c81 100644 --- a/src/src/qtsingleapplication/qtsingleapplication.cpp +++ b/src/src/qtsingleapplication/qtsingleapplication.cpp @@ -19,23 +19,29 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv) : QObject(nullptr) { + // qDebug() << "Function started: QtSingleApplication constructor"; #if (DTK_VERSION < DTK_VERSION_CHECK(5, 4, 0, 0)) _app = new DApplication(argc, argv); #else _app = DApplication::globalApplication(argc, argv); #endif + // qDebug() << "Function completed: QtSingleApplication constructor"; } DApplication *QtSingleApplication::dApplication() { + // qDebug() << "Entering dApplication"; return _app; } QtSingleApplication::~QtSingleApplication() { + // qDebug() << "Function started: QtSingleApplication destructor"; if (_app != nullptr) { + // qDebug() << "QtSingleApplication destructor: Enter if branch (app exists, deleting)"; _app->deleteLater(); _app = nullptr; } + // qDebug() << "Function completed: QtSingleApplication destructor"; } diff --git a/src/src/rollingbox.cpp b/src/src/rollingbox.cpp index 62107ec3e..9b210bbd9 100644 --- a/src/src/rollingbox.cpp +++ b/src/src/rollingbox.cpp @@ -9,8 +9,13 @@ #include #include #include +#include +#if QT_VERSION_MAJOR <= 5 #include +#else +#include +#endif #define BTN_WIDTH 50 #define BTN_HEIGHT 26 @@ -26,6 +31,7 @@ RollingBox::RollingBox(QWidget *parent) : m_deviation(0), m_textSize(15) //暂定15,后续修改 { + // qDebug() << "Initializing RollingBox"; setContentsMargins(0, 0, 0, 0); m_pressResetTimer = new QTimer(this); @@ -42,79 +48,105 @@ RollingBox::RollingBox(QWidget *parent) : shadowEffect->setColor(QColor(33, 33, 33, 125)); shadowEffect->setBlurRadius(8); this->setGraphicsEffect(shadowEffect); + // qDebug() << "Function completed: RollingBox constructor"; } void RollingBox::setRange(int min, int max) { + // qDebug() << "Setting range:" << min << "to" << max; m_rangeMin = min; m_rangeMax = max; - if(m_currentIndex < min) + if(m_currentIndex < min) { + // qDebug() << "Adjusting current index from" << m_currentIndex << "to minimum" << min; m_currentIndex = min; - if(m_currentIndex > max) + } + if(m_currentIndex > max) { + // qDebug() << "Adjusting current index from" << m_currentIndex << "to maximum" << max; m_currentIndex = max; + } update(); + // qDebug() << "Function completed: setRange"; } void RollingBox::setContentList(const QList &content) { + // qDebug() << "Setting content list with" << content.size() << "items"; m_content = content; setRange(0, m_content.size() - 1); + // qDebug() << "Function completed: setContentList"; } int RollingBox::getCurrentValue() { + // qDebug() << "Getting current value:" << m_currentIndex; return m_currentIndex; } void RollingBox::mousePressEvent(QMouseEvent *e) { + // qDebug() << "Function started: RollingBox::mousePressEvent"; if (m_pressResetTimer->isActive()) { + // qDebug() << "RollingBox::mousePressEvent: Enter if branch (timer active, stopping drag)"; m_isDragging = false; m_pressResetTimer->stop(); } m_homingAnimation->stop(); m_mouseSrcPos = e->pos().y(); m_pressResetTimer->start(500); + // qDebug() << "Function completed: RollingBox::mousePressEvent"; } void RollingBox::mouseMoveEvent(QMouseEvent *e) { + // qDebug() << "Function started: RollingBox::mouseMoveEvent"; if (m_isDragging) { + // qDebug() << "RollingBox::mouseMoveEvent: Enter if branch (is dragging)"; //数值到边界时,阻止继续往对应方向移动 if((m_currentIndex == m_rangeMin && e->pos().y() >= m_mouseSrcPos)|| - (m_currentIndex == m_rangeMax && e->pos().y() <= m_mouseSrcPos)) + (m_currentIndex == m_rangeMax && e->pos().y() <= m_mouseSrcPos)) { + // qDebug() << "RollingBox::mouseMoveEvent: Enter if branch (at boundary, returning early)"; return; + } m_deviation = e->pos().y() - m_mouseSrcPos; //若移动速度过快时进行限制 - if(m_deviation > height() / 4) + if(m_deviation > height() / 4) { + // qDebug() << "RollingBox::mouseMoveEvent: Enter if branch (deviation too high, limiting)"; m_deviation = height() / 4; - else if(m_deviation < -height() / 4) + } else if(m_deviation < -height() / 4) { + // qDebug() << "RollingBox::mouseMoveEvent: Enter else if branch (deviation too low, limiting)"; m_deviation = -height() / 4; + } update(); } + // qDebug() << "Function completed: RollingBox::mouseMoveEvent"; } void RollingBox::mouseReleaseEvent(QMouseEvent *e) { + // qDebug() << "Function started: RollingBox::mouseReleaseEvent"; if(m_isDragging) { + // qDebug() << "RollingBox::mouseReleaseEvent: Enter if branch (is dragging)"; m_isDragging = false; homing(); } else { + // qDebug() << "RollingBox::mouseReleaseEvent: Enter else branch (not dragging)"; m_deviation = this->height() / 2 - e->pos().y(); if (qAbs(m_deviation) <= this->height() / 6 || qAbs(m_deviation) >= this->height() / 2 - 10) {//点击当前选项、上下边界 + // qDebug() << "Click too close to current selection or boundary, ignoring"; m_deviation = 0; return; } if (m_deviation < 0 && m_currentIndex >= m_rangeMax) { if (qAbs(m_deviation) >= this->height() / 6) { + // qDebug() << "Cannot move down at maximum index"; m_deviation = 0; return; } @@ -122,6 +154,7 @@ void RollingBox::mouseReleaseEvent(QMouseEvent *e) if (m_deviation > 0 && m_currentIndex <= m_rangeMin) { if (qAbs(m_deviation) >= this->height() / 6) { + // qDebug() << "Cannot move up at minimum index"; m_deviation = 0; return; } @@ -131,27 +164,56 @@ void RollingBox::mouseReleaseEvent(QMouseEvent *e) } QWidget::mouseReleaseEvent(e); + // qDebug() << "Function completed: RollingBox::mouseReleaseEvent"; } void RollingBox::wheelEvent(QWheelEvent *e) { - if (e->delta() > 0 && m_currentIndex <= m_rangeMin) + // qDebug() << "Function started: RollingBox::wheelEvent"; +#if QT_VERSION_MAJOR > 5 + if (e->angleDelta().y() > 0 && m_currentIndex <= m_rangeMin) { + // qDebug() << "RollingBox::wheelEvent: Enter if branch (Qt6, at min index, returning early)"; + return; + } + if (e->angleDelta().y() < 0 && m_currentIndex >= m_rangeMax) { + // qDebug() << "RollingBox::wheelEvent: Enter if branch (Qt6, at max index, returning early)"; + return; + } + + if(e->angleDelta().y() / 90 > 0) { + // qDebug() << "RollingBox::wheelEvent: Enter if branch (Qt6, wheel up)"; + m_deviation = (this->height()) / 4; + } else { + // qDebug() << "RollingBox::wheelEvent: Enter else branch (Qt6, wheel down)"; + m_deviation = -(this->height()) / 4; + } +#else + if (e->delta() > 0 && m_currentIndex <= m_rangeMin) { + // qDebug() << "RollingBox::wheelEvent: Enter if branch (Qt5, at min index, returning early)"; return; - if (e->delta() < 0 && m_currentIndex >= m_rangeMax) + } + if (e->delta() < 0 && m_currentIndex >= m_rangeMax) { + // qDebug() << "RollingBox::wheelEvent: Enter if branch (Qt5, at max index, returning early)"; return; + } if(e->delta() / 90 > 0) { + // qDebug() << "RollingBox::wheelEvent: Enter if branch (Qt5, wheel up)"; m_deviation = (this->height()) / 4; } else { + // qDebug() << "RollingBox::wheelEvent: Enter else branch (Qt5, wheel down)"; m_deviation = -(this->height()) / 4; } +#endif homing(); update(); + // qDebug() << "Function completed: RollingBox::wheelEvent"; } void RollingBox::focusInEvent(QFocusEvent *event) { + // qDebug() << "RollingBox::focusInEvent"; Q_UNUSED(event); m_bFocus = true; update(); @@ -159,6 +221,7 @@ void RollingBox::focusInEvent(QFocusEvent *event) void RollingBox::focusOutEvent(QFocusEvent *event) { + // qDebug() << "RollingBox::focusOutEvent"; Q_UNUSED(event); m_bFocus = false; update(); @@ -166,6 +229,7 @@ void RollingBox::focusOutEvent(QFocusEvent *event) void RollingBox::keyReleaseEvent(QKeyEvent *event) { + // qDebug() << "RollingBox::keyReleaseEvent"; switch (event->key()) { case Qt::Key_Down: if (m_currentIndex < m_rangeMax) { @@ -174,7 +238,6 @@ void RollingBox::keyReleaseEvent(QKeyEvent *event) } else { return; } - break; case Qt::Key_Up: if (m_currentIndex > m_rangeMin) { @@ -190,6 +253,7 @@ void RollingBox::keyReleaseEvent(QKeyEvent *event) void RollingBox::paintEvent(QPaintEvent *e) { + // qDebug() << "Function started: RollingBox::paintEvent"; QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); @@ -209,6 +273,7 @@ void RollingBox::paintEvent(QPaintEvent *e) centerPath.lineTo(tmpLeftRect.topRight()); if (m_bFocus) { + // qDebug() << "RollingBox::focusInEvent"; painter.setPen(QPen(Dtk::Gui::DGuiApplicationHelper::instance()->applicationPalette().highlight().color(), 2)); painter.setBrush(QBrush(QColor(0, 0, 0, 0.4 * 255))); painter.drawPath(centerPath); @@ -231,6 +296,7 @@ void RollingBox::paintEvent(QPaintEvent *e) painter.setBrush(Qt::NoBrush); painter.drawPath(path); } else { + // qDebug() << "RollingBox::focusOutEvent"; painter.setPen(Qt::NoPen); painter.fillPath(centerPath, QBrush(QColor(0, 0, 0, 0.4 * 255))); } @@ -249,10 +315,12 @@ void RollingBox::paintEvent(QPaintEvent *e) paintContent(painter, m_currentIndex - 2, m_deviation - height() / 2); if (m_deviation <= 0 && m_currentIndex + 2 <= m_rangeMax) paintContent(painter, m_currentIndex + 2, m_deviation + height() / 2); + // qDebug() << "Function completed: RollingBox::paintEvent"; } void RollingBox::paintContent(QPainter &painter, int num, int deviation) { + // qDebug() << "RollingBox::paintContent"; // int transparency = 255 - 510 * qAbs(deviation) / height(); // int Height = height() / 2 - qAbs(deviation) / 6; double y = height() / 2 + deviation * 1.3 - BTN_HEIGHT / 2; @@ -268,14 +336,18 @@ void RollingBox::paintContent(QPainter &painter, int num, int deviation) void RollingBox::homing() { + // qDebug() << "Starting homing animation from deviation:" << m_deviation; if(m_deviation > height() / 6) { + // qDebug() << "m_deviation > height() / 6"; m_homingAnimation->setStartValue(height() / 6 - m_deviation); m_homingAnimation->setEndValue(0); m_currentIndex--; } else if (m_deviation > -height() / 6) { + // qDebug() << "m_deviation > -height() / 6"; m_homingAnimation->setStartValue(m_deviation); m_homingAnimation->setEndValue(0); } else if(m_deviation < -height() / 6) { + // qDebug() << "m_deviation < -height() / 6"; m_homingAnimation->setStartValue(-height() / 6 - m_deviation); m_homingAnimation->setEndValue(0); m_currentIndex++; @@ -288,16 +360,26 @@ void RollingBox::homing() emit currentValueChanged(m_currentIndex); m_homingAnimation->start(); + // qDebug() << "Function completed: homing"; } int RollingBox::readDeviation() { + // qWarning() << "Invalid deviation value"; return m_deviation; } void RollingBox::setDeviation(int n) { + // qWarning() << "Invalid deviation value"; m_deviation = n; update(); } +void RollingBox::reset() +{ + m_currentIndex = m_rangeMin; + m_deviation = 0; + emit currentValueChanged(m_currentIndex); + update(); +} diff --git a/src/src/rollingbox.h b/src/src/rollingbox.h index 3e381e953..c323a8656 100644 --- a/src/src/rollingbox.h +++ b/src/src/rollingbox.h @@ -36,6 +36,11 @@ class RollingBox : public QWidget */ int getCurrentValue(); + /** + * @brief 重置至初始位置 + */ + void reset(); + protected: /** * @brief 鼠标按下事件 diff --git a/src/src/settings_translation.cpp b/src/src/settings_translation.cpp index b99666871..e0837a065 100644 --- a/src/src/settings_translation.cpp +++ b/src/src/settings_translation.cpp @@ -7,6 +7,7 @@ void GenerateSettingTranslate() { + // qDebug() << "Function started: GenerateSettingTranslate"; auto group_settings = QObject::tr("Settings"); auto group_baseName = QObject::tr("Basic"); auto group_base_savaName = QObject::tr("File location"); @@ -30,4 +31,5 @@ void GenerateSettingTranslate() auto outsetting_none = QObject::tr("None"); auto outsetting_resolutionsettingName = QObject::tr("Resolution settings"); auto outsetting_resolutionsetting_resolutionName = QObject::tr("Maximum resolution:"); + // qDebug() << "Function completed: GenerateSettingTranslate"; } diff --git a/src/src/shortcut.cpp b/src/src/shortcut.cpp index 162754a62..f699add14 100755 --- a/src/src/shortcut.cpp +++ b/src/src/shortcut.cpp @@ -8,6 +8,7 @@ Shortcut::Shortcut(QObject *parent) : QObject(parent) { + // qDebug() << "Function started: Shortcut constructor"; ShortcutGroup group1; ShortcutGroup group3; @@ -41,10 +42,12 @@ Shortcut::Shortcut(QObject *parent) } m_shortcutObj.insert("shortcut", jsonGroups); + // qDebug() << "Function completed: Shortcut constructor"; } QString Shortcut::toStr() { + // qDebug() << "Function started: toStr"; QJsonDocument doc(m_shortcutObj); return doc.toJson().data(); } diff --git a/src/src/switchcamerabtn.cpp b/src/src/switchcamerabtn.cpp index e9da48c8e..85ce35165 100644 --- a/src/src/switchcamerabtn.cpp +++ b/src/src/switchcamerabtn.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -16,19 +16,26 @@ SwitchCameraBtn::SwitchCameraBtn(QWidget *parent/* = nullptr*/) m_bFocus(false), m_bPressed(false) { + // qDebug() << "Function started: SwitchCameraBtn constructor"; m_normalSvg = new QSvgRenderer(QString(":/images/icons/light/switch_camera.svg")); m_pressedSvg = new QSvgRenderer(QString(":/images/icons/light/switch_camera_press.svg")); + // qDebug() << "Function completed: SwitchCameraBtn constructor"; } void SwitchCameraBtn::paintEvent(QPaintEvent *event) { + // qDebug() << "Function started: SwitchCameraBtn::paintEvent"; Q_UNUSED(event); QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing, true); +#if QT_VERSION_MAJOR <= 5 painter.setRenderHint(QPainter::HighQualityAntialiasing, true); +#endif QPainterPath path; if (nullptr == m_normalSvg || nullptr == m_pressedSvg){ + // qDebug() << "normalSvg or pressedSvg is nullptr, return"; return; } QRect rect = this->rect(); @@ -45,6 +52,7 @@ void SwitchCameraBtn::paintEvent(QPaintEvent *event) painter.drawEllipse(rect1); if (m_bFocus && ! m_bPressed) { + // qDebug() << "Entering if (m_bFocus && ! m_bPressed)"; rect2.setTopLeft(QPoint(rect1.x()+offset2/2, rect1.y()+offset2/2)); rect2.setSize(QSize(rect1.width()-offset2, rect1.height()-offset2)); painter.setPen(QPen(QColor(255,255,255,255), offset2/2)); @@ -56,72 +64,96 @@ void SwitchCameraBtn::paintEvent(QPaintEvent *event) painter.setBrush(QBrush(QColor(0,0,0,100))); painter.drawEllipse(rect3); } else { + // qDebug() << "Entering else"; painter.setPen(Qt::NoPen); painter.setBrush(QBrush(QColor(0,0,0,100))); painter.drawEllipse(rect); } if (m_bPressed) { + // qDebug() << "Entering if (m_bPressed)"; m_pressedSvg->render(&painter); } else { + // qDebug() << "Entering else"; m_normalSvg->render(&painter); } + // qDebug() << "Function completed: SwitchCameraBtn::paintEvent"; } +#if QT_VERSION_MAJOR > 5 +void SwitchCameraBtn::enterEvent(QEnterEvent *event) +#else void SwitchCameraBtn::enterEvent(QEvent *event) +#endif { + // qDebug() << "Function started: SwitchCameraBtn::enterEvent"; Q_UNUSED(event); m_bFocus = true; update(); QEnterEvent *enterEvent = static_cast(event); QToolTip::showText(enterEvent->globalPos(), toolTip(),this); + // qDebug() << "Function completed: SwitchCameraBtn::enterEvent"; } void SwitchCameraBtn::leaveEvent(QEvent *event) { + // qDebug() << "Function started: SwitchCameraBtn::leaveEvent"; Q_UNUSED(event); m_bFocus = false; update(); + // qDebug() << "Function completed: SwitchCameraBtn::leaveEvent"; } void SwitchCameraBtn::mousePressEvent(QMouseEvent *event) { + // qDebug() << "Function started: SwitchCameraBtn::mousePressEvent"; Q_UNUSED(event); m_bPressed = true; update(); + // qDebug() << "Function completed: SwitchCameraBtn::mousePressEvent"; } void SwitchCameraBtn::mouseReleaseEvent(QMouseEvent *event) { + // qDebug() << "Function started: SwitchCameraBtn::mouseReleaseEvent"; Q_UNUSED(event); m_bPressed= false; update(); emit clicked(); + // qDebug() << "Function completed: SwitchCameraBtn::mouseReleaseEvent"; } void SwitchCameraBtn::focusInEvent(QFocusEvent *event) { + // qDebug() << "Function started: SwitchCameraBtn::focusInEvent"; Q_UNUSED(event); m_bFocus= true; update(); + // qDebug() << "Function completed: SwitchCameraBtn::focusInEvent"; } void SwitchCameraBtn::focusOutEvent(QFocusEvent *event) { + // qDebug() << "Function started: SwitchCameraBtn::focusOutEvent"; Q_UNUSED(event); m_bFocus= false; update(); + // qDebug() << "Function completed: SwitchCameraBtn::focusOutEvent"; } SwitchCameraBtn::~SwitchCameraBtn() { + // qDebug() << "Function started: SwitchCameraBtn destructor"; if (nullptr != m_normalSvg) { + // qDebug() << "SwitchCameraBtn destructor: Enter if branch (deleting normal svg)"; m_normalSvg->deleteLater(); m_normalSvg = nullptr; } if (nullptr != m_pressedSvg) { + // qDebug() << "SwitchCameraBtn destructor: Enter if branch (deleting pressed svg)"; m_pressedSvg->deleteLater(); m_pressedSvg = nullptr; } + // qDebug() << "Function completed: SwitchCameraBtn destructor"; } diff --git a/src/src/switchcamerabtn.h b/src/src/switchcamerabtn.h index 5af9e1d4e..8508006c5 100644 --- a/src/src/switchcamerabtn.h +++ b/src/src/switchcamerabtn.h @@ -20,7 +20,11 @@ class SwitchCameraBtn : public QWidget void clicked(); protected: void paintEvent(QPaintEvent *event) override; +#if QT_VERSION_MAJOR > 5 + void enterEvent(QEnterEvent *event) override; +#else void enterEvent(QEvent *event) override; +#endif void leaveEvent(QEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; diff --git a/src/src/takephotosettingareawidget.cpp b/src/src/takephotosettingareawidget.cpp index 3297e8b53..e6d425fbe 100644 --- a/src/src/takephotosettingareawidget.cpp +++ b/src/src/takephotosettingareawidget.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -18,6 +18,8 @@ #include #include #include +#include "ddlog.h" +using namespace DDLog; #define ANIMATION_DURATION 200 #define ANIMATION_FOLD_DURATION 200 @@ -48,15 +50,18 @@ takePhotoSettingAreaWidget::takePhotoSettingAreaWidget(QWidget *parent) : QWidge , m_bPhoto(true) , m_filterType(filter_Normal) { + qCDebug(appLog) << "Initializing takePhotoSettingAreaWidget"; m_delayGroupDisplay = false; m_flashGroupDisplay = false; m_bPhotoToVideState = false; m_isBtnsFold = true; m_buttonGroupColor.setRgb(0, 0, 0, 255 * 0.4); + qCDebug(appLog) << "Function completed: takePhotoSettingAreaWidget constructor"; } void takePhotoSettingAreaWidget::initButtons() { + qCDebug(appLog) << "Initializing buttons"; this->setObjectName(LEFT_BTNS_BOX); this->setAccessibleName(LEFT_BTNS_BOX); @@ -148,6 +153,15 @@ void takePhotoSettingAreaWidget::initButtons() m_filtersUnfoldBtn->setFocusPolicy(Qt::NoFocus); //滤镜滚动条窗口 + // 滤镜缩略图按设计无面板背景,直接浮在视频画面之上(paintEvent 中滤镜组 + // 分支不画底色)。要让按钮之间的 2px 间隙、以及按钮自身的 5px 边距真正透出 + // 底层视频,整条链都必须是透明的:仅给 m_scrollAreaWidget 设透明无效, + // 因为它透出去看到的是 QScrollArea viewport 的不透明底色——表现为一条静止 + // 的分割线。这里给 this、m_scrollArea、viewport 同时设 WA_TranslucentBackground + // 并关掉 viewport 自动填充,让透明一直贯通到视频所在层。 + // 注:Wayland 下视频由 QGraphicsView 渲染、m_openglwidget 为 nullptr; + // X11 下才是 QOpenGLWidget。两条路径都依赖此透明链。 + setAttribute(Qt::WA_TranslucentBackground, true); m_scrollAreaWidget = new QWidget(this); m_scrollAreaWidget->setAttribute(Qt::WA_TranslucentBackground, true); QVBoxLayout *scrollLayout = new QVBoxLayout(m_scrollAreaWidget); @@ -156,7 +170,13 @@ void takePhotoSettingAreaWidget::initButtons() m_scrollAreaWidget->setLayout(scrollLayout); m_scrollArea = new QScrollArea(this); m_scrollArea->setFrameShape(QFrame::NoFrame); + m_scrollArea->setAttribute(Qt::WA_TranslucentBackground, true); + m_scrollArea->setAutoFillBackground(false); m_scrollArea->setWidget(m_scrollAreaWidget); + // viewport 默认 autoFillBackground 且用 palette Window 填充(不透明), + // 是分割线的直接来源;关掉它并设透明,链才算通。 + m_scrollArea->viewport()->setAutoFillBackground(false); + m_scrollArea->viewport()->setAttribute(Qt::WA_TranslucentBackground, true); m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_scrollArea->setVisible(false); @@ -202,10 +222,13 @@ void takePhotoSettingAreaWidget::initButtons() m_exposureSlider->hide(); hideAll(); + + qCDebug(appLog) << "Created" << m_filterPreviewBtnList.size() << "filter preview buttons"; } void takePhotoSettingAreaWidget::initLayout() { + qCDebug(appLog) << "Initializing layout"; QPoint pos = this->pos(); int btnHeight = m_filtersUnfoldBtn->height(); @@ -214,6 +237,7 @@ void takePhotoSettingAreaWidget::initLayout() void takePhotoSettingAreaWidget::init() { + qCDebug(appLog) << "Initializing takePhotoSettingAreaWidget"; initButtons(); initLayout(); @@ -263,6 +287,7 @@ void takePhotoSettingAreaWidget::init() void takePhotoSettingAreaWidget::showFold(bool bShow, bool isShortcut) { + qCDebug(appLog) << "Showing fold state:" << bShow << "isShortcut:" << isShortcut; Q_UNUSED(bShow); circlePushBtnList btnList; @@ -286,6 +311,7 @@ void takePhotoSettingAreaWidget::showFold(bool bShow, bool isShortcut) int index = 0; for (auto btn : btnList) { if (!m_bPhoto) { + // qDebug() << "is not photo"; if (btn == m_flashlightUnfoldBtn || btn == m_filtersUnfoldBtn || btn == m_exposureBtn) @@ -305,6 +331,7 @@ void takePhotoSettingAreaWidget::showFold(bool bShow, bool isShortcut) pPosGroup->addAnimation(iconOpacity); if (btn == originBtn) { + // qDebug() << "is originBtn"; originBtn->move(0,(originBtn->height() + m_btnHeightOffset) * index++); continue; } @@ -356,10 +383,12 @@ void takePhotoSettingAreaWidget::showFold(bool bShow, bool isShortcut) group->start(QAbstractAnimation::DeleteWhenStopped); }); + qCDebug(appLog) << "Exiting showFold"; } void takePhotoSettingAreaWidget::showUnfold(bool bShow, circlePushButton *btn, bool isShortcut) { + qCDebug(appLog) << "Entering showUnfold, bShow:" << bShow << "isShortcut:" << isShortcut; circlePushBtnList btnList; btnList.push_back(m_flashlightUnfoldBtn); btnList.push_back(m_delayUnfoldBtn); @@ -385,6 +414,7 @@ void takePhotoSettingAreaWidget::showUnfold(bool bShow, circlePushButton *btn, b int index = 0; for (auto btn : btnList) { if (!m_bPhoto) { + // qDebug() << "is not photo"; if (btn == m_flashlightUnfoldBtn || btn == m_filtersUnfoldBtn || btn == m_exposureBtn) @@ -405,6 +435,7 @@ void takePhotoSettingAreaWidget::showUnfold(bool bShow, circlePushButton *btn, b pPosGroup->addAnimation(iconOpacity); if (btn == originBtn) { + // qDebug() << "is originBtn"; originBtn->move(0,(originBtn->height() + m_btnHeightOffset) * index++); continue; } @@ -430,10 +461,12 @@ void takePhotoSettingAreaWidget::showUnfold(bool bShow, circlePushButton *btn, b m_foldBtn->setVisible(bShow); if(m_bPhoto) { + // qDebug() << "is photo"; m_flashlightUnfoldBtn->setVisible(bShow); m_filtersUnfoldBtn->setVisible(bShow); m_exposureBtn->setVisible(bShow); } else { + // qDebug() << "is not photo"; m_flashlightUnfoldBtn->setVisible(!bShow); m_filtersUnfoldBtn->setVisible(!bShow); m_exposureBtn->setVisible(!bShow); @@ -448,10 +481,12 @@ void takePhotoSettingAreaWidget::showUnfold(bool bShow, circlePushButton *btn, b //折叠按钮与上一按钮间距比普通间距多10px 整体高度+10 回弹伸缩范围 +5 setFixedSize(QSize(originBtn->width(), 10 + 5 + originBtn->height() * nBtnCount + (nBtnCount - 1) * m_btnHeightOffset)); update(); + qCDebug(appLog) << "Exiting showUnfold"; } void takePhotoSettingAreaWidget::showDelayButtons(bool bShow, bool isShortcut) { + qCDebug(appLog) << "Showing delay buttons:" << bShow << "isShortcut:" << isShortcut; //位移动画 QPropertyAnimation *position1 = new QPropertyAnimation(m_noDelayBtn, "pos", this); QPropertyAnimation *position2 = new QPropertyAnimation(m_delay3SecondBtn, "pos", this); @@ -469,6 +504,7 @@ void takePhotoSettingAreaWidget::showDelayButtons(bool bShow, bool isShortcut) ec.setOvershoot(EASING_OVERSHOOT); if (bShow) { + // qDebug() << "is show"; position1->setDuration(ANIMATION_DURATION); position1->setStartValue(QPoint(0, 0)); position1->setEndValue(QPoint(0, m_delayFoldBtn->height() + m_threeBtnOffset)); @@ -512,6 +548,7 @@ void takePhotoSettingAreaWidget::showDelayButtons(bool bShow, bool isShortcut) m_delayFoldBtn->setFocus(); }); } else { + // qDebug() << "is not show"; position1->setDuration(ANIMATION_DURATION); position1->setStartValue(QPoint(0, m_delayFoldBtn->height() + m_threeBtnOffset)); position1->setEndValue(QPoint(0, 0)); @@ -571,10 +608,12 @@ void takePhotoSettingAreaWidget::showDelayButtons(bool bShow, bool isShortcut) setFixedSize(QSize(m_delayFoldBtn->width(), m_delayFoldBtn->height() * 4 + m_threeBtnOffset * 3 + 2)); update(); + qCDebug(appLog) << "Exiting showDelayButtons"; } void takePhotoSettingAreaWidget::showFlashlights(bool bShow, bool isShortcut) { + qCDebug(appLog) << "Showing flashlight buttons:" << bShow << "isShortcut:" << isShortcut; QPropertyAnimation *position1 = new QPropertyAnimation(m_flashlightOnBtn, "pos", this); QPropertyAnimation *position2 = new QPropertyAnimation(m_flashlightOffBtn, "pos", this); @@ -589,6 +628,7 @@ void takePhotoSettingAreaWidget::showFlashlights(bool bShow, bool isShortcut) ec.setOvershoot(EASING_OVERSHOOT); if (bShow) { + qCDebug(appLog) << "show flashlight is show"; position1->setDuration(ANIMATION_DURATION); position1->setStartValue(QPoint(0, 0)); position1->setEndValue(QPoint(0, m_delayFoldBtn->height() + m_threeBtnOffset)); @@ -622,6 +662,7 @@ void takePhotoSettingAreaWidget::showFlashlights(bool bShow, bool isShortcut) m_flashlightFoldBtn->setFocus(); }); } else { + qCDebug(appLog) << "show flashlight is not show"; position1->setDuration(ANIMATION_DURATION); position1->setStartValue(QPoint(0, m_delayFoldBtn->height() + m_threeBtnOffset)); position1->setEndValue(QPoint(0, 0)); @@ -663,10 +704,12 @@ void takePhotoSettingAreaWidget::showFlashlights(bool bShow, bool isShortcut) setFixedSize(QSize(m_flashlightFoldBtn->width(), m_flashlightFoldBtn->height() * 3 + m_threeBtnOffset * 2 + 2)); update(); + qCDebug(appLog) << "Exiting showFlashlights"; } void takePhotoSettingAreaWidget::showFilters(bool bShow, bool isShortcut) { + qCDebug(appLog) << "Showing filter buttons:" << bShow << "isShortcut:" << isShortcut; QPropertyAnimation *posClose = new QPropertyAnimation(m_filtersCloseBtn, "pos", this); QPropertyAnimation *opacityClose = new QPropertyAnimation(m_filtersCloseBtn, "opacity", this); QPropertyAnimation *iconOpacityClose = new QPropertyAnimation(m_filtersCloseBtn, "iconopacity", this); @@ -701,6 +744,7 @@ void takePhotoSettingAreaWidget::showFilters(bool bShow, bool isShortcut) endGeometry.setWidth(startGeometry.width()); if (bShow) { + qCDebug(appLog) << "show filters is show"; posScroll->setDuration(ANIMATION_FILTER_DURATION); posScroll->setEasingCurve(ec); posScroll->setStartValue(startGeometry); @@ -753,11 +797,13 @@ void takePhotoSettingAreaWidget::showFilters(bool bShow, bool isShortcut) }); if (isShortcut) { + qCDebug(appLog) << "is shortcut"; QTimer::singleShot(ANIMATION_FILTER_DURATION, this, [=] { m_filtersFoldBtn->setFocus(); }); } } else { + qCDebug(appLog) << "show filters is not show"; posClose->setDuration(ANIMATION_FILTER_DURATION); posClose->setEasingCurve(ec); posClose->setStartValue(QPoint(5, (m_filtersFoldBtn->height() + m_threeBtnOffset*2) + endGeometry.height())); @@ -823,16 +869,19 @@ void takePhotoSettingAreaWidget::showFilters(bool bShow, bool isShortcut) int height = (m_filtersFoldBtn->height() + m_threeBtnOffset*2 + 1) * 2 + endGeometry.height(); setFixedSize(QSize(m_filterPreviewBtnList.last()->width(), height)); update(); + qCDebug(appLog) << "Exiting showFilters"; } void takePhotoSettingAreaWidget::foldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Fold button clicked, isShortcut:" << isShortcut; //closeAllGroup(); showFold(true, isShortcut); } void takePhotoSettingAreaWidget::unfoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Unfold button clicked, isShortcut:" << isShortcut; QPropertyAnimation * opacity = new QPropertyAnimation(m_unfoldBtn, "opacity", this); opacity->setStartValue(102); opacity->setEndValue(0); @@ -862,11 +911,13 @@ void takePhotoSettingAreaWidget::unfoldBtnClicked(bool isShortcut) void takePhotoSettingAreaWidget::flashlightFoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Flashlight fold button clicked, isShortcut:" << isShortcut; showFlashlights(false, isShortcut); } void takePhotoSettingAreaWidget::flashlightUnfoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Flashlight unfold button clicked, isShortcut:" << isShortcut; hideAll(); closeAllGroup(); showFlashlights(true, isShortcut); @@ -880,6 +931,7 @@ void takePhotoSettingAreaWidget::flashlightUnfoldBtnClicked(bool isShortcut) void takePhotoSettingAreaWidget::delayUnfoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Delay unfold button clicked, isShortcut:" << isShortcut; hideAll(); closeAllGroup(); showDelayButtons(true, isShortcut); @@ -888,11 +940,13 @@ void takePhotoSettingAreaWidget::delayUnfoldBtnClicked(bool isShortcut) void takePhotoSettingAreaWidget::delayfoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Delay fold button clicked, isShortcut:" << isShortcut; showDelayButtons(false, isShortcut); } void takePhotoSettingAreaWidget::filtersUnfoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Filters unfold button clicked, isShortcut:" << isShortcut; hideAll(); closeAllGroup(); m_filtersGroupDislay = true; @@ -902,12 +956,14 @@ void takePhotoSettingAreaWidget::filtersUnfoldBtnClicked(bool isShortcut) void takePhotoSettingAreaWidget::filtersFoldBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Filters fold button clicked, isShortcut:" << isShortcut; showFilters(false, isShortcut); emit sigFilterGroupDisplay(false); } void takePhotoSettingAreaWidget::hideAll() { + qCDebug(appLog) << "Hiding all"; m_foldBtn->setVisible(false); m_unfoldBtn->setVisible(false); @@ -929,53 +985,74 @@ void takePhotoSettingAreaWidget::hideAll() m_filtersCloseBtn->setVisible(false); m_exposureBtn->setVisible(false); + qCDebug(appLog) << "Exiting hideAll"; } void takePhotoSettingAreaWidget::keyDownClick() { + // qDebug() << "Key down clicked"; if (!m_isBtnsFold) { + // qDebug() << "is not fold"; if (m_flashlightUnfoldBtn->hasFocus()) { + // qDebug() << "Flashlight unfold button has focus"; m_delayUnfoldBtn->setFocus(); } else if(m_delayUnfoldBtn->hasFocus()){ + // qDebug() << "Delay unfold button has focus"; m_filtersUnfoldBtn->setFocus(); } else if (m_filtersUnfoldBtn->hasFocus()) { + // qDebug() << "Filters unfold button has focus"; m_exposureBtn->setFocus(); } else if (m_exposureBtn->hasFocus()) { + // qDebug() << "Exposure button has focus"; m_foldBtn->setFocus(); } else if(m_foldBtn->hasFocus()){ + // qDebug() << "Fold button has focus"; m_flashlightUnfoldBtn->setFocus(); } } if (m_flashGroupDisplay) { + // qDebug() << "is flash group display"; if (m_flashlightFoldBtn->hasFocus()) { + // qDebug() << "Flashlight fold button has focus"; m_flashlightOnBtn->setFocus(); } else if(m_flashlightOnBtn->hasFocus()){ + // qDebug() << "Flashlight on button has focus"; m_flashlightOffBtn->setFocus(); } else if(m_flashlightOffBtn->hasFocus()){ + // qDebug() << "Flashlight off button has focus"; m_flashlightFoldBtn->setFocus(); } } if (m_delayGroupDisplay) { + // qDebug() << "is delay group display"; if (m_delayFoldBtn->hasFocus()) { + // qDebug() << "Delay fold button has focus"; m_noDelayBtn->setFocus(); } else if(m_noDelayBtn->hasFocus()) { + // qDebug() << "No delay button has focus"; m_delay3SecondBtn->setFocus(); } else if(m_delay3SecondBtn->hasFocus()) { + // qDebug() << "Delay 3 second button has focus"; m_delay6SecondBtn->setFocus(); } else if(m_delay6SecondBtn->hasFocus()) { + // qDebug() << "Delay 6 second button has focus"; m_delayFoldBtn->setFocus(); } } if (m_filtersGroupDislay) { + // qDebug() << "is filters group display"; if (m_filtersFoldBtn->hasFocus()) { + // qDebug() << "Filters fold button has focus"; m_filterPreviewBtnList.at(0)->setFocus(); m_scrollArea->verticalScrollBar()->setValue(0); } else { + // qDebug() << "is not filters fold button"; for (int i = 0; i < efilterType::filter_Count; i++) { if (m_filterPreviewBtnList.at(i)->hasFocus()) { + // qDebug() << "is filter preview button"; if (i + 1 < efilterType::filter_Count) { m_filterPreviewBtnList.at(i + 1)->setFocus(); int value = (m_filtersFoldBtn->height() + m_threeBtnOffset * 2) * (i + 2) + 15 - @@ -985,6 +1062,7 @@ void takePhotoSettingAreaWidget::keyDownClick() } return; } else { + // qDebug() << "is filters close button"; m_filtersCloseBtn->setFocus(); return; } @@ -995,52 +1073,72 @@ void takePhotoSettingAreaWidget::keyDownClick() m_filtersFoldBtn->setFocus(); } } + // qDebug() << "Exiting keyDownClick"; } void takePhotoSettingAreaWidget::keyUpClick() { + // qDebug() << "Entering keyUpClick"; if (!m_isBtnsFold) { + // qDebug() << "is not fold"; if (m_flashlightUnfoldBtn->hasFocus()) { + // qDebug() << "Flashlight unfold button has focus"; m_foldBtn->setFocus(); } else if(m_exposureBtn->hasFocus()){ + // qDebug() << "Exposure button has focus"; m_filtersUnfoldBtn->setFocus(); } else if(m_filtersUnfoldBtn->hasFocus()){ + // qDebug() << "Filters unfold button has focus"; m_delayUnfoldBtn->setFocus(); } else if(m_delayUnfoldBtn->hasFocus()){ + // qDebug() << "Delay unfold button has focus"; m_flashlightUnfoldBtn->setFocus(); } else if (m_foldBtn->hasFocus()) { + // qDebug() << "Fold button has focus"; m_exposureBtn->setFocus(); } } if (m_flashGroupDisplay) { + // qDebug() << "is flash group display"; if (m_flashlightFoldBtn->hasFocus()) { + // qDebug() << "Flashlight fold button has focus"; m_flashlightOffBtn->setFocus(); } else if(m_flashlightOnBtn->hasFocus()){ + // qDebug() << "Flashlight on button has focus"; m_flashlightFoldBtn->setFocus(); } else if(m_flashlightOffBtn->hasFocus()){ + // qDebug() << "Flashlight off button has focus"; m_flashlightOnBtn->setFocus(); } } if (m_delayGroupDisplay) { + // qDebug() << "is delay group display"; if (m_delayFoldBtn->hasFocus()) { + // qDebug() << "Delay fold button has focus"; m_delay6SecondBtn->setFocus(); } else if(m_noDelayBtn->hasFocus()) { + // qDebug() << "No delay button has focus"; m_delayFoldBtn->setFocus(); } else if(m_delay3SecondBtn->hasFocus()) { + // qDebug() << "Delay 3 second button has focus"; m_noDelayBtn->setFocus(); } else if(m_delay6SecondBtn->hasFocus()) { + // qDebug() << "Delay 6 second button has focus"; m_delay3SecondBtn->setFocus(); } } if (m_filtersGroupDislay) { + // qDebug() << "is filters group display"; if (m_filtersFoldBtn->hasFocus()) { + // qDebug() << "Filters fold button has focus"; m_filtersCloseBtn->setFocus(); } else { for (int i = efilterType::filter_Count - 1; i >= 0; i--) { if (m_filterPreviewBtnList.at(i)->hasFocus()) { + // qDebug() << "is filter preview button"; if (i - 1 >= 0) { m_filterPreviewBtnList.at(i - 1)->setFocus(); int value = m_scrollArea->verticalScrollBar()->value() - (m_filtersFoldBtn->height() + m_threeBtnOffset * 2) * (i - 1); @@ -1049,6 +1147,7 @@ void takePhotoSettingAreaWidget::keyUpClick() } return; } else { + // qDebug() << "is filters close button"; m_filtersFoldBtn->setFocus(); return; } @@ -1056,60 +1155,85 @@ void takePhotoSettingAreaWidget::keyUpClick() } if (m_filtersCloseBtn->hasFocus()) { + // qDebug() << "is filters close button"; m_filterPreviewBtnList.at(efilterType::filter_Count - 1)->setFocus(); m_scrollArea->verticalScrollBar()->setValue(m_scrollArea->verticalScrollBar()->maximum()); } } } + // qDebug() << "Exiting keyUpClick"; } void takePhotoSettingAreaWidget::keyEnterClick() { + // qDebug() << "Entering keyEnterClick"; if (m_unfoldBtn->hasFocus()) { + // qDebug() << "unfold button has focus"; unfoldBtnClicked(true); } else if (m_foldBtn->hasFocus()) { + // qDebug() << "fold button has focus"; foldBtnClicked(true); } else if (m_flashlightUnfoldBtn->hasFocus()) { + // qDebug() << "flashlight unfold button has focus"; flashlightUnfoldBtnClicked(true); } else if (m_flashlightFoldBtn->hasFocus()) { + // qDebug() << "flashlight fold button has focus"; flashlightFoldBtnClicked(true); } else if (m_flashlightOnBtn->hasFocus()) { + // qDebug() << "flashlight on button has focus"; emit m_flashlightOnBtn->clicked(true); } else if (m_flashlightOffBtn->hasFocus()) { + // qDebug() << "flashlight off button has focus"; emit m_flashlightOffBtn->clicked(true); } else if (m_delayFoldBtn->hasFocus()) { + // qDebug() << "delay fold button has focus"; delayfoldBtnClicked(true); } else if (m_delayUnfoldBtn->hasFocus()) { + // qDebug() << "delay unfold button has focus"; delayUnfoldBtnClicked(true); } else if (m_noDelayBtn->hasFocus()) { + // qDebug() << "no delay button has focus"; emit m_noDelayBtn->clicked(true); } else if (m_delay3SecondBtn->hasFocus()) { + // qDebug() << "delay 3 second button has focus"; emit m_delay3SecondBtn->clicked(true); } else if (m_delay6SecondBtn->hasFocus()) { + // qDebug() << "delay 6 second button has focus"; emit m_delay6SecondBtn->clicked(true); } else if (m_filtersFoldBtn->hasFocus()) { + // qDebug() << "filters fold button has focus"; filtersFoldBtnClicked(true); } else if (m_filtersUnfoldBtn->hasFocus()) { + // qDebug() << "filters unfold button has focus"; filtersUnfoldBtnClicked(true); } else if (filterPreviewButton* pFocusBtn = getFilterPreviewFocusBtn()) { + // qDebug() << "filter preview button has focus"; emit pFocusBtn->clicked(true); } else if (m_filtersCloseBtn->hasFocus()) { + // qDebug() << "filters close button has focus"; filtersFoldBtnClicked(true); } else if (m_exposureBtn->hasFocus()) { + // qDebug() << "exposure button has focus"; exposureBtnClicked(true); } else if (/*曝光滑块有焦点*/false) { // TODO: 执行设置曝光值函数 } + // qDebug() << "Exiting keyEnterClick"; } void takePhotoSettingAreaWidget::paintEvent(QPaintEvent *event) { + // qDebug() << "Entering paintEvent"; QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing, true); +#if QT_VERSION_MAJOR <= 5 painter.setRenderHint(QPainter::HighQualityAntialiasing, true); +#endif int width, height; if (m_delayGroupDisplay) { + // qDebug() << "is delay group display"; QPainterPath path; //上半圆+矩形 QPainterPath arc1; //下半圆 @@ -1132,6 +1256,7 @@ void takePhotoSettingAreaWidget::paintEvent(QPaintEvent *event) painter.fillPath(path, QBrush(m_buttonGroupColor)); } else if (m_flashGroupDisplay) { + // qDebug() << "is flash group display"; QPainterPath path; QPainterPath arc1; @@ -1153,15 +1278,19 @@ void takePhotoSettingAreaWidget::paintEvent(QPaintEvent *event) path.addPath(arc1); painter.fillPath(path, QBrush(m_buttonGroupColor)); } else if (m_filtersGroupDislay) { - + // qDebug() << "is filters group display"; } + // qDebug() << "Exiting paintEvent"; } void takePhotoSettingAreaWidget::onDelayBtnsClicked(bool isShortcut) { + qCDebug(appLog) << "Delay button clicked, isShortcut:" << isShortcut; circlePushButton *pBtn = static_cast(sender()); - if (nullptr == pBtn) + if (nullptr == pBtn) { + qCWarning(appLog) << "Failed to get sender button"; return; + } pBtn == m_noDelayBtn ? m_noDelayBtn->setSelected(true) : m_noDelayBtn->setSelected(false); pBtn == m_delay3SecondBtn ? m_delay3SecondBtn->setSelected(true) : m_delay3SecondBtn->setSelected(false); pBtn == m_delay6SecondBtn ? m_delay6SecondBtn->setSelected(true) : m_delay6SecondBtn->setSelected(false); @@ -1170,45 +1299,58 @@ void takePhotoSettingAreaWidget::onDelayBtnsClicked(bool isShortcut) circlePushButton *bCopyBtn = m_noDelayBtn; if (m_delay3SecondBtn->getButtonState()) { + // qDebug() << "delay 3 second button has focus"; delayTime = 3; bCopyBtn = m_delay3SecondBtn; } if (m_delay6SecondBtn->getButtonState()) { + // qDebug() << "delay 6 second button has focus"; delayTime = 6; bCopyBtn = m_delay6SecondBtn; } + qCDebug(appLog) << "Setting delay time to:" << delayTime << "seconds"; m_delayUnfoldBtn->copyPixmap(*bCopyBtn); m_delayFoldBtn->copyPixmap(*bCopyBtn); emit sngSetDelayTakePhoto(delayTime); update(); showDelayButtons(false, isShortcut); //三级菜单选中后跳转到上一级菜单 + qCDebug(appLog) << "Exiting onDelayBtnsClicked"; } void takePhotoSettingAreaWidget::onFlashlightBtnsClicked(bool isShortcut) { + qCDebug(appLog) << "Flashlight button clicked, isShortcut:" << isShortcut; auto pBtn = static_cast(sender()); - if (nullptr == pBtn) + if (nullptr == pBtn) { + qCWarning(appLog) << "Failed to get sender button"; return; + } pBtn == m_flashlightOnBtn ? m_flashlightOnBtn->setSelected(true) : m_flashlightOnBtn->setSelected(false); pBtn == m_flashlightOffBtn ? m_flashlightOffBtn->setSelected(true) : m_flashlightOffBtn->setSelected(false); - setFlashlight(m_flashlightOnBtn->getButtonState()); - emit sngSetFlashlight(m_flashlightOnBtn->getButtonState()); + bool flashState = m_flashlightOnBtn->getButtonState(); + qCDebug(appLog) << "Setting flashlight state to:" << flashState; + setFlashlight(flashState); + emit sngSetFlashlight(flashState); showFlashlights(false, isShortcut); + qCDebug(appLog) << "Exiting onFlashlightBtnsClicked"; } void takePhotoSettingAreaWidget::onFilterBtnsClicked(bool isShortcut) { + qCDebug(appLog) << "Filter button clicked, isShortcut:" << isShortcut; Q_UNUSED(isShortcut); auto pBtn = static_cast(sender()); - if (!pBtn) + if (!pBtn) { + qCWarning(appLog) << "Failed to get sender button"; return; + } for (auto pTmpBtn : m_filterPreviewBtnList) { pTmpBtn->setSelected(pTmpBtn == pBtn); @@ -1216,25 +1358,43 @@ void takePhotoSettingAreaWidget::onFilterBtnsClicked(bool isShortcut) efilterType newFilterType = pBtn->getFiltertype(); if (m_filterType != newFilterType) { + qCDebug(appLog) << "Changing filter type from" << m_filterType << "to" << newFilterType; emit sngFilterChanged(newFilterType); emit sngSetFilterName(filterPreviewButton::filterName(newFilterType)); m_filterType = newFilterType; } + qCDebug(appLog) << "Exiting onFilterBtnsClicked"; } void takePhotoSettingAreaWidget::onUpdateFilterImage(QImage *img) { - if (!img) + qCDebug(appLog) << "Entering onUpdateFilterImage"; + if (!img) { + qCWarning(appLog) << "Received null image for filter update"; return; - + } for (auto btn : m_filterPreviewBtnList) { QImage tmp = img->copy(); btn->setImage(&tmp); } + + // 滤镜列透明悬浮在视频画面之上(Wayland 为 QGraphicsView,X11 为 + // QOpenGLWidget,二者互为兄弟子树)。缩略图本身每帧由 setImage() 重绘, + // 但按钮之间的 2px 间隙、按钮 5px 边距属于本控件/按钮的透明区域,Qt 不会 + // 因下层视频刷新而自动跨子树重新混合它们——只在 show/hide 时合成一次, + // 之后随视频帧“冻结在首帧”,表现为静止的分割线。这里随每帧主动 update() + // 一次,强制把透明层在最新一帧视频上重新合成,消除冻结的分割线,同时 + // 保留透明背景(不引入底色)。透明链在 initButtons() 中已对 this、 + // m_scrollArea、viewport、m_scrollAreaWidget 一并设好,此处才能生效。 + if (m_scrollArea && m_scrollArea->isVisible()) { + m_scrollAreaWidget->update(); + } + qCDebug(appLog) << "Exiting onUpdateFilterImage"; } void takePhotoSettingAreaWidget::onExposureValueChanged(int value) { + qCDebug(appLog) << "Exposure value changed to:" << value; if (value) m_exposureBtn->setNewNotification(true); else @@ -1243,16 +1403,19 @@ void takePhotoSettingAreaWidget::onExposureValueChanged(int value) filterPreviewButton *takePhotoSettingAreaWidget::getFilterPreviewFocusBtn() { + // qDebug() << "Entering getFilterPreviewFocusBtn"; for (auto pBtn : m_filterPreviewBtnList) { if (pBtn->hasFocus()) return pBtn; } + // qDebug() << "Exiting getFilterPreviewFocusBtn,return nullptr"; return nullptr; } void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) { + qCDebug(appLog) << "Entering exposureBtnClicked"; if (QDateTime::currentMSecsSinceEpoch() - m_animationTime < 500) //防止上一次动画未完成 return; else @@ -1266,9 +1429,11 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) end.setHeight(EXPOSURE_SLIDER_HEIGHT); if (m_exposureSliderDisplay) { + qCDebug(appLog) << "is exposure slider display"; m_exposureSlider->showContent(false, isShortcut); connect(m_exposureSlider, &ExposureSlider::contentHided, this, [=](){ + qCDebug(appLog) << "is exposure slider content hided"; QPropertyAnimation *opacity = new QPropertyAnimation(m_exposureSlider, "opacity", this); opacity->setStartValue(102); opacity->setEndValue(0); @@ -1285,6 +1450,7 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) pGroup->addAnimation(opacity); pGroup->addAnimation(geometry); connect(pGroup, &QParallelAnimationGroup::finished, this, [=](){ + qCDebug(appLog) << "is exposure slider content hided finished"; m_exposureSlider->hide(); if (isShortcut) //键盘触发,焦点设回到曝光按钮上 m_exposureBtn->setFocus(); @@ -1294,6 +1460,7 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) showUnfold(true, m_exposureBtn, isShortcut); if (m_bPhoto && !m_isBtnsFold) { + qCDebug(appLog) << "is exposure slider content hided finished and is photo"; m_flashlightUnfoldBtn->setVisible(true); m_filtersUnfoldBtn->setVisible(true); m_exposureBtn->setVisible(true); @@ -1302,6 +1469,7 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) m_filtersUnfoldBtn->setOpacity(102); m_exposureBtn->setOpacity(102); } else { + qCDebug(appLog) << "is exposure slider content hided finished and is not photo"; m_flashlightUnfoldBtn->setVisible(false); m_filtersUnfoldBtn->setVisible(false); m_exposureBtn->setVisible(false); @@ -1314,6 +1482,7 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) }); } else { + qCDebug(appLog) << "is exposure slider not display"; QPropertyAnimation *opacity = new QPropertyAnimation(m_exposureSlider, "opacity", this); opacity->setStartValue(0); opacity->setEndValue(102); @@ -1330,6 +1499,7 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) pGroup->addAnimation(opacity); pGroup->addAnimation(geometry); connect(pGroup, &QParallelAnimationGroup::finished, this, [=](){ + qCDebug(appLog) << "is exposure slider content hided finished"; m_exposureSlider->showContent(true, isShortcut); pGroup->deleteLater(); }); @@ -1340,15 +1510,18 @@ void takePhotoSettingAreaWidget::exposureBtnClicked(bool isShortcut) m_exposureSliderDisplay = !m_exposureSliderDisplay; m_exposureBtn->setSelected(m_exposureSliderDisplay); + qCDebug(appLog) << "Exiting exposureBtnClicked"; } void takePhotoSettingAreaWidget::setDelayTime(int delayTime) { + qCDebug(appLog) << "Setting delay time to:" << delayTime << "seconds"; m_noDelayBtn->setSelected(false); m_delay3SecondBtn->setSelected(false); m_delay6SecondBtn->setSelected(false); switch (delayTime) { case 0: + qCDebug(appLog) << "set delay time to 0"; // emit m_noDelayBtn->clicked(); //不使用触发按钮点击方式实现,防止影响动画效果 m_noDelayBtn->setSelected(true); m_delayUnfoldBtn->copyPixmap(*m_noDelayBtn); @@ -1356,6 +1529,7 @@ void takePhotoSettingAreaWidget::setDelayTime(int delayTime) update(); break; case 3: + qCDebug(appLog) << "set delay time to 3"; // emit m_delay3SecondBtn->clicked(); m_delay3SecondBtn->setSelected(true); m_delayUnfoldBtn->copyPixmap(*m_delay3SecondBtn); @@ -1363,6 +1537,7 @@ void takePhotoSettingAreaWidget::setDelayTime(int delayTime) update(); break; case 6: + qCDebug(appLog) << "set delay time to 6"; // emit m_delay6SecondBtn->clicked(); m_delay6SecondBtn->setSelected(true); m_delayUnfoldBtn->copyPixmap(*m_delay6SecondBtn); @@ -1370,27 +1545,33 @@ void takePhotoSettingAreaWidget::setDelayTime(int delayTime) update(); break; default: + qCDebug(appLog) << "set delay time to default"; ; } + qCDebug(appLog) << "Exiting setDelayTime"; } void takePhotoSettingAreaWidget::setFlashlight(bool bFlashOn) { + qCDebug(appLog) << "Setting flashlight state to:" << bFlashOn; m_flashlightOnBtn->setSelected(bFlashOn); m_flashlightOffBtn->setSelected(!bFlashOn); auto p = bFlashOn ? m_flashlightOnBtn : m_flashlightOffBtn; m_flashlightUnfoldBtn->copyPixmap(*p); m_flashlightFoldBtn->copyPixmap(*p); update(); + qCDebug(appLog) << "Exiting setFlashlight"; } bool takePhotoSettingAreaWidget::flashLight() { + // qDebug() << "Entering flashLight"; return m_flashlightOnBtn->getButtonState(); } void takePhotoSettingAreaWidget::setFilterType(efilterType type) { + qCDebug(appLog) << "Setting filter type to:" << type; for (auto pBtn : m_filterPreviewBtnList) { pBtn->setSelected(pBtn->getFiltertype() == type); } @@ -1401,60 +1582,79 @@ void takePhotoSettingAreaWidget::setFilterType(efilterType type) efilterType takePhotoSettingAreaWidget::getFilterType() { + // qDebug() << "Entering getFilterType"; return m_filterType; } void takePhotoSettingAreaWidget::resizeEvent(QResizeEvent *event) { + // qDebug() << "Entering resizeEvent"; moveToParentLeft(); return QWidget::resizeEvent(event); } void takePhotoSettingAreaWidget::keyReleaseEvent(QKeyEvent *event) { + // qDebug() << "Entering keyReleaseEvent"; switch (event->key()) { case Qt::Key_Down: + // qDebug() << "key down"; keyDownClick(); break; case Qt::Key_Up: + // qDebug() << "key up"; keyUpClick(); break; case Qt::Key_Return: + // qDebug() << "key return"; keyEnterClick(); break; } + // qDebug() << "Exiting keyReleaseEvent"; QWidget::keyReleaseEvent(event); } void takePhotoSettingAreaWidget::focusInEvent(QFocusEvent *event) { + // qDebug() << "Entering focusInEvent"; Q_UNUSED(event); if (m_isBtnsFold) { + // qDebug() << "key release event is fold"; m_unfoldBtn->setFocus(); } else if (!m_bPhoto) { + // qDebug() << "key release event is not photo"; if (m_delayGroupDisplay) { + // qDebug() << "key release event is delay group display"; m_delayFoldBtn->setFocus(); } else { + // qDebug() << "key release event is delay group not display"; m_delayUnfoldBtn->setFocus(); } } else { + // qDebug() << "key release event is photo"; if (m_flashGroupDisplay) { + // qDebug() << "key release event is flash group display"; m_flashlightFoldBtn->setFocus(); } else if (m_delayGroupDisplay) { + // qDebug() << "key release event is delay group display"; m_delayFoldBtn->setFocus(); } else if (m_filtersGroupDislay) { + // qDebug() << "key release event is filters group display"; m_filtersFoldBtn->setFocus(); }/* else if (m_exposureGroupDisplay) { m_exposureFoldBtn->setFocus(); }*/ else { + // qDebug() << "key release event is not any group display"; m_flashlightUnfoldBtn->setFocus(); } } update(); + // qDebug() << "Exiting focusInEvent"; } void takePhotoSettingAreaWidget::moveToParentLeft() { + // qDebug() << "Entering moveToParentLeft"; if (nullptr == parent()) return; @@ -1467,10 +1667,12 @@ void takePhotoSettingAreaWidget::moveToParentLeft() if (m_filtersGroupDislay) posY += 20; move(LEFT_MARGIN_PIX, posY); + // qDebug() << "Exiting moveToParentLeft"; } void takePhotoSettingAreaWidget::closeAllGroup() { + qCDebug(appLog) << "Closing all groups"; //判断延迟拍照组是否显示 if (m_delayGroupDisplay) delayfoldBtnClicked(); @@ -1490,14 +1692,17 @@ void takePhotoSettingAreaWidget::closeAllGroup() void takePhotoSettingAreaWidget::setOpacity(int opacity) { + qCDebug(appLog) << "Setting opacity to:" << opacity; m_opacity = opacity; m_buttonGroupColor.setAlpha(opacity); update(); -}; +} void takePhotoSettingAreaWidget::setState(bool bPhoto) { + qCDebug(appLog) << "Setting widget state to:" << (bPhoto ? "Photo" : "Video"); if (m_exposureSliderDisplay) { + qCDebug(appLog) << "is exposure slider display"; //判断当前是否由拍照状态切换到录像状态 m_bPhotoToVideState = m_bPhoto && !bPhoto; exposureBtnClicked(); @@ -1506,10 +1711,13 @@ void takePhotoSettingAreaWidget::setState(bool bPhoto) } // 若有功能按钮组处于展开状态,折叠之 - if (m_delayGroupDisplay || m_flashGroupDisplay || m_filtersGroupDislay || m_exposureSliderDisplay) + if (m_delayGroupDisplay || m_flashGroupDisplay || m_filtersGroupDislay || m_exposureSliderDisplay) { + qCDebug(appLog) << "close all group"; closeAllGroup(); + } // 按钮总开关处于展开状态 else if (!m_isBtnsFold){ + qCDebug(appLog) << "not any group display"; // 功能按钮组未处于展开状态,重新设置各个按钮位置 circlePushBtnList btnList; btnList.push_back(m_flashlightUnfoldBtn); @@ -1538,6 +1746,7 @@ void takePhotoSettingAreaWidget::setState(bool bPhoto) m_bPhoto = bPhoto; if (bPhoto && !m_isBtnsFold) { + qCDebug(appLog) << "is photo and is not fold"; m_flashlightUnfoldBtn->setVisible(true); m_filtersUnfoldBtn->setVisible(true); m_exposureBtn->setVisible(true); @@ -1546,15 +1755,18 @@ void takePhotoSettingAreaWidget::setState(bool bPhoto) m_filtersUnfoldBtn->setOpacity(102); m_exposureBtn->setOpacity(102); } else { + qCDebug(appLog) << "is not photo or is fold"; m_flashlightUnfoldBtn->setVisible(false); m_filtersUnfoldBtn->setVisible(false); m_exposureBtn->setVisible(false); } update(); + qCDebug(appLog) << "Exiting setState"; } void takePhotoSettingAreaWidget::resizeScrollHeight(int height) { + qCDebug(appLog) << "Resizing scroll height to:" << height; m_scrollHeight = (m_filtersFoldBtn->height() + m_threeBtnOffset * 2) * 6 + height + 15; //Add a offset here if (m_scrollHeight > m_scrollArea->widget()->height()) m_scrollHeight = m_scrollArea->widget()->height(); diff --git a/src/src/titlebar.cpp b/src/src/titlebar.cpp index 36404c130..408ac6466 100644 --- a/src/src/titlebar.cpp +++ b/src/src/titlebar.cpp @@ -1,9 +1,12 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "titlebar.h" #include "datamanager.h" +#include +#include "ddlog.h" +using namespace DDLog; class TitlebarPrivate { @@ -26,8 +29,12 @@ class TitlebarPrivate Titlebar::Titlebar(QWidget *parent) : DBlurEffectWidget(parent), d_ptr(new TitlebarPrivate(this)) { Q_D(Titlebar); + qCDebug(appLog) << "Initializing Titlebar"; - setAttribute(Qt::WA_TranslucentBackground, true); + // 设置DBlurEffectWidget为完全透明 + setBlurEnabled(false); // 关闭模糊效果 + setMaskAlpha(0); // 设置遮罩完全透明 + setMaskColor(QColor(0, 0, 0, 0)); // 设置遮罩颜色为完全透明 QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); @@ -39,57 +46,68 @@ Titlebar::Titlebar(QWidget *parent) : DBlurEffectWidget(parent), d_ptr(new Title d->m_titlebar->setBlurBackground(false); layout->addWidget(d->m_titlebar); + d->m_shadowEffect = new QGraphicsDropShadowEffect(this); + d->m_shadowEffect->setOffset(d->offsetX, d->offsetX); + d->m_shadowEffect->setBlurRadius(d->offsetX); + d->m_shadowEffect->setColor(Qt::transparent); + + this->setGraphicsEffect(d->m_shadowEffect); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &Titlebar::slotThemeTypeChanged); + qCDebug(appLog) << "Titlebar initialization complete"; } DTitlebar *Titlebar::titlebar() { + // qDebug() << "Function started: titlebar"; Q_D(const Titlebar); return d->m_titlebar; } void Titlebar::slotThemeTypeChanged() { + // qDebug() << "Function started: slotThemeTypeChanged"; Q_D(const Titlebar); QPalette pa; if(DataManager::instance()->getdevStatus() != NOCAM) { + // qDebug() << "Setting light color palette for active camera"; pa.setColor(QPalette::ButtonText, d->lightColor); d->m_titlebar->setPalette(pa); - } else{ + } else { if(DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) { + // qDebug() << "Setting light color palette for dark theme"; pa.setColor(QPalette::ButtonText, d->lightColor); d->m_titlebar->setPalette(pa); } else { + // qDebug() << "Setting dark color palette for light theme"; pa.setColor(QPalette::ButtonText, d->darkColor); d->m_titlebar->setPalette(pa); } } + // qDebug() << "Function completed: slotThemeTypeChanged"; } void Titlebar::paintEvent(QPaintEvent *pe) { + // qDebug() << "Function started: Titlebar::paintEvent"; Q_D(const Titlebar); QPainter painter(this); QPalette pa; - QPen pen(QColor(0, 0, 0, 0)); - QLinearGradient linearGradient(width(), 0, width(), height()); - - linearGradient.setColorAt(0, QColor(0, 0, 0, 255 * 0.5)); //垂直线性渐变 - linearGradient.setColorAt(1, QColor(0, 0, 0, 0)); if(DataManager::instance()->getdevStatus() != NOCAM) { + // qDebug() << "Setting light color palette for active camera"; pa.setColor(QPalette::ButtonText, d->lightColor); d->m_titlebar->setPalette(pa); } painter.setRenderHint(QPainter::Antialiasing, true); - painter.setBrush(QBrush(linearGradient)); - painter.setPen(pen); + painter.setPen(Qt::transparent); painter.drawRect(rect()); + // qDebug() << "Function completed: Titlebar::paintEvent"; } Titlebar::~Titlebar() { - + // qDebug() << "Cleaning up Titlebar"; } diff --git a/src/src/videosurface.cpp b/src/src/videosurface.cpp index 0ed9c762f..0cddfce37 100644 --- a/src/src/videosurface.cpp +++ b/src/src/videosurface.cpp @@ -14,43 +14,60 @@ VideoSurface::VideoSurface(QObject *parent) : QAbstractVideoSurface(parent) , imageFormat_(QImage::Format_Invalid) { + // qDebug() << "Function started: VideoSurface constructor"; } QList VideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const { + // qDebug() << "Function started: supportedPixelFormats"; + QList result; if (handleType == QAbstractVideoBuffer::NoHandle) { - return QList()<< QVideoFrame::Format_RGB32<< QVideoFrame::Format_ARGB32<< QVideoFrame::Format_ARGB32_Premultiplied<< QVideoFrame::Format_RGB565<< QVideoFrame::Format_RGB555; + // qDebug() << "VideoSurface::supportedPixelFormats: Enter if branch (NoHandle)"; + result = QList()<< QVideoFrame::Format_RGB32<< QVideoFrame::Format_ARGB32<< QVideoFrame::Format_ARGB32_Premultiplied<< QVideoFrame::Format_RGB565<< QVideoFrame::Format_RGB555; } else { - return QList(); + // qDebug() << "VideoSurface::supportedPixelFormats: Enter else branch (other handle type)"; + result = QList(); } + // qDebug() << "Function completed: supportedPixelFormats"; + return result; } bool VideoSurface::isFormatSupported(const QVideoSurfaceFormat & format) const { - return QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()) != QImage::Format_Invalid && !format.frameSize().isEmpty() && format.handleType() == QAbstractVideoBuffer::NoHandle; + // qDebug() << "Function started: isFormatSupported"; + bool result = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()) != QImage::Format_Invalid && !format.frameSize().isEmpty() && format.handleType() == QAbstractVideoBuffer::NoHandle; + // qDebug() << "Function completed: isFormatSupported"; + return result; } bool VideoSurface::start(const QVideoSurfaceFormat &format) { + // qDebug() << "Function started: start"; const QImage::Format imageFormat_ = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); const QSize size = format.frameSize(); if (imageFormat_ != QImage::Format_Invalid && !size.isEmpty()) { + // qDebug() << "VideoSurface::start: Enter if branch (valid format and size)"; this->imageFormat_ = imageFormat_; QAbstractVideoSurface::start(format); return true; } + // qDebug() << "Function completed: start, return false"; return false; } void VideoSurface::stop() { + // qDebug() << "Function started: stop"; currentFrame_ = QVideoFrame(); QAbstractVideoSurface::stop(); + // qDebug() << "Function completed: stop"; } bool VideoSurface::present(const QVideoFrame &frame) //每一帧摄像头的数据,都会经过这里 { + // qDebug() << "Function started: present"; if (surfaceFormat().pixelFormat() != frame.pixelFormat() || surfaceFormat().frameSize() != frame.size()) { + // qDebug() << "VideoSurface::present: Enter if branch (format mismatch, stopping)"; setError(IncorrectFormatError); stop(); return false; @@ -58,11 +75,13 @@ bool VideoSurface::present(const QVideoFrame &frame) //每一帧摄像头的数 currentFrame_ = frame; if (currentFrame_.map(QAbstractVideoBuffer::ReadOnly)) { + // qDebug() << "VideoSurface::present: Enter if branch (frame mapped successfully)"; //img就是转换的数据了 QImage img = QImage(currentFrame_.bits(),currentFrame_.width(),currentFrame_.height(),currentFrame_.bytesPerLine(),imageFormat_).mirrored(true,false); emit presentImage(img); currentFrame_.unmap(); } + // qDebug() << "Function completed: present"; return true; } diff --git a/src/src/videowidget.cpp b/src/src/videowidget.cpp index 490c34f97..ce34374a7 100644 --- a/src/src/videowidget.cpp +++ b/src/src/videowidget.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 -2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -17,6 +17,10 @@ #include #include +#include +#include +#include + #include #include #include @@ -30,31 +34,54 @@ #include #include #include -#include +#if QT_VERSION_MAJOR <= 5 #include +#include +#else +#include +#include +#endif + +#include +#include "ddlog.h" +using namespace DDLog; #define COUNTDOWN_WIDTH 32 #define COUNTDOWN_HEIGHT 61 -#define COUNTDOWN_OFFECT 20 +#define COUNTDOWN_OFFSET 20 + +// D-Bus 系统信息服务定义 (V1 版本) +#define DBUS_SYSTEM_INFO_SERVICE_V1 "org.deepin.dde.SystemInfo1" +#define DBUS_SYSTEM_INFO_PATH_V1 "/org/deepin/dde/SystemInfo1" +#define DBUS_SYSTEM_INFO_IFACE_V1 "org.deepin.dde.SystemInfo1" +#define DBUS_PROP_IFACE "org.freedesktop.DBus.Properties" +#define DBUS_PROP_DISTRO_ID "DistroID" -static PRIVIEW_ENUM_STATE g_Enum_Camera_State = PICTRUE; +// D-Bus 系统信息服务定义 (V0 版本) +#define DBUS_SYSTEM_INFO_SERVICE "org.deepin.dde.SystemInfo" +#define DBUS_SYSTEM_INFO_PATH "/org/deepin/dde/SystemInfo" +#define DBUS_SYSTEM_INFO_IFACE "org.deepin.dde.SystemInfo" + +static PREVIEW_ENUM_STATE g_Enum_Camera_State = PICTURE; // 重写QGraphicsView类,在子类中,直接将鼠标事件路由到QWidget,这样QGraphicsScene不会接收和处理鼠标事件 -// bug链接 https://pms.uniontech.com/zentao/bug-view-100791.html +// bug链接 bug 100791 QGraphicsViewEx::QGraphicsViewEx(QWidget *parent) : QGraphicsView(parent) { - + // qDebug() << "QGraphicsViewEx created"; } void QGraphicsViewEx::mouseMoveEvent(QMouseEvent *e) { + // qDebug() << "QGraphicsViewEx mouseMoveEvent"; // 画布视图鼠标事件,默认接收鼠标事件(accepted为true),即默认不向父窗口传递鼠标事件 // 若在鼠标事件处理完成后,需要父窗口继续处理鼠标事件,需要在函数末尾将accepted改为false QGraphicsView::mouseMoveEvent(e); //若没有选中任何图元,才执行移动相机窗口操作 if (scene() && scene()->selectedItems().isEmpty()) { + // qDebug() << "QGraphicsViewEx mouseMoveEvent"; //accepted设为false,鼠标移动事件会继续向父窗口传递,拖动窗口功能可正常运行 e->setAccepted(false); } @@ -73,27 +100,43 @@ videowidget::videowidget(DWidget *parent) m_exposure(0), m_videoFormat("mp4") { + qCDebug(appLog) << "Initializing VideoWidget"; #ifndef __mips__ if (!get_wayland_status()) { m_openglwidget = new PreviewOpenglWidget(this); m_openglwidget->setFocusPolicy(Qt::ClickFocus); + qCDebug(appLog) << "Created OpenGL widget for non-Wayland environment"; } #endif m_pNormalItem = new QGraphicsPixmapItem; m_pNormalItem->setZValue(0); m_bActive = false; //是否录制中 - m_takePicSound = new QSound(":/resource/Camera.wav"); + m_takePicSound = new QSoundEffect(this); + m_takePicSound->setSource(QUrl("qrc:/resource/Camera.wav")); + m_takePicSound->setLoopCount(1); + m_takePicSound->setVolume(1.0); + connect(m_takePicSound, &QSoundEffect::playingChanged, + this, &videowidget::onShutterSoundPlayingChanged); + connect(m_takePicSound, &QSoundEffect::statusChanged, + this, &videowidget::onShutterSoundStatusChanged); m_countTimer = new QTimer(this); m_flashTimer = new QTimer(this); m_recordingTimer = new QTimer(this); m_pNormalView = new QGraphicsViewEx(this); m_gridlinewidget = new GridLineWidget(this); m_gridlinewidget->setGridType(Grid_None); +#if QT_VERSION_MAJOR > 5 + QScreen *screen = QGuiApplication::primaryScreen(); + //获取设备屏幕大小 + QRect screenRect = screen->geometry(); + m_flashLabel = new DLabel(); +#else QDesktopWidget *desktopWidget = QApplication::desktop(); //获取设备屏幕大小 QRect screenRect = desktopWidget->screenGeometry(); m_flashLabel = new DLabel(desktopWidget); +#endif m_flashLabel->setWindowFlags(m_flashLabel->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); m_flashLabel->move(0, 0); m_flashLabel->setFixedSize(screenRect.width(), screenRect.height()); @@ -120,6 +163,10 @@ videowidget::videowidget(DWidget *parent) // 画布错误提示图元 m_pCamErrItem = new QGraphicsTextItem; m_pCamErrItem->setZValue(2); + m_pCamErrItemSub = new QGraphicsTextItem; + m_pCamErrItemSub->setTextWidth(370); + m_pCamErrItemSub->document()->setDefaultTextOption(QTextOption(Qt::AlignCenter)); // 设置文本居中 + m_pCamErrItemSub->setZValue(2); m_pGridLayout = new QGridLayout(this); DLabel *recordingRedStatus = new DLabel;//录制状态红点 @@ -143,6 +190,7 @@ videowidget::videowidget(DWidget *parent) m_pNormalScene->addItem(m_pNormalItem); m_pNormalScene->addItem(m_pSvgItem); m_pNormalScene->addItem(m_pCamErrItem); + m_pNormalScene->addItem(m_pCamErrItemSub); m_pNormalScene->addItem(m_pGridLineItem); recordingwidgetlay->setSpacing(0); @@ -169,8 +217,9 @@ videowidget::videowidget(DWidget *parent) //wayland平台设置背景色为黑色 if (get_wayland_status() == true) { + qCDebug(appLog) << "wayland platform"; QPalette pal(palette()); - pal.setColor(QPalette::Background, Qt::black); + pal.setColor(QPalette::Window, Qt::black); setAutoFillBackground(true); setPalette(pal); } @@ -191,7 +240,7 @@ videowidget::videowidget(DWidget *parent) m_dLabel->setPalette(pltLabel); QPalette pa_cb = m_recordingTime->palette();//不用槽函数,程序打开如果是深色主题,可以正常切换颜色,其他主题不行,DTK的bug? - pa_cb.setColor(QPalette::Background, QColor(255, 0, 0, 30)); + pa_cb.setColor(QPalette::Window, QColor(255, 0, 0, 30)); pa_cb.setColor(QPalette::WindowText, QColor(255, 255, 255)); QFont ft("SourceHanSansSC-Medium"); ft.setWeight(QFont::Medium); @@ -208,7 +257,7 @@ videowidget::videowidget(DWidget *parent) //设置相机背景色为灰色 QColor bgColor(25, 25, 25); QPalette pal(this->palette()); - pal.setColor(QPalette::Background, bgColor); + pal.setColor(QPalette::Window, bgColor); this->setAutoFillBackground(true); this->setPalette(pal); m_pNormalScene->setBackgroundBrush(bgColor); @@ -217,19 +266,23 @@ videowidget::videowidget(DWidget *parent) setGridType(Grid_None); if (DataManager::instance()->encodeEnv() != FFmpeg_Env || !DataManager::instance()->encExists() || GlobalUtils::isLowPerformanceBoard()) { + qCDebug(appLog) << "Unsupported environment or encoding error"; m_videoFormat = "webm"; } if (dc::Settings::get().getOption("outsetting.outformat.vidformat").toInt()) { + qCDebug(appLog) << "Video format setting detected"; if (!GlobalUtils::isLowPerformanceBoard()) m_videoFormat = "webm"; else m_videoFormat = "mp4"; } + qCDebug(appLog) << "VideoWidget initialization complete"; } //延迟加载 void videowidget::delayInit() { + qCDebug(appLog) << "Starting delayed initialization of VideoWidget"; m_imgPrcThread = new MajorImageProcessingThread; m_imgPrcThread->setParent(this); m_imgPrcThread->setObjectName("MajorThread"); @@ -239,14 +292,17 @@ void videowidget::delayInit() setCapStatus(false); m_imgPrcThread->m_bTake = false; if (get_wayland_status() == true) { + qCDebug(appLog) << "Wayland detected"; connect(m_imgPrcThread, SIGNAL(SendMajorImageProcessing(QImage *, int)), this, SLOT(ReceiveMajorImage(QImage *, int))); } else { + qCDebug(appLog) << "X11 detected"; connect(m_imgPrcThread, SIGNAL(SendMajorImageProcessing(QImage *, int)), this, SLOT(ReceiveMajorImage(QImage *, int))); connect(m_imgPrcThread, SIGNAL(sigRenderYuv(bool)), this, SLOT(ReceiveOpenGLstatus(bool))); - connect(m_imgPrcThread, SIGNAL(sigYUVFrame(uchar *, uint, uint)), - m_openglwidget, SLOT(slotShowYuv(uchar *, uint, uint))); + connect(m_imgPrcThread, SIGNAL(sigYUVFrame(std::shared_ptr,uint,uint)), + m_openglwidget, SLOT(slotShowYuv(std::shared_ptr,uint,uint)), + Qt::DirectConnection); } connect(m_imgPrcThread, SIGNAL(reachMaxDelayedFrames()), @@ -256,6 +312,10 @@ void videowidget::delayInit() connect(m_imgPrcThread, SIGNAL(sigReflushSnapshotLabel()), this, SIGNAL(reflushSnapshotLabel())); + connect(m_imgPrcThread, &MajorImageProcessingThread::sigReflushSnapshotLabel, [=](const QString &filePath){ + emit reflushSnapshotLabel(filePath); + }); + connect(m_imgPrcThread, SIGNAL(sigRecordFrame(uchar*, uint)), this, SLOT(onRecordFrame(uchar*, uint))); @@ -270,20 +330,34 @@ void videowidget::delayInit() m_flashLabel->hide(); QString device = dc::Settings::get().getBackOption("device").toString(); - //启动视频 - switchCamera(device.toStdString().c_str(), ""); + // 启动视频预览 + // 如果配置的设备无效,切换到第一个有效的设备 + // 如果有效的设备也不存在,走默认流程 + updateValidDevices(); + if (!isDeviceValidByDevice(device)) { + QString validDevice = getFirstValidDevice(); + qCWarning(appLog) << "INVALID device from config:" << device << ", found first valid device:" << validDevice; + switchCamera(validDevice.toStdString().c_str(), ""); + } else { + qCInfo(appLog) << "VALID device from config:" << device; + switchCamera(device.toStdString().c_str(), ""); // 走默认逻辑 + } QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &videowidget::onThemeTypeChanged); + qCDebug(appLog) << "Delayed initialization complete"; } void videowidget::showNocam() { + qCDebug(appLog) << "Showing no camera state"; if (!m_pNormalView->isVisible()) m_pNormalView->show(); - if (!m_pCamErrItem->isVisible()) + if (!m_pCamErrItem->isVisible()) { m_pCamErrItem->show(); + m_pCamErrItemSub->show(); + } if (!m_pSvgItem->isVisible()) m_pSvgItem->show(); @@ -294,24 +368,42 @@ void videowidget::showNocam() m_openglwidget->hide(); if (m_GridType != Grid_None) { - if (!m_pGridLineItem->isVisible()) - m_pGridLineItem->show(); + qCDebug(appLog) << "Grid detected"; + // 提示界面不显示井字格 + if (m_pGridLineItem->isVisible()) { + m_pGridLineItem->hide(); + } if (m_gridlinewidget->isVisible()) m_gridlinewidget->hide(); } emit sigDeviceChange(); + QString strsub; if (DGuiApplicationHelper::LightType == DGuiApplicationHelper::instance()->themeType()) { - m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/Not connected.svg"), this)); + qCDebug(appLog) << "Light theme detected"; + if (DataManager::instance()->isSupportCameraSwitch()) { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/camera_switch_not_on.svg"), this)); + strsub = tr("Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled"); + } else { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/Not connected.svg"), this)); + } QColor clr(255, 255, 255); clr.setAlphaF(0.8); m_pCamErrItem->setDefaultTextColor(clr); + m_pCamErrItemSub->setDefaultTextColor(clr); } else { - m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/Not connected_dark.svg"), this)); + qCDebug(appLog) << "Dark theme detected"; + if (DataManager::instance()->isSupportCameraSwitch()) { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/camera_switch_not_on_dark.svg"), this)); + strsub = tr("Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled"); + } else { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/Not connected_dark.svg"), this)); + } QColor clr(Qt::white); clr.setAlphaF(0.2); m_pCamErrItem->setDefaultTextColor(clr); + m_pCamErrItemSub->setDefaultTextColor(clr); } QFont ft("SourceHanSansSC"); @@ -320,23 +412,30 @@ void videowidget::showNocam() m_pCamErrItem->setFont(ft); QString str(tr("No webcam found"));//未连接摄像头 m_pCamErrItem->setPlainText(str); + QFont ftsub("SourceHanSansSC"); + ftsub.setPixelSize(12); + m_pCamErrItemSub->setFont(ftsub); + m_pCamErrItemSub->setPlainText(strsub); m_pNormalScene->setSceneRect(m_pSvgItem->boundingRect()); m_flashLabel->hide(); itemPosChange(); m_pCamErrItem->show(); + m_pCamErrItemSub->show(); m_pSvgItem->show(); emit noCam(); + qCDebug(appLog) << "No camera state displayed"; if (getCapStatus()) //录制完成处理 onEndBtnClicked(); + qCDebug(appLog) << "End button clicked"; } void videowidget::showCamUsed() { - qDebug() << "show camUsed" << endl; + qCDebug(appLog) << "Showing camera in use state"; if (!m_pNormalView->isVisible()) m_pNormalView->show(); @@ -347,8 +446,11 @@ void videowidget::showCamUsed() m_openglwidget->hide(); if (m_GridType != Grid_None) { - if (!m_pGridLineItem->isVisible()) - m_pGridLineItem->show(); + qCDebug(appLog) << "Grid type is not Grid_None"; + // 提示界面不显示井字格 + if (m_pGridLineItem->isVisible()) { + m_pGridLineItem->hide(); + } if (m_gridlinewidget->isVisible()) m_gridlinewidget->hide(); } @@ -356,31 +458,42 @@ void videowidget::showCamUsed() emit sigDeviceChange(); QString str(tr("The webcam is in use"));//摄像头已被占用 if (DGuiApplicationHelper::LightType == DGuiApplicationHelper::instance()->themeType()) { + qCDebug(appLog) << "Light theme"; m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/Take up.svg"), this)); QColor clrText(Qt::white); clrText.setAlphaF(0.8); m_pCamErrItem->setDefaultTextColor(clrText);//浅色主题文字和图片是白色,特殊处理 m_pCamErrItem->setPlainText(str); + m_pCamErrItemSub->setDefaultTextColor(clrText); + m_pCamErrItemSub->setPlainText(QString()); } else { + qCDebug(appLog) << "Dark theme"; m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/Take up_dark.svg"), this)); QColor clrText(Qt::white); clrText.setAlphaF(0.2); m_pCamErrItem->setDefaultTextColor(clrText); m_pCamErrItem->setPlainText(str); + m_pCamErrItemSub->setDefaultTextColor(clrText); + m_pCamErrItemSub->setPlainText(QString()); } QFont ft("SourceHanSansSC"); ft.setWeight(QFont::DemiBold); ft.setPixelSize(17); m_pCamErrItem->setFont(ft); + QFont ftsub("SourceHanSansSC"); + ftsub.setPixelSize(12); + m_pCamErrItemSub->setFont(ftsub); m_pNormalScene->setSceneRect(m_pSvgItem->boundingRect()); m_flashLabel->hide(); itemPosChange(); m_pCamErrItem->show(); + m_pCamErrItemSub->show(); m_pSvgItem->show(); emit noCamAvailable(); + qCDebug(appLog) << "Camera in use state displayed"; if (getCapStatus())//录制完成处理 onEndBtnClicked(); @@ -388,10 +501,14 @@ void videowidget::showCamUsed() #ifndef __mips__ void videowidget::ReceiveOpenGLstatus(bool result) { + qCDebug(appLog) << "OpenGL status received"; if (result && m_openglwidget) { + qCDebug(appLog) << "OpenGL status received"; //Success - if (m_pCamErrItem->isVisible()) + if (m_pCamErrItem->isVisible()) { m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); + } if (m_pSvgItem->isVisible()) m_pSvgItem->hide(); @@ -400,6 +517,7 @@ void videowidget::ReceiveOpenGLstatus(bool result) m_pNormalView->hide(); if (m_GridType != Grid_None) { + qCDebug(appLog) << "Grid status received"; if (m_pGridLineItem->isVisible()) m_pGridLineItem->hide(); @@ -418,42 +536,51 @@ void videowidget::ReceiveOpenGLstatus(bool result) int widgetwidth = width(); int widgetheight = height(); if (!framewidth && !frameheight) { + qCDebug(appLog) << "Frame size not available"; m_openglwidget->resize(widgetwidth, widgetheight); } else { + qCDebug(appLog) << "Frame size available"; if ((framewidth * 100 / frameheight) > (widgetwidth * 100 / widgetheight)) { + qCDebug(appLog) << "Frame width is larger than widget width"; m_openglwidget->resize(widgetwidth, widgetwidth * frameheight / framewidth); m_openglwidget->move(0, (widgetheight - widgetwidth * frameheight / framewidth) / 2); } else { + qCDebug(appLog) << "Frame height is larger than widget height"; m_openglwidget->resize(widgetheight * framewidth / frameheight, widgetheight); m_openglwidget->move((widgetwidth - widgetheight * framewidth / frameheight) / 2, 0); } } - if (!m_openglwidget->isVisible()) + if (!m_openglwidget->isVisible() && !m_isFlash) m_openglwidget->show(); malloc_trim(0); emit camAvailable(); } + qCDebug(appLog) << "OpenGL status received"; } #endif void videowidget::ReceiveMajorImage(QImage *image, int result) { + qCDebug(appLog) << "Received major image"; // 若窗口高度改变,需要刷新整个窗口,防止上一帧图像出现在其它区域 static int height = this->height(); if (height != this->height()) { + qCDebug(appLog) << "Window height changed"; update(); height = this->height(); } if (!image->isNull()) { + qCDebug(appLog) << "Image is not null"; switch (result) { case 0: //Success -// m_imgPrcThread->m_rwMtxImg.lock(); - m_pNormalView->show(); + if (!m_isFlash) + m_pNormalView->show(); m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); m_pSvgItem->hide(); m_pNormalItem->show(); @@ -467,19 +594,25 @@ void videowidget::ReceiveMajorImage(QImage *image, int result) if (m_openglwidget && m_openglwidget->isVisible()) m_openglwidget->hide(); { - int widgetwidth = this->width(); - int widgetheight = this->height(); - if ((image->width() * 100 / image->height()) > (widgetwidth * 100 / widgetheight)) { - QImage img = image->scaled(widgetwidth, widgetwidth * image->height() / image->width(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - m_framePixmap = QPixmap::fromImage(img); + const qreal dpr = this->devicePixelRatioF(); + const int widgetwidth = qRound(this->width() * dpr); + const int widgetheight = qRound(this->height() * dpr); + + int targetWidth, targetHeight; + if (qint64(image->width()) * widgetheight > qint64(widgetwidth) * image->height()) { + targetWidth = widgetwidth; + targetHeight = qMin(qRound(qreal(widgetwidth) * image->height() / image->width()), widgetheight); } else { - QImage img = image->scaled(widgetheight * image->width() / image->height(), widgetheight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - m_framePixmap = QPixmap::fromImage(img); + targetHeight = widgetheight; + targetWidth = qMin(qRound(qreal(widgetheight) * image->width() / image->height()), widgetwidth); } - m_pNormalScene->setSceneRect(m_framePixmap.rect()); + m_framePixmap = QPixmap::fromImage(image->scaled(targetWidth, targetHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + m_framePixmap.setDevicePixelRatio(dpr); + + const QRectF sceneRect(0, 0, qreal(m_framePixmap.width()) / dpr, qreal(m_framePixmap.height()) / dpr); + m_pNormalScene->setSceneRect(sceneRect); m_pNormalItem->setPixmap(m_framePixmap); -// m_imgPrcThread->m_rwMtxImg.unlock(); if (DataManager::instance()->encodeEnv() == FFmpeg_Env) { if (get_encoder_status() == 0 && getCapStatus() == true) @@ -493,14 +626,26 @@ void videowidget::ReceiveMajorImage(QImage *image, int result) } break; default: + qCWarning(appLog) << "Received invalid image with result code:" << result; break; } emit camAvailable(); } + qCDebug(appLog) << "Received major image"; +} + +void videowidget::onLockedScreen(bool bLocked) +{ + m_isLockedScreen = bLocked; + if (m_isLockedScreen) { + // 复用现有函数,达到关闭摄像头的效果 + this->onReachMaxDelayedFrames(); + } } void videowidget::onReachMaxDelayedFrames() { + qCWarning(appLog) << "Reached maximum delayed frames, stopping camera"; check_device_list_events(get_v4l2_device_handler()); v4l2_dev_t *videoDevHand = get_v4l2_device_handler(); @@ -520,21 +665,27 @@ void videowidget::onReachMaxDelayedFrames() m_pNormalItem->hide() ; if (m_openglwidget) m_openglwidget->hide(); + qCDebug(appLog) << "Camera stopped due to maximum delayed frames"; } -void videowidget::showCountDownLabel(PRIVIEW_ENUM_STATE state) +void videowidget::showCountDownLabel(PREVIEW_ENUM_STATE state) { + // qDebug() << "Entering showCountDownLabel"; QString str; switch (state) { - case PICTRUE: + case PICTURE: + // qDebug() << "Showing countdown label for photo"; m_recordingTimeWidget->hide(); break; case VIDEO: + // qDebug() << "Showing countdown label for video"; m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); m_pSvgItem->hide(); if (!get_capture_pause()) {//判断是否是暂停状态 + // qDebug() << "capture is not pause"; QString strTime = ""; int nHour = m_nCount / 3600; @@ -583,16 +734,19 @@ void videowidget::showCountDownLabel(PRIVIEW_ENUM_STATE state) break; default: + // qDebug() << "Showing countdown label for unknown state"; m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); m_pSvgItem->hide(); m_recordingTimeWidget->hide(); break; } - + // qDebug() << "Exiting showCountDownLabel"; } void videowidget::resizeEvent(QResizeEvent *size) { + // qDebug() << "Entering resizeEvent"; Q_UNUSED(size); //计时窗口放大缩小的显示 @@ -600,26 +754,37 @@ void videowidget::resizeEvent(QResizeEvent *size) height() - m_recordingTimeWidget->height() - 15); m_dLabel->move((width() - m_dLabel->width()) / 2, - (height() - m_dLabel->height()) - COUNTDOWN_OFFECT); + (height() - m_dLabel->height()) - COUNTDOWN_OFFSET); if (m_pCamErrItem->isVisible()) { + // qDebug() << "Showing camera error item"; itemPosChange(); m_pCamErrItem->show(); + m_pCamErrItemSub->show(); m_pSvgItem->show(); } else { + // qDebug() << "Hiding camera error item"; itemPosChange(); m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); } if (m_gridlinewidget) m_gridlinewidget->resize(rect().size()); + +#ifndef __mips__ + if(m_openglwidget && m_openglwidget->isVisible()) { + ReceiveOpenGLstatus(true); + } +#endif } void videowidget::showCountdown() { + qCDebug(appLog) << "Entering showCountdown"; if (DataManager::instance()->getdevStatus() == NOCAM) { - + qCDebug(appLog) << "No camera available, stopping countdown"; if (m_flashTimer->isActive()) m_flashTimer->stop(); @@ -633,8 +798,10 @@ void videowidget::showCountdown() //显示倒数,m_nMaxInterval秒后结束,并拍照 if (m_nInterval == 0 && DataManager::instance()->getdevStatus() == CAM_CANUSE) { //倒数到最后一次,隐藏计数器 + qCDebug(appLog) << "Countdown complete, current state:" << (g_Enum_Camera_State == VIDEO ? "Video" : "Photo"); m_dLabel->hide(); if (g_Enum_Camera_State == VIDEO) { + qCDebug(appLog) << "Showing countdown label for video"; if (!getCapStatus()) { if (DataManager::instance()->encodeEnv() != QCamera_Env) { /*m_bActive录制状态判断 @@ -651,20 +818,28 @@ void videowidget::showCountdown() emit updateRecordState(photoRecordBtn::Recording); } - if (g_Enum_Camera_State == PICTRUE) { + if (g_Enum_Camera_State == PICTURE) { + qCDebug(appLog) << "Showing countdown label for photo"; if (m_nInterval == 0 && m_curTakePicTime >= 0) { if (m_flashEnable && 1 == m_nMaxContinuous) { +#if QT_VERSION_MAJOR > 5 + QScreen *screen = QGuiApplication::primaryScreen(); + QRect rt = screen->geometry(); +#else int index = QApplication::desktop()->screenNumber(this); QRect rt = QApplication::desktop()->screenGeometry(index); +#endif m_flashLabel->setGeometry(rt); m_flashLabel->setFixedSize(rt.size()); m_flashLabel->show(); } m_flashTimer->start(500); - qDebug() << "flashTimer->start();"; + qCDebug(appLog) << "flashTimer->start();"; - if (m_pNormalView) + if (m_pNormalView) { + m_isFlash = true; m_pNormalView->hide(); + } if (m_openglwidget) m_openglwidget->hide(); if (m_gridlinewidget) @@ -676,8 +851,10 @@ void videowidget::showCountdown() emit updatePhotoState(CMainWindow::Photoing); if (QDir(m_savePicFolder).exists() == false) { + qCDebug(appLog) << "Creating default picture folder"; QString strDefaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + QDir::separator() + "Camera"; if (QDir(strDefaultPath).exists() == false) { + qCDebug(appLog) << "Creating default picture folder"; QDir dir; dir.mkdir(strDefaultPath); } @@ -693,13 +870,14 @@ void videowidget::showCountdown() m_curTakePicTime -= 1; if (m_curTakePicTime == 0) { + qCDebug(appLog) << "Taking picture"; //拍照结束,恢复按钮状态和缩略图标志位 QThread *thread = QThread::create([ = ]() { int nCount = 0; while (true) { if (nCount > 50) { - qWarning() << "too long to emit takePicDone"; + qCWarning(appLog) << "too long to emit takePicDone"; break; } @@ -716,12 +894,13 @@ void videowidget::showCountdown() connect(thread, &QThread::finished, thread, &QObject::deleteLater); thread->start(); } else { + qCDebug(appLog) << "Taking picture once"; QThread *thread = QThread::create([ = ]() { int nCount = 0; while (true) { if (nCount > 50) { - qWarning() << "too long to emit takePicOnce"; + qCWarning(appLog) << "too long to emit takePicOnce"; break; } @@ -743,22 +922,24 @@ void videowidget::showCountdown() m_countTimer->start(m_nMaxInterval == 34 ? 0 : 1000); m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); m_pSvgItem->hide(); m_pNormalView->hide(); } } else { + qCDebug(appLog) << "Showing countdown label for photo"; m_dLabel->setText(QString::number(m_nInterval)); m_dLabel->show(); - showCountDownLabel(PICTRUE); //拍照录像都要显示倒计时 + showCountDownLabel(PICTURE); //拍照录像都要显示倒计时 m_nInterval--; - qInfo() << "m_nInterval:" << m_nInterval; + qCInfo(appLog) << "m_nInterval:" << m_nInterval; } - } void videowidget::showRecTime() { + qCDebug(appLog) << "Updating recording time display"; //获取写video的时间 if (DataManager::instance()->encodeEnv() == FFmpeg_Env) { /** On the equipment with poor performance, the coding time is long, @@ -780,9 +961,11 @@ void videowidget::showRecTime() // return; // } } else if (DataManager::instance()->encodeEnv() == QCamera_Env) { + qCDebug(appLog) << "Getting recording time from camera"; m_nCount = Camera::instance()->getRecoderTime() / 1000; m_nCount += 2; } else if (DataManager::instance()->encodeEnv() == GStreamer_Env) { + qCDebug(appLog) << "Getting recording time from gstreamer"; m_nCount = m_videoWriter->getRecrodTime(); } @@ -829,19 +1012,91 @@ void videowidget::showRecTime() } m_recordingTime->setText(strTime); + qCDebug(appLog) << "Recording time updated:" << strTime; +} + +void videowidget::startShutterSoundWarmup() +{ + /*! + * @brief 预热门格拍照音效:静音播放一次使底层音频后端就绪 + * + * 将音量设为 0 并播放一次,触发 QSoundEffect 进入 Ready 状态。 + * 若已在预热中或音效未就绪则直接返回。 + */ + if (m_shutterSoundWarming || m_takePicSound->status() != QSoundEffect::Ready) { + return; + } + + m_shutterSoundWarming = true; + m_takePicSound->setVolume(0.0); + m_takePicSound->play(); +} + +void videowidget::onShutterSoundPlayingChanged() +{ + /*! + * @brief 门格音效播放状态变化处理 + * + * 预热阶段:播放开始后立即 stop,恢复音量并标记预热完成; + * 若有待播放请求,则通过 QTimer::singleShot(0) 延迟触发实际播放。 + */ + if (!m_shutterSoundWarming) { + return; + } + + if (m_takePicSound->isPlaying()) { + m_takePicSound->stop(); + return; + } + + m_shutterSoundWarming = false; + m_takePicSound->setVolume(1.0); + if (m_shutterSoundPending && get_sound_of_takeing_photo()) { + m_shutterSoundPending = false; + QTimer::singleShot(0, this, [this] { + if (get_sound_of_takeing_photo()) { + m_takePicSound->play(); + } + }); + return; + } + m_shutterSoundPending = false; +} + +void videowidget::onShutterSoundStatusChanged() +{ + /*! + * @brief 门格音效加载状态变化处理 + * + * 加载出错时重置预热/待播放标志并恢复音量; + * 有待播放请求且音效已就绪时重新触发预热流程。 + */ + if (m_takePicSound->status() == QSoundEffect::Error) { + m_shutterSoundWarming = false; + m_shutterSoundPending = false; + m_takePicSound->setVolume(1.0); + } else if (m_shutterSoundPending) { + startShutterSoundWarmup(); + } } void videowidget::flash() { - if (get_sound_of_takeing_photo()) - m_takePicSound->play(); + qCDebug(appLog) << "Entering flash"; + if (get_sound_of_takeing_photo()) { + m_shutterSoundPending = true; + startShutterSoundWarmup(); + } #ifndef __mips__ - if (!get_wayland_status()) + if (!get_wayland_status()) { if (!m_openglwidget->isVisible() && filter_Normal == m_filterType && 0 == m_exposure) m_openglwidget->show(); - + } else { + m_pNormalView->show(); + } #endif + m_isFlash = false; m_flashLabel->hide(); //为避免没有关闭,放到定时器里边关闭 if (m_curTakePicTime == 0) @@ -849,13 +1104,15 @@ void videowidget::flash() //最后一次拍照完成,设置状态恢复 if (0 == m_curTakePicTime) { + qCDebug(appLog) << "Setting photo state to normal"; emit updatePhotoState(CMainWindow::photoNormal); } - + qCDebug(appLog) << "Exiting flash"; } void videowidget::slotresolutionchanged(const QString &resolution) { + qCDebug(appLog) << "Entering slotresolutionchanged"; if (DataManager::instance()->getdevStatus() != CAM_CANUSE) return ; @@ -869,6 +1126,7 @@ void videowidget::slotresolutionchanged(const QString &resolution) int newheight = ResStr[1].toInt();//新的高度 if (DataManager::instance()->encodeEnv() == QCamera_Env) { + qCDebug(appLog) << "Getting camera resolution"; QSize resolution = Camera::instance()->getCameraResolution(); if (resolution.width() != newwidth || resolution.height() != newheight) { QSize size(newwidth, newheight); @@ -876,6 +1134,7 @@ void videowidget::slotresolutionchanged(const QString &resolution) } } else { + qCDebug(appLog) << "Getting v4l2 resolution"; int nWidth = v4l2core_get_frame_width(get_v4l2_device_handler()); int nHeight = v4l2core_get_frame_height(get_v4l2_device_handler()); @@ -887,41 +1146,48 @@ void videowidget::slotresolutionchanged(const QString &resolution) request_format_update(1); } } - + qCDebug(appLog) << "Exiting slotresolutionchanged"; } void videowidget::slotGridTypeChanged(int type) { + // qDebug() << "Entering slotGridTypeChanged"; setGridType(static_cast(type)); } void videowidget::slotVideoFormatChanged(const QString &format) { + // qDebug() << "Entering slotVideoFormatChanged"; m_videoFormat = format; } void videowidget::onRecordFrame(uchar *rgb, uint size) { + // qDebug() << "Entering onRecordFrame"; if (m_videoWriter) m_videoWriter->writeFrame(rgb, size); } void videowidget::onRecordAudio(uchar *data, uint size) { + // qDebug() << "Entering onRecordAudio"; if (m_videoWriter) m_videoWriter->writeAudio(data, size); } void videowidget::onEndBtnClicked() { + qCDebug(appLog) << "End button clicked, stopping recording"; if (m_countTimer->isActive()) m_countTimer->stop(); if (m_recordingTimer->isActive()) m_recordingTimer->stop(); - if (m_pCamErrItem->isVisible() && (m_imgPrcThread->getStatus() == 0) && DataManager::instance()->encodeEnv() != QCamera_Env) + if (m_pCamErrItem->isVisible() && (m_imgPrcThread->getStatus() == 0) && DataManager::instance()->encodeEnv() != QCamera_Env) { m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); + } if (m_pSvgItem->isVisible() && (m_imgPrcThread->getStatus() == 0) && DataManager::instance()->encodeEnv() != QCamera_Env) m_pSvgItem->hide(); @@ -952,11 +1218,15 @@ void videowidget::onEndBtnClicked() recordBtn->blockSignals(true); #endif +#if QT_VERSION_MAJOR > 5 + QElapsedTimer time; +#else QTime time; +#endif time.start(); int duration = 0; if (getCapStatus()) { //录制完成处理 - qDebug() << "stop takeVideo"; + qCDebug(appLog) << "stop takeVideo"; if (DataManager::instance()->encodeEnv() == FFmpeg_Env) { if (video_capture_get_save_video() == 1) { @@ -985,7 +1255,7 @@ void videowidget::onEndBtnClicked() emit takeVdDone(); } - qInfo() << QString("-------------------stop record cost[%1]ms..----------------\n").arg(time.elapsed()); + qCInfo(appLog) << QString("-------------------stop record cost[%1]ms..----------------\n").arg(time.elapsed()); QJsonObject obj { {"tid", EventLogUtils::EndRecording}, @@ -1000,15 +1270,23 @@ void videowidget::onEndBtnClicked() if (recordBtn) recordBtn->blockSignals(false); #endif - + qCDebug(appLog) << "Recording stopped, duration:" << duration << "ms"; } void videowidget::onRestartDevices() { + qCDebug(appLog) << "Entering onRestartDevices"; + if (m_isLockedScreen) { + qCDebug(appLog) << __func__ << "bypass reason(locked screen)"; + return; + } + if (DataManager::instance()->getdevStatus() != CAM_CANUSE) { + qCDebug(appLog) << "Device status is not CAM_CANUSE"; onChangeDev(); if (DataManager::instance()->getdevStatus() == CAM_CANUSE) { + qCDebug(appLog) << "Device status is changed to CAM_CANUSE"; emit sigDeviceChange(); QPalette plt = palette(); plt.setColor(QPalette::Window, Qt::white); @@ -1019,10 +1297,12 @@ void videowidget::onRestartDevices() } } + qCDebug(appLog) << "Exiting onRestartDevices"; } void videowidget::onChangeDev() { + qCDebug(appLog) << "Changing camera device"; v4l2_dev_t *devicehandler = get_v4l2_device_handler(); if (m_imgPrcThread != nullptr) @@ -1032,59 +1312,101 @@ void videowidget::onChangeDev() QString str; if (devicehandler != nullptr) { + qCDebug(appLog) << "Closing v4l2 device handler"; str = QString(devicehandler->videodevice); close_v4l2_device_handler(); } v4l2_device_list_t *devlist = get_device_list(); - if (devlist->num_devices == 2) { - for (int i = 0 ; i < devlist->num_devices; i++) { - QString str1 = QString(devlist->list_devices[i].device); - if (str != str1) { - if (E_OK == switchCamera(devlist->list_devices[i].device, devlist->list_devices[i].name)) { - break; - } + if (devlist == nullptr) { + qCWarning(appLog) << "get device list FAILED"; + return; + } + + // USB摄像头分组相关逻辑来自xiwo分支,是否开启由DConfig控制 + int groupNum = 1; + QVector>> vGroupData; + // 如果未启用USB摄像头分组,则分组数默认为1,保持原有逻辑; + // 如果启用USB摄像头分组,则实际获取USB分组情况,根据分组结果进行处理; + if (DataManager::instance()->isEnableUsbGroup()) { + // 必须确保 devlist 的生命周期长于 vGroupData 的使用周期。 + // 如果 devlist 在 vGroupData 使用完毕前被释放,将导致悬空指针,引发崩溃。 + // 好在 vGroupData 只在本函数中使用,不会在其他地方被引用,所以不会导致悬空指针问题。 + groupNum = getUSBCameraGroup(devlist, vGroupData); + qCInfo(appLog) << __func__ << "groupNum:" << groupNum; + } + // 如果摄像头设备个数为0,分组情况就不用考虑了,直接显示无摄像头提示 + if (devlist->num_devices == 0) { + DataManager::instance()->setdevStatus(NOCAM); + showNocam(); + } else if (groupNum == 0) { + switchCamera("", ""); // 无有效设备,但是有设备,走默认逻辑 + } else if (groupNum == 1) { + if (m_validDevices.empty()) { + switchCamera("", ""); // 无有效设备,但是有设备,走默认逻辑 + } else { + int idx = getValidDeviceIndexByDevice(str); + if (idx == -1 || idx >= m_validDevices.size() - 1) { + // 获取第一个有效设备,直接切换到该设备 + const ValidDevice &dev = m_validDevices[0]; + switchCamera(dev.getDevice().toStdString().c_str(), dev.getName().toStdString().c_str()); + } else { + // 切换到当前设备的下一个有效设备 + const ValidDevice &dev = m_validDevices[idx + 1]; + switchCamera(dev.getDevice().toStdString().c_str(), dev.getName().toStdString().c_str()); } } } else { - if (devlist->num_devices == 0) { - DataManager::instance()->setdevStatus(NOCAM); - showNocam(); - } - - for (int i = 0 ; i < devlist->num_devices; i++) { - QString str1 = QString(devlist->list_devices[i].device); - - if (str == str1) { - if (i == devlist->num_devices - 1) { - switchCamera(devlist->list_devices[0].device, devlist->list_devices[0].name); - break; - } else { - switchCamera(devlist->list_devices[i + 1].device, devlist->list_devices[i + 1].name); - break; + if (groupNum == 2) { + for (int i = 0 ; i < vGroupData.count(); i++) { + const char *curDev = vGroupData[i].second[0]->device; + if (str != curDev) { + if (E_OK == switchCamera(curDev, vGroupData[i].second[0]->name)) { + break; + } } } - - if (str.isEmpty()) { - switchCamera(devlist->list_devices[0].device, devlist->list_devices[0].name); - break; + } else { + bool found = false; // 标记是否找到当前设备 + for (int i = 0 ; i < vGroupData.count(); i++) { + const char *curDev = vGroupData[i].second[0]->device; + if (str == curDev) { + found = true; + if (i == vGroupData.count() - 1) { + switchCamera(vGroupData[0].second[0]->device, vGroupData[0].second[0]->name); + break; + } else { + switchCamera(vGroupData[i + 1].second[0]->device, vGroupData[i + 1].second[0]->name); + break; + } + } + } + if (!found) { + // 未找到当前设备,切换到第一个设备 + switchCamera(vGroupData[0].second[0]->device, vGroupData[0].second[0]->name); } } } + qCDebug(appLog) << "Camera device change complete"; } int videowidget::switchCamera(const char *device, const char *devName) { + qCDebug(appLog) << "Switching camera to device:" << (device ? device : "null"); if (NULL == device) { return -1; } int ret = -1; if (DataManager::instance()->encodeEnv() != QCamera_Env) { + qCDebug(appLog) << "encodeEnv is not QCamera_Env"; ret = camInit(device); } else { + qCDebug(appLog) << "encodeEnv is QCamera_Env"; ret = 0; } + qCInfo(appLog) << "Camera init:" << ret; if (ret == E_OK) { + qCDebug(appLog) << "ret is E_OK"; m_imgPrcThread->init(); m_imgPrcThread->start(); DataManager::instance()->setdevStatus(CAM_CANUSE); @@ -1093,19 +1415,23 @@ int videowidget::switchCamera(const char *device, const char *devName) emit switchCameraSuccess(devName); } dc::Settings::get().setBackOption("device", device); + qCDebug(appLog) << "Camera switch successful to device:" << (devName ? devName : "unknown"); } else if (ret == E_FORMAT_ERR) { + qCDebug(appLog) << "ret is E_FORMAT_ERR"; v4l2_dev_t *vd = get_v4l2_device_handler(); if (vd != nullptr) close_v4l2_device_handler(); - qWarning() << "camInit failed"; + qCWarning(appLog) << "camInit failed"; if (DataManager::instance()->getdevStatus() != CAM_CANNOT_USE) showCamUsed(); DataManager::instance()->setdevStatus(CAM_CANNOT_USE); + qCWarning(appLog) << "Camera switch failed - Format error"; } else { + qCDebug(appLog) << "ret is not E_OK or E_FORMAT_ERR"; v4l2_dev_t *vd = get_v4l2_device_handler(); if (vd != nullptr) @@ -1113,32 +1439,107 @@ int videowidget::switchCamera(const char *device, const char *devName) DataManager::instance()->setdevStatus(NOCAM); showNocam(); + qCWarning(appLog) << "Camera switch failed - Unknown error"; } + qCDebug(appLog) << "Exiting switchCamera, ret: " << ret; return ret; } +int videowidget::getUSBCameraGroup(v4l2_device_list_t *devlist, QVector>> &vGroupData) +{ + // 来自xiwo分支,根据location进行分组 + // 收到建议使用 QMap> 来存储分组数据,但我们担心影响现有代码逻辑, + // 所以暂时保留 QVector>> 来存储分组数据。 + if (devlist == nullptr || devlist->list_devices == nullptr || devlist->num_devices == 0) { + qCWarning(appLog) << __func__ << "devlist is NULL!"; + return 0; + } + + for (int i = 0; i < devlist->num_devices; i++) { + if (!isDeviceValidByDevice(devlist->list_devices[i].device)) { + continue; // 无效设备不参与分组 + } + + QString location = QString(devlist->list_devices[i].location); + + int j = 0; + for (; j < vGroupData.count(); j++) { + if (location == vGroupData.at(j).first) { + break; + } + } + if (j == vGroupData.count()) { + QVector vList; + vList.append(&devlist->list_devices[i]); + vGroupData.append(qMakePair(location, vList)); + } else { + QVector &vlist = vGroupData[j].second; + vlist.append(&devlist->list_devices[i]); + } + } + return vGroupData.count(); +} + QString videowidget::getSaveFilePrefix() { + qCDebug(appLog) << "Entering getSaveFilePrefix"; QString filePrefix = "Camera_"; - if (DSysInfo::deepinType() == DSysInfo::DeepinProfessional) { - filePrefix = "UOS_"; - } else if (DSysInfo::deepinType() == DSysInfo::DeepinDesktop) { - filePrefix = "DEEPIN_"; + + auto getDistroIdFromDBus = [](const QString &service, const QString &path, const QString &iface) -> QString { + QDBusInterface sessionInfoInterface(service, + path, + DBUS_PROP_IFACE, + QDBusConnection::sessionBus()); + + if (sessionInfoInterface.isValid()) { + QDBusReply reply = sessionInfoInterface.call("Get", iface, DBUS_PROP_DISTRO_ID); + if (reply.isValid()) { + QString distroId = reply.value().variant().toString().toUpper(); + distroId.remove(QRegularExpression("[^A-Z0-9_]")); + if (!distroId.isEmpty()) { + return distroId + "_"; + } + } + } + return ""; + }; + + QString prefix = getDistroIdFromDBus(DBUS_SYSTEM_INFO_SERVICE_V1, DBUS_SYSTEM_INFO_PATH_V1, DBUS_SYSTEM_INFO_IFACE_V1); + if (!prefix.isEmpty()) { + qCDebug(appLog) << "Got DistroID from V1:" << prefix; + return prefix; } + + prefix = getDistroIdFromDBus(DBUS_SYSTEM_INFO_SERVICE, DBUS_SYSTEM_INFO_PATH, DBUS_SYSTEM_INFO_IFACE); + if (!prefix.isEmpty()) { + qCDebug(appLog) << "Got DistroID from V0:" << prefix; + return prefix; + } + + qCDebug(appLog) << "Exiting getSaveFilePrefix"; return filePrefix; } +QString videowidget::getSaveVdFolder() const +{ + return m_saveVdFolder; +} + void videowidget::onTakePic(bool bTrue) { - g_Enum_Camera_State = PICTRUE; + qCDebug(appLog) << "Take photo triggered:" << bTrue; + g_Enum_Camera_State = PICTURE; if (bTrue) { + qCDebug(appLog) << "Taking photo"; //1、重置状态 if (m_countTimer->isActive()) m_countTimer->stop(); - if (m_pCamErrItem->isVisible() && (m_imgPrcThread->getStatus() == 0)) + if (m_pCamErrItem->isVisible() && (m_imgPrcThread->getStatus() == 0)) { m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); + } if (m_pSvgItem->isVisible() && (m_imgPrcThread->getStatus() == 0)) m_pSvgItem->hide(); @@ -1153,6 +1554,7 @@ void videowidget::onTakePic(bool bTrue) m_countTimer->start(1000); } } else { + qCDebug(appLog) << "Taking photo"; emit updatePhotoState(CMainWindow::photoNormal); emit takePicCancel(); emit updateBlockSystem(false);//连拍取消时,取消阻止关机 @@ -1177,11 +1579,14 @@ void videowidget::onTakePic(bool bTrue) #endif } + qCDebug(appLog) << "Photo operation complete"; } void videowidget::onTakeVideo() //点一次开,再点一次关 { + qCDebug(appLog) << "Entering onTakeVideo"; if (m_nInterval >= 0 && m_countTimer->isActive()) { //倒计时期间的处理 + qCDebug(appLog) << "m_nInterval >= 0 && m_countTimer->isActive()"; //向mainwindow 发送录像状态通知信号 emit updateRecordState(photoRecordBtn::Normal); m_nInterval = 0; //下次可开启 @@ -1190,8 +1595,10 @@ void videowidget::onTakeVideo() //点一次开,再点一次关 if (m_countTimer->isActive()) m_countTimer->stop(); - if (m_pCamErrItem->isVisible()) + if (m_pCamErrItem->isVisible()) { m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); + } if (m_pSvgItem->isVisible()) m_pSvgItem->hide(); @@ -1200,7 +1607,7 @@ void videowidget::onTakeVideo() //点一次开,再点一次关 } if (getCapStatus()) { //录制完成处理 - qDebug() << "stop takeVideo"; + qCDebug(appLog) << "stop takeVideo"; //向mainwindow 发送录像状态通知信号 emit updateRecordState(photoRecordBtn::Normal); if (DataManager::instance()->encodeEnv() == FFmpeg_Env) { @@ -1222,8 +1629,10 @@ void videowidget::onTakeVideo() //点一次开,再点一次关 if (m_countTimer->isActive()) m_countTimer->stop(); - if (m_pCamErrItem->isVisible()) + if (m_pCamErrItem->isVisible()) { m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); + } if (m_pSvgItem->isVisible()) m_pSvgItem->hide(); @@ -1239,11 +1648,12 @@ void videowidget::onTakeVideo() //点一次开,再点一次关 //向mainwindow 发送录像倒计时状态 emit updateRecordState(photoRecordBtn::preRecord); } - + qCDebug(appLog) << "Video operation complete"; } void videowidget::forbidScrollBar(QGraphicsView *view) { + qCDebug(appLog) << "Entering forbidScrollBar"; view->horizontalScrollBar()->blockSignals(true); view->verticalScrollBar()->blockSignals(true); view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -1252,10 +1662,10 @@ void videowidget::forbidScrollBar(QGraphicsView *view) void videowidget::startTakeVideo() { - + qCDebug(appLog) << "Starting video capture"; #ifdef __sw_64__ if (video_capture_get_save_video() == 1) { - qInfo() << "-------------------------takeVideo reclicked..----------------------"; + qCInfo(appLog) << "-------------------------takeVideo reclicked..----------------------"; return; } #endif @@ -1267,7 +1677,7 @@ void videowidget::startTakeVideo() dir.mkdir(strDefaultVdPath); if (getCapStatus()) { - qDebug() << "stop takeVideo"; + qCDebug(appLog) << "stop takeVideo"; if (DataManager::instance()->encodeEnv() == FFmpeg_Env) stop_encoder_thread(); else if (DataManager::instance()->encodeEnv() == GStreamer_Env) { @@ -1283,8 +1693,9 @@ void videowidget::startTakeVideo() reset_video_timer(); emit updateBlockSystem(false); } else { + qCDebug(appLog) << "GetCapStatus is false"; if (DataManager::instance()->getdevStatus() == CAM_CANUSE) { - qDebug() << "start takeVideo"; + qCDebug(appLog) << "start takeVideo"; DataManager::instance()->getstrFileName() = getSaveFilePrefix() + QDateTime::currentDateTime().toString("yyyyMMddHHmmss") + "_" + QString::number(m_nFileID) + "." + m_videoFormat; emit filename(DataManager::instance()->getstrFileName()); @@ -1332,10 +1743,12 @@ void videowidget::startTakeVideo() m_recordingTimeWidget->move((nWidth - m_recordingTimeWidget->width() - 10) / 2, nHeight - m_recordingTimeWidget->height() - 15); } + qCDebug(appLog) << "Video capture started with format:" << m_videoFormat; } void videowidget::startCaptureVideo() { + qCDebug(appLog) << "Starting video capture with QCamera"; QDir dir; QString strDefaultVdPath = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation) + QDir::separator() + "Camera"; @@ -1343,14 +1756,14 @@ void videowidget::startCaptureVideo() dir.mkdir(strDefaultVdPath); if (getCapStatus()) { - qDebug() << "stop takeVideo"; + qCDebug(appLog) << "stop takeVideo"; Camera::instance()->stopRecoder(); setCapStatus(false); reset_video_timer(); emit updateBlockSystem(false); } else { if (DataManager::instance()->getdevStatus() == CAM_CANUSE) { - qDebug() << "start Gstreamer takeVideo"; + qCDebug(appLog) << "start Gstreamer takeVideo"; DataManager::instance()->getstrFileName() = getSaveFilePrefix() + QDateTime::currentDateTime().toString("yyyyMMddHHmmss") + "_" + QString::number(m_nFileID); emit filename(DataManager::instance()->getstrFileName()); m_nFileID ++; @@ -1385,26 +1798,34 @@ void videowidget::startCaptureVideo() m_recordingTimeWidget->move((nWidth - m_recordingTimeWidget->width() - 10) / 2, nHeight - m_recordingTimeWidget->height() - 15); } + qCDebug(appLog) << "QCamera video capture started"; } void videowidget::itemPosChange() { + qCDebug(appLog) << "Entering itemPosChange"; m_pCamErrItem->setPos((m_pSvgItem->boundingRect().width() - static_cast(m_pCamErrItem->boundingRect().width())) / 2, m_pSvgItem->boundingRect().height()); + // x轴布局居中,y轴在一级提示控件的下方 + m_pCamErrItemSub->setPos((m_pSvgItem->boundingRect().width() - static_cast(m_pCamErrItemSub->boundingRect().width())) / 2, m_pSvgItem->boundingRect().height() + m_pCamErrItem->boundingRect().height()); m_pSvgItem->update(); m_pCamErrItem->update(); + m_pCamErrItemSub->update(); } void videowidget::stopEverything() { + qCDebug(appLog) << "Entering stopEverything"; if (m_countTimer->isActive()) m_countTimer->stop(); m_flashLabel->hide(); - if (m_pCamErrItem->isVisible()) + if (m_pCamErrItem->isVisible()) { m_pCamErrItem->hide(); + m_pCamErrItemSub->hide(); + } if (m_pSvgItem->isVisible()) m_pSvgItem->hide(); @@ -1417,15 +1838,25 @@ void videowidget::stopEverything() if (!m_openglwidget->isVisible()) m_openglwidget->show(); #endif + qCDebug(appLog) << "Exiting stopEverything"; } void videowidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) { + qCDebug(appLog) << "Entering onThemeTypeChanged"; if (m_pSvgItem->isVisible()) { - QString str; + qCDebug(appLog) << "m_pSvgItem is visible"; + QString str, strsub; if (themeType == DGuiApplicationHelper::LightType) { + qCDebug(appLog) << "themeType is LightType"; if (DataManager::instance()->getdevStatus() == NOCAM) { - m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/Not connected.svg"), this)); + qCDebug(appLog) << "DataManager::instance()->getdevStatus() == NOCAM"; + if (DataManager::instance()->isSupportCameraSwitch()) { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/camera_switch_not_on.svg"), this)); + strsub = tr("Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled"); + } else { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/Not connected.svg"), this)); + } str = tr("No webcam found");//未连接摄像头 } else {//仅CAM_CANNOT_USE m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/light/Take up.svg"), this)); @@ -1436,13 +1867,21 @@ void videowidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) clrText.setAlphaF(0.8); m_pCamErrItem->setDefaultTextColor(clrText); m_pCamErrItem->setPlainText(str); + m_pCamErrItemSub->setDefaultTextColor(clrText); + m_pCamErrItemSub->setPlainText(strsub); } else if (themeType == DGuiApplicationHelper::DarkType) { + qCDebug(appLog) << "themeType is DarkType"; if (DataManager::instance()->getdevStatus() == NOCAM) { - qDebug() << "changed theme 3"; - m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/Not connected_dark.svg"), this)); + qCDebug(appLog) << "changed theme 3"; + if (DataManager::instance()->isSupportCameraSwitch()) { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/camera_switch_not_on_dark.svg"), this)); + strsub = tr("Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled"); + } else { + m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/Not connected_dark.svg"), this)); + } str = tr("No webcam found");//未连接摄像头 } else {//仅CAM_CANNOT_USE - qDebug() << "changed theme 4"; + qCDebug(appLog) << "changed theme 4"; m_pSvgItem->setSharedRenderer(new QSvgRenderer(QString(":/images/icons/dark/Take up_dark.svg"), this)); str = tr("The webcam is in use");//摄像头已被占用 } @@ -1451,16 +1890,23 @@ void videowidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) clor.setAlphaF(0.2); m_pCamErrItem->setDefaultTextColor(clor);//浅色主题文字和图片是白色,特殊处理 m_pCamErrItem->setPlainText(str); + m_pCamErrItemSub->setDefaultTextColor(clor); + m_pCamErrItemSub->setPlainText(strsub); } QFont ft("SourceHanSansSC"); ft.setWeight(QFont::DemiBold); ft.setPixelSize(17); m_pCamErrItem->setFont(ft); + QFont ftsub("SourceHanSansSC"); + ftsub.setPixelSize(12); + m_pCamErrItemSub->setFont(ftsub); if (DataManager::instance()->getdevStatus() == NOCAM) { + qCDebug(appLog) << "DataManager::instance()->getdevStatus() == NOCAM"; m_pNormalScene->setSceneRect(m_pSvgItem->boundingRect()); itemPosChange(); } else { + qCDebug(appLog) << "DataManager::instance()->getdevStatus() != NOCAM"; m_pNormalScene->setSceneRect(m_pSvgItem->boundingRect()); itemPosChange(); } @@ -1468,17 +1914,22 @@ void videowidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) if (m_flashLabel->isVisible()) m_flashLabel->hide(); } + qCDebug(appLog) << "Exiting onThemeTypeChanged"; } void videowidget::setHorizontalMirror(bool bMirror) { + qCDebug(appLog) << "Entering setHorizontalMirror"; if (nullptr != m_imgPrcThread) { + qCDebug(appLog) << "m_imgPrcThread is not nullptr"; m_imgPrcThread->setHorizontalMirror(bMirror); } + qCDebug(appLog) << "Exiting setHorizontalMirror"; } void videowidget::setCapStatus(bool status) { + qCDebug(appLog) << "Entering setCapStatus"; m_bActive = status; if (DataManager::instance()->encodeEnv() == GStreamer_Env) m_imgPrcThread->setRecording(status); @@ -1486,16 +1937,19 @@ void videowidget::setCapStatus(bool status) void videowidget::setFlash(bool bFlashOn) { + // qDebug() << "Entering setFlash"; m_flashEnable = bFlashOn; } void videowidget::setMaxRecTime(int hour) { + // qDebug() << "Entering setMaxRecTime"; m_nMaxRecTime = hour; } void videowidget::setFilterType(efilterType type) { + qCDebug(appLog) << "Entering setFilterType"; m_filterType = type; if (m_imgPrcThread) m_imgPrcThread->setFilter(filterPreviewButton::filterName_CUBE(type)); @@ -1503,6 +1957,7 @@ void videowidget::setFilterType(efilterType type) void videowidget::setState(bool bPhoto) { + qCDebug(appLog) << "Entering setState"; m_bPhoto = bPhoto; if (m_imgPrcThread) m_imgPrcThread->setState(bPhoto); @@ -1510,10 +1965,13 @@ void videowidget::setState(bool bPhoto) QRect videowidget::getFrameRect() { + qCDebug(appLog) << "Entering getFrameRect"; QRect rect; if (m_openglwidget && m_openglwidget->isVisible()) { + qCDebug(appLog) << "m_openglwidget is visible"; rect = m_openglwidget->geometry(); } else if (m_pNormalView && m_pNormalView->isVisible()) { + qCDebug(appLog) << "m_pNormalView is visible"; if (m_pNormalItem && m_pNormalItem->isVisible()) rect = QRect(m_pNormalView->mapFromScene(0,0), m_pNormalView->mapFromScene(m_pNormalView->sceneRect().bottomRight())); } @@ -1523,6 +1981,7 @@ QRect videowidget::getFrameRect() void videowidget::setGridType(GridType type) { + qCDebug(appLog) << "Setting grid type:" << type; if (type == m_GridType) return; @@ -1540,13 +1999,18 @@ void videowidget::setGridType(GridType type) m_pGridLineItem->hide(); } else { m_gridlinewidget->hide(); - m_pGridLineItem->show(); + // 提示界面不显示井字格 + if (!m_pSvgItem->isVisible()) { + m_pGridLineItem->show(); + } } } + qCDebug(appLog) << "Grid type updated"; } void videowidget::onExposureChanged(int exposure) { + qCDebug(appLog) << "Exposure changed to:" << exposure; m_exposure = exposure; if (m_imgPrcThread) m_imgPrcThread->setExposure(exposure); @@ -1554,12 +2018,87 @@ void videowidget::onExposureChanged(int exposure) void videowidget::onFilterDisplayChanged(int bDisplay) { + qCDebug(appLog) << "Filter display changed:" << bDisplay; if (m_imgPrcThread) m_imgPrcThread->setFilterGroupState(bDisplay); } +QString videowidget::getFirstValidDevice() +{ + // 加锁,确保线程安全 + QReadLocker locker(&m_mutexValidDevices); + if (m_validDevices.isEmpty()) { + qCWarning(appLog) << __func__ << "no valid device!"; + return ""; + } + + // 返回第一个有效相机设备的设备节点路径 + const ValidDevice &dev = m_validDevices.first(); + qCInfo(appLog) << __func__ << dev.getVid() << dev.getPid() << dev.getName() << dev.getDevice(); + return dev.getDevice(); +} + +void videowidget::updateValidDevices() +{ + qCInfo(appLog) << __func__; + // 加锁,确保线程安全 + QWriteLocker locker(&m_mutexValidDevices); + m_validDevices.clear(); // 清空有效相机设备列表 + + v4l2_device_list_t *devList = get_device_list(); + if (!devList) { + qCWarning(appLog) << __func__ << "get device list FAILED!"; + return; + } + + v4l2_dev_sys_data_t *v4l2_devices = devList->list_devices; + if (!v4l2_devices) { + qCWarning(appLog) << __func__ << "get device list FAILED!"; + return; + } + + for (int i = 0; i < devList->num_devices; i++) { + // 获取设备的VID和PID,不足4位用0填充 + QString vid = formatDeviceId(v4l2_devices[i].vendor); + QString pid = formatDeviceId(v4l2_devices[i].product); + if (DataManager::instance()->isDeviceValid(vid, pid, v4l2_devices[i].name)) { + qCInfo(appLog) << __func__ << "found valid device:" << vid << pid << v4l2_devices[i].name << v4l2_devices[i].device; + // 添加有效相机设备 + m_validDevices.push_back(ValidDevice(vid, pid, v4l2_devices[i].name, v4l2_devices[i].device)); + continue; + } + + qCInfo(appLog) << __func__ << "found invalid device(blacklist):" << vid << pid << v4l2_devices[i].name << v4l2_devices[i].device; + } +} + +bool videowidget::isDeviceValidByDevice(const QString &device) +{ + return getValidDeviceIndexByDevice(device) != -1; +} + +int videowidget::getValidDeviceIndexByDevice(const QString &device) +{ + // 加锁,确保线程安全 + QReadLocker locker(&m_mutexValidDevices); + for (int i = 0; i < m_validDevices.size(); i++) { + if (m_validDevices[i].getDevice() == device) { + return i; + } + } + return -1; +} + +int videowidget::getValidDeviceNum() +{ + // 加锁,确保线程安全 + QReadLocker locker(&m_mutexValidDevices); + return m_validDevices.size(); +} + videowidget::~videowidget() { + qCDebug(appLog) << "Cleaning up VideoWidget"; m_imgPrcThread->stop(); m_imgPrcThread->wait(); delete m_imgPrcThread; @@ -1579,15 +2118,16 @@ videowidget::~videowidget() delete m_flashLabel; m_flashLabel = nullptr; - delete m_takePicSound; - m_takePicSound = nullptr; - delete m_pNormalView; m_pNormalView = nullptr; delete m_pNormalScene; m_pNormalScene = nullptr; + m_shutterSoundWarming = false; + m_shutterSoundPending = false; + disconnect(m_takePicSound, nullptr, this, nullptr); + m_takePicSound->stop(); delete m_takePicSound; m_takePicSound = nullptr; @@ -1613,4 +2153,5 @@ videowidget::~videowidget() m_videoWriter = nullptr; camUnInit(); + qCDebug(appLog) << "VideoWidget cleanup complete"; } diff --git a/src/src/videowidget.h b/src/src/videowidget.h index d769086c1..a97ccdeac 100644 --- a/src/src/videowidget.h +++ b/src/src/videowidget.h @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 -2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -12,15 +12,21 @@ #include #include #include +#if QT_VERSION_MAJOR <= 5 #include #include -#include #include -#include -#include #include +#else +#include +#include +#endif +#include +#include +#include #include +#include #include "LPF_V4L2.h" #include "majorimageprocessingthread.h" @@ -43,14 +49,14 @@ class QGridLayout; class QVBoxLayout; class QHBoxLayout; class QSpacerItem; -class QSound; +class QSoundEffect; class QGraphicsSvgItem; #define FLASH_TIME 500//拍照闪光时间,500毫秒 /** -* @brief PRIVIEW_ENUM_STATE 枚举拍照,无设备,录像 +* @brief PREVIEW_ENUM_STATE 枚举拍照,无设备,录像 */ -enum PRIVIEW_ENUM_STATE {PICTRUE, NODEVICE, VIDEO}; +enum PREVIEW_ENUM_STATE {PICTURE, NODEVICE, VIDEO}; // 重写QGraphicsView类,在子类中,直接将鼠标事件路由到QWidget,这样QGraphicsScene不会接收和处理鼠标事件 class QGraphicsViewEx : public QGraphicsView @@ -64,6 +70,40 @@ class QGraphicsViewEx : public QGraphicsView virtual void mouseMoveEvent(QMouseEvent* e) override; }; +/** +* @brief ValidDevice 有效相机设备,与黑名单机制配套使用 +*/ +class ValidDevice +{ +public: + ValidDevice() = default; + ValidDevice(const QString &_vid, const QString &_pid, const QString &_name, const QString &_device) + : vid(_vid), pid(_pid), name(_name), device(_device) {} + + bool operator==(const ValidDevice &other) const { + return vid == other.vid && pid == other.pid && + name == other.name && device == other.device; + } + + // Setter 方法 + void setVid(const QString &_vid) { vid = _vid; } + void setPid(const QString &_pid) { pid = _pid; } + void setName(const QString &_name) { name = _name; } + void setDevice(const QString &_device) { device = _device; } + + // Getter 方法 + QString getVid() const { return vid; } + QString getPid() const { return pid; } + QString getName() const { return name; } + QString getDevice() const { return device; } + +private: + QString vid; // 相机VID + QString pid; // 相机PID + QString name; // 相机名称 + QString device; // 相机设备节点路径 +}; + /** * @brief videowidget 完成拍照,录像相关工作 * 连拍,延时拍照录像,闪光灯,文件保存等 @@ -155,7 +195,7 @@ class videowidget : public DWidget /** * @brief reflushSnapshotLabel 刷新照片预览图信号 */ - void reflushSnapshotLabel(); + void reflushSnapshotLabel(const QString &filePath); public: /** @@ -266,6 +306,11 @@ class videowidget : public DWidget */ void showCamUsed(); + /** + * @brief getValidDeviceNum 获取有效设备数量 + * @return 有效设备数量 + */ + int getValidDeviceNum(); public slots: /** * @brief onTakePic 拍照事件响应 @@ -320,6 +365,17 @@ public slots: */ void onFilterDisplayChanged(int bDisplay); + /** + * @brief 锁屏事件 + * @param bLocked 是否处于锁屏状态 + */ + void onLockedScreen(bool bLocked); + + /** + * @brief 更新有效相机设备列表 + */ + void updateValidDevices(); + private slots: /** * @brief ReceiveMajorImage 处理视频帧 mips、wayland下使用 @@ -371,6 +427,32 @@ private slots: */ void onRecordAudio(uchar* data, uint size); + /** + * @brief startShutterSoundWarmup 预热门格拍照音效,静音播放一次使底层音频后端就绪 + * + * 将音量设为 0 并播放一次,触发 QSoundEffect::statusChanged 进入 Ready 状态, + * 避免首次拍照时因音频后端初始化延迟导致音效丢失或次数不准。 + * 若已在预热中或音效未就绪则直接返回。 + */ + void startShutterSoundWarmup(); + + /** + * @brief onShutterSoundPlayingChanged 门格音效播放状态变化槽函数 + * + * 预热阶段:播放开始后立即 stop,恢复音量并标记预热完成; + * 若有待播放请求(m_shutterSoundPending),则通过 QTimer::singleShot(0) 延迟触发实际播放, + * 避免在 statusChanged 回调中递归 play 导致的状态混乱。 + */ + void onShutterSoundPlayingChanged(); + + /** + * @brief onShutterSoundStatusChanged 门格音效加载状态变化槽函数 + * + * 音效加载出错时重置预热/待播放标志并恢复音量; + * 有待播放请求且音效已就绪时重新触发预热流程。 + */ + void onShutterSoundStatusChanged(); + private: void resizeEvent(QResizeEvent *size) Q_DECL_OVERRIDE; @@ -378,7 +460,7 @@ private slots: * @brief showCountDownLabel 显示录制和拍照倒计时 * @param state 当前状态(拍照,没有设备,视频) */ - void showCountDownLabel(PRIVIEW_ENUM_STATE state); + void showCountDownLabel(PREVIEW_ENUM_STATE state); /** * @brief forbidScrollBar 禁止滚轮显示区域 @@ -414,14 +496,59 @@ private slots: */ int switchCamera(const char *device, const char *devName); + /** + * @brief 获取USB摄像头分组 + * @param devlist 设备列表 + * @param vGroupData 分组 + * @return 分组个数 + */ + int getUSBCameraGroup(v4l2_device_list_t *devlist, QVector>> &vGroupData); + /** * @brief getSaveFilePrefix * @return UOS_ 专业版 DEEPIN_ 社区版 CAMERA_ 其他 */ QString getSaveFilePrefix(); + + /** + * @brief formatDeviceId 格式化设备ID + * @param id 设备ID + * @return 格式化后的设备ID + */ + static QString formatDeviceId(uint id) { + // 格式化设备ID为4位十六进制数,不足4位用0填充 + return QString("%1").arg(id, 4, 16, QLatin1Char('0')); + } + + /** + * @brief 获取第一个有效的设备 + * @return 没找到时返回空字符串 + */ + QString getFirstValidDevice(); + + /** + * @brief 判断设备是否有效 + * @param device 设备识别路径 /dev/video* + * @return true 有效 false 无效 + */ + bool isDeviceValidByDevice(const QString &device); + + /** + * @brief 获取设备在有效设备列表中的索引 + * @param device 设备识别路径 /dev/video* + * @return 索引 无效时返回-1 + */ + int getValidDeviceIndexByDevice(const QString &device); public: MajorImageProcessingThread *m_imgPrcThread; AudioProcessingThread *m_audPrcThread; + + /** + * @brief getSaveVdFolder + * @return 保存视频默认文件夹 + */ + QString getSaveVdFolder() const; + private: bool m_bActive; //是否录制中 int m_nMaxContinuous; //最大连拍数:0,4,10 @@ -440,7 +567,9 @@ private slots: DLabel *m_recordingTime; //录制时长 QString m_videoFormat; //录制视频格式 - QSound *m_takePicSound; //拍照声音 + QSoundEffect *m_takePicSound; //拍照声音 + bool m_shutterSoundWarming = false; + bool m_shutterSoundPending = false; QString m_savePicFolder; //图片文件夹路径 QString m_saveVdFolder; //视频文件夹路径 QTimer *m_countTimer; //倒计时定时器 @@ -459,13 +588,17 @@ private slots: QGraphicsPixmapItem *m_pNormalItem; QGraphicsTextItem *m_pCamErrItem; //摄像头异常提示 + QGraphicsTextItem *m_pCamErrItemSub; //摄像头异常提示,二级提示 bool m_flashEnable; //是否闪光灯 bool m_bPhoto = true; //相机当前状态,默认为拍照状态 GstVideoWriter *m_videoWriter; //基于GStreamer实现的视频帧数据写入器 efilterType m_filterType; //当前选择的滤镜名称 int m_exposure; - + bool m_isFlash = false; + bool m_isLockedScreen = false; // 是否处于锁屏状态 + QVector m_validDevices; // 有效相机设备列表 + QReadWriteLock m_mutexValidDevices; // 有效相机设备列表读写锁 }; #endif // VIDEOWIDGET_H diff --git a/src/src/windowstatethread.cpp b/src/src/windowstatethread.cpp index 83d126703..c9fa8210c 100644 --- a/src/src/windowstatethread.cpp +++ b/src/src/windowstatethread.cpp @@ -1,5 +1,5 @@ -// Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2020 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -8,75 +8,60 @@ #include #include +#include "ddlog.h" +using namespace DDLog; windowStateThread::windowStateThread(bool isWayland, QObject *parent /*= nullptr*/) : QThread (parent) { setObjectName("windowStateThread"); -#ifdef USE_DEEPIN_WAYLAND - if (isWayland) { - qInfo() << __FUNCTION__ << __LINE__ << "KF5_WAYLAND_FLAGE_ON is open!!"; - //wayland自动识别窗口 - m_connectionThread = new QThread(this); - m_connectionThreadObject = new ConnectionThread(); - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - m_connectionThreadObject->initConnection(); - } -#endif + qCDebug(appLog) << "Initializing window state monitoring thread, Wayland:" << isWayland; } windowStateThread::~windowStateThread() { -#ifdef USE_DEEPIN_WAYLAND - if (m_connectionThread != nullptr) { - m_connectionThread->terminate(); - m_connectionThread->wait(); - } -#endif + qCDebug(appLog) << "Cleaning up window state monitoring thread"; } void windowStateThread::run() { + qCDebug(appLog) << "Starting window state monitoring loop"; while (!isInterruptionRequested()) { -// QMutexLocker locker(&m_mutex); +#ifdef UNITTEST + // 单元测试环境下跳过 workspaceWindows(), + // 因为 DForeignWindow::fromWinId() 在工作线程中调用会违反 Qt 线程安全规则 + break; +#endif //获取当前工作区域内所有的窗口 auto list = workspaceWindows(); + qCDebug(appLog) << "Found" << list.size() << "windows in workspace"; foreach(DForeignWindow *window, list) { if (window && window->windowState() == Qt::WindowState::WindowFullScreen) { - emit someWindowFullScreen(); + qCDebug(appLog) << "Detected fullscreen window:" << window->title(); + //去掉全屏的窗口信号处理 + //emit someWindowFullScreen(); } } //线程休眠1秒 std::this_thread::sleep_for(std::chrono::seconds(1)); -#ifdef UNITTEST - break; -#endif } - qInfo() << "windowStateThread end"; + qCInfo(appLog) << "Window state monitoring thread ended"; } QList windowStateThread::workspaceWindows() const { + qCDebug(appLog) << "Getting workspace windows list"; QList windowList; QList currentApplicationWindowList; const QWindowList &list = qApp->allWindows(); currentApplicationWindowList.reserve(list.size()); + qCDebug(appLog) << "Total application windows:" << list.size(); for (auto window : list) { if (window->property("_q_foreignWinId").isValid()) { + qCDebug(appLog) << "Skipping foreign window"; continue; } @@ -84,11 +69,13 @@ QList windowStateThread::workspaceWindows() const } QVector wmClientList = DWindowManagerHelper::instance()->currentWorkspaceWindowIdList(); + qCDebug(appLog) << "Window manager client list size:" << wmClientList.size(); bool currentWindow = false; for (WId wid : wmClientList) { if (currentApplicationWindowList.contains(wid)){ currentWindow = true; + qCDebug(appLog) << "Found current application window:" << wid; continue; } if (false == currentWindow){ @@ -96,72 +83,11 @@ QList windowStateThread::workspaceWindows() const } if (DForeignWindow *w = DForeignWindow::fromWinId(wid)) { windowList << w; + qCDebug(appLog) << "Added foreign window to list:" << w->title(); } } + qCDebug(appLog) << "Returning" << windowList.size() << "workspace windows"; return windowList; } -#ifdef USE_DEEPIN_WAYLAND -void windowStateThread::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - - connect(registry, &Registry::clientManagementAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_clientManagement = registry->createClientManagement(name, version, this); - connect(m_clientManagement, &ClientManagement::windowStatesChanged, this, - [this] { - m_windowStates = m_clientManagement->getWindowStates(); - this->waylandwindowinfo(m_windowStates); - } - ); - } - ); - - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_clientManagement); - m_windowStates = m_clientManagement->getWindowStates(); - this->waylandwindowinfo(m_windowStates); - } - ); - - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -void windowStateThread::waylandwindowinfo(const QVector &windowStates) -{ - if (windowStates.count() == 0) { - return; - } - - bool aheandInCamera = false; - QRect rect; - for (int i = 0; i < windowStates.count(); ++i) { - if (QString(windowStates[i].resourceName) != "deepin-camera") { - if (!aheandInCamera) - continue; - else { - if (windowStates[i].isFullScreen) { - QRect fullscreenRect(windowStates[i].geometry.x, windowStates[i].geometry.y, - windowStates[i].geometry.width, windowStates[i].geometry.height); - if (fullscreenRect.contains(rect)) - emit someWindowFullScreen(); - } - } - } else { - aheandInCamera = true; - rect = QRect(windowStates[i].geometry.x, windowStates[i].geometry.y, - windowStates[i].geometry.width, windowStates[i].geometry.height); - } - } -} -#endif diff --git a/src/src/windowstatethread.h b/src/src/windowstatethread.h index bef739921..be0c97c27 100644 --- a/src/src/windowstatethread.h +++ b/src/src/windowstatethread.h @@ -13,21 +13,6 @@ #include #include -#ifdef USE_DEEPIN_WAYLAND -#ifdef DWAYLAND -#include -#include -#include -#include -#else -#include -#include -#include -#include -#endif - -using namespace KWayland::Client; -#endif // USE_DEEPIN_WAYLAND DGUI_USE_NAMESPACE @@ -44,37 +29,6 @@ class windowStateThread : public QThread signals: void someWindowFullScreen(); -private: -#ifdef USE_DEEPIN_WAYLAND - /** - * @brief wayland获取屏幕窗口信息的安装注册函数 - * @param registry - */ - void setupRegistry(Registry *registry); - - /** - * @brief wayland获取屏幕窗口信息 - * @param m_windowStates - */ - void waylandwindowinfo(const QVector &m_windowStates); -#endif - -private: -#ifdef USE_DEEPIN_WAYLAND - // 获取wayland窗口信息相关。 wayland获取窗口的方法对于x11有很大的区别 - QThread *m_connectionThread = nullptr; - EventQueue *m_eventQueue = nullptr; - ConnectionThread *m_connectionThreadObject; - Compositor *m_compositor = nullptr; - PlasmaWindowManagement *m_windowManagement = nullptr; - ClientManagement *m_clientManagement = nullptr; - QVector m_windowStates; - /** - * @brief mips平台创建缓存文件的路径 - */ - std::string m_tempPath; -#endif - }; #endif // WINDOWSTATETHREAD_H diff --git a/src/translations/deepin-camera_ady.ts b/src/translations/deepin-camera_ady.ts new file mode 100644 index 000000000..7286ac196 --- /dev/null +++ b/src/translations/deepin-camera_ady.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Видеонь ҳәрәкәтләнә. Пәнәр ҡырылар? + + + Settings + Тәкъдимәтләр + + + None + Хәтәр + + + Photo + Фото + + + Video + Видео + + + Switch Cameras + Камералар үзгәрте + + + + CloseDialog + + Cancel + Бергән + + + Close + Яңылар + + + + ImageItem + + Copy + Күчерте + + + Delete + Хәтәр + + + Open folder + Папка ҡырылар + + + Print + Чыгырте + + + + QObject + + You don't have permission to operate this folder + Сез бу папка үзгәртә алмайсиз + + + Close + Яңылар + + + Open folder + Папка ҡырылар + + + Settings + Тәкъдимәтләр + + + Basic + База + + + File location + Файлын әлеге һыҙыҡта + + + Shoot + Шут + + + Burst mode + Буст режимы + + + Self-timer delay + Сәлф-таймер уҙыуы + + + Output + Чығыш + + + Output format + Чығыш форматы + + + 4 pcs + 4 үзгәрте + + + 10 pcs + 10 үзгәрте + + + None + Хәтәр + + + Camera + Камера + + + Camera is an image and video capture utility using your PC camera or webcam. + Камера - сизнең компьютерҙән һәм вебкамераны ҡулланып, әсәр һәм видео үткәрә торган үҙгәреш барлыҡҡа килтереү өсөн ҡулланыла. + + + File not saved + Файл саҡланмаған + + + Photo: + 'Фото:' + + + Video: + Видео: + + + Resolution settings + Резолюция қатынастары + + + Photos: + Суреттер: + + + Videos: + Видео: + + + Sound effects + Сезәм эффекты + + + Mirror mode + Айырылған режим + + + Flashlight + Флеш-фонарь + + + Gridlines + Таблицалар + + + 1*1 lines + 1*1 линиялар + + + 2*2 lines + 2*2 линиялар + + + Maximum resolution: + Максималды резолюция: + + + + Shortcut + + Camera + Камера + + + Settings + Тинтәр + + + Stop recording + Түптеуҙе тапшырыу + + + Copy + Күсеп + + + Delete + Хәтер + + + Open + Ачу + + + Print + Басып + + + Help + Ярҙам + + + Display shortcuts + Ҡысҡа ҡынаштарҙы күрһәтеү + + + Stop taking photos + Сурет алыуҙы тапшырыу + + + Context menu + Контекст меню + + + + dc::Settings + + None + Ялғыҙ + + + mp4 + mp4 + + + webm + вебм + + + + filterPreviewButton + + Normal + Ҡаҙан + + + Vivid + Ҡаҙан + + + Warm + Уҡыу + + + Cold + Хөнәр + + + Retro + Ретро + + + Film + Филм + + + Gray + Грэй + + + B&W + Бән Қрәй + + + + takePhotoSettingAreaWidget + + Flashlight + Флэшлайт + + + On + Вык + + + Off + Кыр + + + Delay capture + Таймләнгән кәпір + + + None + Хәтә + + + Filters + Филтры + + + Exposure + Экспозура + + + + videowidget + + No webcam found + Вебкам үнән тапылмады + + + The webcam is in use + Вебкам қулланылып ҡуйылған + + + diff --git a/src/translations/deepin-camera_af.ts b/src/translations/deepin-camera_af.ts new file mode 100644 index 000000000..ab177c4c2 --- /dev/null +++ b/src/translations/deepin-camera_af.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video-opname is in progress. Sluit die venster? + + + Settings + Instellings + + + None + Geen + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Skakel kameras + + + + CloseDialog + + Cancel + Kanselleer + + + Close + Sluit + + + + ImageItem + + Copy + Kopieer + + + Delete + Verwijder + + + Open folder + Ou folder + + + Print + Druk + + + + QObject + + You don't have permission to operate this folder + Jy het nie toestemming om hierdie folder te gebruik nie + + + Close + Sluit + + + Open folder + Ou folder + + + Settings + Instellings + + + Basic + Basies + + + File location + Ligging van die lêer + + + Shoot + Skiet + + + Burst mode + Burst-modus + + + Self-timer delay + Self-timer vertraag + + + Output + Uitset + + + Output format + Uitset-formaat + + + 4 pcs + 4 stukke + + + 10 pcs + 10 stukke + + + None + Geen + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera is 'n beeld en video-opname hulpmiddel wat gebruik maak van jou PC-kamera of webcam. + + + File not saved + Lêer is nie gestoor nie + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Oplossingsinstellings + + + Photos: + Foto's: + + + Videos: + Videos: + + + Sound effects + Klinker-effekte + + + Mirror mode + Spieëlmodus + + + Flashlight + Flitslig + + + Gridlines + Raslines + + + 1*1 lines + 1*1 lyne + + + 2*2 lines + 2*2 lyne + + + Maximum resolution: + Maksimum oplossings: + + + + Shortcut + + Camera + Kamera + + + Settings + Instellings + + + Stop recording + Stop opname + + + Copy + Kopieer + + + Delete + Verwijder + + + Open + Oepen + + + Print + Print + + + Help + Hulp + + + Display shortcuts + Toon snelkoppels + + + Stop taking photos + Stop met foto's neem + + + Context menu + Konteks-menu + + + + dc::Settings + + None + Geen + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normaal + + + Vivid + Levendig + + + Warm + Warm + + + Cold + Koud + + + Retro + Retro + + + Film + Film + + + Gray + Gri + + + B&W + Swart en Wit + + + + takePhotoSettingAreaWidget + + Flashlight + Flitslig + + + On + Aan + + + Off + Af + + + Delay capture + Vertragingsafbeelding + + + None + Geen + + + Filters + Filters + + + Exposure + Beligging + + + + videowidget + + No webcam found + Geen webkamera gevind + + + The webcam is in use + Die webkamera word gebruik + + + diff --git a/src/translations/deepin-camera_am_ET.ts b/src/translations/deepin-camera_am_ET.ts new file mode 100644 index 000000000..8e24ed09f --- /dev/null +++ b/src/translations/deepin-camera_am_ET.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + + + + Settings + + + + None + + + + Photo + + + + Video + + + + Switch Cameras + + + + + CloseDialog + + Cancel + + + + Close + + + + + ImageItem + + Copy + + + + Delete + + + + Open folder + + + + Print + + + + + QObject + + You don't have permission to operate this folder + + + + Close + + + + Open folder + + + + Settings + + + + Basic + + + + File location + + + + Shoot + + + + Burst mode + + + + Self-timer delay + + + + Output + + + + Output format + + + + 4 pcs + + + + 10 pcs + + + + None + + + + Camera + + + + Camera is an image and video capture utility using your PC camera or webcam. + + + + File not saved + + + + Photo: + + + + Video: + + + + Resolution settings + + + + Photos: + + + + Videos: + + + + Sound effects + + + + Mirror mode + + + + Flashlight + + + + Gridlines + + + + 1*1 lines + + + + 2*2 lines + + + + Maximum resolution: + + + + + Shortcut + + Camera + + + + Settings + + + + Stop recording + + + + Copy + + + + Delete + + + + Open + + + + Print + + + + Help + + + + Display shortcuts + + + + Stop taking photos + + + + Context menu + + + + + dc::Settings + + None + + + + mp4 + mp4 + + + webm + + + + + filterPreviewButton + + Normal + + + + Vivid + + + + Warm + + + + Cold + + + + Retro + + + + Film + + + + Gray + ጥቄቅ + + + B&W + + + + + takePhotoSettingAreaWidget + + Flashlight + የስራ ባለስልጣ + + + On + ያለ + + + Off + ማይለ + + + Delay capture + ማስታወቂያ የማድረግ + + + None + ምንም + + + Filters + ፍልተር + + + Exposure + ከፍተኛ + + + + videowidget + + No webcam found + ውեբካሜራ የለም + + + The webcam is in use + ውեբካሜራ የሚመጡበት ነው + + + diff --git a/src/translations/deepin-camera_ar.ts b/src/translations/deepin-camera_ar.ts index 0adede3e2..c8f049298 100644 --- a/src/translations/deepin-camera_ar.ts +++ b/src/translations/deepin-camera_ar.ts @@ -9,7 +9,7 @@ Open folder - فتح مجلد + فتح مجلد Settings @@ -21,15 +21,15 @@ Photo - + صورة Video - + فيديو Switch Cameras - + تبديل الكاميرات @@ -74,7 +74,7 @@ Invalid folder - مجلد غير صالح + مجلد غير صالح Open folder @@ -138,7 +138,7 @@ Save to: - حفظ ل: + حفظ إلى: Photo: @@ -154,7 +154,7 @@ Resolution: - الدِّقَّة: + الدِّقَّة: Photos: @@ -170,27 +170,27 @@ Mirror mode - + وضع المرآة Flashlight - + مصباح يدوي Gridlines - + شبكة 1*1 lines - + خطوط 1x1 2*2 lines - + خطوط 2x2 Maximum resolution: - + أقصى دقة @@ -244,15 +244,15 @@ ThumbnailsBar Take photo - التقاط صورة + التقاط صورة Record video - تسجيل فيديو + تسجيل فيديو Stop taking photos - إيقاف التقاط الصور + إيقاف التقاط الصور @@ -261,59 +261,67 @@ None لا أحد + + mp4 + mp4 + + + webm + فريم + filterPreviewButton Normal - + طبيعي Vivid - + براق Warm - + دافئ Cold - + بارد Retro - + ستيني Film - + فيلم Gray - + رمادي B&W - + أبيض وأسود takePhotoSettingAreaWidget Flashlight - + مصباح يدوي On - + eingeschaltet Off - + ausgeschaltet Delay capture - + التقاط التأخير None @@ -321,11 +329,11 @@ Filters - + الفلاتر Exposure - + النوافذ @@ -340,7 +348,7 @@ Stop recording - إيقاف التسجيل + إيقاف التسجيل diff --git a/src/translations/deepin-camera_ast.ts b/src/translations/deepin-camera_ast.ts new file mode 100644 index 000000000..093f2a3a8 --- /dev/null +++ b/src/translations/deepin-camera_ast.ts @@ -0,0 +1,320 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video grabación ta en progreso. Cerrar la finestra? + + + Settings + Ajustes + + + None + Ningún + + + Photo + Fotografía + + + Video + Video + + + Switch Cameras + Cambiar cámaras + + + + CloseDialog + + Cancel + Cancelar + + + Close + Cerrar + + + + ImageItem + + Copy + Copiar + + + Delete + Eliminar + + + Open folder + Abrir carpeta + + + Print + Imprimir + + + + QObject + + You don't have permission to operate this folder + No tens permiso pa operar esta carpeta + + + Close + Cerrar + + + Open folder + Abrir carpeta + + + Settings + Ajustes + + + Basic + Básicu + + + File location + Llocalizashón del fitxer + + + Shoot + Fotografiar + + + Burst mode + Modu de disparu + + + Self-timer delay + Retardu del temporizador + + + Output + Salida + + + Output format + Formatu de salida + + + 4 pcs + 4 pics + + + 10 pcs + 10 pics + + + None + Ningún + + + Camera + Cámara + + + Camera is an image and video capture utility using your PC camera or webcam. + >- +La cámara ye una utilidat pa capturar imáxenes y videos usando la cámara de so computador o webcam. + + + File not saved + Fitxer nun guardáu + + + Photo: + Fotografía: + + + Video: + Video: + + + Resolution settings + Ajustes de resolución + + + Photos: + Fotos: + + + Videos: + Videos: + + + Sound effects + Efectos de sonido + + + Mirror mode + Modo de espego + + + Flashlight + Luz de flash + + + Gridlines + Líneas de malla + + + 1*1 lines + Líneas 1×1 + + + 2*2 lines + Líneas 2×2 + + + Maximum resolution: + Resolución máxima: + + + + Shortcut + + Camera + Kamera + + + Settings + Ajustes + + + Stop recording + Parar de grabar + + + Copy + Kopiar + + + Delete + Borrar + + + Open + Abrir + + + Print + Imprimir + + + Help + Axuda + + + Display shortcuts + Mostrar atajos + + + Stop taking photos + Parar de tomar fotos + + + Context menu + Menú de contexto + + + + dc::Settings + + None + Ningún + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vividu + + + Warm + Calentu + + + Cold + Fríu + + + Retro + Retro + + + Film + Película + + + Gray + Gris + + + B&W + B/N + + + + takePhotoSettingAreaWidget + + Flashlight + Luz + + + On + Encendido + + + Off + Apagado + + + Delay capture + Retrasa la captura + + + None + Ningún + + + Filters + Filtros + + + Exposure + Exposición + + + + videowidget + + No webcam found + No se troba webcam + + + The webcam is in use + La webcam ta en uso + + + diff --git a/src/translations/deepin-camera_az.ts b/src/translations/deepin-camera_az.ts index f9c141157..cf14429e0 100644 --- a/src/translations/deepin-camera_az.ts +++ b/src/translations/deepin-camera_az.ts @@ -40,7 +40,7 @@ Close - Bağlayın + Bağlamaq @@ -59,7 +59,7 @@ Print - Çap edin + Çap etmək @@ -178,19 +178,19 @@ Gridlines - + Tor xətləri 1*1 lines - + 1*1 xətlər 2*2 lines - + 2*2 xətlər Maximum resolution: - + Maksimum qorxulma: @@ -261,6 +261,14 @@ None Heç biri + + mp4 + mp4 + + + webm + webm + filterPreviewButton diff --git a/src/translations/deepin-camera_bg.ts b/src/translations/deepin-camera_bg.ts new file mode 100644 index 000000000..f391391a4 --- /dev/null +++ b/src/translations/deepin-camera_bg.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Видеозаписта се извършва. Да затвориш прозореца? + + + Settings + Настройки + + + None + Нито едно + + + Photo + Снимка + + + Video + Видео + + + Switch Cameras + Промени камери + + + + CloseDialog + + Cancel + Отказ + + + Close + Затвори + + + + ImageItem + + Copy + Копирай + + + Delete + Изтрий + + + Open folder + Отвори папка + + + Print + Печат + + + + QObject + + You don't have permission to operate this folder + Нямаш разрешение да работиш с тази папка + + + Close + Затвори + + + Open folder + Отвори папка + + + Settings + Настройки + + + Basic + Основен + + + File location + Разположение на файла + + + Shoot + Снимай + + + Burst mode + Режим на бързо снимане + + + Self-timer delay + Задължителен интервал + + + Output + Изход + + + Output format + Формат на изход + + + 4 pcs + 4 снимки + + + 10 pcs + 10 снимки + + + None + Нито едно + + + Camera + Камера + + + Camera is an image and video capture utility using your PC camera or webcam. + Камерата е уред за снимане и запис на видеозаписи, използвайки вашата компютърна камера или вебкамера. + + + File not saved + Файлът не е запазен + + + Photo: + Снимка: + + + Video: + Видео: + + + Resolution settings + Настройки резолюция + + + Photos: + Снимки: + + + Videos: + Видео: + + + Sound effects + Звукови ефекти + + + Mirror mode + Режим огледало + + + Flashlight + Флеш + + + Gridlines + Решетка + + + 1*1 lines + 1×1 линии + + + 2*2 lines + 2×2 линии + + + Maximum resolution: + Максимална резолюция: + + + + Shortcut + + Camera + Камера + + + Settings + Настройки + + + Stop recording + Стоп запис + + + Copy + Копиране + + + Delete + Изтриване + + + Open + Отваряне + + + Print + Печат + + + Help + Помощ + + + Display shortcuts + Покажи кратки стили + + + Stop taking photos + Стоп снимки + + + Context menu + Меню с контекст + + + + dc::Settings + + None + Нищо + + + mp4 + mp4 + + + webm + + + + + filterPreviewButton + + Normal + Нормален + + + Vivid + Жив + + + Warm + Топъл + + + Cold + Хладен + + + Retro + Ретро + + + Film + Филм + + + Gray + Сив + + + B&W + Бялосив + + + + takePhotoSettingAreaWidget + + Flashlight + Флешлам + + + On + Включено + + + Off + Изключено + + + Delay capture + Задължително снимане + + + None + Няма + + + Filters + Филтри + + + Exposure + Експозиция + + + + videowidget + + No webcam found + Не е намерена вебкамера + + + The webcam is in use + Вебкамерата се използва + + + diff --git a/src/translations/deepin-camera_bn.ts b/src/translations/deepin-camera_bn.ts new file mode 100644 index 000000000..4aeebfc5e --- /dev/null +++ b/src/translations/deepin-camera_bn.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ভিডিও রেকর্ডিং চালু আছে। পৃষ্ঠা বন্ধ করুন? + + + Settings + সেটিংস + + + None + কোনো নেই + + + Photo + ছবি + + + Video + ভিডিও + + + Switch Cameras + ক্যামেরা বদাল + + + + CloseDialog + + Cancel + বাতিল + + + Close + বন্ধ + + + + ImageItem + + Copy + কপি + + + Delete + মুছুন + + + Open folder + ফোল্ডার খুলুন + + + Print + প্রিন্ট + + + + QObject + + You don't have permission to operate this folder + আপনি এই ফোল্ডারটি পরিচালনা করার অনুমতি পান না + + + Close + বন্ধ + + + Open folder + ফোল্ডার খুলুন + + + Settings + সেটিংস + + + Basic + প্রাথমিক + + + File location + ফাইল অবস্থান + + + Shoot + ফটো তুলুন + + + Burst mode + বার্স্ট মোড + + + Self-timer delay + সেলফ টাইমার দেরি + + + Output + আউটপুট + + + Output format + আউটপুট ফরম্যাট + + + 4 pcs + 4 টি + + + 10 pcs + 10 টি + + + None + কোনো নেই + + + Camera + ক্যামেরা + + + Camera is an image and video capture utility using your PC camera or webcam. + ক্যামেরা হল একটি ছবি এবং ভিডিও সংগ্রহ করার সাধারণ ব্যবহার যা আপনার পিসি ক্যামেরা বা ওয়েবক্যাম ব্যবহার করে। + + + File not saved + ফাইল সংরক্ষণ করা হয়নি + + + Photo: + ছবি: + + + Video: + ভিডিও: + + + Resolution settings + পরিমাণ সেটিংস + + + Photos: + ছবি: + + + Videos: + ভিডিও: + + + Sound effects + সাউন্ড ইফেক্টস + + + Mirror mode + আইনী মোড + + + Flashlight + ফ্লাশলাইট + + + Gridlines + গ্রিডলাইনস + + + 1*1 lines + 1×1 লাইনস + + + 2*2 lines + 2×2 লাইনস + + + Maximum resolution: + সর্বোচ্চ পরিমাণ: + + + + Shortcut + + Camera + ক্যামেরা + + + Settings + সেটিংস + + + Stop recording + রেকর্ডিং বন্ধ করুন + + + Copy + কপি করুন + + + Delete + মুছুন + + + Open + প্রস্তুত করুন + + + Print + প্রিন্ট করুন + + + Help + সাহায্য + + + Display shortcuts + শর্টকাট দেখুন + + + Stop taking photos + ছবি তুলতে বন্ধ করুন + + + Context menu + কন্টেক্স্ট মেনু + + + + dc::Settings + + None + কোনো নয় + + + mp4 + mp4 + + + webm + ওবেম + + + + filterPreviewButton + + Normal + নরম + + + Vivid + বিভিন্ন + + + Warm + গরম + + + Cold + বরফ + + + Retro + রেট্রো + + + Film + ফিল্ম + + + Gray + গ্রে + + + B&W + ব্ল্যাক অ্যান্ড ওয়াইট + + + + takePhotoSettingAreaWidget + + Flashlight + ফ্লাশ লাইট + + + On + অন + + + Off + অফ + + + Delay capture + লেট ক্যাপচার + + + None + কোনো নেই + + + Filters + ফিল্টার + + + Exposure + প্রকাশ + + + + videowidget + + No webcam found + ক্যামেরা খুঁজে পাওয়া যায়নি + + + The webcam is in use + ক্যামেরা ব্যবহার করা হচ্ছে + + + diff --git a/src/translations/deepin-camera_bo.ts b/src/translations/deepin-camera_bo.ts index 29f79ae8a..4bafe2307 100644 --- a/src/translations/deepin-camera_bo.ts +++ b/src/translations/deepin-camera_bo.ts @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - པར་ཆས་ནི་སྤྱོད་ཐབས་བདེ་བའི་པར་ལེན་ཡོ་བྱད་ཞིག་ཡིན་པ་དང་།པར་ལེན་དང་བཪྙན་ཕབ་སོགས་བྱེད་ནུས་མངོན་གྱུར་བྱེད་ཐུབ། + པར་ཆས་ནི་སྤྱོད་ཐབས་བདེ་བའི་པར་ལེན་ཡོ་བྱད་ཞིག་ཡིན་པ་དང་། དེས་པར་ལེན་དང་བཪྙན་ཕབ་སོགས་བྱ་ཐུབ། File not saved @@ -178,19 +178,19 @@ Gridlines - + རི་མོའི་མཚོན་ཆ་བཀོད་སྒྲིག་དྲ་བ། 1*1 lines - + དྲ་མིག་ཀུ་རུ་ཁ། 2*2 lines - + དྲ་མིག་གྲུ་བཞི། Maximum resolution: - + ག୍ୟོགས་རྒྱུན་ཆེ་ཉིད་: @@ -261,6 +261,14 @@ None མེད། + + mp4 + mp4 + + + webm + རྒྱ་གར་གྱི་ୱེབྷི + filterPreviewButton diff --git a/src/translations/deepin-camera_bqi.ts b/src/translations/deepin-camera_bqi.ts new file mode 100644 index 000000000..ae678366a --- /dev/null +++ b/src/translations/deepin-camera_bqi.ts @@ -0,0 +1,321 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ڤيديو ريكورديڠ جو ڤرو ڤرو. كلوس ويندو؟ + + + Settings + Settings + + + None + None + + + Photo + Photo + + + Video + Video + + + Switch Cameras + Switch Cameras + + + + CloseDialog + + Cancel + Cancel + + + Close + Close + + + + ImageItem + + Copy + Copy + + + Delete + Delete + + + Open folder + Open folder + + + Print + Print + + + + QObject + + You don't have permission to operate this folder + چو دو نه ݢو ڤرmission ݢو ݢوڤرئت ݢو ݢو فولدر + + + Close + Close + + + Open folder + Open folder + + + Settings + Settings + + + Basic + Basic + + + File location + File location + + + Shoot + Shoot + + + Burst mode + Burst mode + + + Self-timer delay + Self-timer delay + + + Output + Output + + + Output format + Output format + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + None + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + >- +Camera is an image and video capture utility using your PC camera or +webcam. + + + File not saved + File not saved + + + Photo: + 'Photo:' + + + Video: + ڤيديو: + + + Resolution settings + ريزولوشن سیتنگ + + + Photos: + فوتوس: + + + Videos: + ڤيديو: + + + Sound effects + سوند افектس + + + Mirror mode + میرر مود + + + Flashlight + فلشلائت + + + Gridlines + گریدلائنز + + + 1*1 lines + 1*1 lines + + + 2*2 lines + 2*2 lines + + + Maximum resolution: + مکسیمم ريزولوشن: + + + + Shortcut + + Camera + کامرا + + + Settings + سیتنگ + + + Stop recording + ستوب ريكورديڠ + + + Copy + کوپي + + + Delete + دیلیت + + + Open + اوپن + + + Print + پرنت + + + Help + هيلپ + + + Display shortcuts + ديسplaي شورٹکس + + + Stop taking photos + ستوب ݢوکن فوتوس + + + Context menu + کانتك مودو + + + + dc::Settings + + None + None + + + mp4 + mp4 + + + webm + ويبم + + + + filterPreviewButton + + Normal + Normal + + + Vivid + ڤیوډ + + + Warm + ورم + + + Cold + کولد + + + Retro + ریٹرو + + + Film + فلم + + + Gray + گرے + + + B&W + بی این ڈی + + + + takePhotoSettingAreaWidget + + Flashlight + فلش لائیت + + + On + اون + + + Off + اوف + + + Delay capture + ڈیلے کیپچر + + + None + نائن + + + Filters + فیلٹرز + + + Exposure + ایکسپوچر + + + + videowidget + + No webcam found + ویب کیم نہیں ملا + + + The webcam is in use + ویب کیم استعمال میں ہے + + + diff --git a/src/translations/deepin-camera_br.ts b/src/translations/deepin-camera_br.ts new file mode 100644 index 000000000..90cfaa600 --- /dev/null +++ b/src/translations/deepin-camera_br.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + + + + Settings + Configuracions + + + None + Nenhum + + + Photo + Fotografia + + + Video + Video + + + Switch Cameras + + + + + CloseDialog + + Cancel + Cancelar + + + Close + Fermer + + + + ImageItem + + Copy + Copiar + + + Delete + Eliminar + + + Open folder + Abre a carpeta + + + Print + Imprimir + + + + QObject + + You don't have permission to operate this folder + Non tens permisón pa operar esta carpeta + + + Close + Fermer + + + Open folder + Abre a carpeta + + + Settings + Configuracions + + + Basic + + + + File location + Lokasiun di ficheru + + + Shoot + Fotografiar + + + Burst mode + Modu de disparu + + + Self-timer delay + Retardo del temporizador + + + Output + + + + Output format + + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + Nenhum + + + Camera + + + + Camera is an image and video capture utility using your PC camera or webcam. + Cámara ye unha ferramenta pa capturar imáxenes y vídeos, usando a cámara del PC o webcam + + + File not saved + Ficheru non guardáu + + + Photo: + Fotografia: + + + Video: + Video: + + + Resolution settings + Configuracions di resolucyon + + + Photos: + Fotos: + + + Videos: + Videos: + + + Sound effects + Efeitos de som + + + Mirror mode + Modo espelho + + + Flashlight + Flashlight + + + Gridlines + Linhas de grade + + + 1*1 lines + Linhas 1x1 + + + 2*2 lines + Linhas 2x2 + + + Maximum resolution: + + + + + Shortcut + + Camera + Kamera + + + Settings + Configuracions + + + Stop recording + Parar de gravar + + + Copy + Copiar + + + Delete + Eliminar + + + Open + Abrir + + + Print + Imprimir + + + Help + Ajuda + + + Display shortcuts + Mostrar atalhos + + + Stop taking photos + Parar de tirar fotos + + + Context menu + Menu de contexto + + + + dc::Settings + + None + Nenhum + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Quente + + + Cold + Frio + + + Retro + Retro + + + Film + Ffilm + + + Gray + Gwyrdd + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Fflam + + + On + Ar + + + Off + Allan + + + Delay capture + Gwirddo'r cymryd + + + None + Nid yn unig + + + Filters + Fflamiau + + + Exposure + Gwirddo + + + + videowidget + + No webcam found + Nid oes camara web yn dod + + + The webcam is in use + Mae'r camara web yn cael ei ddefnyddio + + + diff --git a/src/translations/deepin-camera_ca.ts b/src/translations/deepin-camera_ca.ts index 52a4efd39..b031d1a69 100644 --- a/src/translations/deepin-camera_ca.ts +++ b/src/translations/deepin-camera_ca.ts @@ -178,19 +178,19 @@ Gridlines - + Línies de la graella 1*1 lines - + 1*1 2*2 lines - + 2*2 Maximum resolution: - + Resolució màxima: @@ -261,6 +261,14 @@ None Cap + + mp4 + mp4 + + + webm + webm + filterPreviewButton diff --git a/src/translations/deepin-camera_cs.ts b/src/translations/deepin-camera_cs.ts index 85d4c148c..fd955a0cb 100644 --- a/src/translations/deepin-camera_cs.ts +++ b/src/translations/deepin-camera_cs.ts @@ -1,6 +1,4 @@ - - - + CMainWindow @@ -178,19 +176,19 @@ Gridlines - + Čáry mřížky 1*1 lines - + 1 ⨉ 1 čára 2*2 lines - + 2 ⨉ 2 čáry Maximum resolution: - + Maximální rozlišení: @@ -261,40 +259,48 @@ None Žádné + + mp4 + MP4 + + + webm + WebM + filterPreviewButton Normal - + Normální Vivid - + Živé Warm - + Teplé Cold - + Studené Retro - + Retro Film - + Film Gray - + Šedé B&W - + ČB @@ -321,11 +327,11 @@ Filters - + Filtry Exposure - + Expozice @@ -343,4 +349,4 @@ Zastavit zaznamenávání - + \ No newline at end of file diff --git a/src/translations/deepin-camera_da.ts b/src/translations/deepin-camera_da.ts new file mode 100644 index 000000000..040e77df0 --- /dev/null +++ b/src/translations/deepin-camera_da.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Videooptagelsen er i gang. Luk vinduet? + + + Settings + Indstillinger + + + None + Intet + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Skift kamera + + + + CloseDialog + + Cancel + Afbryd + + + Close + Luk + + + + ImageItem + + Copy + + + + Delete + Slet + + + Open folder + Åben mappe + + + Print + Udskriv + + + + QObject + + You don't have permission to operate this folder + Du har ikke tilladelse til at arbejde med denne mappe + + + Close + Luk + + + Open folder + Åben mappe + + + Settings + Indstillinger + + + Basic + Grundlæggende + + + File location + Filplacering + + + Shoot + Tag + + + Burst mode + Burst-tilstand + + + Self-timer delay + Selv-timerforsinkelse + + + Output + Output + + + Output format + Outputformat + + + 4 pcs + 4 stk + + + 10 pcs + 10 stk + + + None + Intet + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera er et værktøj til optagelse af billeder og video, der bruger dit PC-kamera eller webcam. + + + File not saved + Fil ikke gemt + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Opstillingsindstillinger + + + Photos: + Billeder: + + + Videos: + Videos: + + + Sound effects + Lydeffekter + + + Mirror mode + Spejlbælte + + + Flashlight + Lampe + + + Gridlines + Rætlinjer + + + 1*1 lines + 1*1 linjer + + + 2*2 lines + 2*2 linjer + + + Maximum resolution: + Maksimal oppløsning: + + + + Shortcut + + Camera + Kamera + + + Settings + Indstillinger + + + Stop recording + Stop med op­tage + + + Copy + + + + Delete + Slet + + + Open + Åben + + + Print + Udskriv + + + Help + Hjælp + + + Display shortcuts + Vis genkaldingsknapper + + + Stop taking photos + Stop med at tage billeder + + + Context menu + Kontekstmenu + + + + dc::Settings + + None + Ingen + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Varm + + + Cold + Kold + + + Retro + Retro + + + Film + Film + + + Gray + Grå + + + B&W + Svart og hvid + + + + takePhotoSettingAreaWidget + + Flashlight + Lampe + + + On + På + + + Off + Fra + + + Delay capture + Forsinket optagelse + + + None + Ingen + + + Filters + Filter + + + Exposure + Ekspotering + + + + videowidget + + No webcam found + Ingen webkamera fundet + + + The webcam is in use + Webkameraen er i brug + + + diff --git a/src/translations/deepin-camera_de.ts b/src/translations/deepin-camera_de.ts index c5a19748c..6788da203 100644 --- a/src/translations/deepin-camera_de.ts +++ b/src/translations/deepin-camera_de.ts @@ -178,19 +178,19 @@ Gridlines - + Gitternetzlinien 1*1 lines - + 1*1 Linien 2*2 lines - + 2*2 Linien Maximum resolution: - + Maximale Auflösung: @@ -261,6 +261,14 @@ None Keine + + mp4 + + + + webm + + filterPreviewButton diff --git a/src/translations/deepin-camera_el.ts b/src/translations/deepin-camera_el.ts index 76746b522..0aeebb5aa 100644 --- a/src/translations/deepin-camera_el.ts +++ b/src/translations/deepin-camera_el.ts @@ -21,15 +21,15 @@ Photo - + Φωτογραφία Video - + Βίντεο Switch Cameras - + Αλλαγή καμερών @@ -59,7 +59,7 @@ Print - + Εκτύπωση @@ -158,39 +158,39 @@ Photos: - + Φωτογραφίες: Videos: - + Βίντεο: Sound effects - + Ήχοι επίδρασης Mirror mode - + Λευκός κατακόρυφος Flashlight - + Φλασχλίτσα Gridlines - + Γραμμές περιοχής 1*1 lines - + Γραμμές 1*1 2*2 lines - + Γραμμές 2*2 Maximum resolution: - + Μέγιστη ανάλυση: @@ -217,19 +217,19 @@ Open - + Άνοιγμα Print - + Εκτύπωση Help - + Βοήθεια Display shortcuts - + Εμφάνιση συντομεύσεων Stop taking photos @@ -237,7 +237,7 @@ Context menu - + Μενού πεδίου @@ -261,71 +261,79 @@ None Κανένα + + mp4 + mp4 + + + webm + + filterPreviewButton Normal - + Κανονική Vivid - + Ζωντανή Warm - + Θερμή Cold - + Ψυχρή Retro - + Αντίστροφη Film - + Φιλμ Gray - + Γκρι B&W - + Μαύρο-Πίνακας takePhotoSettingAreaWidget Flashlight - + Φλασχλίτσα On - + Ενεργός Off - + Απενεργοποιημένο Delay capture - + Αποστολή με καθυστέρηση None - Κανένα + Κανένα Filters - + Φίλτρα Exposure - + Εξομάλυνση diff --git a/src/translations/deepin-camera_en_US.ts b/src/translations/deepin-camera_en_US.ts index d057cc658..4bffaea5b 100644 --- a/src/translations/deepin-camera_en_US.ts +++ b/src/translations/deepin-camera_en_US.ts @@ -261,6 +261,14 @@ None None + + mp4 + MP4 + + + webm + WebM + filterPreviewButton diff --git a/src/translations/deepin-camera_eo.ts b/src/translations/deepin-camera_eo.ts new file mode 100644 index 000000000..79ab3afc6 --- /dev/null +++ b/src/translations/deepin-camera_eo.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + La video-filmo estas en progreso. Ferma la fenestro? + + + Settings + Agordoj + + + None + Nenio + + + Photo + Fotografio + + + Video + Video + + + Switch Cameras + Ŝanĝi kameraĵojn + + + + CloseDialog + + Cancel + Anuligi + + + Close + Fermi + + + + ImageItem + + Copy + Kopii + + + Delete + Forigi + + + Open folder + Malfermi dosieron + + + Print + Preni + + + + QObject + + You don't have permission to operate this folder + Vi ne havas permeson por manipuli tiun dosieron + + + Close + Fermi + + + Open folder + Malfermi dosieron + + + Settings + Agordoj + + + Basic + Baza + + + File location + Loko de la dosiero + + + Shoot + Fotografu + + + Burst mode + Burst-modo + + + Self-timer delay + Retardo de la self-timer + + + Output + Eligo + + + Output format + Formato de eligo + + + 4 pcs + 4 fotoj + + + 10 pcs + 10 fotoj + + + None + Nenio + + + Camera + Kameraĵo + + + Camera is an image and video capture utility using your PC camera or webcam. + Kameraĵo estas aparato por kapti bildojn kaj videojn uzante vian komputikan kameraĵon aŭ webkameraĵon. + + + File not saved + Dosiero ne konserviĝis + + + Photo: + Fotografio: + + + Video: + Video: + + + Resolution settings + Resolution settings + + + Photos: + Photos: + + + Videos: + Videos: + + + Sound effects + Sound effects + + + Mirror mode + Mirror mode + + + Flashlight + Flashlight + + + Gridlines + Gridlines + + + 1*1 lines + 1×1 lines + + + 2*2 lines + 2×2 lines + + + Maximum resolution: + Maximum resolution: + + + + Shortcut + + Camera + Camera + + + Settings + Settings + + + Stop recording + Stop recording + + + Copy + Copy + + + Delete + Delete + + + Open + Open + + + Print + Print + + + Help + Help + + + Display shortcuts + Display shortcuts + + + Stop taking photos + Stop taking photos + + + Context menu + Context menu + + + + dc::Settings + + None + None + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Warm + + + Cold + Cold + + + Retro + Retro + + + Film + Filmo + + + Gray + Griza + + + B&W + Nigra kaj blanka + + + + takePhotoSettingAreaWidget + + Flashlight + Lampo + + + On + Ŝalti + + + Off + Malŝalti + + + Delay capture + Malkapti + + + None + Neniu + + + Filters + Filtriloj + + + Exposure + Ekspozicio + + + + videowidget + + No webcam found + Neniu webkamera troveblas + + + The webcam is in use + La webkamera estas uzata + + + diff --git a/src/translations/deepin-camera_es.ts b/src/translations/deepin-camera_es.ts index 8d526e2c4..6509186ef 100644 --- a/src/translations/deepin-camera_es.ts +++ b/src/translations/deepin-camera_es.ts @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - Cámara de Deepin captura imágenes y vídeos con la cámara de su equipo o cámara web. + Cámara de Deepin es una utilidad de captura de imágenes y vídeos que utiliza la cámara de su equipo o cámara web. File not saved @@ -174,23 +174,23 @@ Flashlight - Linterna + Flash Gridlines - + Líneas de cuadrícula 1*1 lines - + líneas 1*1 2*2 lines - + líneas 2*2 Maximum resolution: - + Resolución máxima: @@ -261,6 +261,14 @@ None Ninguno + + mp4 + + + + webm + + filterPreviewButton diff --git a/src/translations/deepin-camera_et.ts b/src/translations/deepin-camera_et.ts new file mode 100644 index 000000000..41cc1da28 --- /dev/null +++ b/src/translations/deepin-camera_et.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video kirjutamine on käimas. Sulgude sulgumine? + + + Settings + Seaded + + + None + Mitte midagi + + + Photo + Pilt + + + Video + Video + + + Switch Cameras + Vaheta kameere + + + + CloseDialog + + Cancel + Tühista + + + Close + Sulge + + + + ImageItem + + Copy + Kopeeri + + + Delete + Kustuta + + + Open folder + Avale kaust + + + Print + Printi + + + + QObject + + You don't have permission to operate this folder + Sul pole lubu töödelda seda kausta + + + Close + Sulge + + + Open folder + Avale kaust + + + Settings + Seaded + + + Basic + Põhifunktsioonid + + + File location + Faili asukoht + + + Shoot + Pildistus + + + Burst mode + Kõikumisrežiim + + + Self-timer delay + Automaatse ajastuse viivitus + + + Output + Väljund + + + Output format + Väljundiformaat + + + 4 pcs + 4 tk + + + 10 pcs + 10 tk + + + None + Mitte midagi + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera on pildistamise ja video kogumise tööriist, mis kasutab sinu arvutikameera või webkameera. + + + File not saved + Faili ei salvestatud + + + Photo: + Pilt: + + + Video: + Video: + + + Resolution settings + Lahenduse seadistused + + + Photos: + Pildid: + + + Videos: + Videos: + + + Sound effects + Helid + + + Mirror mode + Ainutähelepanuvorm + + + Flashlight + Valgustus + + + Gridlines + Rihtud jooned + + + 1*1 lines + 1x1 jooned + + + 2*2 lines + 2x2 jooned + + + Maximum resolution: + Maksimaalne lahendus: + + + + Shortcut + + Camera + Kamera + + + Settings + Seadistused + + + Stop recording + Lähtu veebis + + + Copy + Kopeeri + + + Delete + Kustuta + + + Open + Avale + + + Print + Printi + + + Help + Abi + + + Display shortcuts + Kuvada kiirklahvud + + + Stop taking photos + Lähtu pildistamisest + + + Context menu + Kontekstimenüü + + + + dc::Settings + + None + Mitte midagi + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normaalne + + + Vivid + Tugev + + + Warm + Soe + + + Cold + Külma + + + Retro + Retro + + + Film + Film + + + Gray + Heler + + + B&W + Süv + + + + takePhotoSettingAreaWidget + + Flashlight + Pilv + + + On + Sisse + + + Off + Välja + + + Delay capture + Pausimine + + + None + Pole + + + Filters + Filtreid + + + Exposure + Valgus + + + + videowidget + + No webcam found + Kamerasi ei leitud + + + The webcam is in use + Kamerasi kasutatakse + + + diff --git a/src/translations/deepin-camera_eu.ts b/src/translations/deepin-camera_eu.ts new file mode 100644 index 000000000..94ca00c64 --- /dev/null +++ b/src/translations/deepin-camera_eu.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video-recordado estas en progreso. Ferma la fenestro? + + + Settings + Ajustoj + + + None + Neniu + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Switch Cameras + + + + CloseDialog + + Cancel + Anuligi + + + Close + Fermi + + + + ImageItem + + Copy + Kopii + + + Delete + Forigi + + + Open folder + Malfermi dosieron + + + Print + Preni + + + + QObject + + You don't have permission to operate this folder + Vi ne havas permeson por operaci kun tiu dosiero + + + Close + Fermi + + + Open folder + Malfermi dosieron + + + Settings + Ajustoj + + + Basic + Baza + + + File location + Loko de dosiero + + + Shoot + Fotografi + + + Burst mode + Burst-modo + + + Self-timer delay + Tempo de self-timer + + + Output + Eligo + + + Output format + Formato de eligo + + + 4 pcs + 4 pecoj + + + 10 pcs + 10 pecoj + + + None + Neniu + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + + + + File not saved + Dosiero ne konservi + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Ajustoj de rezolucio + + + Photos: + Fotoj: + + + Videos: + Videoj: + + + Sound effects + Sonaj efektaj + + + Mirror mode + Mirror mode + + + Flashlight + Flashlight + + + Gridlines + Gridlines + + + 1*1 lines + 1×1 linioj + + + 2*2 lines + 2×2 linioj + + + Maximum resolution: + Maksimuma rezolucio: + + + + Shortcut + + Camera + Kamera + + + Settings + Ajustoj + + + Stop recording + Stop recording + + + Copy + Kopii + + + Delete + Forigi + + + Open + Malfermi + + + Print + Preni + + + Help + Helpo + + + Display shortcuts + Montri rapidecojn + + + Stop taking photos + Stop taking photos + + + Context menu + Konteksta menuo + + + + dc::Settings + + None + Nenio + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normala + + + Vivid + Vivid + + + Warm + Warna + + + Cold + Kolda + + + Retro + Retro + + + Film + Filmo + + + Gray + Grizo + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Lumino + + + On + On + + + Off + Off + + + Delay capture + Pauso + + + None + Nen + + + Filters + Filtraro + + + Exposure + Exposure + + + + videowidget + + No webcam found + Nen kamera trova + + + The webcam is in use + La kamera estas en uzado + + + diff --git a/src/translations/deepin-camera_fa.ts b/src/translations/deepin-camera_fa.ts new file mode 100644 index 000000000..dbd53f0c6 --- /dev/null +++ b/src/translations/deepin-camera_fa.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + فیودوی کناره گیری در حال انجام است. پنجره را ببندید؟ + + + Settings + تنظیمات + + + None + هیچ + + + Photo + عکس + + + Video + فیودو + + + Switch Cameras + کامراها را عوض کن + + + + CloseDialog + + Cancel + لغو + + + Close + بند کن + + + + ImageItem + + Copy + کپی کن + + + Delete + حذف کن + + + Open folder + پوشه را باز کن + + + Print + چاپ کن + + + + QObject + + You don't have permission to operate this folder + شما مجوزی برای کار با این پوشه ندارید + + + Close + بند کن + + + Open folder + پوشه را باز کن + + + Settings + تنظیمات + + + Basic + اساسی + + + File location + مکان فایل + + + Shoot + شات بزن + + + Burst mode + مود بروست + + + Self-timer delay + مقدار تاخیر تایmer خود + + + Output + خروجی + + + Output format + فرمت خروجی + + + 4 pcs + 4 قطعه + + + 10 pcs + 10 قطعه + + + None + هیچ + + + Camera + کامرا + + + Camera is an image and video capture utility using your PC camera or webcam. + کامرا یک ابزار ثبت تصویر و ویدیو است که از دوربین پی سی یا کام چک شما استفاده می‌کند. + + + File not saved + فایل ذخیره نشده است + + + Photo: + عکس: + + + Video: + فیدیو: + + + Resolution settings + تنظیمات رزولوشن + + + Photos: + عکس‌ها: + + + Videos: + فیدیو‌ها: + + + Sound effects + اثرات صوتی + + + Mirror mode + حالت آینه‌ای + + + Flashlight + فلاش + + + Gridlines + خطوط گرید + + + 1*1 lines + خطوط ۱×۱ + + + 2*2 lines + خطوط ۲×۲ + + + Maximum resolution: + رزولوشن بیشینه: + + + + Shortcut + + Camera + دوربین + + + Settings + تنظیمات + + + Stop recording + توقف از ضبط + + + Copy + کپی + + + Delete + حذف + + + Open + باز کردن + + + Print + چاپ + + + Help + کمک + + + Display shortcuts + نمایش کوتاه‌ها + + + Stop taking photos + توقف از گرفتن عکس + + + Context menu + منوی سریع + + + + dc::Settings + + None + هیچکدام + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + طبیعی + + + Vivid + زیاد + + + Warm + داغ + + + Cold + سرد + + + Retro + روستا + + + Film + فیلم + + + Gray + گری + + + B&W + بی‌آندی + + + + takePhotoSettingAreaWidget + + Flashlight + فلاشلایت + + + On + روشن + + + Off + خاموش + + + Delay capture + تاخیر در ثبت + + + None + هیچکدام + + + Filters + فیلترها + + + Exposure + براش + + + + videowidget + + No webcam found + کاميرای ویдеو یافت نشد + + + The webcam is in use + کاميرای ویدو در حال استفاده است + + + diff --git a/src/translations/deepin-camera_fi.ts b/src/translations/deepin-camera_fi.ts index 3bcf1a23f..6e98c164f 100644 --- a/src/translations/deepin-camera_fi.ts +++ b/src/translations/deepin-camera_fi.ts @@ -5,7 +5,7 @@ CMainWindow Video recording is in progress. Close the window? - Videotallennus on käynnissä. Sulje ikkuna? + Tallennus on käynnissä. Suljetaanko ikkuna? Open folder @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - Kamera on kuvan ja videon sieppaustyökalu, joka käyttää tietokoneen kameraa tai verkkokameraa. + Kamera on työkalu kuvan ja videon tallentamiseen. Käyttää tietokoneen kameraa tai verkkokameraa. File not saved @@ -178,19 +178,19 @@ Gridlines - + Ruudukkoviivat 1*1 lines - + 1*1 viivaa 2*2 lines - + 2*2 viivaa Maximum resolution: - + Suurin tarkkuus: @@ -261,6 +261,14 @@ None Ei mitään + + mp4 + mp4 + + + webm + webm + filterPreviewButton diff --git a/src/translations/deepin-camera_fil.ts b/src/translations/deepin-camera_fil.ts new file mode 100644 index 000000000..a534ecc95 --- /dev/null +++ b/src/translations/deepin-camera_fil.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Ang pag-record ng video ay nangyayari. I-close ang window? + + + Settings + Pamamaraan + + + None + Wala + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Palitan ang mga Camera + + + + CloseDialog + + Cancel + Iwanan + + + Close + I-close + + + + ImageItem + + Copy + Kopyahin + + + Delete + Tanggalin + + + Open folder + Bumuksan ang folder + + + Print + I-print + + + + QObject + + You don't have permission to operate this folder + Wala kang pahintulot para mag-operate sa folder na ito + + + Close + I-close + + + Open folder + Bumuksan ang folder + + + Settings + Pamamaraan + + + Basic + Pamamaraan + + + File location + Lokasyon ng file + + + Shoot + Ilabas + + + Burst mode + Burst mode + + + Self-timer delay + Pang-ikot na delay + + + Output + Output + + + Output format + Format ng output + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + Wala + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + Camera ay isang utility para mag-capture ng imahe at video gamit ang iyong PC camera o webcam. + + + File not saved + File ay hindi sinagot + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Paggawa ng resolusyon + + + Photos: + Mga larawan: + + + Videos: + Mga video: + + + Sound effects + Mga epekto ng tunog + + + Mirror mode + Mood na salamin + + + Flashlight + Lampara ng liwanag + + + Gridlines + Mga linya ng grid + + + 1*1 lines + 1*1 linya + + + 2*2 lines + 2*2 linya + + + Maximum resolution: + Pinakamataas na resolusyon: + + + + Shortcut + + Camera + Kamera + + + Settings + Mga setting + + + Stop recording + Tigil ang pag-record + + + Copy + Kopyahin + + + Delete + Tanggalin + + + Open + Bumuksan + + + Print + Print + + + Help + Tulong + + + Display shortcuts + Ipakita ang mga shortcut + + + Stop taking photos + Tigil ang pagkuha ng mga larawan + + + Context menu + Mga menu ng konteksto + + + + dc::Settings + + None + Wala + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Warm + + + Cold + Cold + + + Retro + Retro + + + Film + Film + + + Gray + Gray + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Flashlight + + + On + On + + + Off + Off + + + Delay capture + Delay capture + + + None + None + + + Filters + Filters + + + Exposure + Exposure + + + + videowidget + + No webcam found + No webcam found + + + The webcam is in use + The webcam is in use + + + diff --git a/src/translations/deepin-camera_fr.ts b/src/translations/deepin-camera_fr.ts index acf79b83a..52a0d8813 100644 --- a/src/translations/deepin-camera_fr.ts +++ b/src/translations/deepin-camera_fr.ts @@ -21,15 +21,15 @@ Photo - + Photo Video - + Vidéo Switch Cameras - + Changer de caméra @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - Camera est un utilitaire de capture d'images et de vidéos utilisant votre caméra intégrée ou votre webcam. + Caméra est un utilitaire de capture d'images et de vidéos utilisant votre caméra intégrée ou votre webcam. File not saved @@ -170,27 +170,27 @@ Mirror mode - + Mode miroir Flashlight - + Flash Gridlines - + Lignes de grille 1*1 lines - + lignes 1x1 2*2 lines - + lignes 2x2 Maximum resolution: - + Résolution maximale : @@ -261,59 +261,67 @@ None Aucun + + mp4 + mp4 + + + webm + webm + filterPreviewButton Normal - + Normal Vivid - + Vif Warm - + Chaud Cold - + Froid Retro - + Rétro Film - + Film Gray - + Gris B&W - + N&B takePhotoSettingAreaWidget Flashlight - + Flash On - + On Off - + Off Delay capture - + Retarder la capture None @@ -321,11 +329,11 @@ Filters - + Filtres Exposure - + Exposition diff --git a/src/translations/deepin-camera_gl_ES.ts b/src/translations/deepin-camera_gl_ES.ts new file mode 100644 index 000000000..a958dcbab --- /dev/null +++ b/src/translations/deepin-camera_gl_ES.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + A rexordada de vídeo está en progreso. Cerrar a finestra? + + + Settings + Preferencias + + + None + Ningún + + + Photo + Fotografía + + + Video + Vídeo + + + Switch Cameras + Cambiar cámaras + + + + CloseDialog + + Cancel + Cancelar + + + Close + Cerrar + + + + ImageItem + + Copy + Copiar + + + Delete + Eliminar + + + Open folder + Abrir cartafol + + + Print + Imprimir + + + + QObject + + You don't have permission to operate this folder + Non ten permiso para operar este cartafol + + + Close + Cerrar + + + Open folder + Abrir cartafol + + + Settings + Preferencias + + + Basic + Básico + + + File location + Lóxico do ficheiro + + + Shoot + Fotografiar + + + Burst mode + Modo de disparo rápido + + + Self-timer delay + Retardo do temporizador + + + Output + Saída + + + Output format + Formato de saída + + + 4 pcs + 4 unidades + + + 10 pcs + 10 unidades + + + None + Ningún + + + Camera + Cámera + + + Camera is an image and video capture utility using your PC camera or webcam. + A cámera é unha ferramenta de captura de imaxes e vídeo usando a súa cámera de PC ou webcam. + + + File not saved + Ficheiro non gardado + + + Photo: + Fotografía: + + + Video: + Vídeo: + + + Resolution settings + Ajustes de resolución + + + Photos: + Fotos: + + + Videos: + Vídeos: + + + Sound effects + Efectos de sonido + + + Mirror mode + Modo de espego + + + Flashlight + Luz frontal + + + Gridlines + Líneas de cuadrícula + + + 1*1 lines + Líneas 1×1 + + + 2*2 lines + Líneas 2×2 + + + Maximum resolution: + Resolución máxima: + + + + Shortcut + + Camera + Cámara + + + Settings + Configuración + + + Stop recording + Parar de grabar + + + Copy + Copiar + + + Delete + Eliminar + + + Open + Abrir + + + Print + Imprimir + + + Help + Axuda + + + Display shortcuts + Mostrar atallos + + + Stop taking photos + Parar de tomar fotos + + + Context menu + Menú de contexto + + + + dc::Settings + + None + Ningún + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivido + + + Warm + Calido + + + Cold + Frio + + + Retro + Retro + + + Film + Filmo + + + Gray + Gris + + + B&W + B/N + + + + takePhotoSettingAreaWidget + + Flashlight + Luz do flash + + + On + On + + + Off + Off + + + Delay capture + Retardo da captura + + + None + Ningún + + + Filters + Filtros + + + Exposure + Exposición + + + + videowidget + + No webcam found + Non se atopou un webcam + + + The webcam is in use + O webcam está en uso + + + diff --git a/src/translations/deepin-camera_he.ts b/src/translations/deepin-camera_he.ts new file mode 100644 index 000000000..58d4257bf --- /dev/null +++ b/src/translations/deepin-camera_he.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ה녹מת וידאו בתהליך. לסגור את החלון? + + + Settings + הגדרות + + + None + ללא + + + Photo + תמונה + + + Video + סרט + + + Switch Cameras + לעבור למכבירים + + + + CloseDialog + + Cancel + לבטל + + + Close + לסגור + + + + ImageItem + + Copy + לעתק + + + Delete + למחוק + + + Open folder + לפתוח תיקייה + + + Print + לדruk + + + + QObject + + You don't have permission to operate this folder + אין לך הרשאה לפעול בתוך התיקייה הזו + + + Close + לסגור + + + Open folder + לפתוח תיקייה + + + Settings + הגדרות + + + Basic + בסיסי + + + File location + מיקום הקובץ + + + Shoot + לצלם + + + Burst mode + מצב בורסט + + + Self-timer delay + השהיה של מצלמת-self + + + Output + פלט + + + Output format + מבנה הפלט + + + 4 pcs + 4 קבצים + + + 10 pcs + 10 קבצים + + + None + ללא + + + Camera + מצלמה + + + Camera is an image and video capture utility using your PC camera or webcam. + מצלמה היא כלי לקליטת תמונות וסרטונים באמצעות מצלמה או וידאו-קאמרה שלך. + + + File not saved + הקובץ לא נשמר + + + Photo: + תמונה: + + + Video: + סרט: + + + Resolution settings + הגדרות פתרון + + + Photos: + תמונות: + + + Videos: + סרטים: + + + Sound effects + השפעת קול + + + Mirror mode + מצב מראה + + + Flashlight + אור לילה + + + Gridlines + קו רשת + + + 1*1 lines + קוים 1*1 + + + 2*2 lines + קוים 2*2 + + + Maximum resolution: + ה פתרון המקסימלי: + + + + Shortcut + + Camera + מצלמה + + + Settings + הגדרות + + + Stop recording + השהה녹ום + + + Copy + העתק + + + Delete + מחק + + + Open + פתח + + + Print + + + + Help + עזרה + + + Display shortcuts + הצגת מקשים קיצור + + + Stop taking photos + השהה צילום + + + Context menu + תפריט הקשר + + + + dc::Settings + + None + אפס + + + mp4 + mp4 + + + webm + ויבם + + + + filterPreviewButton + + Normal + רגיל + + + Vivid + זמין + + + Warm + חם + + + Cold + קר + + + Retro + רטרו + + + Film + סרט + + + Gray + שחור-לבן + + + B&W + שחור-לבן + + + + takePhotoSettingAreaWidget + + Flashlight + אור לוח + + + On + הפעל + + + Off + כבה + + + Delay capture + השהיה צילום + + + None + אף אחד + + + Filters + סינט + + + Exposure + הופעה + + + + videowidget + + No webcam found + לא נמצאה קימה מצלמה + + + The webcam is in use + המצלמה המצלמה בשימוש + + + diff --git a/src/translations/deepin-camera_hi_IN.ts b/src/translations/deepin-camera_hi_IN.ts index 5d8c77acf..68ffd96ea 100644 --- a/src/translations/deepin-camera_hi_IN.ts +++ b/src/translations/deepin-camera_hi_IN.ts @@ -178,19 +178,19 @@ Gridlines - + नेटलाइन्स 1*1 lines - + 1*1 लाइन्स 2*2 lines - + 2*2 लाइन्स Maximum resolution: - + अधिकतम रेज़ोलूशन: @@ -261,40 +261,48 @@ None कुछ नहीं + + mp4 + एमपी4 + + + webm + वेबएम + filterPreviewButton Normal - + सामान्य Vivid - + जीवंत Warm - + गर्म Cold - + ठंडा Retro - + रेट्रो Film - + फिल्म Gray - + ग्रे B&W - + बेलांक @@ -321,11 +329,11 @@ Filters - + फ़िल्टर्स Exposure - + अभिविष्टि diff --git a/src/translations/deepin-camera_hr.ts b/src/translations/deepin-camera_hr.ts index d072c4a73..e94f8326e 100644 --- a/src/translations/deepin-camera_hr.ts +++ b/src/translations/deepin-camera_hr.ts @@ -21,15 +21,15 @@ Photo - + Slika Video - + Video Switch Cameras - + Prebaciti kamere @@ -66,7 +66,7 @@ QObject You don't have permission to operate this folder - + Nemate dopuštenje za rad u ovom folderu Close @@ -94,31 +94,31 @@ Shoot - + Snimi Burst mode - + Režim serije Self-timer delay - + Zadnji odziv Output - + Izlaz Output format - + Format izlaza 4 pcs - + 4 komada 10 pcs - + 10 komada None @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - + Kamera je alat za snimanje slika i videa koristeći vašu računarsku kameru ili webkameru. File not saved @@ -170,27 +170,27 @@ Mirror mode - + Zrcalni režim Flashlight - + Reflektor Gridlines - + Mreža 1*1 lines - + 1*1 linije 2*2 lines - + 2*2 linije Maximum resolution: - + Maksimalna rezolucija: @@ -261,71 +261,79 @@ None NIjedan + + mp4 + mp4 + + + webm + webm + filterPreviewButton Normal - + Normalan Vivid - + Živahan Warm - + Top Cold - + Hladan Retro - + Retro Film - + Film Gray - + Siva B&W - + B&W takePhotoSettingAreaWidget Flashlight - + Reflektor On - + Uključen Off - + Isključeno Delay capture - + Zadliječi snimanje None - NIjedan + NIjedan Filters - + Filteri Exposure - + Osvetljenje diff --git a/src/translations/deepin-camera_hu.ts b/src/translations/deepin-camera_hu.ts index 559ccb19f..16196bb52 100644 --- a/src/translations/deepin-camera_hu.ts +++ b/src/translations/deepin-camera_hu.ts @@ -190,7 +190,7 @@ Maximum resolution: - + Maximum felbontás: @@ -261,6 +261,14 @@ None Nincs + + mp4 + mp4 + + + webm + webm + filterPreviewButton diff --git a/src/translations/deepin-camera_hy.ts b/src/translations/deepin-camera_hy.ts new file mode 100644 index 000000000..57d1f43a4 --- /dev/null +++ b/src/translations/deepin-camera_hy.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Վիդեո գրանցումը կատարվում է, փակեք պատուհանը? + + + Settings + Կարգավորումներ + + + None + Ընտրված չէ + + + Photo + Նկար + + + Video + Վիդեո + + + Switch Cameras + Փոխեք կամերաները + + + + CloseDialog + + Cancel + Չեղարկել + + + Close + Փակել + + + + ImageItem + + Copy + Կապակցել + + + Delete + Ջնջել + + + Open folder + Բացել պատուհանը + + + Print + Տպել + + + + QObject + + You don't have permission to operate this folder + Դուք չունեք իրավունք այս պատուհանի համար + + + Close + Ընթարկել + + + Open folder + Բա՜ցել պատուհանը + + + Settings + Կարգավորումներ + + + Basic + Բազային + + + File location + Ֆայլի տեղորոշումը + + + Shoot + Շատել + + + Burst mode + Շարունակական ռեժիմը + + + Self-timer delay + Սեփական ժամաչափի մեծությունը + + + Output + Արտադրություն + + + Output format + Արտադրության ձևաչափը + + + 4 pcs + 4 հատ + + + 10 pcs + 10 հատ + + + None + Ընտրված չէ + + + Camera + Կամերա + + + Camera is an image and video capture utility using your PC camera or webcam. + Կամերան հաշվի առնելով ձեր համակարգչի կամերան կամ կ્ուբեման օգտագործող նկար և վիդեո ձայն ձեռք բերող ծառայություն է: + + + File not saved + Ֆայլը չի պահպաนվել + + + Photo: + Նկար: + + + Video: + Տեսանյութ: + + + Resolution settings + Լուծույթի կարգավորումներ + + + Photos: + Լուսանկարներ: + + + Videos: + Տեսանյութեր: + + + Sound effects + Ձայնային էֆեկտներ + + + Mirror mode + Առանցքային ռեժիմ + + + Flashlight + Լույսի արտահանդես + + + Gridlines + Կառուցվածքային գծեր + + + 1*1 lines + 1×1 գծեր + + + 2*2 lines + 2×2 գծեր + + + Maximum resolution: + Ամենամեծ լուծույթը: + + + + Shortcut + + Camera + Ֆոտոամրագրիչ + + + Settings + Կարգավորումներ + + + Stop recording + Ավարտել ամրագրումը + + + Copy + Կապակցել + + + Delete + Ջամարտական հետապնդել + + + Open + Բացել + + + Print + Տպել + + + Help + Օգնություն + + + Display shortcuts + Ներկայացնել կարճացումներ + + + Stop taking photos + Ավարտել լուսանկարների առկայությունը + + + Context menu + Տեսական մենյու + + + + dc::Settings + + None + Ոչ մի բան + + + mp4 + mp4 + + + webm + վեբմ + + + + filterPreviewButton + + Normal + Ընդհանուր + + + Vivid + Ծանրական + + + Warm + Հարուստ + + + Cold + Սառը + + + Retro + Ռետրո + + + Film + Ֆիլմ + + + Gray + Գրի + + + B&W + Բ & Ը + + + + takePhotoSettingAreaWidget + + Flashlight + Լուսամատ + + + On + Ան + + + Off + Անց + + + Delay capture + Կանգ առնել հավաքածումը + + + None + Ոչ մեկ + + + Filters + Ֆիլտրեր + + + Exposure + Լույսի ազդեցություն + + + + videowidget + + No webcam found + Կամարան չի հայտնաբերվել + + + The webcam is in use + Կամարանը աշխատանքի մեջ է + + + diff --git a/src/translations/deepin-camera_id.ts b/src/translations/deepin-camera_id.ts new file mode 100644 index 000000000..f1c232f39 --- /dev/null +++ b/src/translations/deepin-camera_id.ts @@ -0,0 +1,354 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Perekaman video sedang berlangsung. Tutup jendela? + + + Open folder + Buka folder + + + Settings + Pengaturan + + + None + Kosong + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Ganti Kamera + + + + CloseDialog + + Cancel + Batal + + + Close + Tutup + + + + ImageItem + + Copy + Salin + + + Delete + Hapus + + + Open folder + Buka folder + + + Print + Cetak + + + + QObject + + You don't have permission to operate this folder + Anda tidak memiliki izin untuk mengoperasikan folder ini + + + Close + Tutup + + + Invalid folder + Folder tidak valid + + + Open folder + Buka folder + + + Settings + Pengaturan + + + Basic + Dasar + + + File location + Lokasi file + + + Shoot + Tekan + + + Burst mode + Mode burst + + + Self-timer delay + Waktu penundaan diri + + + Output + Keluaran + + + Output format + Format keluaran + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + Kosong + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera adalah utilitas pengambil gambar dan video menggunakan kamera PC atau webcam Anda + + + File not saved + File tidak disimpan + + + Save to: + Simpan ke: + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Pengaturan resolusi + + + Resolution: + Resolusi: + + + Photos: + Foto: + + + Videos: + Video: + + + Sound effects + Efek suara + + + Mirror mode + Mode mirror + + + Flashlight + Senter + + + Gridlines + Garis grid + + + 1*1 lines + Garis 1*1 + + + 2*2 lines + Garis 2*2 + + + Maximum resolution: + Resolusi maksimum: + + + + Shortcut + + Camera + Kamera + + + Settings + Pengaturan + + + Stop recording + Berhenti merekam + + + Copy + Salin + + + Delete + Hapus + + + Open + Buka + + + Print + Cetak + + + Help + Bantuan + + + Display shortcuts + Tampilkan pintasan + + + Stop taking photos + Berhenti mengambil foto + + + Context menu + Menu konteks + + + + ThumbnailsBar + + Take photo + Ambil foto + + + Record video + Rekam video + + + Stop taking photos + Berhenti mengambil foto + + + + dc::Settings + + None + Kosong + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Warm + + + Cold + Cold + + + Retro + Retro + + + Film + Film + + + Gray + Gray + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Senter + + + On + Nyalakan + + + Off + Padamkan + + + Delay capture + Penundaan pengambilan gambar + + + None + Kosong + + + Filters + Filter + + + Exposure + Pengaturan eksposur + + + + videowidget + + No webcam found + Webcam tidak ditemukan + + + The webcam is in use + Webcam sedang digunakan + + + Stop recording + Berhenti merekam + + + diff --git a/src/translations/deepin-camera_it.ts b/src/translations/deepin-camera_it.ts index 7d29a70ee..ae8c56ba1 100644 --- a/src/translations/deepin-camera_it.ts +++ b/src/translations/deepin-camera_it.ts @@ -1,6 +1,4 @@ - - - + CMainWindow @@ -179,19 +177,19 @@ Localizzazione italiana a cura di Massimo A. Carofano. Gridlines - + Linee della griglia 1*1 lines - + Griglia 1*1 linee 2*2 lines - + Griglia 2*2 linee Maximum resolution: - + Maximum resolution: @@ -262,6 +260,14 @@ Localizzazione italiana a cura di Massimo A. Carofano. None No + + mp4 + MP4 + + + webm + WebM + filterPreviewButton @@ -344,4 +350,4 @@ Localizzazione italiana a cura di Massimo A. Carofano. Interrompi video - + \ No newline at end of file diff --git a/src/translations/deepin-camera_ja.ts b/src/translations/deepin-camera_ja.ts new file mode 100644 index 000000000..0392ad8f1 --- /dev/null +++ b/src/translations/deepin-camera_ja.ts @@ -0,0 +1,354 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + 録画が進行中です。ウィンドウを閉じてもよろしいですか? + + + Open folder + フォルダを開く + + + Settings + 設定 + + + None + なし + + + Photo + 写真 + + + Video + 動画 + + + Switch Cameras + カメラ切替 + + + + CloseDialog + + Cancel + キャンセル + + + Close + 閉じる + + + + ImageItem + + Copy + コピー + + + Delete + 削除 + + + Open folder + フォルダを開く + + + Print + 印刷 + + + + QObject + + You don't have permission to operate this folder + このフォルダを操作する権限がありません + + + Close + 閉じる + + + Invalid folder + 無効なフォルダです + + + Open folder + フォルダを開く + + + Settings + 設定 + + + Basic + 基本 + + + File location + 保存先 + + + Shoot + 撮影 + + + Burst mode + 撮影モード + + + Self-timer delay + セルフタイマー + + + Output + 出力 + + + Output format + 出力形式 + + + 4 pcs + 4枚 + + + 10 pcs + 10枚 + + + None + なし + + + Camera + カメラ + + + Camera is an image and video capture utility using your PC camera or webcam. + カメラは、PCのWebカメラ等を使用して写真または動画を記録するためのユーティリティーです。 + + + File not saved + ファイルが保存されませんでした + + + Save to: + 保存先: + + + Photo: + 写真: + + + Video: + 動画: + + + Resolution settings + 解像度 + + + Resolution: + 解像度: + + + Photos: + 写真: + + + Videos: + 動画: + + + Sound effects + シャッター音 + + + Mirror mode + ミラーモード + + + Flashlight + フラッシュライト + + + Gridlines + グリッド + + + 1*1 lines + 1*1 + + + 2*2 lines + 2*2 + + + Maximum resolution: + 最大解像度: + + + + Shortcut + + Camera + カメラ + + + Settings + 設定 + + + Stop recording + 録画停止 + + + Copy + コピー + + + Delete + 削除 + + + Open + 開く + + + Print + 印刷 + + + Help + ヘルプ + + + Display shortcuts + ショートカットを表示 + + + Stop taking photos + 撮影停止 + + + Context menu + コンテキストメニュー + + + + ThumbnailsBar + + Take photo + 撮影 + + + Record video + 録画開始 + + + Stop taking photos + 撮影停止 + + + + dc::Settings + + None + なし + + + mp4 + + + + webm + + + + + filterPreviewButton + + Normal + 標準 + + + Vivid + ビビッド + + + Warm + 暖かい + + + Cold + 冷たい + + + Retro + レトロ + + + Film + フィルム + + + Gray + グレー + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + フラッシュライト + + + On + ON + + + Off + OFF + + + Delay capture + セルフタイマー + + + None + なし + + + Filters + フィルター + + + Exposure + 露出 + + + + videowidget + + No webcam found + カメラが見つかりませんでした + + + The webcam is in use + カメラは使用中です + + + Stop recording + 録画停止 + + + diff --git a/src/translations/deepin-camera_ka.ts b/src/translations/deepin-camera_ka.ts new file mode 100644 index 000000000..5389952cd --- /dev/null +++ b/src/translations/deepin-camera_ka.ts @@ -0,0 +1,354 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + მიმდინარეობს ვიდეო ჩაწერა. დავხუროთ ფანჯარა? + + + Open folder + საქაღალდის გახსნა + + + Settings + პარამეტრები + + + None + არაფერი + + + Photo + ფოტო + + + Video + ვიდეო + + + Switch Cameras + კამერების გადაკეთება + + + + CloseDialog + + Cancel + გაუქმება + + + Close + დახურვა + + + + ImageItem + + Copy + კოპირება + + + Delete + წაშლა + + + Open folder + საქაღალდის გახსნა + + + Print + დაბეჭდვა + + + + QObject + + You don't have permission to operate this folder + თქვენ არ გაქვთ საკმარისი უფლება აღნიშნულ საქაღალდეზე ქმედების განსახორციელებლად + + + Close + დახურვა + + + Invalid folder + არასწორი საქაღალდე + + + Open folder + საქაღალდის გახსნა + + + Settings + პარამეტრები + + + Basic + საბაზო + + + File location + ფაილის ლოკაცია + + + Shoot + გადაღება + + + Burst mode + პაკეტური რეჟიმი + + + Self-timer delay + თვით ტაიმერი დაგვიანება + + + Output + გამოსვლა + + + Output format + გამოსვლის ფორმატი + + + 4 pcs + 4 ცალი + + + 10 pcs + 10 ცალი + + + None + არაფერი + + + Camera + კამერა + + + Camera is an image and video capture utility using your PC camera or webcam. + კამერა არის ხელსაწყო სურათის და ვიდეოს გადასაღებად, კომპიუტერის ინტეგრირებული კამერის ანდ დამატებითი ვებ კამერის გამოყენებით + + + File not saved + ფაილი არ შეინახა + + + Save to: + შენახვა: + + + Photo: + სურათი: + + + Video: + ვიდეო: + + + Resolution settings + გაფართოების პარამეტრები + + + Resolution: + გაფართოება: + + + Photos: + სურათები: + + + Videos: + ვიდეო: + + + Sound effects + ხმოვანი ეფექტები + + + Mirror mode + სიმეტრიული რეჟიმი + + + Flashlight + ფლაშის სიგარე + + + Gridlines + ქვეშ ხაზები + + + 1*1 lines + 1×1 ხაზები + + + 2*2 lines + 2×2 ხაზები + + + Maximum resolution: + უდიდესი გადასა trans მატერიალი: + + + + Shortcut + + Camera + კამერა + + + Settings + პარამეტრები + + + Stop recording + ჩაწერის გაჩერება + + + Copy + კოპირება + + + Delete + წაშლა + + + Open + გახსნა + + + Print + დაბეჭდვა + + + Help + დახმარება + + + Display shortcuts + იარლიყის ეკრანზე ჩვენება + + + Stop taking photos + სურათის გადაღების გაჩერება + + + Context menu + კონტექსტუალური მენიუ + + + + ThumbnailsBar + + Take photo + სურათის გადაღება + + + Record video + ვიდეოს ჩაწერა + + + Stop taking photos + სურათის გადაღების გაჩერება + + + + dc::Settings + + None + არაფერი + + + mp4 + მპ4 + + + webm + ვებმ + + + + filterPreviewButton + + Normal + ნორმალი + + + Vivid + სიმართლე + + + Warm + თბილი + + + Cold + ხანდაზმული + + + Retro + რეტრო + + + Film + ფილმი + + + Gray + გრიზი + + + B&W + ბანდი + + + + takePhotoSettingAreaWidget + + Flashlight + ფლაშის სიგარე + + + On + ჩართული + + + Off + გამორთული + + + Delay capture + დასაყოლი ფიქსირება + + + None + არაფერი + + + Filters + ფილტრები + + + Exposure + გამასხვრავა + + + + videowidget + + No webcam found + ვებკამერა ვერ მოიძებნა + + + The webcam is in use + ვებკამერა გამოყენებაშია + + + Stop recording + ჩაწერის გაჩერება + + + diff --git a/src/translations/deepin-camera_km_KH.ts b/src/translations/deepin-camera_km_KH.ts new file mode 100644 index 000000000..0c806a840 --- /dev/null +++ b/src/translations/deepin-camera_km_KH.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ការបันทึกវីដេអូកំពុងបន្ត. បិទប្រអប់? + + + Settings + ការកំណត់ត្រា + + + None + គ្មាន + + + Photo + រូបថត + + + Video + វីដេអូ + + + Switch Cameras + ផ្លាស់ប្ដូរកាមេរ៉ា + + + + CloseDialog + + Cancel + បោះបង់ + + + Close + បិទ + + + + ImageItem + + Copy + ថតចុះ + + + Delete + លុប + + + Open folder + បើកថត + + + Print + បង្ហោះ + + + + QObject + + You don't have permission to operate this folder + អ្នកគ្មានសិទ្ធិក្នុងការធ្វើការលើថតនេះ + + + Close + បិទ + + + Open folder + បើកថត + + + Settings + ការកំណត់ត្រា + + + Basic + មូលដ្ឋាន + + + File location + ទីតាំងឯកសារ + + + Shoot + ថត + + + Burst mode + ការថតចំហៀង + + + Self-timer delay + ការពន្លូតពេលសំលាប់សំលាប់ + + + Output + ការបោះពុង + + + Output format + បំណែកបោះពុង + + + 4 pcs + ៤ គ្រឿង + + + 10 pcs + ១០ គ្រឿង + + + None + គ្មាន + + + Camera + កាមេរ៉ា + + + Camera is an image and video capture utility using your PC camera or webcam. + កាមេរ៉ាគឺជាប្រយោគនៃការបន្ទិករូបថតនិងវីដេអូ ដោយប្រើកាមេរ៉ាមួយនៃកុំព្យូទ័រឬកាមេរ៉ាអេមអេស + + + File not saved + ឯកសារមិនបានរក្សាទុក + + + Photo: + រូបថត: + + + Video: + វីដេអូ: + + + Resolution settings + ការកំណត់គោលដៅ + + + Photos: + ថតរូប: + + + Videos: + វីដេអូ: + + + Sound effects + សំលេង + + + Mirror mode + ការបង្ហាញតាមតំណែង + + + Flashlight + អំពីរលោត + + + Gridlines + ប្រទេស + + + 1*1 lines + ប្រទេស ១*១ + + + 2*2 lines + ប្រទេស ២*២ + + + Maximum resolution: + គោលដៅអតិបរមា: + + + + Shortcut + + Camera + កាមេរ៉ា + + + Settings + ការកំណត់ + + + Stop recording + បិទការថត + + + Copy + ថត​បញ្ចូល + + + Delete + លុប + + + Open + បើក + + + Print + បោះពុម្ព + + + Help + ជំនួយ + + + Display shortcuts + បង្ហាញ​ប្រអប់​បើក​បើក​ប្រអប់ + + + Stop taking photos + បិទការថតរូប + + + Context menu + ប្រអប់​បើក​បើក​ប្រអប់ + + + + dc::Settings + + None + គ្មាន + + + mp4 + mp4 + + + webm + វ៉ែបម + + + + filterPreviewButton + + Normal + ធម្មតា + + + Vivid + ក្រាស់ + + + Warm + ព្រះអាទិត្ត + + + Cold + ត្រជាក់ + + + Retro + ថត​ប្រវត្តិសាស្ត្រ + + + Film + វីដេអូ + + + Gray + ស្វាយ + + + B&W + ខ្មៅ និង លាស់ + + + + takePhotoSettingAreaWidget + + Flashlight + ប្រយុទ្ធកាប់ + + + On + បើក + + + Off + បិទ + + + Delay capture + បញ្ចប់ការថតដោយផ្ទះ + + + None + គ្មាន + + + Filters + ប្រភេទនៃការថត + + + Exposure + ការបង្ហាញ + + + + videowidget + + No webcam found + គ្មានកាមេរ៉ាវីដេអូត្រូវបានរកឃើញ + + + The webcam is in use + កាមេរ៉ាវីដេអូកំពុងត្រូវបានប្រើ + + + diff --git a/src/translations/deepin-camera_kn_IN.ts b/src/translations/deepin-camera_kn_IN.ts new file mode 100644 index 000000000..912169f62 --- /dev/null +++ b/src/translations/deepin-camera_kn_IN.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + వీడియో రికార్డింగ్ ప్రారంభమైంది. విండోను మూసివేయాలా? + + + Settings + సెట్టింగ్స్ + + + None + ఏం కూడా లేదు + + + Photo + ఫోటో + + + Video + వీడీయో + + + Switch Cameras + కెర్నర్లను మార్చండి + + + + CloseDialog + + Cancel + రద్దు చేయండి + + + Close + మూసివేయండి + + + + ImageItem + + Copy + కాపీ చేయండి + + + Delete + అప్పగించండి + + + Open folder + ఫోల్డర్ తెరవండి + + + Print + ప్రింట్ చేయండి + + + + QObject + + You don't have permission to operate this folder + ఈ ఫోల్డర్ ను పనిచేయడానికి మీకు అనుమతి లేదు + + + Close + మూసివేయండి + + + Open folder + ఫోల్డర్ తెరవండి + + + Settings + సెట్టింగ్స్ + + + Basic + బేసిక్ + + + File location + ఫైల్ స్థానం + + + Shoot + షూట్ చేయండి + + + Burst mode + బర్స్ట్ మోడ్ + + + Self-timer delay + సెల్ఫ్ టైమర్ వేచిపెట్టడం + + + Output + అయింది + + + Output format + అయింది ఫార్మాట్ + + + 4 pcs + 4 పీస్ + + + 10 pcs + 10 పీస్ + + + None + ఏం కూడా లేదు + + + Camera + కెర్నర్ + + + Camera is an image and video capture utility using your PC camera or webcam. + కెర్నర్ మీ పీసీ కెర్నర్ లేదా వెబ్ కెర్నర్ ఉపయోగించి ఫోటో మరియు వీడియో పొందడానికి ఉపయోగించే సాధనం + + + File not saved + ఫైల్ సేవ్ చేయబడలేదు + + + Photo: + ఫోటో: + + + Video: + వీడియో: + + + Resolution settings + పరిమాణ సెట్టింగ్స్ + + + Photos: + ఫోటోలు: + + + Videos: + వీడియోలు: + + + Sound effects + ధ్వని ప్రభావాలు + + + Mirror mode + అందరికీ ప్రతిచేయడం + + + Flashlight + ఫ్లాష్ లైట్ + + + Gridlines + గ్రిడ్ లైన్స్ + + + 1*1 lines + 1×1 లైన్స్ + + + 2*2 lines + 2×2 లైన్స్ + + + Maximum resolution: + అధిక పరిమాణ: + + + + Shortcut + + Camera + కెమెరా + + + Settings + సెట్టింగ్స్ + + + Stop recording + రికార్డింగ్ ఆపండి + + + Copy + కాపీ చేయండి + + + Delete + డిలీట్ చేయండి + + + Open + ఓపెన్ చేయండి + + + Print + ప్రింట్ చేయండి + + + Help + హెల్ప్ + + + Display shortcuts + స్థానాలు ప్రదర్శించండి + + + Stop taking photos + ఫోటోలు తీయడం ఆపండి + + + Context menu + కాంటెక్స్ట్ మెన్యూ + + + + dc::Settings + + None + కోణం + + + mp4 + ఎంపీ4 + + + webm + వెబ్ఎం + + + + filterPreviewButton + + Normal + సాధారణ + + + Vivid + ప్రామాణిక + + + Warm + ఉష్ణం + + + Cold + చల్లం + + + Retro + రీట్రో + + + Film + సినిమా + + + Gray + గ్రే + + + B&W + బ్యాక్ అండ్ వైట్ + + + + takePhotoSettingAreaWidget + + Flashlight + ఫ్లాష్ లైట్ + + + On + ఏ + + + Off + అఫ్ + + + Delay capture + సమయం వాయిదా చేయించడం + + + None + కోడు + + + Filters + ఫిల్టర్లు + + + Exposure + ప్రకాశన + + + + videowidget + + No webcam found + వీడియో కెమెరా కనుగొనబడలేదు + + + The webcam is in use + వీడియో కెమెరా వాడు కొంటున్నది + + + diff --git a/src/translations/deepin-camera_ko.ts b/src/translations/deepin-camera_ko.ts new file mode 100644 index 000000000..dd392a643 --- /dev/null +++ b/src/translations/deepin-camera_ko.ts @@ -0,0 +1,354 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + 비디오 녹화가 진행 중입니다. 창을 닫으시겠습니까? + + + Open folder + 폴더 열기 + + + Settings + 설정 + + + None + 없음 + + + Photo + 사진 + + + Video + 비디오 + + + Switch Cameras + 카메라 변경하기 + + + + CloseDialog + + Cancel + 취소 + + + Close + 닫기 + + + + ImageItem + + Copy + 복사 + + + Delete + 삭제 + + + Open folder + 폴더 열기 + + + Print + 인쇄 + + + + QObject + + You don't have permission to operate this folder + 이 폴더를 조작할 수 있는 권한이 없습니다. + + + Close + 닫기 + + + Invalid folder + 올바르지 않은 폴더 + + + Open folder + 폴더 열기 + + + Settings + 설정 + + + Basic + 기본 + + + File location + 파일 위치 + + + Shoot + 촬영 + + + Burst mode + 버스트 모드 + + + Self-timer delay + 자동 촬영 지연 + + + Output + 출력 + + + Output format + 출력 형식 + + + 4 pcs + 4개 + + + 10 pcs + 10개 + + + None + 없음 + + + Camera + 카메라 + + + Camera is an image and video capture utility using your PC camera or webcam. + 카메라는 PC 카메라 또는 웹캠을 사용하는 이미지 및 비디오 캡처 유틸리티입니다. + + + File not saved + 파일이 저장되지 않음 + + + Save to: + 저장 위치: + + + Photo: + 사진: + + + Video: + 비디오: + + + Resolution settings + 해상도 설정 + + + Resolution: + 해상도: + + + Photos: + 사진: + + + Videos: + 비디오: + + + Sound effects + 음향 효과 + + + Mirror mode + 거울 모드 + + + Flashlight + 플래시 + + + Gridlines + 그리드 라인 + + + 1*1 lines + 1x1 라인 + + + 2*2 lines + 2x2 라인 + + + Maximum resolution: + 최대 해상도: + + + + Shortcut + + Camera + 카메라 + + + Settings + 설정 + + + Stop recording + 녹화 중지 + + + Copy + 복사 + + + Delete + 삭제 + + + Open + 열기 + + + Print + 인쇄 + + + Help + 도움말 + + + Display shortcuts + 단축키 보이기 + + + Stop taking photos + 사진 촬영 중지 + + + Context menu + 컨텍스트 메뉴 + + + + ThumbnailsBar + + Take photo + 사진 찍기 + + + Record video + 비디오 녹화 + + + Stop taking photos + 사진 촬영 중지 + + + + dc::Settings + + None + 없음 + + + mp4 + mp4 + + + webm + 웨브M + + + + filterPreviewButton + + Normal + 정상 + + + Vivid + 생동감 있는 + + + Warm + 따뜻한 + + + Cold + 차가운 + + + Retro + 리tro + + + Film + 필름 + + + Gray + 그레이 + + + B&W + 흑백 + + + + takePhotoSettingAreaWidget + + Flashlight + 플래시 + + + On + 켜짐 + + + Off + 꺼짐 + + + Delay capture + 지연 촬영 + + + None + 없음 + + + Filters + 필터 + + + Exposure + 노출 + + + + videowidget + + No webcam found + 웹캠을 찾을 수 없음 + + + The webcam is in use + 웹캠이 사용 중입니다 + + + Stop recording + 녹화 중지 + + + diff --git a/src/translations/deepin-camera_ku.ts b/src/translations/deepin-camera_ku.ts new file mode 100644 index 000000000..0a19b281c --- /dev/null +++ b/src/translations/deepin-camera_ku.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ئەمەن ئەرە بەرە ڤیديو بەرە ئەرە بەرە. پەن ئەرە بەرە؟ + + + Settings + ئەوەنە + + + None + هەن + + + Photo + فۆتو + + + Video + ڤیديو + + + Switch Cameras + کاميرەلار بەرە چەنبەرە + + + + CloseDialog + + Cancel + بەرە کەن + + + Close + بەرە کەن + + + + ImageItem + + Copy + کۆپى + + + Delete + دەلەت + + + Open folder + فۆlder بەرە + + + Print + پىرنت + + + + QObject + + You don't have permission to operate this folder + ئەمەن فۆlder بەرە چەن نە بەرە ڤەرە بەرە + + + Close + بەرە کەن + + + Open folder + فۆlder بەرە + + + Settings + ئەوەنە + + + Basic + بەسیک + + + File location + فایل ڤەرە + + + Shoot + شۇوت + + + Burst mode + بۇرست مود + + + Self-timer delay + سەل-تاىمر دېلى + + + Output + ئۆتپۇت + + + Output format + ئۆتپۇت فۆرmat + + + 4 pcs + 4 ئەك + + + 10 pcs + 10 ئەك + + + None + هەن + + + Camera + کاميرە + + + Camera is an image and video capture utility using your PC camera or webcam. + کاميرە ھەم فۆتو ھەم ڤیديو بەرە چەن بەرە ڤەرە بەرە دەن بەرە كاميرە ھەم وېبکام چەن بەرە. + + + File not saved + فایل نە بەرە + + + Photo: + 'فۆتو:' + + + Video: + ڤیدیو: + + + Resolution settings + ئەوەتەن گەمارەکان + + + Photos: + فوتو: + + + Videos: + ڤیدیو: + + + Sound effects + سۆند ئەفектەکان + + + Mirror mode + ئەنگلەتەن گەمارە + + + Flashlight + فلاشلائت + + + Gridlines + گریدلاینەکان + + + 1*1 lines + 1*1 لاینەکان + + + 2*2 lines + 2*2 لاینەکان + + + Maximum resolution: + ئەوەتەن گەمارەکان: + + + + Shortcut + + Camera + کامەرا + + + Settings + سەتtings + + + Stop recording + دەرەکت کردنەوە + + + Copy + کۆپى + + + Delete + دەلەت + + + Open + ئەپەن + + + Print + پرنت + + + Help + هەڵپ + + + Display shortcuts + کوتاکەکان نمایش کەوە + + + Stop taking photos + فوتو کردنەوە + + + Context menu + کۆنتكس مېنى + + + + dc::Settings + + None + هەن + + + mp4 + mp4 + + + webm + + + + + filterPreviewButton + + Normal + نۆرمال + + + Vivid + ڤیود + + + Warm + ورم + + + Cold + کولد + + + Retro + رېترو + + + Film + فلم + + + Gray + گری + + + B&W + بئن ۲ + + + + takePhotoSettingAreaWidget + + Flashlight + فلاشلیت + + + On + ئەکتیڤ + + + Off + دەکتیڤ + + + Delay capture + ئەرەرە کۆتەرە + + + None + هەن + + + Filters + فیلترە + + + Exposure + ئەزەرکردن + + + + videowidget + + No webcam found + وێبکەمی نەدۆزرە + + + The webcam is in use + وێبکەمی دەکەتیڤ دەبێت + + + diff --git a/src/translations/deepin-camera_ku_IQ.ts b/src/translations/deepin-camera_ku_IQ.ts new file mode 100644 index 000000000..4e17ce944 --- /dev/null +++ b/src/translations/deepin-camera_ku_IQ.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ئەرەقەت دەرەقەت کردنە. پەنەرەت بەرەن؟ + + + Settings + تەمەمەت + + + None + هەن + + + Photo + فوتۆ + + + Video + ڤیديو + + + Switch Cameras + کامەرە دەرەقەت کردنە + + + + CloseDialog + + Cancel + بەرەن + + + Close + بەرەن + + + + ImageItem + + Copy + کۆپى + + + Delete + دەلەت + + + Open folder + پەنەرەت ڤولدى + + + Print + پىرنت + + + + QObject + + You don't have permission to operate this folder + تەمەمەت دەرەقەت کردنە بۆ ئەم ڤولدى ھەن + + + Close + بەرەن + + + Open folder + پەنەرەت ڤولدى + + + Settings + تەمەمەت + + + Basic + بەسیک + + + File location + فایل پەنەرەت + + + Shoot + شۇوت + + + Burst mode + بۈرست مود + + + Self-timer delay + سەل چىمەر دېلى + + + Output + ئاۋۇت + + + Output format + ئاۋۇت فۆرmat + + + 4 pcs + 4 ڤىس + + + 10 pcs + 10 ڤىس + + + None + هەن + + + Camera + کامەرە + + + Camera is an image and video capture utility using your PC camera or webcam. + کامەرە ھەن فوتۆ و ڤیديو دەرەقەت کردنە بەرەنە، دېرەقەت کردنە بۆ ئەرەقەت ڤىسەرەت یا وېبکام بەرەنە. + + + File not saved + فایل دەرەقەت نە قەتە + + + Photo: + فوتۆ: + + + Video: + ڤیدئو: + + + Resolution settings + ئەنجام ئەتەسەن + + + Photos: + فوتو: + + + Videos: + ڤیدئو: + + + Sound effects + ئەۋزەتەن + + + Mirror mode + میرور ڤەرە + + + Flashlight + فلاشلىت + + + Gridlines + گریدلاین + + + 1*1 lines + 1*1 چەنە + + + 2*2 lines + 2*2 چەنە + + + Maximum resolution: + ئەنجام ئەتەسەن كۆبرە: + + + + Shortcut + + Camera + کاميرە + + + Settings + ئەتەسەن + + + Stop recording + دەپەرە بىرە + + + Copy + كۆپى + + + Delete + دەپەرە + + + Open + بىرە + + + Print + چاپى + + + Help + كۆمەك + + + Display shortcuts + شۇرتوتەن بىرە + + + Stop taking photos + فوتو بىرە + + + Context menu + مەنۇ مەدەن + + + + dc::Settings + + None + هەن + + + mp4 + mp4 + + + webm + + + + + filterPreviewButton + + Normal + نۆرمال + + + Vivid + ۋىۋىد + + + Warm + ورم + + + Cold + كولد + + + Retro + رېترو + + + Film + فيلم + + + Gray + گری + + + B&W + بی وی + + + + takePhotoSettingAreaWidget + + Flashlight + فلاشلايت + + + On + ئەو + + + Off + ئەف + + + Delay capture + تێمارەکە بەکارهێنە + + + None + هیچکە + + + Filters + فیلتر + + + Exposure + بەرەوەرە + + + + videowidget + + No webcam found + وێبکام نەدۆزرا + + + The webcam is in use + وێبکام بەکارهێنرا + + + diff --git a/src/translations/deepin-camera_ky.ts b/src/translations/deepin-camera_ky.ts new file mode 100644 index 000000000..6a310592f --- /dev/null +++ b/src/translations/deepin-camera_ky.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Видео жазылды. Панельди жыгызышы керек? + + + Settings + Танзимат + + + None + Жок + + + Photo + Сурет + + + Video + Видео + + + Switch Cameras + Камераларды алмасыңыз + + + + CloseDialog + + Cancel + Бекит + + + Close + Жыгыз + + + + ImageItem + + Copy + Көшүр + + + Delete + Жою + + + Open folder + Каталогты ачу + + + Print + Басып чыгар + + + + QObject + + You don't have permission to operate this folder + Сиз бул каталогты үзгөртүү үчүн қызмет қўшмайтын + + + Close + Жыгыз + + + Open folder + Каталогты ачу + + + Settings + Танзимат + + + Basic + Базалық + + + File location + Файл жайлыгы + + + Shoot + Шығар + + + Burst mode + Тапшырмалық режим + + + Self-timer delay + Өз уюмалық қайта ияләнүү үчүн бэйик + + + Output + Чыгыс + + + Output format + Чыгыс форматы + + + 4 pcs + 4 та + + + 10 pcs + 10 та + + + None + Жок + + + Camera + Камера + + + Camera is an image and video capture utility using your PC camera or webcam. + Камера - сиздин компьютер камерыңыз әлбетте вебкамерасыңыз үзгөртүү үчүн қызмет қўшмайтын. + + + File not saved + Файл сақталды + + + Photo: + Сурет: + + + Video: + Видео: + + + Resolution settings + Резолюция қаттылары + + + Photos: + Фото: + + + Videos: + Видео: + + + Sound effects + Сезе эффекты + + + Mirror mode + Айырым режим + + + Flashlight + Флеш-фар + + + Gridlines + Таблицалар + + + 1*1 lines + 1*1 тенгелер + + + 2*2 lines + 2*2 тенгелер + + + Maximum resolution: + Максималды резолюция: + + + + Shortcut + + Camera + Камера + + + Settings + Таңбалар + + + Stop recording + Жазу қайтарыл + + + Copy + Көбөө + + + Delete + Жоготу + + + Open + Ачыл + + + Print + Жаныл + + + Help + Көмөк + + + Display shortcuts + Таңбаларды көрсөт + + + Stop taking photos + Фото алу қайтарыл + + + Context menu + Контекст меню + + + + dc::Settings + + None + Бергөн + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Түпкөн + + + Vivid + Түшкөн + + + Warm + Уюм + + + Cold + Салын + + + Retro + Ретро + + + Film + Фильм + + + Gray + Грэй + + + B&W + Сым + + + + takePhotoSettingAreaWidget + + Flashlight + Флэшлайт + + + On + Ачык + + + Off + Жыгыл + + + Delay capture + Кыскарт + + + None + Жок + + + Filters + Фильтрлар + + + Exposure + Тарылыш + + + + videowidget + + No webcam found + Камера табылмады + + + The webcam is in use + Камера қулланылуда + + + diff --git a/src/translations/deepin-camera_lo.ts b/src/translations/deepin-camera_lo.ts new file mode 100644 index 000000000..cb13665aa --- /dev/null +++ b/src/translations/deepin-camera_lo.ts @@ -0,0 +1,652 @@ + + + + + CMainWindow + + + + Video recording is in progress. Close the window? + ການບັນທຶກວີດີໂອແລະກຳລາການປິດຫນ້າທີ່ກຳລາການບັນທຶກວີດີໂອນີ້ຫຍັງ? + + + + Settings + ການຕັ້ງຄ່າ + + + + + None + ບໍ່ມີ + + + + + + Photo + ຮູບພາບ + + + + + Video + ວີດີໂອ + + + + Switch Cameras + ປ່ຽນແປງເຄື່ອງສໍາລັບການຖ່າຍ + + + + CloseDialog + + + Cancel + ຍົກເລີກ + + + + Close + ປິດ + + + + ImageItem + + + Copy + ຄັດລອກ + + + + Delete + ລົບ + + + + Open folder + ເປີດຟ້ອນ + + + + Print + ພິມ + + + + QObject + + + + You don't have permission to operate this folder + ທ່ານບໍ່ມີສິດໃນການດຳເນີນການຟ້ອນນີ້ + + + + + Close + ປິດ + + + + + Open folder + ເປີດບ່ອນຈັດເກັບ + + + + Settings + ການຕັ້ງຄ່າ + + + + Basic + ພື້ນຖານ + + + + File location + ທີ່ຕັ້ງຟາຍ + + + + Shoot + ຖ່າຍ + + + + Burst mode + ຮູບແບບການຖ່າຍຕໍ່ເນື່ອງ + + + + Self-timer delay + ເວລາລໍຖ້າຕົວເອງ + + + + Output + ຜົນໄດ້ຮັບ + + + + Output format + ຮູບແບບຜົນໄດ້ຮັບ + + + + 4 pcs + 4 ອັນ + + + + 10 pcs + 10 ອັນ + + + + None + ບໍ່ມີ + + + + + Camera + ກ້ອງຖ່າຍ + + + + Camera is an image and video capture utility using your PC camera or webcam. + ການຖ່າຍເປັນຕົວຊ່ວຍຈັບຮູບພາບ ແລະ ວິດີໂອໃນການໃຊ້ກ້ອງຖ່າຍຂອງຄອມພິວເຕີ້ຂອງທ່ານ ຫຼື ກ້ອງຖ່າຍວີດີໂອ + + + + + File not saved + ຟາຍບໍ່ໄດ້ຖືກບັນທຶກ + + + + Photo: + ຮູບຖ່າຍ: + + + + Video: + ວີດີໂອ: + + + + Resolution settings + ການຕັ້ງຄ່າຄວາມຊັດເຈນ + + + + Photos: + ຮູບຖ່າຍ: + + + + Videos: + ວີດີໂອ: + + + + Sound effects + ສຽງປະກົດການ + + + + Mirror mode + ຮູບແບບການສະແດງຮູບພາບ + + + + Flashlight + ແສງເຄື່ອງຍ່າງ + + + + Gridlines + ເສັ້ນເຕີ່ມ + + + + 1*1 lines + ເສັ້ນ 1*1 + + + + 2*2 lines + ເສັ້ນ 2*2 + + + + Maximum resolution: + ຄວາມຊັດເຈນສູງສຸດ: + + + + OptionPicLineEditBtn + ປຸ່ມແກ້ໄຂຂໍ້ຄວາມຮູບພາບ + + + + OptionVideoLineEditBtn + ປຸ່ມແກ້ໄຂຂໍ້ຄວາມວີດີໂອ + + + + OptionFormatLabel + ປ້າຍຮູບແບບທາງເລືອກ + + + + OptionFrame + ກອບທາງເລືອກ + + + + PicOption + ທາງເລືອກຮູບພາບ + + + + VideoOption + ທາງເລືອກວີດີໂອ + + + + OptionPicSelectableLineEdit + ຂໍ້ຄວາມທາງເລືອກຮູບພາບທີ່ເລືອກໄດ້ + + + + OptionVideoSelectableLineEdit + ຂໍ້ຄວາມທາງເລືອກວີດີໂອທີ່ເລືອກໄດ້ + + + + OptionInvalidDialog + ກ່ອງໂຕ້ຕອບທາງເລືອກທີ່ບໍ່ຖືກຕ້ອງ + + + + SettingDialog + ກ່ອງໂຕ້ຕອບການຕັ້ງຄ່າ + + + + MainWindow + ໜ້າຕ່າງຫຼັກ + + + + TitleBar + ແຖບຫົວຂໍ້ + + + + TitleMenu + ເມນູຫົວຂໍ້ + + + + VideoPreviewWidget + ວິດເຈັດຕົວຢ່າງວີດີໂອ + + + + SelectBtn + ປຸ່ມເລືອກ + + + + PicVdBtn + ປຸ່ມຮູບພາບວີດີໂອ + + + + TakeVdEndBtn + ປຸ່ມສິ້ນສຸດການຖ່າຍວີດີໂອ + + + + ThumbnailPreview + ພຣີວິວຮູບພາບຂະໜາດນ້ອຍ + + + + ModeSwitchBox + ກ່ອງປ່ຽນໂໝດ + + + + SwitchRecordBtn + ປຸ່ມປ່ຽນການບັນທຶກ + + + + LeftBtnsBox + ກ່ອງປຸ່ມຂ້າງຊ້າຍ + + + + UnfoldBtn + ປຸ່ມກາຍເປັນຂະຫຍາຍ + + + + FoldBtn + ປຸ່ມພັບ + + + + FlashlightUnfoldBtn + ປຸ່ມໄຟສ່ອງທາງຂະຫຍາຍ + + + + FlashlightFoldBtn + ປຸ່ມໄຟສ່ອງທາງພັບ + + + + FlashlightOnBtn + ປຸ່ມໄຟສ່ອງທາງເປີດ + + + + FlashlightOffBtn + ປຸ່ມໄຟສ່ອງທາງປິດ + + + + DelayUnfoldBtn + ປຸ່ມຂະຫຍາຍຄວາມລ່າຊ້າ + + + + DelayFoldBtn + ປຸ່ມພັບຄວາມລ່າຊ້າ + + + + DelayNoDelayBtn + ປຸ່ມບໍ່ມີຄວາມລ່າຊ້າ + + + + Delay3SecBtn + ປຸ່ມລ່າຊ້າ 3 ວິນາທີ + + + + Delay6SecBtn + ປຸ່ມລ່າຊ້າ 6 ວິນາທີ + + + + FiltersUnfoldBtn + ປຸ່ມຂະຫຍາຍຕົວກອງ + + + + FiltersFoldBtn + ປຸ່ມພັບຕົວກອງ + + + + FiltersCloseBtn + ປຸ່ມປິດຕົວກອງ + + + + ExposureBtn + ປຸ່ມປັບແສງ + + + + ExposureSlider + ເລື່ອນປັບແສງ + + + + ShortcutCallMenu + ທາງລັດເອີ້ນເມນູ + + + + ShortcutCopy + ທາງລັດຄັດລອກ + + + + ShortcutDelete + ທາງລັດລົບ + + + + ShortcutOpenFolder + ທາງລັດເປີດໂຟນເດີ + + + + ShortcutPrint + ທາງລັດພິມ + + + + ViewShortCut + ທາງລັດເບິ່ງ + + + + SpaceShortCut + ທາງລັດຊ່ອງວ່າງ + + + + CloseDlg + ປິດກ່ອງໂຕະລາງ + + + + PrintDialog + ພິມກ່ອງໂຕະລາງ + + + + CancelBtn + ປຸ່ມຍົກເລີກ + + + + CloseBtn + ປຸ່ມປິດ + + + + Shortcut + + + Camera + ກ້ອງຖ່າຍ + + + + Settings + ຕັ້ງຄ່າ + + + + Stop recording + ຢຸດບັນທຶກ + + + + Copy + ຄັດລອກ + + + + Delete + ລົບ + + + + Open + ເປີດ + + + + Print + ພິມ + + + + Help + ຊ່ວຍເຫຼືອ + + + + Display shortcuts + ສະແດງລະຫັດການດຳເນີນການ + + + + Stop taking photos + ຢຸດຖ່າຍຮູບ + + + + Context menu + ລະຫັດການດຳເນີນການ + + + + dc::Settings + + + + None + ບໍ່ມີ + + + + + mp4 + mp4 + + + + + + webm + webm + + + + filterPreviewButton + + + + + Normal + ທົ່ວໄປ + + + + Vivid + ສີ່ງເດັ່ນ + + + + Warm + ຮ້ອມ + + + + Cold + ເຢັນ + + + + Retro + ຍ້ອນຍຸກ + + + + Film + ຟິລມ + + + + Gray + ສີເທົາ + + + + B&W + ສີຂາວ-ສີດ່າງ + + + + takePhotoSettingAreaWidget + + + Flashlight + ແສງສະຫຼາດ + + + + On + ເປີດ + + + + Off + ປິດ + + + + Delay capture + ລໍ້ກ່ອງ + + + + None + ບໍ່ມີ + + + + + Filters + ຕາຕະລາງ + + + + Exposure + ການສະແດງສີ + + + + videowidget + + + + + No webcam found + ບໍ່ພົບກ້ອງຖ່າຍວີດີໂອ + + + + + + The webcam is in use + ກ້ອງຖ່າຍວີດີໂອຖືກໃຊ້ງານ + + + diff --git a/src/translations/deepin-camera_lt.ts b/src/translations/deepin-camera_lt.ts new file mode 100644 index 000000000..6394c2f86 --- /dev/null +++ b/src/translations/deepin-camera_lt.ts @@ -0,0 +1,359 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video transkripcija vyksta. Užverti langele? + + + Open folder + Atverti folderį + + + + Settings + Nustatymai + + + + None + Nėra + + + + Photo + Fotografija + + + + Video + Video + + + + Switch Cameras + Pakeisti kamerą + + + + + CloseDialog + + Cancel + Atšaukti + + + + Close + Užverti + + + + + ImageItem + + Copy + Kopijuoti + + + + Delete + Ištrinti + + + + Open folder + Atverti folderį + + + + Print + Spausdinti + + + + + QObject + + You don't have permission to operate this folder + Neturiate leidimo veikti šiuo folderiu + + + + Close + Užverti + + + + Open folder + Atverti folderį + + + + Settings + Nustatymai + + + + Basic + Pagrindinė + + + + File location + Failo vieta + + + + Shoot + Rašyti + + + + Burst mode + Žiūrovos režimas + + + + Self-timer delay + Sveikinimo trukmė + + + + Output + Išvestis + + + + Output format + Išvesties formatas + + + + 4 pcs + 4 pc + + + + 10 pcs + 10 pc + + + + None + Nėra + + + Camera + Kameras + + + Camera is an image and video capture utility using your PC camera or webcam. + Kameras yra vaizdo ir video užklausos priemonė, kuri naudoja Jūsų PC kamerą ar webkamera. + + + File not saved + failas nebuvo išsaugotas + + + Photo: + Vaizdas: + + + Video: + Video: + + + Resolution settings + Nustatymai apie resoliuciją + + + Photos: + Vaizdai: + + + Videos: + Video: + + + Sound effects + Garsieji efektiškai + + + Mirror mode + Skritulio režimas + + + Flashlight + Sklyptuvas + + + Gridlines + Rėžių linijos + + + 1*1 lines + 1*1 linijos + + + 2*2 lines + 2*2 linijos + + + Maximum resolution: + Nors didžiausioje resoliucijoje: + + + + Shortcut + + Camera + Kameras + + + Settings + Nustatymai + + + Stop recording + Stabite įrašymą + + + Copy + Kopijuoti + + + Delete + Ištrinti + + + Open + Atidaryti + + + Print + Spausdinti + + + Help + Pagalba + + + Display shortcuts + Rodyti įspūdžius + + + Stop taking photos + Stošis nuo vaizdo įrašymo + + + Context menu + Kontekstinis meniu + + + + ThumbnailsBar + + Stop taking photos + Stošis nuo vaizdo įrašymo + + + + dc::Settings + + None + Nėra + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normalus + + + Vivid + Ilguma + + + Warm + Gretas + + + Cold + Kaltas + + + Retro + Retro + + + Film + Filmas + + + Gray + Grizlas + + + B&W + Balti ir raudonai + + + + takePhotoSettingAreaWidget + + Flashlight + Ilguma + + + On + Išeinantis + + + Off + Išjungtas + + + Delay capture + Pratęsti vaizdo įrašymą + + + None + Nėra + + + Filters + Filtras + + + Exposure + Išvaizdos išvaizda + + + + videowidget + + No webcam found + Nenorėjęs webkameros + + + The webcam is in use + Webkamera yra naudojama + + + Stop recording + Stabite įrašymą + + + diff --git a/src/translations/deepin-camera_ml.ts b/src/translations/deepin-camera_ml.ts new file mode 100644 index 000000000..4dc45604e --- /dev/null +++ b/src/translations/deepin-camera_ml.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + വീഡിയോ റെക്കോർഡിംഗ് പ്രോഗ്രസ്സിലാണ്. വിൻഡോ അടച്ചാൽ മതിയോ? + + + Settings + സെറ്റിംഗ്സ് + + + None + ഇല്ല + + + Photo + ഫോട്ടോ + + + Video + വീഡിയോ + + + Switch Cameras + ക്യാമറകൾ മാറ്റുക + + + + CloseDialog + + Cancel + റദ്ദാക്കുക + + + Close + അടച്ചാൽ + + + + ImageItem + + Copy + കോപ്പി + + + Delete + ഡിലീറ്റ് + + + Open folder + ഫോൾഡർ തുറക്കുക + + + Print + പ്രിന്റ് + + + + QObject + + You don't have permission to operate this folder + നിങ്ങൾക്ക് ഈ ഫോൾഡർ പ്രവർത്തിപ്പിക്കാനുള്ള അനുമതിയില്ല + + + Close + അടച്ചാൽ + + + Open folder + ഫോൾഡർ തുറക്കുക + + + Settings + സെറ്റിംഗ്സ് + + + Basic + ബേസിക് + + + File location + ഫയൽ സ്ഥലം + + + Shoot + ശൂട്ട് + + + Burst mode + ബർസ്റ്റ് മോഡ് + + + Self-timer delay + സെല്ഫ് ടൈമർ താമസം + + + Output + ഔട്പുട്ട് + + + Output format + ഔട്പുട്ട് ഫോർമാറ്റ് + + + 4 pcs + 4 പിസി + + + 10 pcs + 10 പിസി + + + None + ഇല്ല + + + Camera + ക്യാമറ + + + Camera is an image and video capture utility using your PC camera or webcam. + ക്യാമറ ഒരു ഇമേജ് അടുക്കൽ ഉപകരണമാണ്, നിങ്ങളുടെ പിസി ക്യാമറ അല്ലെങ്കിൽ വെബ്ക്യാമറ ഉപയോഗിച്ചാണ് പ്രവർത്തിക്കുന്നത്. + + + File not saved + ഫയൽ സേവ് ചെയ്തില്ല + + + Photo: + ഫോട്ടോ: + + + Video: + വീഡിയോ: + + + Resolution settings + ക്ഷമത സെറ്റിംഗ്സ് + + + Photos: + ഫോട്ടോസ്: + + + Videos: + വീഡിയോസ്: + + + Sound effects + സോണ്ട് ഇഫക്ട്സ് + + + Mirror mode + മിറർ മോഡ് + + + Flashlight + ഫ്ലാഷ്ലൈറ്റ് + + + Gridlines + ഗ്രിഡ് ലൈനുകൾ + + + 1*1 lines + 1×1 ലൈനുകൾ + + + 2*2 lines + 2×2 ലൈനുകൾ + + + Maximum resolution: + ഉയർന്ന ക്ഷമത: + + + + Shortcut + + Camera + ക്യാമറ + + + Settings + സെറ്റിംഗ്സ് + + + Stop recording + രെക്കോർഡിംഗ് നിർത്തുക + + + Copy + കോപ്പി ചെയ്യുക + + + Delete + ഡിലീറ്റ് ചെയ്യുക + + + Open + ഓപ്പൺ ചെയ്യുക + + + Print + പ്രിന്റ് ചെയ്യുക + + + Help + ഹെല്പ് + + + Display shortcuts + ശോദ്ധന ഷോർട്ട് കട്ടുകൾ പ്രദർശിപ്പിക്കുക + + + Stop taking photos + ഫോട്ടോസ് എടുക്കുക നിർത്തുക + + + Context menu + കോൺടെക്സ്റ്റ് മെനു + + + + dc::Settings + + None + ഇല്ല + + + mp4 + മ്പി4 + + + webm + വെബിഎം + + + + filterPreviewButton + + Normal + നോർമൽ + + + Vivid + വിവിഡ് + + + Warm + വാർം + + + Cold + കോൾഡ് + + + Retro + റെട്രോ + + + Film + ഫിലിം + + + Gray + ഗ്രേ + + + B&W + ബി അൻഡ് വൈ + + + + takePhotoSettingAreaWidget + + Flashlight + ഫ്ലാഷ്ലൈറ്റ് + + + On + ഓൺ + + + Off + ഔഫ് + + + Delay capture + ഡെലേ കെപ്പർ + + + None + നോൺ + + + Filters + ഫില്ട്ടർസ് + + + Exposure + ഇക്സ്പോസർ + + + + videowidget + + No webcam found + വിഡിയോ ക്യാമറ കണ്ടെത്തിയില്ല + + + The webcam is in use + വിഡിയോ ക്യാമറ ഉപയോഗത്തിലാണ് + + + diff --git a/src/translations/deepin-camera_mn.ts b/src/translations/deepin-camera_mn.ts new file mode 100644 index 000000000..cf4e56b72 --- /dev/null +++ b/src/translations/deepin-camera_mn.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Видео нь баталгаажуулалт явуулж байна. Хөнгөн дугаарыг хаах? + + + Settings + Сэтгэл + + + None + Хийгүй + + + Photo + Фото + + + Video + Видео + + + Switch Cameras + Хөнгөн дугаарыг солих + + + + CloseDialog + + Cancel + Цуцлах + + + Close + Хаах + + + + ImageItem + + Copy + Хуваалцах + + + Delete + Устгах + + + Open folder + Фолдыг нээх + + + Print + Хэвлэх + + + + QObject + + You don't have permission to operate this folder + Та энэ фолдыг ажиллах эрхгүй байна + + + Close + Хаах + + + Open folder + Фолдыг нээх + + + Settings + Сэтгэл + + + Basic + Нийтлэг + + + File location + Файлын байршил + + + Shoot + Фото авах + + + Burst mode + Хөнгөн дугаарын хөдөлгөөн + + + Self-timer delay + Өөрөө хугацаа татах хугацаа + + + Output + Гаралт + + + Output format + Гаралтын формат + + + 4 pcs + 4 төрөл + + + 10 pcs + 10 төрөл + + + None + Хийгүй + + + Camera + Хөнгөн дугаар + + + Camera is an image and video capture utility using your PC camera or webcam. + Хөнгөн дугаар нь таны компьютерын хөнгөн дугаар эсвэл вебкамрыг ашиглан фото болон видео авах урлаг юм. + + + File not saved + Файл хадгалаагүй + + + Photo: + Фото: + + + Video: + Видео: + + + Resolution settings + Хөрөнгөөний төлөвлөгөө + + + Photos: + Фото: + + + Videos: + Видео: + + + Sound effects + Хураамын үнэмшил + + + Mirror mode + Тархалтын төлөвлөгөө + + + Flashlight + Түлхүүрийн үнэмшил + + + Gridlines + Гарчиг хүрээ + + + 1*1 lines + 1*1 хүрээ + + + 2*2 lines + 2*2 хүрээ + + + Maximum resolution: + Хамгийн их хөрөнгөө: + + + + Shortcut + + Camera + Хөнгөнүүд + + + Settings + Төлөвлөгөө + + + Stop recording + Хураагдлыг дүүргэх + + + Copy + Хуваах + + + Delete + Устгах + + + Open + Нээх + + + Print + Хэвлэх + + + Help + Тусламж + + + Display shortcuts + Төлөвлөгөөний товчлуур + + + Stop taking photos + Фото хийхийг дүүргэх + + + Context menu + Хэлбэртэй меню + + + + dc::Settings + + None + Хийгүй + + + mp4 + mp4 + + + webm + вебм + + + + filterPreviewButton + + Normal + Нормал + + + Vivid + Хүчтэй + + + Warm + Хүйтэй + + + Cold + Хүйтэн + + + Retro + Хүчтэй + + + Film + Филм + + + Gray + Грэй + + + B&W + Бүх төрөл + + + + takePhotoSettingAreaWidget + + Flashlight + Флашлайт + + + On + Сон + + + Off + Ха + + + Delay capture + Хугацаа хүртэл хуваалцах + + + None + Хийнгүй + + + Filters + Фильтрүүд + + + Exposure + Хүрээлэгч + + + + videowidget + + No webcam found + Вэбкэм байхгүй + + + The webcam is in use + Вэбкэм нь ашиглагдаж байна + + + diff --git a/src/translations/deepin-camera_mr.ts b/src/translations/deepin-camera_mr.ts new file mode 100644 index 000000000..62f0e29cb --- /dev/null +++ b/src/translations/deepin-camera_mr.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + વીડિયો રેકોર્ડિંગ ચાલી રહી છે. વિંડો બંધ કરો? + + + Settings + સેટિંગ્સ + + + None + કોઈ પણ + + + Photo + ફોટો + + + Video + વીડિયો + + + Switch Cameras + કેમરાને બદલો + + + + CloseDialog + + Cancel + રદ કરો + + + Close + બંધ કરો + + + + ImageItem + + Copy + કૉપી કરો + + + Delete + ટેકરો + + + Open folder + ફોલ્ડર ખોલો + + + Print + પ્રિન્ટ કરો + + + + QObject + + You don't have permission to operate this folder + તમને આ ફોલ્ડર કામગીરી માટે અધિકાર નથી + + + Close + બંધ કરો + + + Open folder + ફોલ્ડર ખોલો + + + Settings + સેટિંગ્સ + + + Basic + બેસિક + + + File location + ફાઈલ સ્થાન + + + Shoot + શૂટ કરો + + + Burst mode + બર્સ્ટ મોડ + + + Self-timer delay + સેલ્ફ ટાઇમર ડેલે + + + Output + આઉટપુટ + + + Output format + આઉટપુટ ફોર્મેટ + + + 4 pcs + 4 પીસીસી + + + 10 pcs + 10 પીસીસી + + + None + કોઈ પણ + + + Camera + કેમરા + + + Camera is an image and video capture utility using your PC camera or webcam. + કેમરા તમારા પીસી કેમરા અથવા વેબકેમનો ઉપયોગ કરીને છબી અને વીડિયો સંગ્રહણ માટે એક સાધન છે. + + + File not saved + ફાઈલ બચાવી નથી શેર કરી + + + Photo: + ફોટો: + + + Video: + વિડિઓ: + + + Resolution settings + ક્રમાંક નિક્ષેપ + + + Photos: + ફોટોગ્રાફ: + + + Videos: + વિડિઓસ: + + + Sound effects + ધ્વનિ પ્રભાવ + + + Mirror mode + દર્પણ પ્રભાવ + + + Flashlight + ફ્લાશલાઇટ + + + Gridlines + ગ્રિડ લાઇન્સ + + + 1*1 lines + 1*1 લાઇન્સ + + + 2*2 lines + 2*2 લાઇન્સ + + + Maximum resolution: + મહત્તમ ક્રમાંક: + + + + Shortcut + + Camera + કેમરા + + + Settings + સેટિંગ્સ + + + Stop recording + રેકોર્ડિંગ સ્ટોપ કરો + + + Copy + કોપી કરો + + + Delete + ડીલીટ કરો + + + Open + ઓપન કરો + + + Print + પ્રિંટ કરો + + + Help + મદદ + + + Display shortcuts + શર્ટકટ દર્શાવો + + + Stop taking photos + ફોટોગ્રાફ લેવાનું સ્ટોપ કરો + + + Context menu + કન્ટેક્ટ મેન્યુ + + + + dc::Settings + + None + કોઈપણ + + + mp4 + મ્પેફી + + + webm + વેબમે + + + + filterPreviewButton + + Normal + સામાન્ય + + + Vivid + સ્પષ્ટ + + + Warm + ગરમ + + + Cold + ઠંડો + + + Retro + રેટ્રો + + + Film + फिल्म + + + Gray + ગ્રે + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + ફ્લાશલાઇટ + + + On + ઓન + + + Off + ઓફ + + + Delay capture + ડેલે કેપ્ચર + + + None + નિયો + + + Filters + ફિલ્ટર્સ + + + Exposure + એક્સ્પોઝર + + + + videowidget + + No webcam found + કેમરા મળી શક્યો નથી + + + The webcam is in use + કેમરા વપરાઈ રહ્યો છે + + + diff --git a/src/translations/deepin-camera_ms.ts b/src/translations/deepin-camera_ms.ts index a239d12bd..99ca56f90 100644 --- a/src/translations/deepin-camera_ms.ts +++ b/src/translations/deepin-camera_ms.ts @@ -1,6 +1,4 @@ - - - + CMainWindow @@ -178,19 +176,19 @@ Gridlines - + Garisan grid 1*1 lines - + Garisan 1*1 2*2 lines - + Garisan 2*2 Maximum resolution: - + Resolusi maksimum: @@ -261,40 +259,48 @@ None Tiada + + mp4 + MP4 + + + webm + WebM + filterPreviewButton Normal - + Biasa Vivid - + Terang Warm - + Panas Cold - + Sejuk Retro - + Retro Film - + Filem Gray - + Kelabu B&W - + H&P @@ -321,11 +327,11 @@ Filters - + Penapis Exposure - + Dedahan @@ -343,4 +349,4 @@ Henti rakaman - + \ No newline at end of file diff --git a/src/translations/deepin-camera_my.ts b/src/translations/deepin-camera_my.ts new file mode 100644 index 000000000..ed011ba9e --- /dev/null +++ b/src/translations/deepin-camera_my.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ဗီဒီယို ရိုက်နေပါသည်။ ပိုက်ကို ပိတ်ရန် လိုအပ်ပါသလား။ + + + Settings + စီစဉ်များ + + + None + မရှိ + + + Photo + ဓာတ်ပုံ + + + Video + ဗီဒီယို + + + Switch Cameras + ကင်မရှင်များကို ပြောင်းလဲ + + + + CloseDialog + + Cancel + ဖျက်ပစ် + + + Close + ပိတ် + + + + ImageItem + + Copy + အမှားကူး + + + Delete + ဖျက် + + + Open folder + မိတ္တူကို ဖွင့် + + + Print + ထုတ် + + + + QObject + + You don't have permission to operate this folder + သင်သည် မိတ္တူကို အလုပ်လုပ်ရန် ခွင့်ပြုခွင့်မရှိပါ + + + Close + ပိတ် + + + Open folder + မိတ္တူကို ဖွင့် + + + Settings + စီစဉ်များ + + + Basic + အခြေခံ + + + File location + ဖိုင်နေရာ + + + Shoot + ရိုက် + + + Burst mode + ချိန်းကာလ + + + Self-timer delay + အိုးတီမီး နှေးကွေး + + + Output + ထုတ်ပေး + + + Output format + ထုတ်ပေး ပုံစံ + + + 4 pcs + ၄ ခု + + + 10 pcs + ၁၀ ခု + + + None + မရှိ + + + Camera + ကင်မရှင် + + + Camera is an image and video capture utility using your PC camera or webcam. + ကင်မရှင်မှာ သင်၏ ကွန်ပျိုးတိုင်းကင်မရှင် သို့မဟုတ် ဝိုင်ကို အသုံးပြု၍ ဓာတ်ပုံနှင့် ဗီဒီယိုကို ရိုက်နိုင်သည့် ဆော့ဝ်ဗ်ဖြစ်ပါသည်။ + + + File not saved + ဖိုင်ကို သိမ်းဆည်းခဲ့ခြင်း မရှိ + + + Photo: + ဓာတ်ပုံ: + + + Video: + + + + Resolution settings + + + + Photos: + + + + Videos: + + + + Sound effects + + + + Mirror mode + + + + Flashlight + + + + Gridlines + + + + 1*1 lines + + + + 2*2 lines + + + + Maximum resolution: + + + + + Shortcut + + Camera + + + + Settings + + + + Stop recording + + + + Copy + + + + Delete + + + + Open + + + + Print + + + + Help + + + + Display shortcuts + + + + Stop taking photos + + + + Context menu + + + + + dc::Settings + + None + + + + mp4 + mp4 + + + webm + + + + + filterPreviewButton + + Normal + + + + Vivid + + + + Warm + + + + Cold + + + + Retro + + + + Film + ပီလ် + + + Gray + ဂရို + + + B&W + ဘီအို + + + + takePhotoSettingAreaWidget + + Flashlight + ဖုန်းကိုင်း + + + On + အားဖြင့် + + + Off + အားမဖြင့် + + + Delay capture + နှေးကွေးရိုက်ယူ + + + None + မရှိ + + + Filters + ပီလ်တား + + + Exposure + အထူးပြု + + + + videowidget + + No webcam found + ကင်မရာကို တွေ့ရှိမရ + + + The webcam is in use + ကင်မရာကို အသုံးပြုနေသည် + + + diff --git a/src/translations/deepin-camera_nb.ts b/src/translations/deepin-camera_nb.ts new file mode 100644 index 000000000..db114f18d --- /dev/null +++ b/src/translations/deepin-camera_nb.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Videoopptredet er i gang. Lukk vinduet? + + + Settings + Innstillinger + + + None + Ingen + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Bytt kamera + + + + CloseDialog + + Cancel + Avbryt + + + Close + Lukk + + + + ImageItem + + Copy + Kopier + + + Delete + Slett + + + Open folder + Åpne mappe + + + Print + Skriv ut + + + + QObject + + You don't have permission to operate this folder + Du har ikke tillatelse til å operere denne mappen + + + Close + Lukk + + + Open folder + Åpne mappe + + + Settings + Innstillinger + + + Basic + Grunnleggende + + + File location + Filsted + + + Shoot + Ta bilde + + + Burst mode + Burst-modus + + + Self-timer delay + Selv-timer forsinkelse + + + Output + Utdata + + + Output format + Utdataformat + + + 4 pcs + 4 stk + + + 10 pcs + 10 stk + + + None + Ingen + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera er et verktøy for oppfølging av bilder og videoer ved bruk av PC-kameraet eller webcam. + + + File not saved + Fil ikke lagret + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Oppløsningsinnstillinger + + + Photos: + Fotografer: + + + Videos: + Videos: + + + Sound effects + Lyd effekter + + + Mirror mode + Speilmodus + + + Flashlight + Lampe + + + Gridlines + Rutemønstre + + + 1*1 lines + 1:1-linjer + + + 2*2 lines + 2:2-linjer + + + Maximum resolution: + Maksimal oppløsning: + + + + Shortcut + + Camera + Kamera + + + Settings + Innstillinger + + + Stop recording + Stopp opptak + + + Copy + Kopier + + + Delete + Slett + + + Open + Åpne + + + Print + Skriv ut + + + Help + Hjelp + + + Display shortcuts + Vis snarveier + + + Stop taking photos + Stopp med å ta bilder + + + Context menu + Kontekstmeny + + + + dc::Settings + + None + Ingen + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Varm + + + Cold + Kold + + + Retro + Retro + + + Film + Films + + + Gray + Grå + + + B&W + Svart og hvit + + + + takePhotoSettingAreaWidget + + Flashlight + Lyktstav + + + On + På + + + Off + Av + + + Delay capture + Forsinket opptak + + + None + Ingen + + + Filters + Filter + + + Exposure + Utstråling + + + + videowidget + + No webcam found + Ingen webkamera funnet + + + The webcam is in use + Webkameraen er i bruk + + + diff --git a/src/translations/deepin-camera_ne.ts b/src/translations/deepin-camera_ne.ts new file mode 100644 index 000000000..033ddde69 --- /dev/null +++ b/src/translations/deepin-camera_ne.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + भिडियो रेकर्डिंग चलिरहेको छ। खिडिली बन्द गर्नु भन्दैछ? + + + Settings + सेटिंग्स + + + None + कुचि + + + Photo + फोटो + + + Video + भिडियो + + + Switch Cameras + केमेरा बदल्नु + + + + CloseDialog + + Cancel + रद्द गर्नु + + + Close + बन्द गर्नु + + + + ImageItem + + Copy + काट्नु + + + Delete + हटाउनु + + + Open folder + फोल्डर खोल्नु + + + Print + छाप्नु + + + + QObject + + You don't have permission to operate this folder + तपाईं यो फोल्डर चलाउन अनुमति छैन + + + Close + बन्द गर्नु + + + Open folder + फोल्डर खोल्नु + + + Settings + सेटिंग्स + + + Basic + बेसिक + + + File location + फाइल स्थिति + + + Shoot + फोटो लिनु + + + Burst mode + बर्स्ट मोड + + + Self-timer delay + सेल्फ-टाइमर डिले + + + Output + आउटपुट + + + Output format + आउटपुट फॉरमेट + + + 4 pcs + 4 पीस + + + 10 pcs + 10 पीस + + + None + कुचि + + + Camera + केमेरा + + + Camera is an image and video capture utility using your PC camera or webcam. + केमेरा तपाईंको कम्प्युटर केमेरा वा वेबकेम प्रयोग गरेर छायाँचित्र र भिडियो ग्रहण गर्ने उपकरण हो। + + + File not saved + फाइल बचाइएको छैन + + + Photo: + फोटो: + + + Video: + विडियो: + + + Resolution settings + अनुकूलन सेटिंग्स + + + Photos: + छविहर: + + + Videos: + विडियोहर: + + + Sound effects + ध्वनि असर + + + Mirror mode + दर्पण तरह + + + Flashlight + फ्लैशलाइट + + + Gridlines + नेटलाइन + + + 1*1 lines + 1*1 रेखाएँ + + + 2*2 lines + 2*2 रेखाएँ + + + Maximum resolution: + अधिकतम अनुकूलन: + + + + Shortcut + + Camera + कैमरा + + + Settings + सेटिंग्स + + + Stop recording + रिकॉर्डिंग बंद करें + + + Copy + कॉपी + + + Delete + हटाएँ + + + Open + खोलें + + + Print + प्रिंट + + + Help + सहायता + + + Display shortcuts + शॉर्टकट दिखाएँ + + + Stop taking photos + फोटो लेना बंद करें + + + Context menu + कंटेक्स्ट मेनू + + + + dc::Settings + + None + कोई नहीं + + + mp4 + म्प4 + + + webm + वेबम + + + + filterPreviewButton + + Normal + सामान्य + + + Vivid + जीवंत + + + Warm + गर्म + + + Cold + ठंडा + + + Retro + रेट्रो + + + Film + फिल्म + + + Gray + ग्रे + + + B&W + ब्लैक एंड व्हाइट + + + + takePhotoSettingAreaWidget + + Flashlight + फ्लैशलाइट + + + On + अन + + + Off + आफ + + + Delay capture + विलंबित शूट + + + None + कोई भी नहीं + + + Filters + फिल्टर + + + Exposure + अभिव्यक्ति + + + + videowidget + + No webcam found + केबेम नहीं मिला + + + The webcam is in use + केबेम के उपयोग में है + + + diff --git a/src/translations/deepin-camera_nl.ts b/src/translations/deepin-camera_nl.ts index 2b1e90400..a4e916cee 100644 --- a/src/translations/deepin-camera_nl.ts +++ b/src/translations/deepin-camera_nl.ts @@ -90,7 +90,7 @@ File location - Bestandslocatie + Bestandslocaties Shoot @@ -102,15 +102,15 @@ Self-timer delay - Vastlegvertraging + Wachttijd Output - Uitvoer + Bestanden Output format - Uitvoerformaat + Bestandsformaten 4 pcs @@ -170,27 +170,27 @@ Mirror mode - Spiegelmodus + Spiegelstand Flashlight - Zaklamp + Flits gebruiken Gridlines - + Roosterlijnen tonen 1*1 lines - + 1x1 2*2 lines - + 2x2 Maximum resolution: - + Maximale resolutie: @@ -261,6 +261,14 @@ None Geen + + mp4 + mp4 + + + webm + webm + filterPreviewButton @@ -301,7 +309,7 @@ takePhotoSettingAreaWidget Flashlight - Zaklamp + Flits gebruiken On diff --git a/src/translations/deepin-camera_pam.ts b/src/translations/deepin-camera_pam.ts new file mode 100644 index 000000000..26ce756dd --- /dev/null +++ b/src/translations/deepin-camera_pam.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + An video nga pag-record ay nagsisimula. I-close ang window? + + + Settings + Pangangalaga + + + None + Wala + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Palitan ang mga Camera + + + + CloseDialog + + Cancel + Ibalik + + + Close + I-close + + + + ImageItem + + Copy + Kopyahin + + + Delete + Tanggalin + + + Open folder + Bumukas ng folder + + + Print + Print + + + + QObject + + You don't have permission to operate this folder + Wala kang pahintulot para mag-operate sa folder na ito + + + Close + I-close + + + Open folder + Bumukas ng folder + + + Settings + Pangangalaga + + + Basic + Pangunahing + + + File location + Lokasyon ng file + + + Shoot + Ilalabas + + + Burst mode + Burst mode + + + Self-timer delay + Delay sa self-timer + + + Output + Pangalan + + + Output format + Format ng output + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + Wala + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + Camera ay isang tool para mag-capture ng imahe at video gamit ang iyong PC camera o webcam. + + + File not saved + File ay hindi sinalvador + + + Photo: + 'Foto:' + + + Video: + Video: + + + Resolution settings + Resolution settings + + + Photos: + Photos: + + + Videos: + Videos: + + + Sound effects + Sound effects + + + Mirror mode + Mirror mode + + + Flashlight + Flashlight + + + Gridlines + Gridlines + + + 1*1 lines + 1*1 lines + + + 2*2 lines + 2*2 lines + + + Maximum resolution: + Maximum resolution: + + + + Shortcut + + Camera + Camera + + + Settings + Settings + + + Stop recording + Stop recording + + + Copy + Copy + + + Delete + Delete + + + Open + Open + + + Print + Print + + + Help + Help + + + Display shortcuts + Display shortcuts + + + Stop taking photos + Stop taking photos + + + Context menu + Context menu + + + + dc::Settings + + None + None + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Warm + + + Cold + Cold + + + Retro + Retro + + + Film + Mga pelikula + + + Gray + Abot + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Lampara + + + On + Nangunguna + + + Off + Naglalaban + + + Delay capture + Pangunguna nga pagkuha + + + None + Wala + + + Filters + Mga filter + + + Exposure + Pangunguna + + + + videowidget + + No webcam found + Wala na webcam nga nakita + + + The webcam is in use + Ang webcam nangunguna + + + diff --git a/src/translations/deepin-camera_pl.ts b/src/translations/deepin-camera_pl.ts index e04e19d73..a1e44c21b 100644 --- a/src/translations/deepin-camera_pl.ts +++ b/src/translations/deepin-camera_pl.ts @@ -5,7 +5,7 @@ CMainWindow Video recording is in progress. Close the window? - Nagrywanie wideo w trakcie. Czy na pewno chcesz zamknąć okno? + Nagrywanie wideo w trakcie. Czy na pewno zamknąć okno? Open folder @@ -59,14 +59,14 @@ Print - Wydrukuj + Drukuj QObject You don't have permission to operate this folder - Nie masz uprawnień do operowania na tym folderze + Nie posiadasz uprawnień do wykonywania działań na tym folderze Close @@ -86,11 +86,11 @@ Basic - Podstawowy + Podstawowe File location - Lokalizacja pliku + Położenie pliku Shoot @@ -98,7 +98,7 @@ Burst mode - Tryb zdjęć seryjnych + Tryb seryjny Self-timer delay @@ -106,7 +106,7 @@ Output - Wynik + Wyjście Output format @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - Kamera to narzędzie do przechwytywania obrazów i wideo za pomocą kamery komputera lub kamery internetowej. + Kamera to narzędzie do przechwytywania obrazów i wideo za pomocą wbudowanej lub zewnętrznej kamery internetowej. File not saved @@ -178,19 +178,19 @@ Gridlines - + Linie siatki 1*1 lines - + 1*1 linii 2*2 lines - + 2*2 linii Maximum resolution: - + Maksymalna rozdzielczość: @@ -221,7 +221,7 @@ Print - Wydrukuj + Drukuj Help @@ -244,7 +244,7 @@ ThumbnailsBar Take photo - Zrobić zdjęcie + Zrób zdjęcie Record video @@ -261,6 +261,14 @@ None Brak + + mp4 + + + + webm + + filterPreviewButton @@ -313,7 +321,7 @@ Delay capture - Opóźnij migawkę + Opóźnienie przechwytywania None @@ -325,7 +333,7 @@ Exposure - Odsłonięcie + Ekspozycja @@ -336,7 +344,7 @@ The webcam is in use - Kamera internetowa jest używana + Kamera internetowa jest już w użyciu Stop recording diff --git a/src/translations/deepin-camera_pt.ts b/src/translations/deepin-camera_pt.ts index 9453ed536..0673699d2 100644 --- a/src/translations/deepin-camera_pt.ts +++ b/src/translations/deepin-camera_pt.ts @@ -1,6 +1,4 @@ - - - + CMainWindow @@ -130,7 +128,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - A Câmara é um utilitário de captura de imagem e vídeo que usa a câmara do PC ou webcam. + A Câmara é um utilitário de captura de imagem e vídeo que utiliza a câmara do PC ou webcam. File not saved @@ -178,19 +176,19 @@ Gridlines - + Linhas de grelha 1*1 lines - + Linhas 1*1 2*2 lines - + Linhas 2*2 Maximum resolution: - + Resolução máxima: @@ -261,6 +259,14 @@ None Nenhuma + + mp4 + MP4 + + + webm + WebM + filterPreviewButton @@ -343,4 +349,4 @@ Parar de gravar - + \ No newline at end of file diff --git a/src/translations/deepin-camera_pt_BR.ts b/src/translations/deepin-camera_pt_BR.ts index 22295d6d2..aca63f7ff 100644 --- a/src/translations/deepin-camera_pt_BR.ts +++ b/src/translations/deepin-camera_pt_BR.ts @@ -5,7 +5,7 @@ CMainWindow Video recording is in progress. Close the window? - A gravação de vídeo está em andamento. Fechar a janela? + A gravação de vídeo está em andamento. Fechar janela? Open folder @@ -29,7 +29,7 @@ Switch Cameras - Alternar câmera + Alternar câmeras @@ -94,7 +94,7 @@ Shoot - Disparar + Capturar Burst mode @@ -114,11 +114,11 @@ 4 pcs - 4 pçs + 4 peças 10 pcs - 10 pçs + 10 peças None @@ -130,7 +130,7 @@ Camera is an image and video capture utility using your PC camera or webcam. - O Câmera é um utilitário para capturar imagens e vídeos pela webcam. + A Câmera é uma ferramenta de captura de imagem e vídeo que utiliza a câmera do seu PC ou webcam. File not saved @@ -150,7 +150,7 @@ Resolution settings - Configurações da resolução + Configurações de resolução Resolution: @@ -170,7 +170,7 @@ Mirror mode - Modo câmera frontal + Modo espelho Flashlight @@ -178,19 +178,19 @@ Gridlines - + Linhas de grade 1*1 lines - + Linhas 1x1 2*2 lines - + Linhas 2x2 Maximum resolution: - + Resolução máxima: @@ -205,7 +205,7 @@ Stop recording - Interromper a gravação + Interromper gravação Copy @@ -233,7 +233,7 @@ Stop taking photos - Interromper a captura de fotos + Interromper captura de fotos Context menu @@ -252,7 +252,7 @@ Stop taking photos - Interromper a captura de fotos + Interromper captura de fotos @@ -261,40 +261,48 @@ None Nenhum + + mp4 + + + + webm + + filterPreviewButton Normal - + Normal Vivid - + Vívido Warm - + Quente Cold - + Frio Retro - + Retro Film - + Cinema Gray - + Cinza B&W - + P&B @@ -321,11 +329,11 @@ Filters - + Filtros Exposure - + Exposição @@ -340,7 +348,7 @@ Stop recording - Interromper a gravação + Interromper gravação diff --git a/src/translations/deepin-camera_ro.ts b/src/translations/deepin-camera_ro.ts index f24e8a8e1..3cdb21e2f 100644 --- a/src/translations/deepin-camera_ro.ts +++ b/src/translations/deepin-camera_ro.ts @@ -21,15 +21,15 @@ Photo - + Fotografie Video - + Video Switch Cameras - + Schimbă camerele @@ -170,27 +170,27 @@ Mirror mode - + Modul oglindă Flashlight - + Fotocamere Gridlines - + Linii de rețea 1*1 lines - + Linii 1*1 2*2 lines - + Linii 2*2 Maximum resolution: - + Rezoluție maximă: @@ -261,59 +261,67 @@ None Nimic + + mp4 + mp4 + + + webm + webm + filterPreviewButton Normal - + Normal Vivid - + Vivid Warm - + Cald Cold - + Refrigerat Retro - + Retro Film - + Film Gray - + Albă-negru B&W - + Albă-negru takePhotoSettingAreaWidget Flashlight - + Fotocamere On - + Pornit Off - + Oprit Delay capture - + Captură întârziată None @@ -321,11 +329,11 @@ Filters - + Filtre Exposure - + Expoziție diff --git a/src/translations/deepin-camera_ru.ts b/src/translations/deepin-camera_ru.ts index 2808d4a77..544b8e751 100644 --- a/src/translations/deepin-camera_ru.ts +++ b/src/translations/deepin-camera_ru.ts @@ -1,11 +1,9 @@ - - - + CMainWindow Video recording is in progress. Close the window? - Видео запись в процессе. Закрыть окно? + Ведётся видеозапись. Закрыть окно? Open folder @@ -17,19 +15,19 @@ None - Ничего + Нет Photo - + Фото Video - + Видео Switch Cameras - + Переключить камеру @@ -98,7 +96,7 @@ Burst mode - Режим серийной съемки + Режим серийной съёмки Self-timer delay @@ -122,7 +120,7 @@ None - Ничего + Нет Camera @@ -130,11 +128,11 @@ Camera is an image and video capture utility using your PC camera or webcam. - Камера - это приложение для захвата изображения и записи видео, используя веб-камеру вашего компьютера. + Камера — это приложение для захвата изображения и записи видео, используя веб-камеру вашего компьютера. File not saved - Файл не сохранен + Файл не сохранён Save to: @@ -170,27 +168,27 @@ Mirror mode - + Зеркальный режим Flashlight - + Фонарик Gridlines - + Линии сетки 1*1 lines - + 1*1 линий 2*2 lines - + 2*2 линий Maximum resolution: - + Максимальное разрешение: @@ -225,7 +223,7 @@ Help - Помощь + Справка Display shortcuts @@ -259,88 +257,96 @@ dc::Settings None - Ничего + Нет + + + mp4 + MP4 + + + webm + WebM filterPreviewButton Normal - + Обычный Vivid - + Яркий Warm - + Тёплый Cold - + Холодный Retro - + Ретро Film - + Плёнка Gray - + Серый B&W - + Чёрно-белый takePhotoSettingAreaWidget Flashlight - + Фонарик On - + Вкл Off - + Откл Delay capture - + Задержка снимка None - Ничего + Нет Filters - + Фильтры Exposure - + Выдержка videowidget No webcam found - Веб камера не найдена + Веб-камера не найдена The webcam is in use - Веб камера включена + Веб-камера включена Stop recording Остановить видеозапись - + \ No newline at end of file diff --git a/src/translations/deepin-camera_sc.ts b/src/translations/deepin-camera_sc.ts new file mode 100644 index 000000000..199e958b1 --- /dev/null +++ b/src/translations/deepin-camera_sc.ts @@ -0,0 +1,320 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + A s’è in progressu de registrazione video. Chiudi a finestra? + + + Settings + Settings + + + None + None + + + Photo + Photo + + + Video + Video + + + Switch Cameras + Switch Cameras + + + + CloseDialog + + Cancel + Cancel + + + Close + Close + + + + ImageItem + + Copy + Copy + + + Delete + Delete + + + Open folder + Open folder + + + Print + Print + + + + QObject + + You don't have permission to operate this folder + No tens permìssion de operare a s’è folder + + + Close + Close + + + Open folder + Open folder + + + Settings + Settings + + + Basic + Basic + + + File location + File location + + + Shoot + Shoot + + + Burst mode + Burst mode + + + Self-timer delay + Self-timer delay + + + Output + Output + + + Output format + Output format + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + None + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + >- +A càmera è un’ùtilità de cattura d’ìmàgine e video cun a s’è càmera de PC o webcam. + + + File not saved + File not saved + + + Photo: + 'Photo:' + + + Video: + Video: + + + Resolution settings + Resolution settings + + + Photos: + Photos: + + + Videos: + Videos: + + + Sound effects + Sound effects + + + Mirror mode + Mirror mode + + + Flashlight + Flashlight + + + Gridlines + Gridlines + + + 1*1 lines + 1*1 lines + + + 2*2 lines + 2*2 lines + + + Maximum resolution: + Maximum resolution: + + + + Shortcut + + Camera + Camera + + + Settings + Settings + + + Stop recording + Stop recording + + + Copy + Copy + + + Delete + Delete + + + Open + Open + + + Print + Print + + + Help + Help + + + Display shortcuts + Display shortcuts + + + Stop taking photos + Stop taking photos + + + Context menu + Context menu + + + + dc::Settings + + None + None + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Warm + + + Cold + Cold + + + Retro + Retro + + + Film + Film + + + Gray + Gray + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Flashlight + + + On + On + + + Off + Off + + + Delay capture + Delay capture + + + None + None + + + Filters + Filters + + + Exposure + Exposure + + + + videowidget + + No webcam found + No webcam found + + + The webcam is in use + The webcam is in use + + + diff --git a/src/translations/deepin-camera_si.ts b/src/translations/deepin-camera_si.ts new file mode 100644 index 000000000..9ba515312 --- /dev/null +++ b/src/translations/deepin-camera_si.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + වීඩියෝ අඟුරු අවසන් වී නැත. විභාගය අවසන් කිරීමට? + + + Settings + සැකසුම් + + + None + කිසිමින් + + + Photo + පොටො + + + Video + වීඩියෝ + + + Switch Cameras + කාමරා පරිවර්තනය කරන්න + + + + CloseDialog + + Cancel + අවලංගු කරන්න + + + Close + අවසන් කරන්න + + + + ImageItem + + Copy + කොපි කරන්න + + + Delete + මින් අවලංගු කරන්න + + + Open folder + ෆෝල්ඩරය පෙන්වන්න + + + Print + ප්‍රින්ට් කරන්න + + + + QObject + + You don't have permission to operate this folder + ඔබට මෙම ෆෝල්ඩරය පෙන්වීමට හැකියාව නැත + + + Close + අවසන් කරන්න + + + Open folder + ෆෝල්ඩරය පෙන්වන්න + + + Settings + සැකසුම් + + + Basic + මූලික + + + File location + ෆයිල් ලෝකේෂනය + + + Shoot + ශෝට් කරන්න + + + Burst mode + බර්ස්ට් මෝඩ් + + + Self-timer delay + සෙල්ෆ් තයිමර් දිගුවිලි + + + Output + උපුට් + + + Output format + උපුට් ස්වරූපය + + + 4 pcs + 4 ප්‍රිස් + + + 10 pcs + 10 ප්‍රිස් + + + None + කිසිමින් + + + Camera + කාමරා + + + Camera is an image and video capture utility using your PC camera or webcam. + කාමරා යනු ඔබගේ ප්‍රින්ටර් කාමරා හෝ වීඩියෝ අඟුරු අවසන් කරන ලද පරිගණක කාමරා හෝ වීබ් කාමරා වෙනි වීඩියෝ සහ පොටො අවසන් කරන ලද පරිගණක කාමරා හෝ වීබ් කාමරා වෙනි ලෝකේෂනය + + + File not saved + ෆයිල් අවසන් කරන නැත + + + Photo: + පොටො: + + + Video: + ວີດີໂອ: + + + Resolution settings + ການຕັ້ງຄ່າຄວາມແຈ້ງ + + + Photos: + ຮູບພາບ: + + + Videos: + ວີດີໂອ: + + + Sound effects + ຄວາມສາມາດດັນເຄື່ອງ + + + Mirror mode + ແບບກາງແຈ້ງ + + + Flashlight + ເຄື່ອງສະແດງແອັດ + + + Gridlines + ເສັ້ນແຜງ + + + 1*1 lines + ເສັ້ນ 1*1 + + + 2*2 lines + ເສັ້ນ 2*2 + + + Maximum resolution: + ຄວາມແຈ້ງສູງສຸດ: + + + + Shortcut + + Camera + ເຄື່ອງຖ່າຍຮູບ + + + Settings + ການຕັ້ງຄ່າ + + + Stop recording + ຢູ່ໃນການບັນທຶກ + + + Copy + ຄວາມສາມາດທີ່ບັນທຶກ + + + Delete + ລົບ + + + Open + ເປີດ + + + Print + ພິມ + + + Help + ຊ່ວຍເຫຼືອ + + + Display shortcuts + ສະແດງການກັນຂ້ອນຂ້າງ + + + Stop taking photos + ຢູ່ໃນການຖ່າຍຮູບ + + + Context menu + ແຜນການປ້ອນຂໍ້ມູນ + + + + dc::Settings + + None + ບໍ່ມີ + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + ປົກກະຕິ + + + Vivid + ເຊື່ອມຕໍ່ + + + Warm + ຮ້ອນ + + + Cold + ເຢັນ + + + Retro + ເກົ່າ + + + Film + ප්‍රතිරෝධය + + + Gray + කාළා අතර + + + B&W + බිළියා සහ කාළා + + + + takePhotoSettingAreaWidget + + Flashlight + ප්‍රතිරෝධය + + + On + උදව් + + + Off + අඳව් + + + Delay capture + කාල් අවම නිරිඛාණය + + + None + කිසිවත් + + + Filters + ප්‍රතිරෝධ අතර + + + Exposure + අපේක්ෂිතය + + + + videowidget + + No webcam found + වීඩියෝ ප්‍රතිරෝධයක් නොමැත + + + The webcam is in use + වීඩියෝ ප්‍රතිරෝධය භාවිතා කර ඇත + + + diff --git a/src/translations/deepin-camera_sk.ts b/src/translations/deepin-camera_sk.ts new file mode 100644 index 000000000..b5742fc6f --- /dev/null +++ b/src/translations/deepin-camera_sk.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video záznam sa práce. Zatvor okno? + + + Settings + Nastavenia + + + None + Žiadne + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Zmeň kameru + + + + CloseDialog + + Cancel + Zrušiť + + + Close + Zatvoriť + + + + ImageItem + + Copy + Kopírovať + + + Delete + Vymazať + + + Open folder + Otvoriť priečinok + + + Print + Tlač + + + + QObject + + You don't have permission to operate this folder + Nemáte oprávnenie pracovať s týmto priečinkom + + + Close + Zatvoriť + + + Open folder + Otvoriť priečinok + + + Settings + Nastavenia + + + Basic + Základné + + + File location + Miesto súboru + + + Shoot + Začni zaznamenávať + + + Burst mode + Režim rýchleho záberu + + + Self-timer delay + Zpoždenie samotimeru + + + Output + Výstup + + + Output format + Formát výstupu + + + 4 pcs + 4 kusy + + + 10 pcs + 10 kusov + + + None + Žiadne + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera je nástroj na zachytávanie obrazu a videa pomocou vašej počítačnej kamery alebo webkamery. + + + File not saved + Súbor nie je uložený + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Nastavenia rozlíšenia + + + Photos: + Fotografie: + + + Videos: + Videos: + + + Sound effects + Zvukové efekty + + + Mirror mode + Spiegačka + + + Flashlight + Flashlight + + + Gridlines + Sietka + + + 1*1 lines + 1*1 línii + + + 2*2 lines + 2*2 línii + + + Maximum resolution: + Maximálne rozlíšenie: + + + + Shortcut + + Camera + Kamera + + + Settings + Nastavenia + + + Stop recording + Zastaviť záznam + + + Copy + Kopírovať + + + Delete + Vymazať + + + Open + Otvoriť + + + Print + Tlač + + + Help + Pomoc + + + Display shortcuts + Zobraziť skratky + + + Stop taking photos + Zastaviť fotografovanie + + + Context menu + Kontextové menu + + + + dc::Settings + + None + Žiadne + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normálne + + + Vivid + Pozdĺžne + + + Warm + Teplé + + + Cold + Chladné + + + Retro + Retro + + + Film + Film + + + Gray + Svetlo + + + B&W + Čierno-biele + + + + takePhotoSettingAreaWidget + + Flashlight + Flash + + + On + Na + + + Off + Vypnút + + + Delay capture + Zdržať sa záberu + + + None + Žiadne + + + Filters + Filtre + + + Exposure + Expozícia + + + + videowidget + + No webcam found + Webkamera nie je nájdená + + + The webcam is in use + Webkamera je v použití + + + diff --git a/src/translations/deepin-camera_sl.ts b/src/translations/deepin-camera_sl.ts index e7519cfba..f0d62056d 100644 --- a/src/translations/deepin-camera_sl.ts +++ b/src/translations/deepin-camera_sl.ts @@ -178,19 +178,19 @@ Gridlines - + Mreža 1*1 lines - + 1*1 črt 2*2 lines - + 2*2 črt Maximum resolution: - + Maksimalna resolucija: @@ -261,40 +261,48 @@ None Brez + + mp4 + mp4 + + + webm + webm + filterPreviewButton Normal - + Normalno Vivid - + Živo Warm - + toplo Cold - + Hladno Retro - + Retro Film - + Film Gray - + Sivo B&W - + ČB @@ -321,11 +329,11 @@ Filters - + Filtri Exposure - + Osvetlitev diff --git a/src/translations/deepin-camera_sq.ts b/src/translations/deepin-camera_sq.ts index f59425cc4..a40a8bc3d 100644 --- a/src/translations/deepin-camera_sq.ts +++ b/src/translations/deepin-camera_sq.ts @@ -178,19 +178,19 @@ Gridlines - + Vija rrjete 1*1 lines - + Vija 1*1 2*2 lines - + Vija 2*2 Maximum resolution: - + Qartësi maksimum: @@ -261,6 +261,14 @@ None Asnjë + + mp4 + + + + webm + + filterPreviewButton diff --git a/src/translations/deepin-camera_sr.ts b/src/translations/deepin-camera_sr.ts index 0aa1750d3..576b3d4a7 100644 --- a/src/translations/deepin-camera_sr.ts +++ b/src/translations/deepin-camera_sr.ts @@ -178,19 +178,19 @@ Gridlines - + Мрежа линија 1*1 lines - + 1*1 линије 2*2 lines - + 2*2 линије Maximum resolution: - + Максимална резолуција: @@ -261,40 +261,48 @@ None Ништа + + mp4 + mp4 + + + webm + вебм + filterPreviewButton Normal - + Нормално Vivid - + Живо Warm - + Топло Cold - + Хладно Retro - + Ретро Film - + Филм Gray - + Сива B&W - + Бео-сиво @@ -321,11 +329,11 @@ Filters - + Филтери Exposure - + Експозија diff --git a/src/translations/deepin-camera_sv.ts b/src/translations/deepin-camera_sv.ts new file mode 100644 index 000000000..48ba23d77 --- /dev/null +++ b/src/translations/deepin-camera_sv.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Videoinspelning pågår. Stäng fönstret? + + + Settings + Inställningar + + + None + Ingen + + + Photo + Foto + + + Video + Video + + + Switch Cameras + Växla kameror + + + + CloseDialog + + Cancel + Avbryt + + + Close + Stäng + + + + ImageItem + + Copy + Kopiera + + + Delete + Radera + + + Open folder + Öppna mapp + + + Print + Skriv ut + + + + QObject + + You don't have permission to operate this folder + Du har inte behörighet att arbeta med denna mapp + + + Close + Stäng + + + Open folder + Öppna mapp + + + Settings + Inställningar + + + Basic + Grundläggande + + + File location + Filplats + + + Shoot + Skapa + + + Burst mode + Burstläge + + + Self-timer delay + Selvtimedelay + + + Output + Utdata + + + Output format + Utdataformat + + + 4 pcs + 4 st + + + 10 pcs + 10 st + + + None + Ingen + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + Kamera är ett verktyg för att ta bilder och videor med din datorkamera eller webkamera. + + + File not saved + Fil har inte sparats + + + Photo: + Foto: + + + Video: + Video: + + + Resolution settings + Lösningstillställningar + + + Photos: + Fotografier: + + + Videos: + Videos: + + + Sound effects + Ljudeffekter + + + Mirror mode + Spegläge + + + Flashlight + Lamp + + + Gridlines + Rutnät + + + 1*1 lines + 1:1 linjer + + + 2*2 lines + 2:2 linjer + + + Maximum resolution: + Maximal lösning: + + + + Shortcut + + Camera + Kamera + + + Settings + Inställningar + + + Stop recording + Stoppa inspelning + + + Copy + Kopiera + + + Delete + Radera + + + Open + Öppna + + + Print + Skriv ut + + + Help + Hjälp + + + Display shortcuts + Visa snabbtangent + + + Stop taking photos + Stoppa foto + + + Context menu + Kontextmeny + + + + dc::Settings + + None + Ingen + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Varm + + + Cold + Kall + + + Retro + Retro + + + Film + Film + + + Gray + Grå + + + B&W + Svartvit + + + + takePhotoSettingAreaWidget + + Flashlight + Lampljus + + + On + På + + + Off + Av + + + Delay capture + Försenade upptag + + + None + Ingen + + + Filters + Filter + + + Exposure + Exponering + + + + videowidget + + No webcam found + Ingen webbkamera hittades + + + The webcam is in use + Webbkameran används redan + + + diff --git a/src/translations/deepin-camera_sw.ts b/src/translations/deepin-camera_sw.ts new file mode 100644 index 000000000..00842f740 --- /dev/null +++ b/src/translations/deepin-camera_sw.ts @@ -0,0 +1,321 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Video recording in progress. Close the window? + + + Settings + Settings + + + None + None + + + Photo + Photo + + + Video + Video + + + Switch Cameras + Switch Cameras + + + + CloseDialog + + Cancel + Cancel + + + Close + Close + + + + ImageItem + + Copy + Copy + + + Delete + Delete + + + Open folder + Open folder + + + Print + Print + + + + QObject + + You don't have permission to operate this folder + Unaweza kufanya kazi na mfano hili + + + Close + Close + + + Open folder + Open folder + + + Settings + Settings + + + Basic + Basic + + + File location + File location + + + Shoot + Shoot + + + Burst mode + Burst mode + + + Self-timer delay + Self-timer delay + + + Output + Output + + + Output format + Output format + + + 4 pcs + 4 pcs + + + 10 pcs + 10 pcs + + + None + None + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + >- +Camera ni programi ya kusajiliwa na video kwa kuzingatia kamera ya PC au +webcam. + + + File not saved + File not saved + + + Photo: + 'Photo:' + + + Video: + Videoni: + + + Resolution settings + Mipakaizi ya kipindani + + + Photos: + Picha: + + + Videos: + Videoni: + + + Sound effects + Mipakaizi ya miziki + + + Mirror mode + Mipakaizi ya miru + + + Flashlight + Mipakaizi ya mato + + + Gridlines + Mipakaizi ya grid + + + 1*1 lines + Lini ya 1*1 + + + 2*2 lines + Lini ya 2*2 + + + Maximum resolution: + Kipakaizi ya kipindani kubwa: + + + + Shortcut + + Camera + Kamera + + + Settings + Mipakaizi + + + Stop recording + Zalisha video + + + Copy + Kopia + + + Delete + Ondoa + + + Open + Kamenge + + + Print + Vipakaizi + + + Help + Mipakaizi + + + Display shortcuts + Tazama mipakaizi + + + Stop taking photos + Zalisha picha + + + Context menu + Menu ya kipakaizi + + + + dc::Settings + + None + Hakuna + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Kamili + + + Vivid + Mwimbi + + + Warm + Mwimbi + + + Cold + Mkali + + + Retro + Mkali + + + Film + Filmi + + + Gray + Mwenge + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Mwaka + + + On + Pamoja + + + Off + Pofu + + + Delay capture + Unganisha kujitambua + + + None + Hapana + + + Filters + Mifoto + + + Exposure + Ukumbuka + + + + videowidget + + No webcam found + Hakuna webcam inayotajwa + + + The webcam is in use + Webcam inayotajwa inaonyesha + + + diff --git a/src/translations/deepin-camera_ta.ts b/src/translations/deepin-camera_ta.ts new file mode 100644 index 000000000..b2b409cea --- /dev/null +++ b/src/translations/deepin-camera_ta.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ஒலிப்பதிவு பணியில் உள்ளது. பொறுத்து பூட்டு? + + + Settings + அமைப்புகள் + + + None + ஒன்றும் இல்லை + + + Photo + புகைப்படம் + + + Video + ஒலிப்பதிவு + + + Switch Cameras + கேமராக்களை மாற்று + + + + CloseDialog + + Cancel + தவறு + + + Close + மூடு + + + + ImageItem + + Copy + கொடு + + + Delete + அழி + + + Open folder + கையில் திறந்து + + + Print + அச்சு + + + + QObject + + You don't have permission to operate this folder + நீர் இந்த கையில் செயல்பட அனுமதி இல்லை + + + Close + மூடு + + + Open folder + கையில் திறந்து + + + Settings + அமைப்புகள் + + + Basic + அடிப்படை + + + File location + நூலக இடம் + + + Shoot + உருவாக்கு + + + Burst mode + வேகமாக உருவாக்கு + + + Self-timer delay + செல்ஃப் டைமர் தாமாக்கு + + + Output + உருவாக்கு + + + Output format + உருவாக்கு வடிவம் + + + 4 pcs + 4 பொறுத்து + + + 10 pcs + 10 பொறுத்து + + + None + ஒன்றும் இல்லை + + + Camera + நோக்கி + + + Camera is an image and video capture utility using your PC camera or webcam. + கேமரா ஒரு புகைப்படம் மற்றும் ஒலிப்பதிவு உபகரணம், உங்கள் கணினி கேமரா அல்லது webcam ஐப் பயன்படுத்தி செயல்படுகிறது + + + File not saved + நூலகம் சேமிக்கப்படவில்லை + + + Photo: + புகைப்படம்: + + + Video: + வீdeo: + + + Resolution settings + தொகுதி முఖ్యం + + + Photos: + ఫోటోలు: + + + Videos: + వీడియోలు: + + + Sound effects + ధ్వని ప్రభావం + + + Mirror mode + అద్దం మోడ్ + + + Flashlight + ఫ్లాష్ లైట్ + + + Gridlines + గ్రిడ్ లైన్స్ + + + 1*1 lines + 1*1 లైన్స్ + + + 2*2 lines + 2*2 లైన్స్ + + + Maximum resolution: + అతిపెద్ద తెల్లవంతం: + + + + Shortcut + + Camera + కెమెరా + + + Settings + సెట్టింగ్స్ + + + Stop recording + ప్రింట్ చేయడం ఆపండి + + + Copy + కాపీ చేయండి + + + Delete + డిలీట్ చేయండి + + + Open + ఓపెన్ చేయండి + + + Print + ప్రింట్ చేయండి + + + Help + హెల్ప్ + + + Display shortcuts + శ్రోత్రాలను కనిపెట్టండి + + + Stop taking photos + ఫోటోలు తీసేందుకు ఆపండి + + + Context menu + సందర్భ మెను + + + + dc::Settings + + None + ఏదీ లేదు + + + mp4 + mp4 + + + webm + வீப்ம் + + + + filterPreviewButton + + Normal + సాధారణం + + + Vivid + ప్రామాణికం + + + Warm + ఉష్ణం + + + Cold + చల్లం + + + Retro + రీట్రో + + + Film + படம் + + + Gray + நீலம் + + + B&W + பேன்ட் மற்றும் வெள்ளை + + + + takePhotoSettingAreaWidget + + Flashlight + பேன்ட் கேமரா + + + On + அன + + + Off + ஆஃப் + + + Delay capture + தாமதமாக படம் எடு + + + None + ஒன்றும் இல்லை + + + Filters + பேன்ட் + + + Exposure + காட்சி + + + + videowidget + + No webcam found + வெப்கேமரா காணவில்லை + + + The webcam is in use + வெப்கேமரா பயன்பாட்டில் + + + diff --git a/src/translations/deepin-camera_th.ts b/src/translations/deepin-camera_th.ts new file mode 100644 index 000000000..db92c057f --- /dev/null +++ b/src/translations/deepin-camera_th.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + การบันทึกวิดีโอกำลังดำเนินการอยู่ ปิดหน้าต่างนี้หรือไม่? + + + Settings + ตั้งค่า + + + None + ไม่มี + + + Photo + ภาพถ่าย + + + Video + วิดีโอ + + + Switch Cameras + เปลี่ยนกล้อง + + + + CloseDialog + + Cancel + ยกเลิก + + + Close + ปิด + + + + ImageItem + + Copy + คัดลอก + + + Delete + ลบ + + + Open folder + เปิดโฟลเดอร์ + + + Print + พิมพ์ + + + + QObject + + You don't have permission to operate this folder + คุณไม่มีสิทธิ์ในการดำเนินการกับโฟลเดอร์นี้ + + + Close + ปิด + + + Open folder + เปิดโฟลเดอร์ + + + Settings + ตั้งค่า + + + Basic + พื้นฐาน + + + File location + ตำแหน่งไฟล์ + + + Shoot + ถ่าย + + + Burst mode + โหมดถ่ายต่อเนื่อง + + + Self-timer delay + การล่าช้าของตัวจับเวลา + + + Output + การส่งออก + + + Output format + รูปแบบการส่งออก + + + 4 pcs + 4 ชิ้น + + + 10 pcs + 10 ชิ้น + + + None + ไม่มี + + + Camera + กล้อง + + + Camera is an image and video capture utility using your PC camera or webcam. + กล้องเป็นเครื่องมือในการถ่ายภาพและวิดีโอโดยใช้กล้องคอมพิวเตอร์หรือเว็บแคมของคุณ + + + File not saved + ไฟล์ไม่ได้รับการบันทึก + + + Photo: + ภาพถ่าย: + + + Video: + วิดีโอ: + + + Resolution settings + การตั้งค่าความละเอียด + + + Photos: + รูปภาพ: + + + Videos: + วิดีโอ: + + + Sound effects + เสียง + + + Mirror mode + โหมดกระจก + + + Flashlight + แฟลชไลต์ + + + Gridlines + เส้นกริด + + + 1*1 lines + เส้น 1*1 + + + 2*2 lines + เส้น 2*2 + + + Maximum resolution: + ความละเอียดสูงสุด: + + + + Shortcut + + Camera + กล้อง + + + Settings + การตั้งค่า + + + Stop recording + หยุดบันทึก + + + Copy + คัดลอก + + + Delete + ลบ + + + Open + เปิด + + + Print + พิมพ์ + + + Help + ช่วยเหลือ + + + Display shortcuts + แสดงคำสั่งลัด + + + Stop taking photos + หยุดถ่ายรูป + + + Context menu + เมนูบริบท + + + + dc::Settings + + None + ไม่มี + + + mp4 + mp4 + + + webm + วีบีเอ็ม + + + + filterPreviewButton + + Normal + ปกติ + + + Vivid + สดใส + + + Warm + อบอุ่น + + + Cold + เย็น + + + Retro + รีเทโรม + + + Film + ภาพยนตร์ + + + Gray + เทา + + + B&W + ขาว-ดำ + + + + takePhotoSettingAreaWidget + + Flashlight + แฟลช + + + On + เปิด + + + Off + ปิด + + + Delay capture + ถ่ายภาพช้า + + + None + ไม่มี + + + Filters + กรอง + + + Exposure + การเปิดรับแสง + + + + videowidget + + No webcam found + ไม่พบกล้องถ่ายภาพ + + + The webcam is in use + กล้องถ่ายภาพกำลังถูกใช้งาน + + + diff --git a/src/translations/deepin-camera_tr.ts b/src/translations/deepin-camera_tr.ts index a7131ec21..9ad076d69 100644 --- a/src/translations/deepin-camera_tr.ts +++ b/src/translations/deepin-camera_tr.ts @@ -178,19 +178,19 @@ Gridlines - + Kılavuz çizgileri 1*1 lines - + 1*1 satır 2*2 lines - + 2*2 satır Maximum resolution: - + Maksimum çözünürlük: @@ -261,6 +261,14 @@ None Yok + + mp4 + mp4 + + + webm + webm + filterPreviewButton diff --git a/src/translations/deepin-camera_tzm.ts b/src/translations/deepin-camera_tzm.ts new file mode 100644 index 000000000..1ef72bd49 --- /dev/null +++ b/src/translations/deepin-camera_tzm.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + ⵜⴰⵎⵣⵓⵔⵜ 3ⵎⵣⵓⵔ 3ⵜⵔⵓⵔ. 3ⵜⵔⵓⵔ 3ⵜⵎⵣⵓ? + + + Settings + ⵜⵓⵎⵣⵓⵔ + + + None + ⵜⵓⵎⵣⵓⵔ + + + Photo + ⵜⵓⵎⵣⵓⵔ + + + Video + 4ⵎⵣⵓⵔ + + + Switch Cameras + ⵜⵓⵎⵣⵓⵔ 3ⵜⵎⵣⵓⵔ + + + + CloseDialog + + Cancel + ⵜⵓⵎⵣⵓⵔ + + + Close + ⵜⵓⵎⵣⵓⵔ + + + + ImageItem + + Copy + ⵜⵓⵎⵣⵓⵔ + + + Delete + ⵜⵓⵎⵣⵓⵔ + + + Open folder + ⵜⵓⵎⵣⵓⵔ + + + Print + ⵜⵓⵎⵣⵓⵔ + + + + QObject + + You don't have permission to operate this folder + ⵜⵓⵎⵣⵓⵔ 3ⵜⵎⵣⵓⵔ 3ⵜⵎⵣⵓⵔ 3ⵜⵓⵎⵣⵓ + + + Close + 3ⵜⵓⵎⵣⵓ + + + Open folder + 3ⵜⵓⵎⵣⵓ + + + Settings + 3ⵜⵓⵎⵣⵓ + + + Basic + 3ⵜⵓⵎⵣⵓ + + + File location + 3ⵜⵓⵎⵣⵓ + + + Shoot + 3ⵜⵓⵎⵣⵓ + + + Burst mode + 3ⵜⵓⵎⵣⵓ + + + Self-timer delay + 4 3ⵜⵓⵎⵣⵓ + + + Output + 10 3ⵜⵓⵎⵣⵓ + + + Output format + 3ⵜⵓⵎⵣⵓ + + + 4 pcs + 4 ɣar + + + 10 pcs + 10 ɣar + + + None + Iɣi + + + Camera + Kamera + + + Camera is an image and video capture utility using your PC camera or webcam. + + + + File not saved + + + + Photo: + + + + Video: + + + + Resolution settings + + + + Photos: + + + + Videos: + + + + Sound effects + + + + Mirror mode + + + + Flashlight + + + + Gridlines + + + + 1*1 lines + + + + 2*2 lines + + + + Maximum resolution: + + + + + Shortcut + + Camera + + + + Settings + + + + Stop recording + + + + Copy + + + + Delete + + + + Open + + + + Print + + + + Help + + + + Display shortcuts + + + + Stop taking photos + + + + Context menu + القائمة ngữ السياق + + + + dc::Settings + + None + + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Normal + + + Vivid + Vivid + + + Warm + Warm + + + Cold + Cold + + + Retro + Retro + + + Film + Film + + + Gray + Gray + + + B&W + B&W + + + + takePhotoSettingAreaWidget + + Flashlight + Flashlight + + + On + On + + + Off + Off + + + Delay capture + Delay capture + + + None + None + + + Filters + Filters + + + Exposure + Exposure + + + + videowidget + + No webcam found + No webcam found + + + The webcam is in use + The webcam is in use + + + diff --git a/src/translations/deepin-camera_ug.ts b/src/translations/deepin-camera_ug.ts index b5324eedb..d78e7acac 100644 --- a/src/translations/deepin-camera_ug.ts +++ b/src/translations/deepin-camera_ug.ts @@ -178,19 +178,19 @@ Gridlines - + بەدىئىي تۈزۈلمە تور 1*1 lines - + 1*1 لىك تور 2*2 lines - + 2*2 لىك تور Maximum resolution: - + ئەڭ كۆرۈكچىلىك ئەساسيى: @@ -261,6 +261,14 @@ None يوق + + mp4 + mp4 + + + webm + ۋېبم + filterPreviewButton diff --git a/src/translations/deepin-camera_uk.ts b/src/translations/deepin-camera_uk.ts index 655b7f97d..4ee9fc10c 100644 --- a/src/translations/deepin-camera_uk.ts +++ b/src/translations/deepin-camera_uk.ts @@ -178,19 +178,19 @@ Gridlines - + Лінії сітки 1*1 lines - + Лінії 1*1 2*2 lines - + Лінії 2*2 Maximum resolution: - + Максимальна роздільність: @@ -261,6 +261,14 @@ None Немає + + mp4 + + + + webm + + filterPreviewButton diff --git a/src/translations/deepin-camera_ur.ts b/src/translations/deepin-camera_ur.ts new file mode 100644 index 000000000..a23db3bc3 --- /dev/null +++ b/src/translations/deepin-camera_ur.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + وڈیو ریکارڈنگ جاری ہے۔ ونڈو بند کریں؟ + + + Settings + سیٹنگس + + + None + کوئی نہیں + + + Photo + فتو + + + Video + وڈیو + + + Switch Cameras + کیمیرا تبدیل کریں + + + + CloseDialog + + Cancel + منسوخ کریں + + + Close + بند کریں + + + + ImageItem + + Copy + کاپی کریں + + + Delete + حذف کریں + + + Open folder + فولڈر کھولیں + + + Print + پرنٹ کریں + + + + QObject + + You don't have permission to operate this folder + آپ کو اس فولڈر کے ساتھ کام کرنے کی اجازت نہیں ہے + + + Close + بند کریں + + + Open folder + فولڈر کھولیں + + + Settings + سیٹنگس + + + Basic + اولیا + + + File location + فائل کی جگہ + + + Shoot + شوت کریں + + + Burst mode + برست میڈ + + + Self-timer delay + آفتاب کے ٹائمر کی تاخیر + + + Output + آؤٹ پٹ + + + Output format + آؤٹ پٹ فارمیٹ + + + 4 pcs + 4 ٹکڑے + + + 10 pcs + 10 ٹکڑے + + + None + کوئی نہیں + + + Camera + کیمیرا + + + Camera is an image and video capture utility using your PC camera or webcam. + کیمیرا آپ کے کمپیوٹر کیمیرا یا ویب کیم کا استعمال کرتے ہوئے تصویر اور وڈیو کی تھیم کی ایک ٹول ہے۔ + + + File not saved + فائل بچی نہیں + + + Photo: + 'فتو:' + + + Video: + ویڈیو: + + + Resolution settings + حلوے کی تعداد + + + Photos: + عکس: + + + Videos: + ویڈیو: + + + Sound effects + صوتی اثرات + + + Mirror mode + آئینہ میڈیا + + + Flashlight + فلاش لائٹ + + + Gridlines + نیٹ ورک لائنس + + + 1*1 lines + 1*1 لائنس + + + 2*2 lines + 2*2 لائنس + + + Maximum resolution: + مaksimum حلوا: + + + + Shortcut + + Camera + کیمرہ + + + Settings + سیتtings + + + Stop recording + ریکارڈنگ روکیں + + + Copy + کاپی کریں + + + Delete + ڈیلیٹ کریں + + + Open + اپنی کریں + + + Print + پرنٹ کریں + + + Help + ہیلپ + + + Display shortcuts + کٹ ہوت کو دکھائیں + + + Stop taking photos + فتوے روکیں + + + Context menu + کنٹیکس مینو + + + + dc::Settings + + None + کوئی نہیں + + + mp4 + mp4 + + + webm + ویبم + + + + filterPreviewButton + + Normal + نرمال + + + Vivid + ویوڈ + + + Warm + ورم + + + Cold + کول + + + Retro + ریٹرو + + + Film + فلم + + + Gray + گرے + + + B&W + بی ٹو + + + + takePhotoSettingAreaWidget + + Flashlight + فلاش لائٹ + + + On + آن + + + Off + اф + + + Delay capture + ڈیلے کیپچر + + + None + کوئی + + + Filters + فائلٹر + + + Exposure + ایکسپوچر + + + + videowidget + + No webcam found + ویب کیم نہیں ملا + + + The webcam is in use + ویب کیم استعمال میں ہے + + + diff --git a/src/translations/deepin-camera_vi.ts b/src/translations/deepin-camera_vi.ts new file mode 100644 index 000000000..2b6bb2d80 --- /dev/null +++ b/src/translations/deepin-camera_vi.ts @@ -0,0 +1,319 @@ + + + + + CMainWindow + + Video recording is in progress. Close the window? + Quá trình ghi video đang diễn ra. Đóng cửa sổ? + + + Settings + Cài đặt + + + None + Không + + + Photo + Ảnh + + + Video + Video + + + Switch Cameras + Chuyển đổi camera + + + + CloseDialog + + Cancel + Hủy + + + Close + Đóng + + + + ImageItem + + Copy + Sao chép + + + Delete + Xóa + + + Open folder + Mở thư mục + + + Print + In + + + + QObject + + You don't have permission to operate this folder + Bạn không có quyền thao tác với thư mục này + + + Close + Đóng + + + Open folder + Mở thư mục + + + Settings + Cài đặt + + + Basic + Cơ bản + + + File location + Vị trí tệp + + + Shoot + Chụp + + + Burst mode + Chế độ chụp liên tiếp + + + Self-timer delay + Chậm chụp tự động + + + Output + Kết quả + + + Output format + Định dạng xuất + + + 4 pcs + 4 ảnh + + + 10 pcs + 10 ảnh + + + None + Không + + + Camera + Camera + + + Camera is an image and video capture utility using your PC camera or webcam. + Camera là công cụ ghi hình và video sử dụng camera hoặc webcam của bạn. + + + File not saved + Tệp không được lưu + + + Photo: + Ảnh: + + + Video: + Video: + + + Resolution settings + Cài đặt độ phân giải + + + Photos: + Ảnh: + + + Videos: + Video: + + + Sound effects + Hiệu ứng âm thanh + + + Mirror mode + Chế độ gương + + + Flashlight + Đèn pin + + + Gridlines + Đường lưới + + + 1*1 lines + 1*1 đường + + + 2*2 lines + 2*2 đường + + + Maximum resolution: + Độ phân giải tối đa: + + + + Shortcut + + Camera + Máy ảnh + + + Settings + Cài đặt + + + Stop recording + Dừng quay + + + Copy + Sao chép + + + Delete + Xóa + + + Open + Mở + + + Print + In + + + Help + Trợ giúp + + + Display shortcuts + Hiển thị phím tắt + + + Stop taking photos + Dừng chụp ảnh + + + Context menu + Menu ngữ cảnh + + + + dc::Settings + + None + Không + + + mp4 + mp4 + + + webm + webm + + + + filterPreviewButton + + Normal + Bình thường + + + Vivid + Sống động + + + Warm + Ấm áp + + + Cold + Lạnh + + + Retro + Nhật xưa + + + Film + Phim + + + Gray + Xám + + + B&W + Đen trắng + + + + takePhotoSettingAreaWidget + + Flashlight + Đèn pin + + + On + Bật + + + Off + Tắt + + + Delay capture + Chậm chụp + + + None + Không + + + Filters + Lọc + + + Exposure + Bộ phơi + + + + videowidget + + No webcam found + Không tìm thấy máy quay + + + The webcam is in use + Máy quay đang được sử dụng + + + diff --git a/src/translations/deepin-camera_zh_CN.ts b/src/translations/deepin-camera_zh_CN.ts index fde6e9a73..ac2c1aff2 100644 --- a/src/translations/deepin-camera_zh_CN.ts +++ b/src/translations/deepin-camera_zh_CN.ts @@ -261,6 +261,14 @@ None 无 + + mp4 + + + + webm + + filterPreviewButton @@ -334,6 +342,10 @@ No webcam found 未连接摄像头 + + Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled + 你的摄像头可能未开启,如需使用,请检查摄像头的硬件开关或键盘上的摄像头热键是否开启 + The webcam is in use 摄像头已被占用 diff --git a/src/translations/deepin-camera_zh_HK.ts b/src/translations/deepin-camera_zh_HK.ts index e7ff72081..15c6d9280 100644 --- a/src/translations/deepin-camera_zh_HK.ts +++ b/src/translations/deepin-camera_zh_HK.ts @@ -1,346 +1,358 @@ - + - - - CMainWindow - - Video recording is in progress. Close the window? - 正在錄製影片,是否關閉? - - - Open folder - 打開文件夾 - - - Settings - 設置 - - - None - 無 - - - Photo - 拍照 - - - Video - 影片 - - - Switch Cameras - 切換鏡頭 - - - - CloseDialog - - Cancel - 取消 - - - Close - 關閉 - - - - ImageItem - - Copy - 複製 - - - Delete - 刪除 - - - Open folder - 打開文件夾 - - - Print - 打印 - - - - QObject - - You don't have permission to operate this folder - 您沒有權限操作此文件夾 - - - Close - 關閉 - - - Invalid folder - 文件夾無效 - - - Open folder - 打開文件夾 - - - Settings - 設置 - - - Basic - 基本設置 - - - File location - 保存路徑 - - - Shoot - 拍照設置 - - - Burst mode - 連拍 - - - Self-timer delay - 拍照延時設置 - - - Output - 輸出設置 - - - Output format - 輸出格式 - - - 4 pcs - 4張 - - - 10 pcs - 10張 - - - None - 無 - - - Camera - 相機 - - - Camera is an image and video capture utility using your PC camera or webcam. - 相機是一款簡單易用的鏡頭應用工具,可實現拍照、錄製影片等功能。 - - - File not saved - 文件未保存 - - - Save to: - 存儲位置: - - - Photo: - 照片: - - - Video: - 影片: - - - Resolution settings - 解像度設置 - - - Resolution: - 解像度: - - - Photos: - 照片存儲位置: - - - Videos: - 影片存儲位置: - - - Sound effects - 音效 - - - Mirror mode - 鏡像鏡頭 - - - Flashlight - 閃光燈 - - - Gridlines - 構圖網格 - - - 1*1 lines - 十字網格 - - - 2*2 lines - 井字網格 - - - Maximum resolution: - - - - - Shortcut - - Camera - 相機 - - - Settings - 設置 - - - Stop recording - 結束錄製 - - - Copy - 複製 - - - Delete - 刪除 - - - Open - 打開 - - - Print - 打印 - - - Help - 幫助 - - - Display shortcuts - 顯示快捷鍵 - - - Stop taking photos - 結束拍照 - - - Context menu - 喚起右鍵菜單 - - - - ThumbnailsBar - - Take photo - 拍照 - - - Record video - 錄製影片 - - - Stop taking photos - 結束拍照 - - - - dc::Settings - - None - 無 - - - - filterPreviewButton - - Normal - 標準 - - - Vivid - 鮮明 - - - Warm - 暖色 - - - Cold - 冷色 - - - Retro - 復古 - - - Film - 沖印 - - - Gray - 灰度 - - - B&W - 黑白 - - - - takePhotoSettingAreaWidget - - Flashlight - 閃光燈 - - - On - 開啟 - - - Off - 關閉 - - - Delay capture - 延時拍攝 - - - None - 無 - - - Filters - 濾鏡 - - - Exposure - 曝光 - - - - videowidget - - No webcam found - 未連接鏡頭 - - - The webcam is in use - 鏡頭已被佔用 - - - Stop recording - 結束錄製 - - + + + CMainWindow + + Video recording is in progress. Close the window? + 正在錄製影片,是否關閉? + + + Open folder + 打開文件夾 + + + Settings + 設置 + + + None + 無 + + + Photo + 拍照 + + + Video + 影片 + + + Switch Cameras + 切換鏡頭 + + + + CloseDialog + + Cancel + 取消 + + + Close + 關閉 + + + + ImageItem + + Copy + 複製 + + + Delete + 刪除 + + + Open folder + 打開文件夾 + + + Print + 打印 + + + + QObject + + You don't have permission to operate this folder + 您沒有權限操作此文件夾 + + + Close + 關閉 + + + Invalid folder + 文件夾無效 + + + Open folder + 打開文件夾 + + + Settings + 設置 + + + Basic + 基本設置 + + + File location + 保存路徑 + + + Shoot + 拍照設置 + + + Burst mode + 連拍 + + + Self-timer delay + 拍照延時設置 + + + Output + 輸出設置 + + + Output format + 輸出格式 + + + 4 pcs + 4張 + + + 10 pcs + 10張 + + + None + 無 + + + Camera + 相機 + + + Camera is an image and video capture utility using your PC camera or webcam. + 相機是一款簡單易用的鏡頭應用工具,可實現拍照、錄製影片等功能。 + + + File not saved + 文件未保存 + + + Save to: + 存儲位置: + + + Photo: + 照片: + + + Video: + 影片: + + + Resolution settings + 解像度設置 + + + Resolution: + 解像度: + + + Photos: + 照片存儲位置: + + + Videos: + 影片存儲位置: + + + Sound effects + 音效 + + + Mirror mode + 鏡像鏡頭 + + + Flashlight + 閃光燈 + + + Gridlines + 構圖網格 + + + 1*1 lines + 十字網格 + + + 2*2 lines + 井字網格 + + + Maximum resolution: + 最大解像度: + + + + Shortcut + + Camera + 相機 + + + Settings + 設置 + + + Stop recording + 結束錄製 + + + Copy + 複製 + + + Delete + 刪除 + + + Open + 打開 + + + Print + 打印 + + + Help + 幫助 + + + Display shortcuts + 顯示快捷鍵 + + + Stop taking photos + 結束拍照 + + + Context menu + 喚起右鍵菜單 + + + + ThumbnailsBar + + Take photo + 拍照 + + + Record video + 錄製影片 + + + Stop taking photos + 結束拍照 + + + + dc::Settings + + None + 無 + + + mp4 + + + + webm + + + + + filterPreviewButton + + Normal + 標準 + + + Vivid + 鮮明 + + + Warm + 暖色 + + + Cold + 冷色 + + + Retro + 復古 + + + Film + 沖印 + + + Gray + 灰度 + + + B&W + 黑白 + + + + takePhotoSettingAreaWidget + + Flashlight + 閃光燈 + + + On + 開啟 + + + Off + 關閉 + + + Delay capture + 延時拍攝 + + + None + 無 + + + Filters + 濾鏡 + + + Exposure + 曝光 + + + + videowidget + + No webcam found + 未連接鏡頭 + + + Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled + 你的鏡頭可能未開啟,如需使用,請檢查鏡頭的硬體開關或鍵盤上的鏡頭熱鍵是否開啟 + + + The webcam is in use + 鏡頭已被佔用 + + + Stop recording + 結束錄製 + + diff --git a/src/translations/deepin-camera_zh_TW.ts b/src/translations/deepin-camera_zh_TW.ts index e16eeb866..eecb388db 100644 --- a/src/translations/deepin-camera_zh_TW.ts +++ b/src/translations/deepin-camera_zh_TW.ts @@ -1,346 +1,358 @@ - + - - - CMainWindow - - Video recording is in progress. Close the window? - 正在錄製影片,是否關閉? - - - Open folder - 開啟資料夾 - - - Settings - 設定 - - - None - 無 - - - Photo - 拍照 - - - Video - 影片 - - - Switch Cameras - 切換攝影機 - - - - CloseDialog - - Cancel - 取消 - - - Close - 關閉 - - - - ImageItem - - Copy - 複製 - - - Delete - 刪除 - - - Open folder - 開啟資料夾 - - - Print - 列印 - - - - QObject - - You don't have permission to operate this folder - 您沒有權限操作此資料夾 - - - Close - 關閉 - - - Invalid folder - 資料夾無效 - - - Open folder - 開啟資料夾 - - - Settings - 設定 - - - Basic - 基本設定 - - - File location - 儲存路徑 - - - Shoot - 拍照設定 - - - Burst mode - 連拍 - - - Self-timer delay - 拍照延時設定 - - - Output - 輸出設定 - - - Output format - 輸出格式 - - - 4 pcs - 4張 - - - 10 pcs - 10張 - - - None - 無 - - - Camera - 相機 - - - Camera is an image and video capture utility using your PC camera or webcam. - 相機是一款簡單易用的攝影機應用工具,可實現拍照、錄製影片等功能。 - - - File not saved - 文件未儲存 - - - Save to: - 儲存位置: - - - Photo: - 照片: - - - Video: - 影片: - - - Resolution settings - 解析度設定 - - - Resolution: - 解析度: - - - Photos: - 照片存儲位置: - - - Videos: - 影片存儲位置: - - - Sound effects - 音效 - - - Mirror mode - 鏡像攝影機 - - - Flashlight - 閃光燈 - - - Gridlines - 構圖網格 - - - 1*1 lines - 十字網格 - - - 2*2 lines - 井字網格 - - - Maximum resolution: - - - - - Shortcut - - Camera - 相機 - - - Settings - 設定 - - - Stop recording - 結束錄製 - - - Copy - 複製 - - - Delete - 刪除 - - - Open - 打開 - - - Print - 列印 - - - Help - 說明 - - - Display shortcuts - 顯示快捷鍵 - - - Stop taking photos - 結束拍照 - - - Context menu - 喚起右鍵菜單 - - - - ThumbnailsBar - - Take photo - 拍照 - - - Record video - 錄製影片 - - - Stop taking photos - 結束拍照 - - - - dc::Settings - - None - 無 - - - - filterPreviewButton - - Normal - 標準 - - - Vivid - 鮮明 - - - Warm - 暖色 - - - Cold - 冷色 - - - Retro - 復古 - - - Film - 沖印 - - - Gray - 灰度 - - - B&W - 黑白 - - - - takePhotoSettingAreaWidget - - Flashlight - 閃光燈 - - - On - 開啟 - - - Off - 關閉 - - - Delay capture - 延時拍攝 - - - None - 無 - - - Filters - 濾鏡 - - - Exposure - 曝光 - - - - videowidget - - No webcam found - 未連接攝影機 - - - The webcam is in use - 攝影機已被占用 - - - Stop recording - 結束錄製 - - + + + CMainWindow + + Video recording is in progress. Close the window? + 正在錄製影片,是否關閉? + + + Open folder + 開啟資料夾 + + + Settings + 設定 + + + None + 無 + + + Photo + 拍照 + + + Video + 影片 + + + Switch Cameras + 切換攝影機 + + + + CloseDialog + + Cancel + 取消 + + + Close + 關閉 + + + + ImageItem + + Copy + 複製 + + + Delete + 刪除 + + + Open folder + 開啟資料夾 + + + Print + 列印 + + + + QObject + + You don't have permission to operate this folder + 您沒有權限操作此資料夾 + + + Close + 關閉 + + + Invalid folder + 資料夾無效 + + + Open folder + 開啟資料夾 + + + Settings + 設定 + + + Basic + 基本設定 + + + File location + 儲存路徑 + + + Shoot + 拍照設定 + + + Burst mode + 連拍 + + + Self-timer delay + 拍照延時設定 + + + Output + 輸出設定 + + + Output format + 輸出格式 + + + 4 pcs + 4張 + + + 10 pcs + 10張 + + + None + 無 + + + Camera + 相機 + + + Camera is an image and video capture utility using your PC camera or webcam. + 相機是一款簡單易用的攝影機應用工具,可實現拍照、錄製影片等功能。 + + + File not saved + 文件未儲存 + + + Save to: + 儲存位置: + + + Photo: + 照片: + + + Video: + 影片: + + + Resolution settings + 解析度設定 + + + Resolution: + 解析度: + + + Photos: + 照片存儲位置: + + + Videos: + 影片存儲位置: + + + Sound effects + 音效 + + + Mirror mode + 鏡像攝影機 + + + Flashlight + 閃光燈 + + + Gridlines + 構圖網格 + + + 1*1 lines + 十字網格 + + + 2*2 lines + 井字網格 + + + Maximum resolution: + 最大解析度: + + + + Shortcut + + Camera + 相機 + + + Settings + 設定 + + + Stop recording + 結束錄製 + + + Copy + 複製 + + + Delete + 刪除 + + + Open + 打開 + + + Print + 列印 + + + Help + 說明 + + + Display shortcuts + 顯示快捷鍵 + + + Stop taking photos + 結束拍照 + + + Context menu + 喚起右鍵菜單 + + + + ThumbnailsBar + + Take photo + 拍照 + + + Record video + 錄製影片 + + + Stop taking photos + 結束拍照 + + + + dc::Settings + + None + 無 + + + mp4 + + + + webm + + + + + filterPreviewButton + + Normal + 標準 + + + Vivid + 鮮明 + + + Warm + 暖色 + + + Cold + 冷色 + + + Retro + 復古 + + + Film + 沖印 + + + Gray + 灰度 + + + B&W + 黑白 + + + + takePhotoSettingAreaWidget + + Flashlight + 閃光燈 + + + On + 開啟 + + + Off + 關閉 + + + Delay capture + 延時拍攝 + + + None + 無 + + + Filters + 濾鏡 + + + Exposure + 曝光 + + + + videowidget + + No webcam found + 未連接攝影機 + + + Your camera might not be turned on. If you need to use it, please check whether the hardware switch of the camera or the camera hotkey on the keyboard is enabled + 你的攝影機可能未開啟,如需使用,請檢查攝影機的硬體開關或鍵盤上的攝影機熱鍵是否開啟 + + + The webcam is in use + 攝影機已被占用 + + + Stop recording + 結束錄製 + + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt old mode 100644 new mode 100755 index 91f91e690..c02abe3fb --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,10 +1,11 @@ +# 定义需要的cmake版本 +cmake_minimum_required(VERSION 3.16) + # 设置工程名字 project(deepin-camera-test VERSION 1.0.0) set(CMD_NAME deepin-camera-test) set(TARGET_NAME deepin-camera-test) -# 定义需要的cmake版本 -cmake_minimum_required(VERSION 3.0) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) @@ -35,27 +36,38 @@ set(PROJECT_INCLUDE ../src/src/qtsingleapplication ../src/ ./stub - /usr/include + ${CMAKE_INSTALL_PREFIX}/include + ${CMAKE_INSTALL_PREFIX}/include/libusb-1.0 /usr/include/libusb-1.0 - /usr/include/SDL2 + ${CMAKE_INSTALL_PREFIX}/include/SDL2 ${PROJECT_SOURCE_DIR}/../deepin-camera ${PROJECT_SOURCE_DIR}/googletest/include ) -# 设置Qt模块 -set(QtModule Core Gui Widgets DBus Concurrent LinguistTools Multimedia PrintSupport Svg) +# 设置Qt6模块 +set(QtModule Core Gui Widgets DBus Concurrent LinguistTools Multimedia PrintSupport Svg SvgWidgets OpenGLWidgets Xml Test) -# 查找Qt相关的库链接 -find_package(Qt5 REQUIRED ${QtModule}) +# 查找Qt6相关的库链接 +find_package(Qt6 REQUIRED ${QtModule}) find_package(PkgConfig REQUIRED) file (GLOB_RECURSE CXXSOURCES ./*.cpp ../src/src/basepub/*.cpp - ../src/src/*.cpp ../src/src/qtsingleapplication/*.cpp ./stub/*.cpp ) +# 收集 src/src/*.cpp (排除 videosurface.cpp) +file(GLOB_RECURSE SRC_CXXSOURCES ../src/src/*.cpp) + +# 将 src/src/*.cpp (排除 videosurface.cpp) 加入编译 +foreach(src_file ${SRC_CXXSOURCES}) + get_filename_component(src_name ${src_file} NAME) + if(NOT src_name STREQUAL "videosurface.cpp") + list(APPEND CXXSOURCES ${src_file}) + endif() +endforeach() + file (GLOB_RECURSE CSOURCES ../src/src/*.c ../libcam/*.c @@ -82,40 +94,55 @@ add_executable( ${TARGET_NAME} ${CXXSOURCES} ${CSOURCES} ${RESOURCES} pkg_check_modules(3rd_lib REQUIRED - dtkgui - dtkwidget gstreamer-1.0 gstreamer-app-1.0 + dtk6gui + dtk6widget + gstreamer-1.0 + gstreamer-app-1.0 pciaccess -# libv4l2 -# libudev -# libusb-1.0 -# libavcodec -# libavutil -# libavformat -# libswscale -# libpng -# sdl2 -# libpulse -# libswresample -# libffmpegthumbnailer + libva + libavcodec + libavutil + libavformat + libswscale + libswresample + libudev ) # 添加第三方库的所有文件夹路径到工程中来(注意 *_INCLUDE_DIRS) target_include_directories(${TARGET_NAME} PUBLIC ${3rd_lib_INCLUDE_DIRS} ${PROJECT_INCLUDE} ${GLOB_RECURSE}) # 将第三方库链接进来(注意 *_LIBRARIES) -target_link_libraries(${PROJECT_NAME} ${3rd_lib_LIBRARIES} +target_link_libraries(${TARGET_NAME} PRIVATE + ${3rd_lib_LIBRARIES} gtest pthread - Qt5Test + Qt6::Test dl -# portaudio -# asound -# z + va + va-x11 - imagevisualresult + imagevisualresult6 ) -# 将工程与Qt模块链接起来 -qt5_use_modules(${PROJECT_NAME} ${QtModule}) +# 将工程与Qt6模块链接起来 +target_link_libraries(${TARGET_NAME} PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::DBus + Qt6::Concurrent + Qt6::Multimedia + Qt6::PrintSupport + Qt6::Svg + Qt6::SvgWidgets + Qt6::OpenGLWidgets +) + +# 链接DTK6库 +target_link_libraries(${TARGET_NAME} PRIVATE + dtk6core + dtk6gui + dtk6widget +) include_directories(${PROJECT_BINARY_DIR}) include_directories(${PROJECT_SOURCE_DIR}) @@ -149,13 +176,13 @@ set(OBJECT_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/objects) # COMMAND lcov --remove ./coverageResult/${PROJECT_NAME}_Coverage.info 'CMakeFiles/${PROJECT_NAME}.dir/${PROJECT_NAME}_autogen/*/*' # '${PROJECT_NAME}_autogen/*/*' # 'googletest/*/*' -# '*/usr/include/*' +# '*${CMAKE_INSTALL_PREFIX}/include/*' # '*/tests/*' # '*/src/qtsingleapplication/*' # '*/basepub/printoptionspage.cpp' # '*/src/src/dbus_adpator.cpp' # '*/src/src/settings_translation.cpp' -# '/usr/local/*' +# '${CMAKE_INSTALL_PREFIX}/local/*' # -o ./coverageResult/${PROJECT_NAME}_Coverage_fileter.info # COMMAND echo " =================== do filter end ==================== " diff --git a/tests/CameraTest.cpp b/tests/CameraTest.cpp index 27b09d65e..9d9f34892 100644 --- a/tests/CameraTest.cpp +++ b/tests/CameraTest.cpp @@ -24,21 +24,22 @@ #include "src/majorimageprocessingthread.h" #include "src/capplication.h" #include "src/camera.h" -#include "src/videosurface.h" #include "src/basepub/datamanager.h" #include "ac-deepin-camera-define.h" #include "stub/stub_function.h" #include "addr_pri.h" -#include -#include +#include +#include ACCESS_PRIVATE_FUN(CMainWindow, void(), initCameraConnection); ACCESS_PRIVATE_FIELD(CMainWindow, bool, m_bRecording); +#if QT_VERSION_MAJOR <= 5 ACCESS_PRIVATE_FIELD(Camera, QString, m_curDevName); ACCESS_PRIVATE_FIELD(Camera, VideoSurface*, m_videoSurface); +#endif CameraTest::CameraTest() { @@ -81,6 +82,7 @@ void CameraTest::TearDown() */ TEST_F(CameraTest, refreshCamera) { +#if QT_VERSION_MAJOR <= 5 // 重启摄像头 Stub_Function::resetSub(ADDR(Camera, getSupportResolutionsSize), ADDR(Stub_Function, getSupportResolutionsSize)); Stub_Function::resetSub(ADDR(QCamera, status), ADDR(Stub_Function, cameraStatus)); @@ -94,6 +96,12 @@ TEST_F(CameraTest, refreshCamera) access_private_field::Cameram_curDevName(*Camera::instance()) = "/dev/video4"; m_devnumMonitor->existDevice(); access_private_field::Cameram_curDevName(*Camera::instance()) = ""; +#else + // Qt6 下仅测试设备监控功能 + Stub_Function::resetSub(ADDR(DataManager, getdevStatus), ADDR(Stub_Function, getNoDevStatus)); + m_devnumMonitor->existDevice(); + Stub_Function::clearSub(ADDR(DataManager, getdevStatus)); +#endif } /** @@ -145,8 +153,9 @@ TEST_F(CameraTest, recordFunction) QTest::qWait(500); } +#if QT_VERSION_MAJOR <= 5 /** - * @brief videoSurface功能 + * @brief videoSurface功能 (Qt5 only) */ TEST_F(CameraTest, videoSurfaceFunction) { @@ -158,7 +167,7 @@ TEST_F(CameraTest, videoSurfaceFunction) } /** - * @brief 发送一帧图片 + * @brief 发送一帧图片 (Qt5 only) */ TEST_F(CameraTest, presentImage) { @@ -175,5 +184,5 @@ TEST_F(CameraTest, presentImage) m_processThread->m_bTake = false; Stub_Function::clearSub(ADDR(QVideoFrame, map)); } - +#endif diff --git a/tests/ClosedialogTest.cpp b/tests/ClosedialogTest.cpp index 65a042e7d..5996478be 100644 --- a/tests/ClosedialogTest.cpp +++ b/tests/ClosedialogTest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "ClosedialogTest.h" diff --git a/tests/DevNumTest.cpp b/tests/DevNumTest.cpp index ee2201896..aedcc1422 100644 --- a/tests/DevNumTest.cpp +++ b/tests/DevNumTest.cpp @@ -21,7 +21,7 @@ #include "src/mainwindow.h" #include "src/capplication.h" #include "stub/stub_function.h" -#include +#include DevNumberTest::DevNumberTest() { diff --git a/tests/GStreamerTest.cpp b/tests/GStreamerTest.cpp index b5cbac223..79bd51b51 100644 --- a/tests/GStreamerTest.cpp +++ b/tests/GStreamerTest.cpp @@ -29,8 +29,7 @@ #include "addr_pri.h" -#include -#include +#include ACCESS_PRIVATE_FUN(CMainWindow, void(), initCameraConnection); diff --git a/tests/ImageItemTest.cpp b/tests/ImageItemTest.cpp index 4df03dff5..5129d59dd 100644 --- a/tests/ImageItemTest.cpp +++ b/tests/ImageItemTest.cpp @@ -26,7 +26,7 @@ #include "datamanager.h" #include "stub/addr_pri.h" #include "src/imageitem.h" -#include +#include #include diff --git a/tests/MainwindowTest.cpp b/tests/MainwindowTest.cpp index e5f6d7889..8db1c9773 100644 --- a/tests/MainwindowTest.cpp +++ b/tests/MainwindowTest.cpp @@ -10,10 +10,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "MainwindowTest.h" #include "DButtonBox" diff --git a/tests/MainwindowTest.h b/tests/MainwindowTest.h index 140e37aae..a6611cc0b 100644 --- a/tests/MainwindowTest.h +++ b/tests/MainwindowTest.h @@ -4,16 +4,18 @@ #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) +#include +#endif #include "src/mainwindow.h" #include "src/capplication.h" diff --git a/tests/MajorImageProcessingThreadTest.cpp b/tests/MajorImageProcessingThreadTest.cpp index bd3d7a2e0..76ab68ff0 100644 --- a/tests/MajorImageProcessingThreadTest.cpp +++ b/tests/MajorImageProcessingThreadTest.cpp @@ -21,7 +21,7 @@ #include "src/majorimageprocessingthread.h" #include "src/capplication.h" #include "stub/stub_function.h" -#include +#include extern "C" { #include "v4l2_devices.h" diff --git a/tests/PhotoRecordBtnTest.cpp b/tests/PhotoRecordBtnTest.cpp index 3cdaf69a3..8afb2035a 100644 --- a/tests/PhotoRecordBtnTest.cpp +++ b/tests/PhotoRecordBtnTest.cpp @@ -26,7 +26,7 @@ #include "ac-deepin-camera-define.h" #include "stub/addr_pri.h" #include "datamanager.h" -#include +#include PhotoRecordBtnTest::PhotoRecordBtnTest() diff --git a/tests/RollingBoxTest.cpp b/tests/RollingBoxTest.cpp index 258829dc4..e4d751cb5 100644 --- a/tests/RollingBoxTest.cpp +++ b/tests/RollingBoxTest.cpp @@ -27,7 +27,7 @@ #include "ac-deepin-camera-define.h" #include "stub/addr_pri.h" #include "datamanager.h" -#include +#include RollingBoxTest::RollingBoxTest() { diff --git a/tests/TakePhotoSettingTest.cpp b/tests/TakePhotoSettingTest.cpp index b26ef742e..117bda3fe 100644 --- a/tests/TakePhotoSettingTest.cpp +++ b/tests/TakePhotoSettingTest.cpp @@ -24,7 +24,7 @@ #include "src/accessibility/ac-deepin-camera-define.h" #include "addr_pri.h" -#include +#include using namespace Dtk::Core; @@ -306,7 +306,12 @@ TEST_F(TakePhotoSettingTest, exposureSlider) QTest::qWait(500); QPoint p(slider->rect().topLeft() + QPoint(10, 20)); +#if QT_VERSION_MAJOR <= 5 QWheelEvent wheelEvent(p, 40, Qt::MiddleButton, Qt::NoModifier); +#else + // Qt6: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, buttons, modifiers, phase, inverted) + QWheelEvent wheelEvent(QPointF(p), QPointF(slider->mapToGlobal(p)), QPoint(0, 40), QPoint(0, 40), Qt::NoButton, Qt::NoModifier, Qt::ScrollBegin, false); +#endif QApplication::sendEvent(slider, &wheelEvent); QTest::qWait(500); diff --git a/tests/VideoWidgetTest.cpp b/tests/VideoWidgetTest.cpp index 238dcc986..16477ceb7 100644 --- a/tests/VideoWidgetTest.cpp +++ b/tests/VideoWidgetTest.cpp @@ -25,7 +25,7 @@ #include "ac-deepin-camera-define.h" #include "stub/addr_pri.h" #include "datamanager.h" -#include +#include ACCESS_PRIVATE_FUN(videowidget, void(), showNocam); @@ -36,7 +36,7 @@ ACCESS_PRIVATE_FUN(videowidget, void(), stopEverything); ACCESS_PRIVATE_FUN(videowidget, void(), onReachMaxDelayedFrames); ACCESS_PRIVATE_FUN(videowidget, void(), flash); ACCESS_PRIVATE_FUN(videowidget, void(QGraphicsView *view), forbidScrollBar); -ACCESS_PRIVATE_FUN(videowidget, void(PRIVIEW_ENUM_STATE state), showCountDownLabel); +ACCESS_PRIVATE_FUN(videowidget, void(PREVIEW_ENUM_STATE state), showCountDownLabel); ACCESS_PRIVATE_FUN(videowidget, void(const QString &resolution), slotresolutionchanged); ACCESS_PRIVATE_FIELD(videowidget, QGraphicsTextItem *, m_pCamErrItem); diff --git a/tests/main.cpp b/tests/main.cpp index 99987062a..5b5bbe723 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -4,14 +4,16 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) +#include +#endif +#include #include "SettingTest.h" #include "src/accessibility/ac-deepin-camera-define.h" @@ -25,8 +27,10 @@ int main(int argc, char *argv[]) testing::InitGoogleTest(&argc, argv); //加载翻译 - //设置属性 + //设置属性 (Qt6中AA_UseHighDpiPixmaps已默认启用,无需手动设置) +#if QT_VERSION_MAJOR <= 5 qApp->setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif qApp->setOrganizationName("deepin"); qApp->setApplicationName("deepin-camera"); @@ -43,7 +47,9 @@ int main(int argc, char *argv[]) qApp->setApplicationDescription("This is camera."); +#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) DApplicationSettings saveTheme; +#endif //仅允许打开一个相机,设置共享内存段 QSharedMemory shared_memory("deepincamera"); diff --git a/tests/stub/stub_function.cpp b/tests/stub/stub_function.cpp index b0da250e0..e62d1635a 100644 --- a/tests/stub/stub_function.cpp +++ b/tests/stub/stub_function.cpp @@ -388,20 +388,24 @@ QList Stub_Function::getSupportResolutionsSize() return resolutions; } +#if QT_VERSION_MAJOR <= 5 QCamera::Status Stub_Function::cameraStatus() { return QCamera::UnavailableStatus; } +#endif Stub_Function::DeviceStatus Stub_Function::getNoDevStatus() { return NOCAM; } +#if QT_VERSION_MAJOR <= 5 bool Stub_Function::videoFrameMapReadOnly(QAbstractVideoBuffer::MapMode mode) { return true; } +#endif EncodeEnv Stub_Function::qCameraEnv() { diff --git a/tests/stub/stub_function.h b/tests/stub/stub_function.h index 208e94940..259b9dbe8 100644 --- a/tests/stub/stub_function.h +++ b/tests/stub/stub_function.h @@ -2,7 +2,7 @@ #define STUB_FUNCTION_H #include -#include +#include #include "../../src/devnummonitor.h" #include "../../src/imageitem.h" #include "datamanager.h" @@ -139,9 +139,13 @@ class Stub_Function // Camera类相关桩函数--------------------begin QList getSupportResolutionsSize(); +#if QT_VERSION_MAJOR <= 5 QCamera::Status cameraStatus(); +#endif DeviceStatus getNoDevStatus(); +#if QT_VERSION_MAJOR <= 5 bool videoFrameMapReadOnly(QAbstractVideoBuffer::MapMode mode); +#endif EncodeEnv qCameraEnv(); EncodeEnv gstreamerEnv(); int recordingState(); diff --git a/tests/test-prj-running.sh b/tests/test-prj-running.sh index df99b9494..38a05659b 100755 --- a/tests/test-prj-running.sh +++ b/tests/test-prj-running.sh @@ -1,3 +1,7 @@ +# 切换到脚本所在目录,确保相对路径正确 +SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) +cd "$SCRIPT_DIR" + remove_cache(){ export DISPLAY=":0" export QT_QPA_PLATFORM= @@ -19,15 +23,20 @@ make_new_dir(){ } copy_test_files() { - cp -r /data/source/deepin-camera/jpegtest/*.jpg ~/Pictures/相机/ - cp -r /data/source/deepin-camera/jpegtest/*.jpg ~/Pictures/Camera/ - cp -r /data/source/deepin-camera/webmtest/*.webm ~/Videos/相机/ - cp -r /data/source/deepin-camera/webmtest/*.webm ~/Videos/Camera/ + # 尝试从标准路径复制测试数据,如果不存在则跳过(本地开发环境可能没有这些文件) + if [ -d "/data/source/deepin-camera/jpegtest" ]; then + cp -r /data/source/deepin-camera/jpegtest/*.jpg ~/Pictures/相机/ 2>/dev/null || true + cp -r /data/source/deepin-camera/jpegtest/*.jpg ~/Pictures/Camera/ 2>/dev/null || true + fi + if [ -d "/data/source/deepin-camera/webmtest" ]; then + cp -r /data/source/deepin-camera/webmtest/*.webm ~/Videos/相机/ 2>/dev/null || true + cp -r /data/source/deepin-camera/webmtest/*.webm ~/Videos/Camera/ 2>/dev/null || true + fi } build_exe(){ cd ../build-ut - cmake -DCMAKE_BUILD_TYPE=Debug .. + cmake -DCMAKE_BUILD_TYPE=Debug ../tests make -j16 } @@ -37,17 +46,17 @@ create_coverage_report(){ PROJECT_REALNAME=deepin-camera #项目名称 echo " ===================CREAT LCOV REPROT==================== " - lcov --directory ./tests/CMakeFiles/${PROJECT_REALNAME}.dir --zerocounters - ASAN_OPTIONS="fast_unwind_on_malloc=1" ./tests/${PROJECT_NAME} --gtest_output=xml:./report/report_deepin-camera.xml + lcov --directory ./CMakeFiles/${PROJECT_NAME}.dir --zerocounters + ASAN_OPTIONS="fast_unwind_on_malloc=1" ./${PROJECT_NAME} --gtest_output=xml:./report/report_deepin-camera.xml lcov --directory . --capture --output-file ./html/${PROJECT_REALNAME}_Coverage.info echo " =================== do filter begin ==================== " - lcov --remove ./html/${PROJECT_REALNAME}_Coverage.info 'CMakeFiles/${PROJECT_NAME}.dir/deepin-camera-test_autogen/*/*' '${PROJECT_NAME}_autogen/*/*' 'googletest/*/*' '*/usr/include/*' '*/tests/*' '*/src/src/qtsingleapplication/*' '*/src/src/basepub/printoptionspage.cpp' '*/src/src/dbus_adpator.cpp' '*/src/src/settings_translation.cpp' '/usr/local/*' '*/config.h' '*/src/src/thumbnailsbar.*' '*/src/src/thumbwidget.*' -o ./html/${PROJECT_REALNAME}_Coverage_fileter.info + lcov --remove ./html/${PROJECT_REALNAME}_Coverage.info 'CMakeFiles/${PROJECT_NAME}.dir/${PROJECT_NAME}_autogen/*/*' '${PROJECT_NAME}_autogen/*/*' 'googletest/*/*' '*/usr/include/*' '*/tests/*' '*/src/src/qtsingleapplication/*' '*/src/src/basepub/printoptionspage.cpp' '*/src/src/dbus_adpator.cpp' '*/src/src/settings_translation.cpp' '/usr/local/*' '*/config.h' '*/src/src/thumbnailsbar.*' '*/src/src/thumbwidget.*' -o ./html/${PROJECT_REALNAME}_Coverage_fileter.info echo " =================== do filter end ==================== " genhtml -o ./html ./html/${PROJECT_REALNAME}_Coverage_fileter.info echo " -- Coverage files have been output to ${CMAKE_BINARY_DIR}/html" mv ./html/index.html ./html/cov_${PROJECT_REALNAME}.html - mv asan.log* asan_${PROJECT_REALNAME}.log + mv asan.log* asan_${PROJECT_REALNAME}.log 2>/dev/null || true } diff --git a/tests/windowStateTest.cpp b/tests/windowStateTest.cpp index 0f2453e3f..082e81bc1 100644 --- a/tests/windowStateTest.cpp +++ b/tests/windowStateTest.cpp @@ -22,7 +22,7 @@ #include "src/mainwindow.h" #include "src/windowstatethread.h" #include "stub/stub_function.h" -#include +#include #include "addr_pri.h" ACCESS_PRIVATE_FUN(windowStateThread, void(), run);