avformat/whep: add SDP offer/answer generation for WHEP demuxer - #81
Open
Nariman-Sayed wants to merge 4 commits into
Open
avformat/whep: add SDP offer/answer generation for WHEP demuxer#81Nariman-Sayed wants to merge 4 commits into
Nariman-Sayed wants to merge 4 commits into
Conversation
Add certificate_key_init(), initialize(), generate_sdp_offer(), exchange_sdp() and parse_answer(), covering the offer/answer phase of the WHEP (WebRTC-HTTP Egress Protocol) demuxer. Uses the shared RTCContext for ICE state (ufrag/pwd, remote candidate), matching the current whip.c layout. Not yet included: whep_init() entry point, FFInputFormat registration, ICE/DTLS/SRTP, RTP receive. These are deferred to follow-up commits. Signed-off-by: Nariman Sayed <narimansayed28@gmail.com>
Chain the existing offer/answer functions into whep_init(), and register the WHEP demuxer (ff_whep_demuxer) in allformats.c, Makefile, and configure. read_packet() is a stub (AVERROR(ENOSYS)). RTP receive is deferred to a follow-up commit. Tested end-to-end against a real SRS server: offer/answer exchange, ICE candidate parsing, and DTLS fingerprint validation all succeed (WHEP_STATE_NEGOTIATED reached). Stream creation fails as expected since read_packet is not yet implemented. Signed-off-by: Nariman Sayed <narimansayed28@gmail.com>
Open the UDP transport to the remote ICE candidate parsed from the SDP answer, chained into whep_init() after parse_answer(). Tested against a real SRS server: UDP socket connects successfully to the negotiated candidate address. Signed-off-by: Nariman Sayed <narimansayed28@gmail.com>
Add STUN binding request/response handling and DTLS handshake initiation for WHEP, adapted from whip.c's implementation. is_dtls_active is hardcoded to active for now rather than parsed from the peer's a=setup: line in the SDP answer. SRS always answers with a=setup:passive, so this is correct against it, but reading the real a=setup: value is a follow-up improvement. Tested end-to-end against a real SRS server: ICE STUN completes, DTLS handshake finishes successfully. Signed-off-by: Nariman Sayed <narimansayed28@gmail.com>
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.
Add certificate_key_init(), initialize(), generate_sdp_offer(), exchange_sdp() and parse_answer(), covering the offer/answer phase of the WHEP (WebRTC-HTTP Egress Protocol) demuxer.
Uses the shared RTCContext for ICE state (ufrag/pwd, remote candidate), matching the current whip.c layout.
Not yet included: whep_init() entry point, FFInputFormat registration, ICE/DTLS/SRTP, RTP receive. These are deferred to follow-up commits.