Skip to content

Add a way to get RTSP status#31

Open
PulpFiction-Jeson wants to merge 1 commit into
jimm98y:mainfrom
PulpFiction-Jeson:main
Open

Add a way to get RTSP status#31
PulpFiction-Jeson wants to merge 1 commit into
jimm98y:mainfrom
PulpFiction-Jeson:main

Conversation

@PulpFiction-Jeson

@PulpFiction-Jeson PulpFiction-Jeson commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

1.Add a way to get RTSP status
2.Reset the state when you actively call Stop()

Reason for change:
When doing real-time preview and switching of multiple streams, you can create and reuse RTSPClient instances in advance. Call connect when you need to play, and call stop when you don't. Before calling, you can use rtspstatus to check the status of the current instance to avoid repeated calls and some errors.

Copilot AI review requested due to automatic review settings July 20, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a public way to query an RTSPClient instance’s RTSP connection status and resets the internal status state when Stop() is called, supporting scenarios where a client instance is reused across multiple stream switches.

Changes:

  • Exposes RtspStatus publicly and adds a public API to retrieve the current status.
  • Resets _rtspSocketStatus to WaitingToConnect when Stop() is called.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +360 to +363
public RtspStatus GetRtspStatus()
{
return _rtspSocketStatus;
}
Comment on lines 459 to 463
public void Stop()
{
StopClient();
_rtspSocketStatus = RtspStatus.WaitingToConnect;
}
@PulpFiction-Jeson

Copy link
Copy Markdown
Contributor Author

In my project, there are many plans (a plan represents which streams are shown on several monitors, or something similar). For each stream, I create an RTSP client instance, each with its own thread, constantly checking whether the stream needs to connect() or stop(). Without this status, there's no way to tell.

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.

2 participants