Skip to content

fix: replace QMediaPlayer with QSoundEffect for shutter sound - #544

Draft
pengfeixx wants to merge 172 commits into
linuxdeepin:release/eaglefrom
pengfeixx:agent/bugfix/133173
Draft

pengfeixx wants to merge 172 commits into
linuxdeepin:release/eaglefrom
pengfeixx:agent/bugfix/133173

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Root Cause Analysis

During Qt6 adaptation (commit cde1e76), the shutter sound playback was migrated from QSound to QMediaPlayer+QAudioOutput without adding a warmup mechanism. QMediaPlayer lazily initializes its audio pipeline on first play() and releases it after idle, causing missing or delayed shutter sound on the first trigger after idle. In burst/timelapse mode, consecutive play() calls during pipeline transition states result in some calls producing no audible sound — inaccurate sound count. The release/eagle branch already fixed this same class of issue (commit 5a8a1a9, PMS 369937) using QSoundEffect+warmup, but that fix was never merged to master.

Fix

Replace QMediaPlayer+QAudioOutput with QSoundEffect (unified for Qt5/Qt6, eliminating #if QT_VERSION_MAJOR branching). Add a warmup mechanism: before actual playback, silently play at volume 0 to preload the audio buffer, then stop and restore volume — ensuring subsequent triggers produce immediate, reliable sound. Three private slots (startShutterSoundWarmup, onShutterSoundPlayingChanged, onShutterSoundStatusChanged) manage the warmup state machine.

Change Safety Assessment

Code Safety

  • Risk Level: Low
  • No public API changes; all new methods are private slots, only used internally
  • Member variable replacement (QMediaPlayer*+QAudioOutput*/QSound* → QSoundEffect* + 2 bool state vars) is private, no external impact
  • Does not revert any historical fix; this is the Qt6 adaptation of 5a8a1a9's QSoundEffect+warmup pattern from release/eagle

Business Impact Scope

  • Shutter sound during single photo capture: warmup ensures sound plays reliably even after idle period
  • Shutter sound during burst/continuous capture: warmup + pending mechanism ensures every shot produces audible sound
  • Shutter sound during timelapse interval capture: warmup re-initializes after idle intervals, preventing missing first sound

Verification Suggestion

Focus regression testing on burst mode (verify sound count matches photo count) and timelapse mode (verify first sound after idle is audible). Also verify no audio artifact during warmup phase.


根因分析

Qt6 适配(commit cde1e76)将快门音从 QSound 迁移到 QMediaPlayer+QAudioOutput,但未添加预热机制。QMediaPlayer 在首次 play() 时延迟初始化音频管道,空闲后释放管道导致下次播放需重新初始化——延时拍摄首声无声或音量偏小。连拍时连续 play() 在管道过渡状态下部分调用无效,导致音效次数不准确。release/eagle 分支已有同类修复(commit 5a8a1a9,PMS 369937),使用 QSoundEffect+warmup,但未合入 master。

修复方案

用 QSoundEffect 替换 QMediaPlayer(统一 Qt5/Qt6 路径,消除 #if QT_VERSION_MAJOR 分支)。新增 warmup 预热机制:正式播放前以零音量预载音频缓冲,随后停止并恢复音量,确保后续触发即时可靠发声。三个 private slots(startShutterSoundWarmup、onShutterSoundPlayingChanged、onShutterSoundStatusChanged)管理预热状态机。

改动安全评估

代码安全评估

  • 风险等级: 低风险
  • 无公开 API 变更;新增方法均为 private slots,仅类内部使用
  • 成员变量替换(QMediaPlayer*+QAudioOutput*/QSound* → QSoundEffect* + 2 个 bool 状态变量)为 private,外部不可访问
  • 不撤销任何历史修复;本次为 5a8a1a9(release/eagle)QSoundEffect+warmup 模式的 Qt6 适配

业务影响范围

  • 单张拍照快门音:预热机制确保空闲后也能可靠播放
  • 连拍模式快门音:预热 + pending 机制确保每张拍照都有音效
  • 延时拍照间隔捕获快门音:空闲间隔后重新预热,防止首声丢失

验证建议

重点回归测试连拍模式(验证音效次数与拍照次数一致)和延时拍摄模式(验证空闲后首声可听见)。同时验证预热阶段无音频杂音。

pengfeixx and others added 30 commits August 20, 2024 17:47
Camera treeland adaptation

Log: Camera treeland adaptation
Camera treeland adaptation

Log: Camera treeland adaptation
Update changelog

Log: Update changelog
the correct get the product machine name

Log: the correct get the product machine name
Bug: https://pms.uniontech.com/bug-view-267231.html
Make build configuration files and dynamic library search more generic in order to adapt linglong build.

Log: Adapt to linglong.
Add the build scripts for linglong.

Log: Add linglong build scripts.
Fix the crash issue if try take video in linglong box.

Log: Fix video crash issue in linglong box.
v6.5.1 release.

Log: v6.5.1 release.
Miss to update the depending debs, which cause build failed on arm64.

Log: Fix linglong miss arm64 depending debs.
linglong package slimming.

Log: linglong package slimming
Update linglong build script.

Log: Update linglong build script
remove kwayland-shell env

Log: remove kwayland-shell env
Remove full screen occlusion and stop recording function

Log:Remove full screen occlusion and stop recording function
Task: https://pms.uniontech.com/story-view-37517.html
修复紧凑模式下按钮大小错误的问题

Log: 修复紧凑模式下按钮大小错误的问题
Bug: https://pms.uniontech.com/bug-view-279807.html
修复紧凑模式的问题

Log: 修复紧凑模式适配问题
Bug: https://pms.uniontech.com/bug-view-279807.html
update linglong version

Log: update linglong version
Bump version to 6.5.6

Log: Bump version to 6.5.6
Bump version to 6.5.7

Log: Bump version to 6.5.7
Adapt linglong for loong64.

Log: Adapt linglong for loong64.
Task: https://pms.uniontech.com/task-view-368689.html
Adapt to the new version of linglong.

Log: Adapt to the new version of linglong.
Task: https://pms.uniontech.com/task-view-369975.html
Temporarily use ll-cli run deepin-movie, instead of
DBus interface.
It seems that deepin-movie takes more time to start,
causeing method calls to not respond.

Log: Fix start deepin-movie but not play.
Bug: https://pms.uniontech.com/bug-view-294085.html
Use runtime OS edition instead of compilation
OS edition.

Log: Us runtime OS edition
Bug: https://pms.uniontech.com/bug-view-294085.html
update changelog

Log: update changelog
In linglong environment, the application cannot be opened through
QProcess, but can be opened through DBus.

Log: fix fail to view video in linglong env.
Bug: https://pms.uniontech.com/bug-view-282515.html
update changelog

Log:update changelog
remove invalid  url

Log: remove invalid  url
)

Add new configuration class for managing camera encoding settings

Log: add org_deepin_camera_encode configuration class
QT6 adaptation

Log: QT6 adaptation
add-uos and others added 17 commits August 18, 2026 03:14
Do not preset decoder width/height before avcodec_open2(); let FFmpeg
parse the real size from the JPEG SOF header. Copy decoded frames using
the actual sw_frame/picture dimensions and realloc buffers when needed.
Add jpeg_get_decoded_size() and trim yuv_frame to the real decoded size.

不在 avcodec_open2() 前预设解码器宽高,改由 FFmpeg 从 JPEG SOF 头解析
真实尺寸。按实际解码帧尺寸拷贝并在需要时 realloc 缓冲。新增
jpeg_get_decoded_size(),并在首帧后将 yuv_frame 收紧到真实解码尺寸。

Log: 修复MJPG解码尺寸与协商分辨率不一致导致的解码失败和画面错位
PMS: BUG-372317
Influence: 修复相机协商与实际分辨率不一致导致的解码失败、画面错位及内存浪费。
sync by github workflow

Log: none
Influence: none
Add QPainter::Antialiasing render hint for switchcamerabtn and
takephotosettingareawidget, which were missing it under Qt6.

Qt6下switchcamerabtn和takephotosettingareawidget的paintEvent
未设置抗锯齿,导致圆形边框绘制出现锯齿。

Log: Qt6下开启抗锯齿修复边框锯齿
Influence: 修复Qt6下切换摄像头按钮和拍照设置区域边框锯齿问题,提升显示效果。
- bump version to 6.5.47

Log : bump version to 6.5.47
Add setObjectName/setAccessibleName for m_slider in ExposureSlider
and m_menu in ImageItem so accessibility tools can locate them.

为 ExposureSlider 的 m_slider 和 ImageItem 的 m_menu 补全
setObjectName/setAccessibleName,使无障碍工具可定位控件。

Log: 补全相机AT-SPI控件名称
Influence: 补全2个交互控件的无障碍名称,AT-SPI覆盖率从92%提升至100%。
Complete all unfinished Arabic translation entries in .ts files.

Log: update Arabic (ar) translations
as title

Log: update version
100% translated source file: 'deepin-camera_en_US.ts'
on 'ms'.
Pass file:// URL to imageViewer/movie DBus interface instead of a
bare path, because image viewer matches the file against a URL
list. Fall back to command-line launch when imageViewer returns
false.

通过DBus打开缩略图文件时传file://形式的URL而非裸路径,
看图内部按URL列表匹配文件;看图返回false时回退命令行启动。

Log: 修复相机缩略图打开图片时看图不显示图片的问题
PMS: BUG-381089
Influence: 相机右下角缩略图打开图片可正常显示,视频打开不受影响
1. Add the Brazilian Portuguese (pt_BR) help manual under `src/assets/deepin-camera/camera/pt_BR/`.
2. Include `p_camera.md` and all 7 delivered screenshots.

Log: Add the pt_BR help manual for Camera.

Influence:
1. Verify the new manual is installed under /usr/share/deepin-manual/manual-assets/application/deepin-camera/camera/pt_BR.
2. Check that all image references resolve from the installed directory.
3. Confirm no existing language directory or common asset is modified.

docs(camera): 新增葡萄牙语帮助手册

1. 在 `src/assets/deepin-camera/camera/pt_BR/` 下新增巴西葡萄牙语(pt_BR)帮助手册。
2. 包含 `p_camera.md` 及交付的全部 7 张图片。

Log: 新增相机的 pt_BR 帮助手册。

Influence:
1. 验证新手册安装到 /usr/share/deepin-manual/manual-assets/application/deepin-camera/camera/pt_BR。
2. 检查所有图片引用在安装目录下可正常解析。
3. 确认没有修改任何已有语言目录或 common 资源。

PMS:Task-396575   Multica: V-6803
Replace the manual install_dep/deploy_dep packaging with declarative
buildext.apt.build_depends/depends, aligning with the buildext
migration of deepin-movie-reborn and deepin-editor:

- declare build-time packages missing from base/runtime (cmake, ffmpeg
  dev libs, v4l/portaudio/pciaccess/usb/va/imageeditor/gstreamer dev)
- declare runtime packages missing from base/runtime (deepin-event-log,
  libimageeditor6, libportaudio2, libffmpegthumbnailer4v5, gst
  plugins-base/good, dmidecode); drop entries unused by code or already
  provided by base/runtime
- fix hardcoded include paths (gstreamer/libusb) for the buildext
  layout via build-time seds, keeping src/CMakeLists.txt untouched
- copy real libblas.so.3/liblapack.so.3 and create bare-name symlinks
  (libswscale/libffmpegthumbnailer/libportaudio) into the app lib dir,
  reproducing the old layer's dlopen support and replacing the
  mv-blas/lapack + LDD_FILES logic

Verified with ll-builder build (runtime ldd check included); the app
runs with zero dlopen failures in an offscreen smoke test.

Change-Id: I7ce1c50db645bbad31d670090aabdbdc85691205
as title

Log: update version
Convert plain qDebug/qInfo/qWarning to categorized qCDebug/qCInfo/qCWarning
with org.deepin.camera category in core files, register log_rules DConfig
listening before application creation, and add dconfig meta
org.deepin.camera.json.

将核心文件的普通日志宏改为带 org.deepin.camera 分类的 qCDebug/qCInfo/qCWarning,
注册 log_rules DConfig 监听,新增 dconfig 元数据文件。

Log: 适配deepin-debug-config调试模式(1/3)
Influence: 可通过deepin-debug-config动态切换deepin-camera的日志输出级别
Convert plain qDebug/qInfo/qWarning to categorized qCDebug/qCInfo/qCWarning
with org.deepin.camera category in src/src files (closedialog, devnummonitor,
exposureslider, filterpreviewbutton, globalutils, gstvideowriter, imageitem,
logconfigread, mainwindow, majorimageprocessingthread), and add ddlog.h
includes.

将 src/src 下 10 个源文件的普通日志宏改为带 org.deepin.camera 分类的
qCDebug/qCInfo/qCWarning,并补充 ddlog.h 头文件引入。

Log: 适配deepin-debug-config调试模式(2/3)
Influence: 可通过deepin-debug-config动态切换deepin-camera的日志输出级别
Convert plain qDebug/qInfo/qWarning to categorized qCDebug/qCInfo/qCWarning
with org.deepin.camera category in src/src files (previewopenglwidget,
takephotosettingareawidget, titlebar, videowidget, windowstatethread), and
add ddlog.h includes.

将 src/src 下 5 个源文件的普通日志宏改为带 org.deepin.camera 分类的
qCDebug/qCInfo/qCWarning,并补充 ddlog.h 头文件引入。

Log: 适配deepin-debug-config调试模式(3/3)
Influence: 可通过deepin-debug-config动态切换deepin-camera的日志输出级别
The buildext migration (dcf0c67) creates bare-name dlopen symlinks only
for libswscale/libffmpegthumbnailer/libportaudio, missing libavformat.so.
libavformat60 is provided only by the runtime layer and is invisible to
the app's libPath() scan of Qt LibrariesPath (/usr/lib/${TRIPLET}); the
lookup then falls back to the bare name, which ld.so cannot resolve
without a symlink (no wildcard matching). Recording (libcam_encoder
mp4/muxer -> getAvformat) therefore fails dlopen("libavformat.so") and
every dlsym returns NULL, and the first call segfaults the app
(ll-box retval=139) although startup, preview and filters keep working.

- add libavformat.so to the bare-name symlink loop, same recipe as the
  other three libs (link to the real versioned file from the build
  container's -dev package)
- add a cp -L fallback when the depends closure did not bring the real
  file into the app lib dir, keeping the bare link resolvable in-layer
  regardless of buildext skip_existing behaviour

Verified with ll-builder build; in the built container (which mirrors
the runtime layout, no libavformat in /usr/lib) a dlopen probe loads
libavformat.so via the default ld path and resolves all recording-path
symbols (avformat_open_input/alloc_output_context2/new_stream/
write_header/write_frame/write_trailer/avio_open/avio_closep); offscreen
startup smoke test shows no dlopen failures.

Log: 修复玲珑包录像必崩(libavformat.so 裸名缺失导致 dlopen 失败、函数指针为空)
Influence: 玲珑包录像功能恢复正常,滤镜/预览行为不变
Change-Id: Iff8eb0d8af0dbfecbf7ca4a52ee09daa
- update version to 6.5.50

log: update version to 6.5.50
@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Remove the shutter-sound warmup state machine and its signal handlers, and have flash() play the sound directly when enabled.

  • src/src/videowidget.cpp L91 (removed lines), L914 (removed lines), L918
  • src/src/videowidget.h L396 (removed lines), L533 (removed lines)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@pengfeixx
pengfeixx marked this pull request as draft November 13, 2026 17:45
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pengfeixx

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/src/videowidget.cpp" line_range="918" />
<code_context>
-
-    m_shutterSoundWarming = true;
-    m_takePicSound->setVolume(0.0);
-    m_takePicSound->play();
-}
-
</code_context>
<issue_to_address>
**Burst still produces one sound**

When burst mode is selected with a zero-second interval, `showCountdown()` restarts the single-shot `m_flashTimer` for each rapid photo, so the timer emits `flash()` only after the last shot; this direct `play()` therefore runs once for the burst, and users hear only one shutter sound.

Trigger shutter playback for each captured photo rather than relying on the single-shot flash timer, or schedule a distinct flash callback per shot.
</issue_to_address>

### Comment 2
<location path="src/src/videowidget.cpp" line_range="918" />
<code_context>
-
-    m_shutterSoundWarming = true;
-    m_takePicSound->setVolume(0.0);
-    m_takePicSound->play();
-}
-
</code_context>
<issue_to_address>
**Rapid shots truncate shutter sounds**

When continuous capture starts another shot before the current shutter clip finishes, `QSoundEffect::play()` restarts the already-playing `m_takePicSound` instead of queueing playback, so users do not hear a complete shutter sound for each captured image.

Queue each shutter playback or use a separate effect per shot so each capture gets a complete sound.
</issue_to_address>

### Comment 3
<location path="src/src/videowidget.cpp" line_range="918" />
<code_context>
-
-    m_shutterSoundWarming = true;
-    m_takePicSound->setVolume(0.0);
-    m_takePicSound->play();
-}
-
</code_context>
<issue_to_address>
**First shutter sound is lost**

When the first capture happens before the sound effect finishes loading, `m_takePicSound->play()` runs while the effect is still Loading, and no pending play or retry remains, so the user hears no shutter sound for that shot.

Defer playback until the effect is Ready while retaining a pending play for the capture.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread src/src/videowidget.cpp Outdated
if (get_sound_of_takeing_photo()) {
m_shutterSoundPending = true;
startShutterSoundWarmup();
m_takePicSound->play();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Burst still produces one sound

When burst mode is selected with a zero-second interval, showCountdown() restarts the single-shot m_flashTimer for each rapid photo, so the timer emits flash() only after the last shot; this direct play() therefore runs once for the burst, and users hear only one shutter sound.

Trigger shutter playback for each captured photo rather than relying on the single-shot flash timer, or schedule a distinct flash callback per shot.

Prompt for AI agents
In `src/src/videowidget.cpp` at line 918:

**Burst still produces one sound**

When burst mode is selected with a zero-second interval, `showCountdown()` restarts the single-shot `m_flashTimer` for each rapid photo, so the timer emits `flash()` only after the last shot; this direct `play()` therefore runs once for the burst, and users hear only one shutter sound.

Trigger shutter playback for each captured photo rather than relying on the single-shot flash timer, or schedule a distinct flash callback per shot.

Comment thread src/src/videowidget.cpp Outdated
if (get_sound_of_takeing_photo()) {
m_shutterSoundPending = true;
startShutterSoundWarmup();
m_takePicSound->play();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Rapid shots truncate shutter sounds

When continuous capture starts another shot before the current shutter clip finishes, QSoundEffect::play() restarts the already-playing m_takePicSound instead of queueing playback, so users do not hear a complete shutter sound for each captured image.

Queue each shutter playback or use a separate effect per shot so each capture gets a complete sound.

Prompt for AI agents
In `src/src/videowidget.cpp` at line 918:

**Rapid shots truncate shutter sounds**

When continuous capture starts another shot before the current shutter clip finishes, `QSoundEffect::play()` restarts the already-playing `m_takePicSound` instead of queueing playback, so users do not hear a complete shutter sound for each captured image.

Queue each shutter playback or use a separate effect per shot so each capture gets a complete sound.

Comment thread src/src/videowidget.cpp Outdated
if (get_sound_of_takeing_photo()) {
m_shutterSoundPending = true;
startShutterSoundWarmup();
m_takePicSound->play();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · First shutter sound is lost

When the first capture happens before the sound effect finishes loading, m_takePicSound->play() runs while the effect is still Loading, and no pending play or retry remains, so the user hears no shutter sound for that shot.

Defer playback until the effect is Ready while retaining a pending play for the capture.

Prompt for AI agents
In `src/src/videowidget.cpp` at line 918:

**First shutter sound is lost**

When the first capture happens before the sound effect finishes loading, `m_takePicSound->play()` runs while the effect is still Loading, and no pending play or retry remains, so the user hears no shutter sound for that shot.

Defer playback until the effect is Ready while retaining a pending play for the capture.

@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 6.5.50
EXISTED: no
DISTRIBUTION: unstable

@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "debian/rules": {
            "a": [
                "export QT_SELECT=5"
            ],
            "b": [
                "export QT_SELECT=6"
            ]
        }
    }
}

@github-actions

Copy link
Copy Markdown

CLA Assistant Lite bot:

如果你是以企业贡献者的身份进行提交,请联系我们签署企业贡献者许可协议
If you submit as corporate contributor, please contact us to sign our Corporate Contributor License Agreement

感谢您的提交,我们非常感谢。 像许多开源项目一样,在接受您的贡献之前,我们要求您签署我们的个人贡献者许可协议。 您只需发布与以下格式相同的评论即可签署个人贡献者许可协议。
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Individual Contributor License Agreement before we can accept your contribution. You can sign the Individual Contributor License Agreement by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA.

4 out of 6 committers have signed the CLA.
✅ pengfeixx
✅ rb-union
✅ wyu71
✅ dengzhongyuan365-dev
❌ JWWTSL
❌ dengbo11
You can retrigger this bot by commenting recheck in this Pull Request

@pengfeixx pengfeixx changed the title fix: remove broken warmup state machine for shutter sound fix: replace QMediaPlayer with QSoundEffect for shutter sound Nov 16, 2026
1. Root cause: Qt6 path used QMediaPlayer+QAudioOutput for shutter
   sound, which has delayed audio pipeline initialization causing
   missing or inaccurate shutter sounds during burst/timelapse
2. Fix: replace with QSoundEffect (unified for Qt5/Qt6) and add
   warmup mechanism that silently preloads audio at volume 0 before
   actual playback, ensuring immediate sound on subsequent triggers
3. Rework: add missing slot declarations in header, move
   QSoundEffect include out of Qt6-only block for Qt5 compat,
   disconnect signals and reset state flags in destructor to
   prevent use-after-free, add Doxygen comments to new functions
4. Impact: shutter sound plays reliably during rapid photo capture;
   no public API change, only internal implementation replacement

Log: Fix shutter sound missing or inaccurate during burst capture

Influence:
1. Test shutter sound during single photo capture
2. Test shutter sound during burst/continuous capture mode
3. Test shutter sound during timelapse interval capture
4. Verify no audio artifact during warmup phase
5. Test shutter sound after idle period
6. Verify Qt5 and Qt6 build compilation succeeds

fix: 使用QSoundEffect替换QMediaPlayer播放快门音

1. 根因:Qt6路径使用QMediaPlayer+QAudioOutput播放快门音,音频
   管线延迟初始化导致连拍/延时拍照时快门音丢失或计数不准
2. 方案:统一使用QSoundEffect(Qt5/Qt6共用),新增warmup预热
   机制在正式播放前以零音量预载音频流,确保后续触发即时发声
3. 返工:补充头文件缺失的槽函数声明,将QSoundEffect头文件移出
   Qt6条件编译块以兼容Qt5,析构函数中断开信号连接并重置状态
   标志防止use-after-free,为新函数添加Doxygen注释
4. 影响:连拍时快门音可靠播放;无公开API变更,仅内部实现替换

Log: 修复连拍/延时拍照时快门音丢失或计数不准的问题

Influence:
1. 测试单张拍照时的快门音
2. 测试连拍模式下的快门音
3. 测试延时拍照间隔捕获的快门音
4. 验证预热阶段无音频杂音
5. 测试空闲一段时间后的快门音
6. 验证Qt5和Qt6构建编译通过

PMS: BUG-133173
@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "debian/rules": {
            "a": [
                "export QT_SELECT=5"
            ],
            "b": [
                "export QT_SELECT=6"
            ]
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.