Skip to content

frontend: Preview the Enhanced Broadcasting encoding ladder - #181

Merged
zackees merged 3 commits into
obs-rust:masterfrom
nathan-v:frontend/eb-ladder-preview
Oct 11, 2026
Merged

zackees merged 3 commits into
obs-rust:masterfrom
nathan-v:frontend/eb-ladder-preview

Conversation

@nathan-v

@nathan-v nathan-v commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Refs #19

Split from #162. The read-only encoding ladder does not change how encoders are created, so it can land on its own. It is independent of #162.

What changed

  • Settings → Stream, Enhanced Broadcasting: Preview encoding ladder. It downloads the Go Live config for the settings on the page and does not start a broadcast.
  • The table is read-only. Columns are track, canvas, encoder, resolution, fps, bitrate, preset, tune, B-frames, and lookahead. Those cells are the service values. The encoder id is the video codec.
  • Custom RTMP previews the pasted config override. Twitch needs a stream key. Changing bitrate, tracks, canvas, key, VOD, or the override marks the table stale.
  • DownloadGoLiveConfig takes interactive_status. Preview passes false so a warning status does not open a continue-anyway dialog. Go Live still passes the default, true.
  • mtv_ladder_fill turns the parsed config into those rows. The Qt page and the download stay outside the test.

RED → GREEN

The stub returns empty: no rows, no bitrate total, and a blank config id.

  • RED a5775fccf. test_multitrack_ladder links that stub and does not link libobs or Qt. test_rungs_keep_order_resolution_and_codec fails because the row count is 0 instead of 2.
  • GREEN 3f74d0a6c. Four tests pass: rung order, resolution, and encoder id; fps and bitrate (including a fractional fps and a non-numeric bitrate); missing or invalid fields; an empty config, including the audio codec.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • Local gate passed and the pushed head is stamped
  • Intentional differences from C listed in the parity test header and rust/README.md (ports)

This machine has no Docker, so the cmocka CI lane and the local-gate stamp were not run. The new test was compiled and run locally with VS 2022 /W4 /WX (four tests, exit 0). RelWithDebInfo obs64.exe built with this change.

@zackees

zackees commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks for splitting this out of #162. Same requirement as there: a RED→GREEN test for the logic (docs/rust-port/coordination.md section 4). The UI and network parts can stay untested, but the part that turns a downloaded Go Live config (or a pasted Custom RTMP override) into the preview rows is pure logic. Please factor that into a small Qt-free function and add a test that fails first: rung order, resolution, fps, bitrate, codec, missing or invalid fields, and an empty config. New cmocka tests go in test/cmocka/tests.d/; avoid fail_msg().

@nathan-v
nathan-v requested a review from zackees as a code owner October 11, 2026 02:10
@nathan-v

Copy link
Copy Markdown
Contributor Author

The row formatting is now mtv_ladder_fill, a Qt-free function. The settings page calls it for a downloaded Go Live config and for a pasted Custom RTMP override. The download and the table widgets stay untested.

RED a5775fccf links an empty stub, so test_rungs_keep_order_resolution_and_codec stops with a row count of 0 instead of 2. GREEN 3f74d0a6c passes four tests: rung order, resolution, and the encoder id (the video codec); fps and bitrate; missing or invalid fields; and an empty config, including the audio codec. The test lives in test/cmocka/tests.d/ and does not use fail_msg().

I compiled it with VS 2022 /W4 /WX and a stand-in cmocka header, and both the RED executable (exit 1) and the GREEN executable (exit 0) behaved as described. RelWithDebInfo obs64.exe built with the helper wired in. This machine has no Docker, so the Tier 2 lane was not run. Please rebase onto master and stamp. The previous head was 8c7f23de9.

Settings, Stream can ask the service which encodes the current settings
would get, without starting a broadcast. The table is read-only and
shows the service values. Custom RTMP previews the pasted config
override. A preview download skips the continue-anyway status prompts.

Split from the encoder-override change. Refs obs-rust#19
mtv_ladder_fill is the Qt-free formatting of a Go Live config into
preview rows. The stub leaves that output empty, so
test_rungs_keep_order_resolution_and_codec stops because the row count
is 0 instead of 2. The other cases cover fps, bitrate, codec, missing
or invalid fields, and an empty config.

Refs obs-rust#19
mtv_ladder_fill keeps rung order and formats resolution, fps, bitrate,
and the encoder id. Missing settings become "-". An empty config has no
rows and no bitrate total. Settings calls it for a downloaded Go Live
config and for a pasted Custom RTMP override.

The cmocka tests added in the previous commit pass: four cases.

Refs obs-rust#19

Local-Gate: v1 tree=e1687730a67aed5761bad316ff9c57d07d0702c4 secs=194 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791685605,"gate":"rust/all/fmt","host":"linux-x86_64","key":"3f265d96d00bc45a3e6f6e41eeff26cd55672fbab83ee0d98cb27387cca87e57","lane":"lint","parents":["41b39ab546e1531202bdac8683153c44f862f282"],"secs":77,"stamp":"135f51b71929c48f545d5300831e8a08","tree":"e1687730a67aed5761bad316ff9c57d07d0702c4","v":1,"via":"run"}
Ci-Attestation: {"at":1791685605,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"3f265d96d00bc45a3e6f6e41eeff26cd55672fbab83ee0d98cb27387cca87e57","lane":"lint","parents":["41b39ab546e1531202bdac8683153c44f862f282"],"secs":77,"stamp":"07376efff4dffbd03963df2384fa7219","tree":"e1687730a67aed5761bad316ff9c57d07d0702c4","v":1,"via":"run"}
Ci-Attestation: {"at":1791685605,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"4f41bd2dddf7214d26dfba0fc449b9eb47edf90f66c8f6b84541f3cbcb93872b","lane":"rust-test","parents":["41b39ab546e1531202bdac8683153c44f862f282"],"secs":36,"stamp":"8dfff2d8be8f7efcda3492650b768c04","tree":"e1687730a67aed5761bad316ff9c57d07d0702c4","v":1,"via":"run"}
Ci-Attestation: {"at":1791685605,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"6f61f462a9d23b83e86933abdd610033cf2cc6d691ec0a5f48e6107c8ba191f4","lane":"tier2-linux","parents":["41b39ab546e1531202bdac8683153c44f862f282"],"secs":81,"stamp":"7cd001c150f8c620008ec6573d30a122","tree":"e1687730a67aed5761bad316ff9c57d07d0702c4","v":1,"via":"run"}
@zackees
zackees force-pushed the frontend/eb-ladder-preview branch from 3f74d0a to 7aab124 Compare October 11, 2026 02:26
@zackees

zackees commented Oct 11, 2026

Copy link
Copy Markdown
Member

Verified head 3f74d0a6c locally, then rebased onto master (which now includes #162) and stamped it. The new head is 7aab12490: RED 41b39ab54, GREEN 7aab12490.

  • RED (a5775fccf): Tier 2 OFF passed 48 of 49. test_multitrack_ladder failed all 4 tests against the empty stub.
  • GREEN (3f74d0a6c): Tier 2 passed 49 of 49 with ENABLE_RUST_LIBOBS OFF and 49 of 49 with it ON.
  • Local gate on the rebased head: lint, rust-test and tier2-linux all passed.

#162 added widgets at the same spot, so the rebase hit conflicts. I kept both sides in en-US.ini, OBSBasicSettings.cpp and OBSBasicSettings_Stream.cpp. In OBSBasicSettings.ui, #162's controls keep grid rows 7–10, and the Preview button, stale label, ladder table and status label move to rows 11–14. Please check the settings page layout on Windows when you can. CI will compile the frontend, but it can't look at the layout.

@zackees
zackees merged commit b7be9d6 into obs-rust:master Oct 11, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants