Skip to content

Mocap Slice B (#871): ENABLE_MOCAP build infra + VideoFrameSource (Qt Multimedia) - #880

Closed
fernandotonon wants to merge 1 commit into
masterfrom
feat/mocap-slice-b-video-source-871
Closed

Mocap Slice B (#871): ENABLE_MOCAP build infra + VideoFrameSource (Qt Multimedia)#880
fernandotonon wants to merge 1 commit into
masterfrom
feat/mocap-slice-b-video-source-871

Conversation

@fernandotonon

Copy link
Copy Markdown
Owner

Part of epic #869. Closes #871. Follows the Slice A spike (#878).

What this adds

  • ENABLE_MOCAP CMake option (default OFF) near the ONNX/Alembic blocks: requires ENABLE_ONNX (fatal error otherwise — one "mocap build" configuration, no half-working states), finds/links Qt6::Multimedia for 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:
    • FileFrameSourceQMediaPlayer+QVideoSink, RGB888 frames with media timestamps, targetFps decimation. Playback-driven (real-time); faster-than-realtime decode documented as a follow-up.
    • CameraFrameSourceQCamera+QMediaCaptureSession, availableDevices() for the GUI picker / MCP list_capture_devices, permission-denied mapped to a readable error, and a latest-wins FrameMailbox so live inference never falls behind the camera.
    • ImageSequenceFrameSource — synchronous test double (also the future CLI --frames-dir debug path).
    • FrameDecimator/FrameMailbox are pure data, headless-tested.
  • NSCameraUsageDescription in Info.plist.in.
  • CI: Linux unit-test lane adds the qtmultimedia aqt module + -DENABLE_MOCAP=ON (the ENABLE_PS1_RIP precedent — one lane first).
  • test_main.cpp: opt-in QTMESH_TESTS_SKIP_OGRE_PREFLIGHT env (headless machines with no GL at all can still run pure-data suites with a filter; CI unaffected).

Verification

  • macOS build green with -DENABLE_MOCAP=ON -DENABLE_ONNX=ON (Qt 6.9.3 + qtmultimedia module).
  • 13 new headless tests pass locally: frame order/timestamps/RGB888 guarantee, 60→30 fps decimation, latest-wins drop semantics (incl. a cross-thread producer), open() failure paths, camera device enumeration without a camera.
  • Real-camera paths are env-gated by nature (QTMESH_MOCAP_CAMERA_TESTS reserved); file-decode smoke happens in Slice D's CLI integration.

Packaging notes (for Slice G)

  • macOS: macdeployqt picks up QtMultimedia + FFmpeg libs when linked — verify in the release-lane bundle before flipping the flag on releases.
  • Windows/MinGW: Qt Multimedia MinGW binaries need verification; until then MOCAP stays OFF on Windows (the ONNX/MinGW precedent).
  • Debian: FFmpeg runtime deps to be added when release lanes enable the flag.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fernandotonon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3f466ec-6262-482e-aab2-c84ad04c1684

📥 Commits

Reviewing files that changed from the base of the PR and between ed2b35d and 858b973.

📒 Files selected for processing (8)
  • .github/workflows/deploy.yml
  • CMakeLists.txt
  • src/CMakeLists.txt
  • src/Info.plist.in
  • src/Mocap/VideoFrameSource.cpp
  • src/Mocap/VideoFrameSource.h
  • src/Mocap/VideoFrameSource_test.cpp
  • src/test_main.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mocap-slice-b-video-source-871

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment on lines +170 to +171
std::unique_ptr<QMediaPlayer> m_player;
std::unique_ptr<QVideoSink> m_sink;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +207 to +208
std::unique_ptr<QMediaCaptureSession> m_session;
std::unique_ptr<QVideoSink> m_sink;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

@fernandotonon

Copy link
Copy Markdown
Owner Author

Consolidated into #909 (single epic PR targeting master). Review findings from this PR are addressed there — see the latest commit.

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.

Mocap Slice B — ENABLE_MOCAP build infra + VideoFrameSource (Qt Multimedia: file / camera / image-sequence)

1 participant