mirror of
https://github.com/ossrs/srs.git
synced 2025-11-24 03:44:02 +08:00
This PR refactors the stream bridge architecture in SRS to improve code organization, type safety, and maintainability by replacing the generic ISrsStreamBridge interface with protocol-specific bridge classes and target interfaces. 1. New Target Interface Architecture: - Introduces ISrsFrameTarget for AV frame consumers (RTMP sources) - Introduces ISrsRtpTarget for RTP packet consumers (RTC sources) - Introduces ISrsSrtTarget for SRT packet consumers (SRT sources) 2. Protocol-Specific Bridge Classes: - SrsRtmpBridge: Converts RTMP frames to RTC/RTSP protocols - SrsSrtBridge: Converts SRT packets to RTMP/RTC protocols - SrsRtcBridge: Converts RTC packets to RTMP protocol 3. Simplified Bridge Management: - Removes the generic SrsCompositeBridge chain pattern - Each source type now uses its appropriate bridge type directly With this improvement, you are able to implement very complex bridge and protocol converting, for example, you can bridge RTMP to RTC with opus audio when you support enhanced RTMP with opus. Another plan is to support bridging RTC to RTSP, directly without converting RTP to media frame packet, but directly deliver RTP packet from RTC source to RTSP source. --------- Co-authored-by: OSSRS-AI <winlinam@gmail.com>