Skip to content

refactor(srt): unify property order, expose resilience knobs on inputs, share defaults#553

Merged
srperens merged 4 commits intomainfrom
refactor/srt-blocks-properties-and-order
May 7, 2026
Merged

refactor(srt): unify property order, expose resilience knobs on inputs, share defaults#553
srperens merged 4 commits intomainfrom
refactor/srt-blocks-properties-and-order

Conversation

@srperens
Copy link
Copy Markdown
Collaborator

@srperens srperens commented May 7, 2026

Continues #552 (closed when its branch was renamed for clarity).

Summary

The four SRT-related blocks (efpsrt + mpegtssrt × input + output) had drifted apart over time:

  • inputs lacked the resilience knobs (keep-listening, auto-reconnect, wait-for-connection) that outputs already had
  • defaults for those knobs were repeated as inline literals across files
  • the property display order in the frontend was different across blocks, even for properties that exist in all four

This PR cleans all of that up.

Changes

1. Expose three resilience properties on SRT inputs

On both efpsrt_input and mpegtssrt_input:

  • keep_listening (default true) — keep srtsrc alive after peer disconnect so reconnects don't require a flow restart
  • auto_reconnect (default true) — auto-reconnect on connection failure
  • wait_for_connection (default false) — do NOT block pipeline state on peer presence (upstream srtsrc default is true, but that deadlocks PAUSED→PLAYING when the peer is offline)

Each is gated by srtsrc.has_property(...) for compatibility with older gst-plugins-bad versions that lack the property. keep_listening was already exposed on efpsrt_input but is new on mpegtssrt_input; the other two are new on both.

2. Share boolean defaults via strom-types

Three new constants in types/src/block.rs, matching the existing pattern for DEFAULT_SRT_INPUT_URI etc:

  • DEFAULT_SRT_KEEP_LISTENING = true
  • DEFAULT_SRT_AUTO_RECONNECT = true
  • DEFAULT_SRT_WAIT_FOR_CONNECTION = false

All four SRT blocks (input + output) now reference these constants instead of repeating literal values. No behavior change — previous inline literals matched these values exactly.

3. Unified property display order across all 4 SRT blocks

The frontend renders `exposed_properties` in declared order with no sorting, so the only fix is to keep declaration order consistent across blocks. New unified prefix:

# All 4 blocks
1 num_video_tracks
2 num_audio_tracks
3 srt_uri
4 latency
5 wait_for_connection
6 auto_reconnect
7 keep_listening (input only — srtsink doesn't expose it)
8 decode (inputs only)

Then block-specific properties follow the prefix:

  • `efpsrt_input`: bucket_timeout, hol_timeout, normalize_segment
  • `mpegtssrt_input`: tsdemux_latency, ignore_pcr
  • `efpsrt`: sync, mtu
  • `mpegtssrt`: sync

Previously the inputs had num_video_tracks / num_audio_tracks at the bottom and the new resilience props in the middle, which was inconsistent with the outputs and pushed the track-count properties from "near top" to "near bottom" in the frontend.

Test plan

  • `cargo check` clean
  • `cargo fmt` clean
  • `cargo test --test openapi_test` clean
  • Pre-commit (fmt + clippy + secret scan) passes
  • Verify on `str` host: SRT input survives peer drop and reconnects without flow restart
  • Verify in browser GUI: properties display in the unified order across all 4 SRT blocks

🤖 Generated with Claude Code

Per Enstedt and others added 4 commits May 7, 2026 10:57
…ection

Mirror the resilience knobs that already exist on the SRT output blocks
(efpsrt, mpegtssrt) onto the input blocks (efpsrt_input, mpegtssrt_input).

Three new properties on both input blocks, all defaulting to a
production-friendly value:

- **keep_listening** (default true): keep the SRT source alive after
  a peer disconnect so reconnects work without flow restart. Was
  already exposed on efpsrt_input; added to mpegtssrt_input.

- **auto_reconnect** (default true): srtsrc reconnects on connection
  failure. Same semantics and default as on the output blocks. New
  on both input blocks.

- **wait_for_connection** (default false): do NOT block pipeline state
  changes waiting for a peer. Upstream srtsrc default is `true`, but
  we override to `false` to match the output blocks and avoid
  deadlocking PAUSED→PLAYING transitions when the peer is offline.
  New on both input blocks.

Each is gated by `srtsrc.has_property(...)` so we don't break against
older gst-plugins-bad versions that lack the property.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n defaults

Move the three boolean SRT defaults into strom-types so all four SRT
blocks (efpsrt + mpegtssrt × input + output) reference the same
constants instead of repeating literal values:

- DEFAULT_SRT_KEEP_LISTENING = true
- DEFAULT_SRT_AUTO_RECONNECT = true
- DEFAULT_SRT_WAIT_FOR_CONNECTION = false

This matches the existing pattern for DEFAULT_SRT_INPUT_URI,
DEFAULT_SRT_OUTPUT_URI, and DEFAULT_SRT_LATENCY_MS.

No behavior change — the previous inline literals matched these values
exactly. The user-visible win is that future tweaks happen in one
place and are guaranteed consistent across input and output blocks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reorder ExposedProperty entries in efpsrt_input and mpegtssrt_input so the
first 6 properties match the SRT output blocks (efpsrt, mpegtssrt). The
unified prefix is now:

  1. num_video_tracks
  2. num_audio_tracks
  3. srt_uri
  4. latency
  5. wait_for_connection
  6. auto_reconnect
  (7. keep_listening on inputs only — srtsink doesn't expose it)

Then block-specific properties follow:
  - efpsrt_input:    decode, bucket_timeout, hol_timeout, normalize_segment
  - mpegtssrt_input: tsdemux_latency, ignore_pcr, decode
  - efpsrt:          sync, mtu
  - mpegtssrt:       sync

Previously the inputs had num_video_tracks / num_audio_tracks at the bottom
and the SRT-resilience props sandwiched in the middle, which jumped the
track-count properties from "near top" (output convention) to "near bottom"
in the frontend rendering. The frontend renders properties in declared
order with no sorting, so the only fix is to keep the source order
consistent across blocks.

No behavior change — only ExposedProperty declaration order moves.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Place 'decode' at the same position (#8, right after the SRT-resilience
group) as it sits in efpsrt-input. Now both input blocks have identical
prefix ordering through 'decode' (the block-specific tail differs after).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@srperens srperens merged commit 6606142 into main May 7, 2026
14 checks passed
@srperens srperens deleted the refactor/srt-blocks-properties-and-order branch May 7, 2026 13:51
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