Skip to content

feat: add sample timeout for gscam stream recovery#108

Open
KirillHit wants to merge 1 commit into
ros-drivers:ros2from
KirillHit:ros2
Open

feat: add sample timeout for gscam stream recovery#108
KirillHit wants to merge 1 commit into
ros-drivers:ros2from
KirillHit:ros2

Conversation

@KirillHit

Copy link
Copy Markdown

Problem

gscam can hang indefinitely when a stream temporarily stops producing samples, so reopen_on_eof may never get a chance to reopen the pipeline. This was observed with looped RTSP streams that periodically restart.

Cause

gscam waits for frames with gst_app_sink_pull_sample(), which can block indefinitely if the RTSP pipeline stays alive but no new samples arrive. In that state, reopen_on_eof does not get a chance to reopen the stream.

Solution

Add an optional sample_timeout_ms parameter. When set, gscam uses gst_app_sink_try_pull_sample() with that timeout. If no sample is received, the loop exits and the existing reopen_on_eof logic restarts the stream. Default is 0, preserving the previous blocking behavior.

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