Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bacccf8
test(mcp): RED typed tool schema and structured result contract (#4445)
zackees Nov 9, 2026
a86793e
feat(mcp): typed tools, structured domain errors and schema snapshot …
zackees Nov 9, 2026
b23483d
docs(mcp): format generated schema by tool for review (#4445)
zackees Nov 9, 2026
c79b261
fix(mcp): preserve readiness errors and accurate operation hints (#4445)
zackees Nov 9, 2026
f988eb2
fix(mcp): retain legacy JSON text ordering and output descriptions (#…
zackees Nov 9, 2026
a11ee2a
test(mcp): RED device and pipeline counter baseline contract (#4446)
zackees Nov 9, 2026
bacedb8
feat(mcp): device, media and measured pipeline control (#4446)
zackees Nov 9, 2026
55af673
fix(mcp): guard camera readiness and track metric generations (#4446)
zackees Nov 9, 2026
278a1b1
style(mcp): format native readiness contract (#4446)
zackees Nov 9, 2026
861014e
test(mcp): RED deterministic condition waits and deadlines (#4447)
zackees Nov 9, 2026
7320a13
feat(mcp): bounded typed waits and start auto-wait (#4447)
zackees Nov 9, 2026
5213498
fix(mcp): reject late condition satisfaction after oversleep (#4447)
zackees Nov 9, 2026
a90961a
Merge branch 'infra/control-api-wait' into infra/control-api-transport
zackees Nov 9, 2026
3b16073
test(mcp): RED local endpoint contract (#4448)
zackees Nov 9, 2026
3754670
feat(mcp): attach to running OBS through private control sockets (#4448)
zackees Nov 9, 2026
c3dedb4
style(mcp): satisfy socket cleanup clippy gate (#4448)
zackees Nov 9, 2026
2a04faf
Merge remote-tracking branch 'origin/master' into infra/control-api-d…
zackees Nov 9, 2026
3f1ef1c
fix(mcp): bind calldata ABI without linking OBS implementations (#4446)
zackees Nov 9, 2026
4cf6042
Merge branch 'infra/control-api-domains' into infra/control-api-wait
zackees Nov 9, 2026
d1ff018
Merge branch 'infra/control-api-wait' into infra/control-api-transport
zackees Nov 9, 2026
1ab4670
Merge remote-tracking branch 'origin/master' into infra/control-api-d…
zackees Nov 10, 2026
a02b707
Merge branch 'infra/control-api-domains' into infra/control-api-wait
zackees Nov 10, 2026
9fb1f5b
Merge branch 'infra/control-api-wait' into infra/control-api-transport
zackees Nov 10, 2026
2cc0bcc
fix(mcp): type frontend capabilities and stop before scene cleanup (#…
zackees Nov 10, 2026
b30179d
test(mcp): RED cancellation drops buffered socket requests (#4448)
zackees Nov 10, 2026
3f4ee74
fix(mcp): stop dispatching buffered requests after cancellation (#4448)
zackees Nov 10, 2026
5fdef58
fix(mcp): preserve frontend output preparation when attached (#4448)
zackees Nov 10, 2026
1bde274
fix(mcp): preserve queued frontend start-stop ordering (#4448)
zackees Nov 10, 2026
f9e51fa
Merge remote-tracking branch 'origin/master' into infra/control-api-t…
zackees Nov 10, 2026
1c29021
test(ci): RED require isolated transition-video scheduling (#4468)
zackees Nov 10, 2026
7beb525
ci: GREEN isolate transition video timing fixture (#4468)
zackees Nov 10, 2026
caa0110
Merge remote-tracking branch 'origin/master' into infra/control-api-t…
zackees Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ci/shared-build-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ rust/obs-exit-watchdog/src/platform/mod.rs # new crate's platform boundary (#406
rust/obs-gpu-status/src/platform/mod.rs
rust/obs-graphics/src/platform/mod.rs
rust/obs-hotkey/build.rs
rust/obs-mcp-module/build.rs # Control transport/platform selector; native module ABI requires cross-platform checks (#4448).
rust/obs-mcp-module/src/platform/mod.rs # Control transport/platform selector; native module ABI requires cross-platform checks (#4448).
rust/obs-mcp/src/platform/mod.rs # Control transport/platform selector; native module ABI requires cross-platform checks (#4448).
rust/obs-media-io/src/platform/mod.rs
rust/obs-nvenc/src/platform/mod.rs
rust/obs-preflight/src/platform/mod.rs
Expand Down
8 changes: 7 additions & 1 deletion ci/test_sanitize_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def write_stub(directory: Path, name: str, body: str) -> Path:
TIMING_TESTS_D = (
"test_slideshow_mem_cap",
)
TIMING_TESTS_GRAPH = ("test_media_cover_art_monitor", "test_media_sync_offset_restart", "test_async_delay_audio", "test_dock_proportions", "test_dock_state_restart", "test_deinterlace_mode_load", "test_hotkey_capture_mnemonic", "test_volume_meter_ticker")
TIMING_TESTS_GRAPH = ("test_media_cover_art_monitor", "test_media_sync_offset_restart", "test_async_delay_audio", "test_dock_proportions", "test_dock_state_restart", "test_deinterlace_mode_load", "test_hotkey_capture_mnemonic", "test_volume_meter_ticker", "test_source_transition_video")
TEST_GRAPH = ROOT / "test" / "cmocka" / "build" / "test-graph.json"


Expand All @@ -147,6 +147,12 @@ def test_timing_tests_hold_the_timing_lock(self):
for name in TIMING_TESTS_GRAPH:
self.assertIn("timing", tests[name].get("resource_locks", []), name)

def test_transition_video_has_exclusive_ctest_scheduling(self):
# Its frame-bound callback assertions race a background texture trylock
# under competing native-graphics load (#4468).
test = json.loads(TEST_GRAPH.read_text(encoding="utf-8"))["tests"]["test_source_transition_video"]
self.assertTrue(test.get("run_serial"), "transition video must not compete with other CTest processes")

def test_a_resource_lock_runs_alone_in_the_pool(self):
payload = json.dumps(
{"tests": [{"name": "t", "command": ["/b/t"], "properties": [{"name": "RESOURCE_LOCK", "value": ["timing"]}]}]}
Expand Down
5 changes: 4 additions & 1 deletion ci/test_tier2_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"test_pipewire_screencast_shm": 90,
"test_screencast_portal_teardown": 60,
"test_vlc_audio_pacing": 120,
"test_source_transition_video": 120,
"test_xshm_resolution_change": 60,
}

Expand Down Expand Up @@ -107,7 +108,9 @@ def test_isolated_tests_can_overlap_without_losing_timeouts_or_cases(self):
name = test["name"]
properties = {p["name"]: p["value"] for p in test["properties"]}
with self.subTest(test=name):
exclusive = name.startswith("test_deinterlace_2x_field_order_") or (name == "test_xshm_resolution_change" and not wrapper)
exclusive = (name.startswith("test_deinterlace_2x_field_order_")
or name == "test_source_transition_video"
or (name == "test_xshm_resolution_change" and not wrapper))
self.assertEqual(bool(properties.get("RUN_SERIAL")), exclusive,
"Retain timing isolation and unisolated display mutation")
self.assertEqual(properties["TIMEOUT"], TIMEOUTS[name])
Expand Down
3 changes: 3 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -3066,3 +3066,6 @@ area.
*All platforms*, 2026-11-02. Follows
[#3491](https://github.com/obs-rust/obs-studio/pull/3491), epic
[#3283](https://github.com/obs-rust/obs-studio/issues/3283).

- **Control socket** (#4456): private Unix MCP endpoint, `--mcp-attach` stdio proxy,
and an in-app frontend module that controls the existing OBS instance.
21 changes: 21 additions & 0 deletions docs/rust-port/control-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,24 @@ Rust client and ci/vcam_av_sync.py MCP transport. Each slice targets master
from a fresh infra/control-api-* branch with RED then GREEN shared MCP tests.
The client reuses server types; Python retains websocket and adds --transport
mcp plus fallback. Real GUI/device validation runs only in bosn containers.

## Attach to the application

Build `soldr cargo build -p obs-mcp-module` and install the resulting
`libobs_mcp_module.so` in OBS's normal module search path. The module binds
`$XDG_RUNTIME_DIR/obs-studio-rust/control.sock` with mode 0600 in a private
directory. It shares the app's libobs and stops its worker on frontend scripting
shutdown, before scene cleanup (EXIT is a fallback). It never starts a second
OBS instance or changes the application's global coordinate mode.

`obs-studio-rust --mcp-attach [socket]` relays stdio to that instance. The same
newline JSON-RPC Server handles both transports. At most 32 clients share the
control thread; requests are serial, bounded to 16 MiB per buffered frame.
`wait_for` blocks the control thread, while OBS render/audio threads continue.
Windows named pipes are unsupported pending #4455.

For headless CI use `obs-studio-rust --mcp-listen [socket]` (native build).
Keep its stdin open for the test's lifetime; EOF stops the socket and libobs.
The attached backend resolves frontend scenes and output names on each call,
preserves coordinate settings, and queues scene changes through the graphics
thread so the frontend's UI mutation path cannot block shutdown.
2 changes: 1 addition & 1 deletion local-gate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ exclude = [
"docs/**", "**/*.md", "build-aux/**", "libobs-d3d11/**", "libobs-metal/**", "libobs-winrt/**",
"additional_install_files/**", "tools/**", "ci/**", ".github/**", ".claude/**", "rust/*/tests/**",
"rust/*/benches/**", "rust/*/examples/**", "rust/obs-c-oracle/**", "rust/obs-camera-busy/**", "rust/obs-exit-watchdog/**",
"rust/obs-fallback-warning/**", "rust/obs-gpu-status/**", "rust/obs-frontend/**",
"rust/obs-mcp-module/**", "rust/obs-fallback-warning/**", "rust/obs-gpu-status/**", "rust/obs-frontend/**",
]
keep = ["rust/*/Cargo.toml", "rust/obs-mcp/tests/**", "rust/obs-studio-rust/tests/**", "rust/obs-sys/tests/**"]

Expand Down
1 change: 1 addition & 0 deletions rust/obs-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ libc = { workspace = true, default-features = true }
cc = { workspace = true, default-features = true, features = ["parallel"] }

[dev-dependencies]
tempfile = { workspace = true, default-features = true }
schemars = { workspace = true, features = ["derive", "std"] }
serde = { workspace = true, features = ["derive"] }
obs-audio-monitoring = { path = "../obs-audio-monitoring" }
Expand Down
18 changes: 18 additions & 0 deletions rust/obs-mcp-module/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "obs-mcp-module"
version = "0.1.0"
description = "In-app local control module for OBS"
autotests = false
edition.workspace = true
rust-version.workspace = true
license.workspace = true
publish.workspace = true
[lib]
crate-type = ["cdylib"]
test = false
doctest = false
[lints]
workspace = true
[target.'cfg(unix)'.dependencies]
obs-mcp = { path = "../obs-mcp", features = ["libobs"] }
libloading = { workspace = true, default-features = true }
5 changes: 5 additions & 0 deletions rust/obs-mcp-module/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[path = "src/platform/link.rs"]
mod link;
fn main() {
link::configure();
}
27 changes: 27 additions & 0 deletions rust/obs-mcp-module/src/ffi/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use std::ffi::{c_char, c_void};
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_ver() -> u32 {
crate::platform::version()
}
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_set_pointer(_: *mut c_void) {}
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_load() -> bool {
crate::platform::load()
}
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_unload() {
crate::platform::unload();
}
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_name() -> *const c_char {
c"OBS Control API".as_ptr()
}
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_description() -> *const c_char {
c"Owner-only MCP socket for the running OBS instance".as_ptr()
}
#[unsafe(no_mangle)]
pub extern "C" fn obs_module_author() -> *const c_char {
c"obs-rust".as_ptr()
}
5 changes: 5 additions & 0 deletions rust/obs-mcp-module/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! Loadable OBS frontend control module. It never starts or shuts down libobs.
#![deny(unsafe_code)]
#[allow(unsafe_code, reason = "OBS module C ABI exports")]
mod ffi;
mod platform;
6 changes: 6 additions & 0 deletions rust/obs-mcp-module/src/platform/link.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub fn configure() {
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") {
println!("cargo:rustc-link-arg=-undefined");
println!("cargo:rustc-link-arg=dynamic_lookup");
}
}
4 changes: 4 additions & 0 deletions rust/obs-mcp-module/src/platform/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
std::cfg_select! {
unix => {mod unix; pub use unix::*;}
_ => {pub fn version()->u32{0} pub fn load()->bool{false} pub fn unload(){} }
}
Loading
Loading