Skip to content

Conversation

@xianshijing-lk
Copy link
Contributor

@xianshijing-lk xianshijing-lk commented Jan 28, 2026

This PR will fix the Cis related to local_video example

Summary by CodeRabbit

  • New Features

    • Added a required "desktop" feature for local video examples; example commands now include the feature flag and binaries require it.
  • Documentation

    • Updated usage to show desktop mode and new publisher flags (simulcast, H.265, max-bitrate).
  • Refactor

    • Reworked device enumeration to a portable, cross-platform implementation.
    • Moved video dependencies to platform-specific configurations for cleaner builds.
  • Chores

    • Crate now gated to supported desktop OSes; removed legacy platform binding entries.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Added a crate-level desktop feature, gated three example binaries on it, moved nokhwa dependencies to per-target entries (macOS, Linux, Windows), removed macOS bindings, and replaced macOS-specific capability enumeration with a platform-agnostic enumerate_capabilities in the local_video example.

Changes

Cohort / File(s) Summary
Dependency & Feature Configuration
examples/local_video/Cargo.toml
Added crate-level desktop feature; marked binaries publisher, subscriber, list_devices with required-features = ["desktop"]. Replaced the previous global nokhwa entry with a global output-threaded nokhwa plus per-target nokhwa features: macOS (input-avfoundation), Linux (input-v4l), Windows (input-msmf). Removed nokhwa-bindings-macos.
Documentation Updates
examples/local_video/README.md
Documented the desktop feature and updated usage examples to include -F desktop; added publisher examples with --simulcast, --h265, and --max-bitrate.
Platform-Agnostic Implementation
examples/local_video/src/list_devices.rs
Replaced macOS-specific nokhwa_bindings_macos usage with a portable enumerate_capabilities that queries Camera capabilities via FourCC when available, with a fallback to generic formats; removed platform-conditional compilation around capability enumeration.
Crate Target Gating
livekit-ffi-node-bindings/src/lib.rs
Added crate-level cfg to restrict compilation to Linux, macOS, or Windows: #![cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))].

Sequence Diagram(s)

(Skipped — changes do not introduce a new multi-component sequential control flow requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hop through Cargo.toml with glee,

swapping bindings so cameras roam free.
A desktop feature gates my little show,
formats found on mac, linux, windows — go!
Tiny paws applaud: build, run, and glow!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix CIs' is vague and lacks specificity about what CI issues are being fixed and how the changes address them. Use a more descriptive title that specifies the CI issue being addressed, such as 'Restrict Node FFI bindings to supported platforms' or 'Fix CI failures by configuring platform-specific dependencies and feature gates'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d392064 and a3fde98.

📒 Files selected for processing (1)
  • livekit-ffi-node-bindings/src/lib.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Build (aarch64-apple-darwin)
  • GitHub Check: Build (aarch64-apple-ios-sim)
  • GitHub Check: Build (aarch64-unknown-linux-gnu)
  • GitHub Check: Build (armv7-linux-androideabi)
  • GitHub Check: Build (aarch64-pc-windows-msvc)
  • GitHub Check: Build (aarch64-apple-ios)
  • GitHub Check: Build (x86_64-apple-darwin)
  • GitHub Check: Build (x86_64-unknown-linux-gnu)
  • GitHub Check: Build (x86_64-linux-android)
  • GitHub Check: Build (aarch64-linux-android)
  • GitHub Check: Build (x86_64-pc-windows-msvc)
  • GitHub Check: Test (x86_64-unknown-linux-gnu)
  • GitHub Check: Test (x86_64-pc-windows-msvc)
  • GitHub Check: Test (x86_64-apple-darwin)
🔇 Additional comments (1)
livekit-ffi-node-bindings/src/lib.rs (1)

15-16: LGTM! Appropriate platform gating for Node FFI bindings.

The crate-level #![cfg(...)] attribute correctly restricts compilation to the three desktop platforms where Node.js native bindings are supported. This is a sensible approach to prevent CI failures on unsupported targets.

Note: Downstream crates that depend on this module will see an empty crate on unsupported platforms—ensure any such dependencies are also conditionally compiled or feature-gated accordingly.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@examples/local_video/Cargo.toml`:
- Around line 46-58: Remove the unconditional objc2 dependency entry from
Cargo.toml and leave objc2 only under the macOS target section; specifically
delete the top-level line "objc2 = { version = "0.6.0", features =
["relax-sign-encoding"] }" so that objc2 is only declared inside
[target.'cfg(target_os = "macos")'.dependencies] (where nokhwa and objc2 are
already declared), preventing builds on non‑Apple platforms from trying to
fetch/build objc2.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff6041e and ffd69de.

📒 Files selected for processing (3)
  • examples/local_video/Cargo.toml
  • examples/local_video/README.md
  • examples/local_video/src/list_devices.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test (x86_64-apple-darwin)
  • GitHub Check: Test (x86_64-unknown-linux-gnu)
  • GitHub Check: Test (x86_64-pc-windows-msvc)
🔇 Additional comments (6)
examples/local_video/README.md (4)

5-6: Clear desktop-only guidance.

Nice clarity on platform scope and feature requirement.


19-33: Publisher examples read well.

Commands align with the new feature gating and flag set.


37-37: No additional feedback.


48-62: No additional feedback.

examples/local_video/src/list_devices.rs (1)

30-67: Portable capability enumeration looks solid.

The flow is clean and the formatting/dedup logic is sensible.

examples/local_video/Cargo.toml (1)

7-24: Feature gating for desktop binaries is clear and consistent.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@ladvoc ladvoc self-requested a review January 28, 2026 02:04
Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

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

Builds pass now, LGTM

@ladvoc ladvoc merged commit be5cfc9 into main Jan 28, 2026
23 checks passed
@ladvoc ladvoc deleted the sxian/fix_CIs branch January 28, 2026 02:05
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.

2 participants