How openipc/webrtc-c works
This is Amazon’s pure-C Kinesis Video Streams WebRTC client. The principal workflow is to create a signaling client, exchange session descriptions and ICE information with a remote peer, establish ICE connectivity, then transport encrypted real-time media and optional data channels. The graph also preserves documented codec and media-pipeline capabilities. Several relationships and subsystem internals are inferred from documented capabilities or unsampled modules; those links are dashed rather than presented as inspected call paths.
Main entry points: PeerConnection.c Peer connection · IceAgent.c ICE agent · RtpPacket.c RTP packet handling · Dtls.c DTLS
Components 26
KVS signaling
- Signaling client
src/source/Signaling/Client.c - Signaling state and API
src/source/Signaling/Signaling.c - WebSocket/API calls
src/source/Signaling/LwsApiCalls.c
Peer negotiation
- Peer connection
src/source/PeerConnection/PeerConnection.c - Session descriptions
src/source/PeerConnection/SessionDescription.c - SDP serialization
src/source/Sdp/Serialize.c - SDP parsing
src/source/Sdp/Deserialize.c
ICE connectivity
- ICE agent
src/source/Ice/IceAgent.c - ICE state machine
src/source/Ice/IceAgentStateMachine.c - STUN
src/source/Stun/Stun.c - TURN relay
src/source/Ice/TurnConnection.c - Network sockets
src/source/Ice/SocketConnection.c
Media and data transport
- RTP packet handling
src/source/Rtp/RtpPacket.c - Audio/video payloaders
src/source/Rtp/Codecs - RTCP and feedback
src/source/PeerConnection/Rtcp.c - Jitter buffering
src/source/PeerConnection/JitterBuffer.c - NACK retransmission
src/source/PeerConnection/Retransmitter.c - Data channels
src/source/PeerConnection/DataChannel.c - SCTP transport
src/source/Sctp/Sctp.c - Connection metrics
src/source/Metrics/Metrics.c
Secure transport
- DTLS
src/source/Crypto/Dtls.c - SRTP sessions
src/source/Srtp/SrtpSession.c - Crypto backends
src/source/Crypto/Crypto.c
Other components
- WebRTC application
- Kinesis Video Streams
- Remote WebRTC peer
Connections 30
- WebRTC application → Signaling client: creates client
src/source/Signaling/Client.c - Signaling client → Signaling state and API: manages signaling
- Signaling state and API → WebSocket/API calls: uses API calls
- WebSocket/API calls → Kinesis Video Streams: exchanges signaling
- Signaling state and API → Peer connection: delivers negotiation
- Peer connection → Session descriptions: handles descriptions
src/source/PeerConnection/SessionDescription.c - Session descriptions → SDP serialization: serializes SDP
- Session descriptions → SDP parsing: parses SDP
- Peer connection → ICE agent: coordinates connectivity
- ICE agent → ICE state machine: tracks ICE state
- ICE agent → STUN: checks candidates
- ICE agent → TURN relay: uses relay
src/source/Ice/IceAgent.c - ICE agent → Network sockets: opens sockets
src/source/Ice/IceAgent.c - STUN → Remote WebRTC peer: tests connectivity
- Peer connection → DTLS: secures connection
- DTLS → SRTP sessions: provides media keys
- Crypto backends → DTLS: supports cryptography
- WebRTC application → Peer connection: configures media
- Peer connection → RTP packet handling: handles RTP
- Audio/video payloaders → RTP packet handling: payloads media
- RTP packet handling → SRTP sessions: encrypts packets
- Peer connection → RTCP and feedback: handles feedback
- Peer connection → Jitter buffering: buffers received frames
- RTCP and feedback → NACK retransmission: requests retransmission
- Peer connection → Data channels: offers data channels
- Data channels → SCTP transport: uses SCTP
- SCTP transport → DTLS: uses secure transport
- Peer connection → Connection metrics: records metrics
- RTP packet handling → Remote WebRTC peer: exchanges media
- Data channels → Remote WebRTC peer: exchanges data