Mocap Slice B (#871): ENABLE_MOCAP build infra + VideoFrameSource (Qt Multimedia) - #880
Mocap Slice B (#871): ENABLE_MOCAP build infra + VideoFrameSource (Qt Multimedia)#880fernandotonon wants to merge 1 commit into
Conversation
Slice B of epic #869 (performance capture). - New ENABLE_MOCAP CMake option (default OFF; requires ENABLE_ONNX, errors otherwise) pulling in Qt6::Multimedia for the app + UnitTests. - src/Mocap/VideoFrameSource.{h,cpp}: one frame-source abstraction delivering timestamped RGB888 MocapFrames from (a) a video file (QMediaPlayer + QVideoSink, targetFps decimation, playback-driven — faster-than-realtime decode is a documented follow-up), (b) a live camera (QCamera + QMediaCaptureSession, device enumeration for the GUI picker / MCP, permission-denied mapped to a human-readable error, latest-wins FrameMailbox for a slower inference consumer), (c) an image sequence (the synchronous headless test double / CLI --frames-dir path). - FrameDecimator + FrameMailbox are pure data and headless-tested; 13 new tests pass (emission order/timestamps, 60->30 decimation, latest-wins drop semantics incl. cross-thread, open() failure paths, device enumeration). - test_main.cpp gains QTMESH_TESTS_SKIP_OGRE_PREFLIGHT so pure-data suites can run on machines with no GL/WindowServer at all; CI never sets it. - NSCameraUsageDescription added to Info.plist.in. - CI: Linux unit-test lane installs the qtmultimedia module and configures with -DENABLE_MOCAP=ON. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 858b973858
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| std::unique_ptr<QMediaPlayer> m_player; | ||
| std::unique_ptr<QVideoSink> m_sink; |
There was a problem hiding this comment.
Destroy the player before its video sink
When a FileFrameSource that has successfully opened a video is destroyed, C++ destroys these members in reverse declaration order, so m_sink is deleted while m_player still points at it from setVideoSink(). QMediaPlayer detaches its sink during destruction, so this leaves a dangling QVideoSink and can crash on teardown; reset/detach the player before the sink or declare the sink before the player.
Useful? React with 👍 / 👎.
| std::unique_ptr<QMediaCaptureSession> m_session; | ||
| std::unique_ptr<QVideoSink> m_sink; |
There was a problem hiding this comment.
Detach the capture session before deleting the sink
When CameraFrameSource is destroyed after open(), member teardown deletes m_sink before m_session, even though the session still references that sink from setVideoSink(). QMediaCaptureSession detaches the previous sink during destruction, so it can call back into freed memory; reset/detach the session before the sink or declare the sink before the session.
Useful? React with 👍 / 👎.
|
|
Consolidated into #909 (single epic PR targeting master). Review findings from this PR are addressed there — see the latest commit. |



Part of epic #869. Closes #871. Follows the Slice A spike (#878).
What this adds
ENABLE_MOCAPCMake option (default OFF) near the ONNX/Alembic blocks: requiresENABLE_ONNX(fatal error otherwise — one "mocap build" configuration, no half-working states), finds/linksQt6::Multimediafor the app and UnitTests. Default builds are behavior-identical (no new deps pulled).src/Mocap/VideoFrameSource.{h,cpp}— the frame-source abstraction Slices C–F consume so nothing else ever touches Qt Multimedia:FileFrameSource—QMediaPlayer+QVideoSink, RGB888 frames with media timestamps,targetFpsdecimation. Playback-driven (real-time); faster-than-realtime decode documented as a follow-up.CameraFrameSource—QCamera+QMediaCaptureSession,availableDevices()for the GUI picker / MCPlist_capture_devices, permission-denied mapped to a readable error, and a latest-winsFrameMailboxso live inference never falls behind the camera.ImageSequenceFrameSource— synchronous test double (also the future CLI--frames-dirdebug path).FrameDecimator/FrameMailboxare pure data, headless-tested.NSCameraUsageDescriptioninInfo.plist.in.qtmultimediaaqt module +-DENABLE_MOCAP=ON(theENABLE_PS1_RIPprecedent — one lane first).test_main.cpp: opt-inQTMESH_TESTS_SKIP_OGRE_PREFLIGHTenv (headless machines with no GL at all can still run pure-data suites with a filter; CI unaffected).Verification
-DENABLE_MOCAP=ON -DENABLE_ONNX=ON(Qt 6.9.3 + qtmultimedia module).open()failure paths, camera device enumeration without a camera.QTMESH_MOCAP_CAMERA_TESTSreserved); file-decode smoke happens in Slice D's CLI integration.Packaging notes (for Slice G)
macdeployqtpicks up QtMultimedia + FFmpeg libs when linked — verify in the release-lane bundle before flipping the flag on releases.🤖 Generated with Claude Code