Skip to content

fix(pipewire): fill the framerate list for the format the properties show (#1068) - #3070

Merged
zackees merged 2 commits into
masterfrom
fix/1068-initial-framerate-list
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/1068-initial-framerate-list

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

Refs #1068 (part 2). Not Fixes: the property code is exercised under Xvfb by the Tier 2 cmocka test below, not by eye in a running OBS, so the report's own camera (Intel IPU3 behind libcamera) is still unverified.

Why

format_selected() returned early when parse_format() found no valid format in the settings — a source just added, or one saved before the field existed. The format list still labelled every camera format with its framerate (64x48 (1.33:1) - 30 FPS - YUYV422), but the framerate list was never filled: the dropdown was empty next to a label that named a framerate.

RED

test/cmocka/test_pipewire_camera_format_dedup.c, new case initial_settings_fill_framerate_list, on master in the Tier 2 Linux container (private PipeWire daemon, fake camera portal, fake camera with libcamera's param order):

[ RUN      ] initial_settings_fill_framerate_list
first format: 64x48 (1.33:1) - 30 FPS - YUYV422
framerate items: 0, enabled: 1
0 framerates listed under a format label that names one
[  FAILED  ] initial_settings_fill_framerate_list

The case also pins one entry per framerate: the fake camera repeats its default size, so the same framerate reaches camera_framerates() once per copy and showed up twice.

GREEN

[ RUN      ] initial_settings_fill_framerate_list
first format: 64x48 (1.33:1) - 30 FPS - YUYV422
framerate items: 1, enabled: 1
[       OK ] initial_settings_fill_framerate_list

format_selected() fills the framerate list for the first format the properties show and registers framerate_selected, so a pick still reaches the stream. The source's own format stays unset, so the stream negotiates one exactly as before — no restart, no pinned size. camera_framerates() now keeps one entry per framerate (append_framerate(), same value comparison as framerates_contain()).

Checks

  • Tier 2 Linux (rust/tools/linux-validate/run.py build tree), test_pipewire_camera* and test_pipewire_context_fail: 9/9 pass in both modes (libobs-c-reference and libobs).
  • clang-format --dry-run --Werror on both files: clean.
  • ./lint: the clang-format lane passes; the run ends on ci/test_check_changes.py failing with git: command not found in its own subprocess (environment, not this change).

Test cost

New cmocka case: 1.2 s wall in both modes, no threads of its own, one fake PipeWire stream plus the existing fixture. The test file's whole binary runs in 1.2 s (one new case, one existing).

Not done

Running OBS with the change and opening the camera's properties on the reporter's IPU3 camera — no libcamera hardware here. The label/list consistency case is the contract; if a camera still disagrees, its pw-dump belongs on the issue.

…ies show (#1068)

A source whose settings carry no valid "format" yet shows a format label that
names its framerate, while the framerate list beside it stays empty.

RED on master, run in the Tier 2 Linux container (private PipeWire daemon,
fake camera portal, both libobs modes):

  [ RUN      ] initial_settings_fill_framerate_list
  first format: 64x48 (1.33:1) - 30 FPS - YUYV422
  framerate items: 0, enabled: 1
  0 framerates listed under a format label that names one
  [  FAILED  ] initial_settings_fill_framerate_list

The case also pins one entry per framerate: the fake camera repeats its
default size, so the same framerate reaches the list twice.
…show (#1068)

When the source's settings hold no valid format yet (a source just added, or
one saved before the field existed), format_selected() returned early: the
format list still labelled the camera's formats, framerates included, but the
framerate list was never filled, so it showed nothing next to a label that
named a framerate.

Fill the list for the first format the properties show, and register the
framerate callback so a pick still reaches the stream. The source's own
format stays unset, so the stream negotiates one exactly as before.

camera_framerates() collects one entry per framerate now: a libcamera camera
repeats its default size's EnumFormat, so the same framerate arrived once per
copy and the list showed it twice.

GREEN, Tier 2 Linux container, both modes (libobs-c-reference and libobs):

  [ RUN      ] initial_settings_fill_framerate_list
  first format: 64x48 (1.33:1) - 30 FPS - YUYV422
  framerate items: 1, enabled: 1
  [       OK ] initial_settings_fill_framerate_list

The other eight pipewire camera and context cmocka tests pass in both modes.
@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Opened with the RED/GREEN evidence from the Tier 2 Linux container; watching CI.

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Coordinator review: LGTM. It addresses both points the closed #3053 left open:

  • RED → GREEN is shown from the Tier 2 container (0 → 1 framerate items), not "pending".
  • It no longer writes settings["format"] from the modified callback. The list is filled for the format shown first, and the source's own format stays unset, so the stream negotiates as before. No saved scene changes behind the user's back.

append_framerate deduplicates by value (30/1 == 60/2), which also fixes the doubled entries from libcamera's repeated EnumFormat. Using Refs rather than Fixes is honest, since the reporter's IPU3 camera hasn't been tested yet. The features line is present. Queue on green.

@zackees
zackees enabled auto-merge October 30, 2026 13:46
@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Status: CI green except Sanitize 🧪 / asan 🧪 (still running); auto-merge is on, so it queues when asan lands.

Evidence run locally, in this checkout's Tier 2 Linux build tree (same container the harness uses, private PipeWire daemon + Xvfb):

  • test_pipewire_camera_format_dedup: RED on master (framerate items: 0), GREEN with this branch (framerate items: 1), both libobs modes.
  • test_pipewire_camera* + test_pipewire_context_fail: 9/9 pass in both modes.
  • clang-format --dry-run --Werror clean on both touched files.

Not done here: the full local gate (./unittest) and the HEAD stamp. ./lint's clang-format lane passes but the run ends on ci/test_check_changes.py failing with git: command not found in its own subprocess (environment). So this is not stamped — CI is the gate.

@zackees
zackees added this pull request to the merge queue Oct 30, 2026
Merged via the queue into master with commit 8659a0d Oct 30, 2026
42 checks passed
@zackees
zackees deleted the fix/1068-initial-framerate-list branch October 30, 2026 14:54
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.

1 participant