Skip to content

feat(srt): expose keep-listening, auto-reconnect, wait-for-connection on input blocks; share defaults across all SRT blocks#552

Closed
srperens wants to merge 4 commits intomainfrom
feat/srt-input-keep-listening-auto-reconnect
Closed

feat(srt): expose keep-listening, auto-reconnect, wait-for-connection on input blocks; share defaults across all SRT blocks#552
srperens wants to merge 4 commits intomainfrom
feat/srt-input-keep-listening-auto-reconnect

Conversation

@srperens
Copy link
Copy Markdown
Collaborator

@srperens srperens commented May 7, 2026

Summary

Mirror the SRT resilience knobs that already exist on the SRT output blocks (efpsrt, mpegtssrt) onto the input blocks (efpsrt_input, mpegtssrt_input), and centralise the boolean defaults in strom-types so all four SRT blocks reference the same constants.

Changes

Three properties exposed on both SRT input blocks (efpsrt_input, mpegtssrt_input):

  • keep_listening (default true) — keep srtsrc alive after peer disconnect
  • auto_reconnect (default true) — auto-reconnect on connection failure
  • wait_for_connection (default false) — do NOT block pipeline state on peer presence

Each is gated by srtsrc.has_property(...) for compatibility with older gst-plugins-bad versions that lack the property.

Shared defaults moved to strom-types (types/src/block.rs):

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

All four SRT blocks (efpsrt + mpegtssrt × input + output) now reference these constants instead of repeating literal values, matching the existing pattern for DEFAULT_SRT_INPUT_URI / DEFAULT_SRT_OUTPUT_URI / DEFAULT_SRT_LATENCY_MS.

Why these defaults

  • keep_listening=true: reconnects don't require a flow restart on the listener side
  • auto_reconnect=true: handles transient network drops automatically
  • wait_for_connection=false: upstream srtsrc defaults to true which deadlocks PAUSED→PLAYING when the peer is offline; we override consistently across all SRT blocks

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

🤖 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 closed this May 7, 2026
@srperens srperens deleted the feat/srt-input-keep-listening-auto-reconnect branch May 7, 2026 09:36
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