Skip to content

feat: add media capture APIs, wasm example, and CI coverage#27

Merged
niklabh merged 1 commit intomainfrom
feat/media-capture
Apr 10, 2026
Merged

feat: add media capture APIs, wasm example, and CI coverage#27
niklabh merged 1 commit intomainfrom
feat/media-capture

Conversation

@niklabh
Copy link
Copy Markdown
Owner

@niklabh niklabh commented Apr 10, 2026

Implement Phase 1 Media Capture from the roadmap: camera (open/close, RGBA frames, dimensions), microphone (mono f32 ring buffer, sample rate, read_samples), primary-display screenshot (RGBA + dimensions), and api_media_pipeline_stats (camera frame count + mic ring depth).

Host (oxide-browser):

  • New module media_capture.rs registering imports under oxide; HostState gains media_capture: Arc<Mutex>.
  • Use nokhwa (input-native + camera-sync-impl for Send), cpal for input, screenshots for display capture; rfd dialogs before hardware access.
  • pub(crate) write_guest_bytes for guest memory writes from media_capture.

SDK (oxide-sdk):

  • FFI + safe wrappers: camera_, microphone_, screen_capture*, media_pipeline_stats; crate docs table updated.

Example (examples/media-capture):

  • PNG-encode RGBA for canvas_image (host decodes encoded images only).
  • UI: camera preview, mic level meter, screenshot thumbnail, pipeline footer.

Other:

  • examples/index: Media Capture card linking to media_capture.wasm.
  • CI: libv4l-dev (Linux camera); wasm32 check for media-capture example.
  • ROADMAP: mark Media Capture items complete.

Implement Phase 1 Media Capture from the roadmap: camera (open/close, RGBA
frames, dimensions), microphone (mono f32 ring buffer, sample rate,
read_samples), primary-display screenshot (RGBA + dimensions), and
api_media_pipeline_stats (camera frame count + mic ring depth).

Host (oxide-browser):
- New module media_capture.rs registering imports under oxide; HostState
  gains media_capture: Arc<Mutex<MediaCaptureState>>.
- Use nokhwa (input-native + camera-sync-impl for Send), cpal for input,
  screenshots for display capture; rfd dialogs before hardware access.
- pub(crate) write_guest_bytes for guest memory writes from media_capture.

SDK (oxide-sdk):
- FFI + safe wrappers: camera_*, microphone_*, screen_capture*,
  media_pipeline_stats; crate docs table updated.

Example (examples/media-capture):
- PNG-encode RGBA for canvas_image (host decodes encoded images only).
- UI: camera preview, mic level meter, screenshot thumbnail, pipeline footer.

Other:
- examples/index: Media Capture card linking to media_capture.wasm.
- CI: libv4l-dev (Linux camera); wasm32 check for media-capture example.
- ROADMAP: mark Media Capture items complete.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Warning

Rate limit exceeded

@niklabh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 32 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 32 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43737cc5-f553-42fd-9305-e7fd53f2834a

📥 Commits

Reviewing files that changed from the base of the PR and between b0c43c4 and e663591.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • Cargo.toml
  • ROADMAP.md
  • examples/index/src/lib.rs
  • examples/media-capture/Cargo.toml
  • examples/media-capture/src/lib.rs
  • oxide-browser/Cargo.toml
  • oxide-browser/src/capabilities.rs
  • oxide-browser/src/lib.rs
  • oxide-browser/src/media_capture.rs
  • oxide-sdk/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/media-capture

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 and usage tips.

@niklabh niklabh merged commit 826a261 into main Apr 10, 2026
5 checks passed
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.

1 participant