Skip to content

fix: coordinate CEF initialization, browser tasks and unload - #1

Merged
zackees merged 5 commits into
masterfrom
feat/cef-context-ready
Oct 18, 2026
Merged

zackees merged 5 commits into
masterfrom
feat/cef-context-ready

Conversation

@zackees

@zackees zackees commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Coordinated with obs-rust/obs-studio#1333. This dependency fix lands before the parent PR is merged; its production commit is already selected by the parent pin.

Change

  • Reject ordinary CEF tasks until the browser context is ready, preventing calls into the versioned CEF API before initialization.
  • Register the local-file scheme factory from the context-ready callback.
  • Delete a source directly when it is destroyed before any CEF creation task could be accepted.
  • Signal initialization completion on success and failure. Unload waits for that outcome and posts quit after successful API initialization, including when the context is still starting. Failed initialization skips the CEF loop/shutdown.

Regression evidence

RED commits: 37bc20b (queue before initialization), 722370d / a9a56fd (real module immediate unload and private source early release).
Implementation: 0c3b700.

Linux x86_64, CEF 7871 / Chromium 150:

  • The queue test relinks actual original browser objects. Original aborts with CefTask_0_CToCpp called with invalid version -1; fixed rejects the task safely.
  • The lifecycle harness loads the actual module through libobs, starts CEF, then immediately unloads. Original aborts or times out (30 seconds on the final repeat); fixed exits 0.
  • A separate process creates and releases a private browser source during startup, then shuts down. Original aborts; fixed exits 0. Private ownership ensures the canvas cannot retain the source.
  • Final module/helper CMake reference build succeeds. This is a behavioral reference build, not the parent's replacement native builder.
  • clang-format 22.1.3, Ruff checks and diff checks pass; focused read-only lifecycle review is clean.

The staged Cargo-built frontend with this module creates a custom browser dock, navigates a local panel page and receives its JavaScript readiness title. The separate blank browser-source investigation is resolved for the disposable Linux test profile, as described below. The production startup fix alone did not resolve that credential-service integration issue.

Remaining validation

Linux startup/shutdown and staged application validation are complete. Windows/macOS runtime, normal desktop keyring integration and packaged applications remain unverified and are deferred with the parent prototype follow-ups in obs-rust/obs-studio#1332. These focused tests do not prove absence of leaks. New tests are documented in tests/README.md; existing tests and public OBS headers are unchanged.

Follow-up runtime diagnosis

CEF net logging shows the isolated desktop session's global persistent-cookie key load never completing, while the custom panel's separate cookie store completes. In a fresh disposable profile, --password-store=basic completes the global load and passes the unchanged browser-source green pixel and window.obsstudio.getCurrentScene callback checks, WebSocket checks, real frontend H264/AAC recording, saved profile and normal shutdown. A second run with basic storage and no net logging also passes. Both runs use the final rebuilt module/helper with this startup fix. Production credential-storage behavior is unchanged. The parent now passes the complete staged Cargo GUI checks against both C and Rust cores, including actual native dock pixels, browser source rendering/JavaScript, helper processes, recordings and saved configuration. A warm run passes with 226 hits and zero misses; its 77.56 s interval includes runtime checks, not just compilation. Normal desktop keyring integration remains unverified.

Real initialization-failure characterization

Test-only follow-up 4f26bda starts a real module holding a fresh profile, then a
second module using the same locked profile. Shutdown is released only after
CEF reports actual initialization failure (exit code 24). Both original and
fixed modules unload successfully. This verifies preservation of the failure
contract; it is not another unique RED regression. The parent remains pinned
to production commit 0c3b700.

Shipping validation

The maintainer requested landing the prototype and doing further validation afterward. Parent shipping head 26f33f149 passes the actual staged OBS application against both C/Rust cores with this production browser commit: browser/source/dock pixels, JavaScript/websocket behavior, profile/frontend recording and normal shutdown. The final native invocation completes successfully in440.60s including compilation/runtime. Required browser clang-format check is green; the earlier focused RED/GREEN/lifecycle review remains applicable. This merge preserves the production commit referenced by the parent gitlink.

zackees added a commit to obs-rust/obs-studio that referenced this pull request Oct 18, 2026
Preserve the browser runtime and JavaScript bridge checks against both core variants. Use a disposable basic-store profile for isolated GUI validation; production credential storage is unchanged. Depends on obs-rust/obs-browser#1. Full platform and packaging conversion remains in progress.
@zackees
zackees marked this pull request as ready for review October 18, 2026 04:40
@zackees
zackees merged commit b0f67b5 into master Oct 18, 2026
1 check passed
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 18, 2026
* test(build): define shared native build and plugin contracts (RED)

Refs obs-rust#1332. Both integration contracts fail because the shared-library backend is not implemented. Preserve the full application conversion and performance requirements in the build plan.

* build: compile and dynamically link native targets with cc::Build (GREEN)

Refs obs-rust#1332. Compile separate or unity C/C++ sources with cc::Build, link shared libraries with target-specific conventions and keep generated source paths explicit. Both native integration contracts and all-target clippy pass on Linux. Full libobs/application conversion remains in progress.

* test(build): require the bundled obs-sys crate to build real libobs (RED)

Refs obs-rust#1332. The bundled C API test fails at the explicitly unimplemented libobs backend. Move the existing source sets into a manifest shared with the CMake reference so the new native build does not maintain a divergent source list.

* feat(build): compile bundled Linux libobs through cc::Build

* test(build): require native C and Rust libobs twins

* feat(build): reuse common objects for the Rust libobs twin

* test(build): require real OBS filter and transition module loading

* feat(build): compile and load OBS filter and transition modules

* test(build): require the real native OpenGL renderer

* feat(build): compile OpenGL and render frames with both libobs variants

* test(build): require native executables linked to shared libraries

* feat(build): link native executables and preserve static archive inputs

* test(build): require x264, FFmpeg, and recording output modules

* feat(build): build recording modules and validate H264 AAC output

* test(build): require deployed FFmpeg mux helper and Matroska recording

* feat(build): deploy and exercise FFmpeg recording helper

* test(build): require image text capture audio and service modules

* feat(build): build common source and service modules with cc

* test(build): require native PipeWire module support

* feat(build): compile and load PipeWire with native graphics initialized

* test(build): require frontend API and Qt VST module

* feat(build): compile frontend API and Qt VST with explicit moc generation

* test(build): require separate C and C++ target flags

* feat(build): isolate C and C++ compiler options for mixed targets

* test(build): require Qt UI resources and real spinbox widgets

* feat(build): generate Qt UI resources and compile shared widgets

* test(build): require a Cargo-built OBS frontend executable

* feat(build): compile and link the Linux OBS frontend through cc

* test(build): require the real frontend GUI to start and close

* test(build): run the staged OBS GUI with both native cores

* test(build): require an actual frontend recording

* test(build): validate recording through the real OBS frontend

* test(build): require NVENC plugin twins and capability helper

* feat(build): build and exercise NVENC plugin twins through cc

* test(build): require NVENC in the staged GUI runtime

* test(build): exercise NVENC through the staged OBS frontend

* test(build): require the native OBS scripting graph

* feat(build): compile Lua and Python scripting with native runtime checks

* test(build): require the frontend Tools plugin graph

* feat(build): compile frontend Tools and exercise saved GUI scripts

* fix(build): normalize compiler paths and account for native test targets

* test(build): require the native websocket plugin and real wire behavior

* test(build): require Tier 2 to read canonical native source sets

* fix(build): derive Tier 2 exclusions from the shared source manifest

* feat(build): compile and exercise the native websocket server with cc

* test(build): require individual compilation of explicit unity groups

* test(ci): require uv before the Tier 2 manifest reader

* fix(ci): install uv in the stock Tier 2 job containers

* feat(build): compile libobs unity members as separate translation units

* test(build): require native VLC playlist playback in the staged app

* feat(build): compile VLC with optional runtime discovery and verify playback

* test(build): require building the unchanged C tests through cc

* feat(build): compile and run the native C test inventory with cc

* test(build): require compiled PCH with language and invalidation parity

* build: add optional compiled PCH to native Linux cores

* test(obs-sys): require configurable bundled native build modes

* build(obs-sys): configure bundled unity and PCH through Cargo

* test(build): require native browser module and CEF helper artifacts

* build: enable Linux CEF browser module and docks with cc::Build

Preserve the browser runtime and JavaScript bridge checks against both core variants. Use a disposable basic-store profile for isolated GUI validation; production credential storage is unchanged. Depends on obs-rust/obs-browser#1. Full platform and packaging conversion remains in progress.

* docs: record native build measurements with explicit job limits

* docs: record unity on and PCH off as the selected default

* docs: audit PCH requests and actual warm compiler execution

* test: require optional FDK AAC build and actual encoded recordings

* build: compile optional FDK AAC module through cc::Build

* test: require optional JACK and sndio native modules

* build: support JACK and sndio with real native audio capture checks

* docs: record JACK and sndio staged GUI validation

* test: require QSV native module and matching core capabilities

* build: add Linux QSV graph with unity PCH and CMake runtime parity

* test: require MP4 and MOV to honor disabled HEVC support

* fix: preserve MP4 MOV and VAAPI builds with HEVC disabled

* test: require the unchanged VLC compatibility suite in the Cargo graph

* build: run unchanged VLC compatibility tests through Cargo

* test: require graphics cmocka coverage in the Cargo graph

* build: add unchanged graphics audio compatibility tests to Cargo

* docs: record combined native graphics and VLC compatibility evidence

* test: expose uninitialized sub-sample audio buffering intervals

* fix: initialize audio interval before zero-tick buffering

* test: require the audio interval regression in the Cargo battery

* build: include the audio interval regression in the native Cargo battery

* docs: record fixed-core application and audio compatibility validation

* test: require the native WebRTC WHIP module and registrations

* build: compile and stream the Linux WebRTC module through cc build

* test: require the original standalone WHIP tests in the Cargo graph

* build: compile the unchanged WHIP clock and host tests through Cargo

* test: stage the native runner early and honor implicit GUI recording

* docs: defer remaining parity validation to follow-up 1390

* docs: clarify libdatachannel SDK version in build report
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