ultravideo / uvgRTP

An open-source library for RTP/SRTP media delivery
BSD 2-Clause "Simplified" License
318 stars 90 forks source link

Multiplexing packets based on protocol #191

Closed jrsnen closed 1 year ago

jrsnen commented 1 year ago

RFC 6189 states that ZRTP should be multiplexed in the same port as RTP. Currently, uvgRTP performs the ZRTP first, and then gives over the port to RTP, which is not correct.

Multiplexing should also probably be implemented in such a way that the user can get and further process messages that uvgRTP does not support, such as STUN messages used in performing ICE.

While implementing this, I would also implement the same for RTCP (#160), the main benefit with RTCP multiplexing is effectively halving the amount of sockets required by uvgRTP.

The multiplexing should be done in reception_flow.cc file.

altonen commented 1 year ago

Multiplexing was supported at least before, that was the whole point of primary and auxiliary handlers of the packet dispatcher. I don't know if that functionality has since been removed but it probably can be resurrected from old commits.

jrsnen commented 1 year ago

@altonen ok, thanks for the info. I didn't realize how this was implemented, so last year I added checks to handlers that discard packets that do not conform to said protocol, and this must be the problem with ZRTP. No need to revert any changes, just modifying those handlers (RTP and ZRTP), so they do nothing for wrong packets. I would have done this slightly differently, but the current implementation is fine.

Adding a way for users to get unprocessed packets would be nice still.

tampsa commented 1 year ago

Implemented/fixed by efe7d98