Feature: Add Lightweight ONVIF Support for RTSP Server Discovery#354
Open
SB2318 wants to merge 2 commits into
Open
Feature: Add Lightweight ONVIF Support for RTSP Server Discovery#354SB2318 wants to merge 2 commits into
SB2318 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a lightweight, non-conformant ONVIF server for RTSP streaming mode. It enables ScreenStream to be automatically discovered by Network Video Recorders (NVRs) and Video Management Software (VMS) on the local network.
Fixes #346
Key Features
WS-Discovery Support
Implemented UDP multicast discovery:
239.255.255.250FF02::C3702This allows automatic device discovery on the local network.
SOAP HTTP Server
Added a lightweight SOAP server running on
RTSP_PORT + 1000(default:9554) to handle core ONVIF Profile T/S requests.Multicast Management
Added proper permission handling and
MulticastLockmanagement to improve multicast reliability across Android versions and device manufacturers.UI Integration
Added a real-time counter in the RTSP Server UI to provide visual feedback whenever an ONVIF probe or request is received.
Technical Details
rtsp,appOnvifServer.kthandles low-level XML/SOAP routing without external heavy libraries, keeping the app lightweight.RtspServerlifecycle and starts/stops automatically when streaming begins or ends.android.permission.CHANGE_WIFI_MULTICAST_STATEto allow multicast packet reception.Proposed Changes
rtspOnvifServer.kt— Core implementation for WS-Discovery and SOAP handlersRtspServer.kt— Integrated ONVIF server startup/shutdownRtspStreamingService.kt— Added event handling for ONVIF request trackingmodels.kt— AddedonvifServerMessagesCounttoRtspStateRtspMainScreenUI.kt— Updated UI cards to display ONVIF request counterappAndroidManifest.xml— Added required multicast permissionVerification Report
Environment
Test Results
ProbeMatch"ScreenStream ONVIF Server""Profile_1"(Main Stream)rtsp://<ip>:<port>/<path>Status: Ready for Review