You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the media action admission decisions in obs-source.c to obs-source #2239
Port the media action admission decisions in libobs/obs-source.c.h to rust/obs-source, as a new module media_admission. These decisions move:
In obs_source_media_play_pause, _restart, _stop, _next, _previous, _get_duration, _get_time, _set_time, _get_state, _started and _ended: whether the action is accepted. That means a valid source that is controllable (OBS_SOURCE_CONTROLLABLE_MEDIA) and has the matching callback. It also covers each getter's fallback value (0, OBS_MEDIA_STATE_NONE).
In process_media_actions: the action dispatch table, mapping each queued action to the callback it calls and the signal it emits.
These stay in C: the action queue and its mutex, the plugin callbacks, the signals, and the source refs.
obs-websocket reaches this path through TriggerMediaInputAction and SetMediaInputCursor.
Plan (one PR, separate commits)
A behaviour-neutral move into libobs/obs-source-media-admission.c.h, as hidden functions.
Characterization in test_source_media_admission_steps. It covers:
every action × controllable flag × callback present or absent;
each getter's fallback;
the dispatch for every action, plus a value outside the enum.
RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-source-media-admission group. Exported symbols are unchanged.
Tier 3 parity against the original C, exhaustive over the flags, plus a deliberate-break check and port_comparison numbers.
Every media and websocket media test must stay green on every lane: grep test/cmocka for media_ and ws_media.
Claiming: #2239, the media action admission decisions in libobs/obs-source.c.h, ported to rust/obs-source as media_admission.
Move the accept decisions of the obs_source_media_* functions, the getters' fallbacks and the process_media_actions dispatch into a hidden libobs/obs-source-media-admission.c.h, with no change in behaviour (exports stay 1766).
Characterization: test_source_media_admission_steps (every action × controllable flag × callback present/absent, each getter's fallback, every queued action plus one outside the enum).
RED: Tier 1 tests against todo!() shims.
GREEN: the safe core plus shims in a libobs.ported-source-media-admission group. The queue, its mutex, the callbacks, the signals and the refs stay C.
Tier 3: an oracle over the unchanged C, exhaustive parity, a mutation table and port_comparison numbers.
Docs.
I stay off the lines #2208 and #2215 touch. PR expected within a day.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2239, the media action admission decisions in
libobs/obs-source.c.h, ported torust/obs-sourceasmedia_admission.obs_source_media_*functions, the getters' fallbacks and theprocess_media_actionsdispatch into a hiddenlibobs/obs-source-media-admission.c.h, with no change in behaviour (exports stay 1766).test_source_media_admission_steps(every action × controllable flag × callback present/absent, each getter's fallback, every queued action plus one outside the enum).todo!()shims.libobs.ported-source-media-admissiongroup. The queue, its mutex, the callbacks, the signals and the refs stay C.port_comparisonnumbers.I stay off the lines #2208 and #2215 touch. PR expected within a day.
libobs: Move the media action admission decisions into obs-source-med…
test: Characterize the media action admission decisions
obs-source: Add Tier 1 tests for the media action admission port
obs-source: Port the media action admission decisions
obs-source: Check the media action admission port against the C
docs: Record the media action admission port
docs: Sort the media admission entry in the obs-source crate row
obs-source: Port the media action admission decisions (obs-rust#2257)