sgcWebRTC — the WebRTC Media Engine for Delphi & C++ Builder
Add real-time audio, video, screen sharing and data channels to your Delphi and C++ Builder apps, without touching a browser.
Add real-time audio, video, screen sharing and data channels to your Delphi and C++ Builder apps, without touching a browser.
sgcWebRTC does not add new palette components on top of sgcWebSockets — it unlocks the rest of the W3C-shaped surface on the same TsgcRTCPeerConnection class: signaling, connectivity, encryption, data channels and media all live on one object.
CreateOffer, CreateAnswer, SetLocalDescription, SetRemoteDescription and AddIceCandidate build and consume real SDP, so the peer at the other end can be a browser. You carry the SDP over whatever signaling channel you already have.
Trickle or non-trickle ICE gathering against RTCOptions.ICEServers, with server-reflexive candidates from STUN and relayed candidates from TURN when a direct path is blocked. OnICECandidate and OnConnectionStateChange track the transport.
Every session is secured the way WebRTC mandates: a DTLS handshake over the nominated ICE pair derives the SRTP keys, and every RTP, RTCP and SCTP packet on the connection is encrypted from the first packet.
CreateDataChannel opens an ordered or unordered, reliable or partially-reliable channel (RFC 8831/8832) over SCTP-over-DTLS. Send, SendBytes and the OnMessage / OnMessageBinary events move text and binary payloads.
AddTrack attaches an Opus or G.711 audio track, or a VP8, H.264 or Motion JPEG video track; SendPCM and SendVideoFrame push captured media in, OnAudio and OnVideoFrame deliver the decoded remote track.
A delay-based estimator in the style of Google Congestion Control tracks the link and drives the video encoder's target bitrate, backed by RTCP NACK/PLI retransmission, RFC 4588 RTX and RED/ULPFEC, the same toolbox a browser uses on a lossy network.
sgcWebRTC does not add a new class to the palette. It is the same TsgcRTCPeerConnection component that ships in sgcWebSockets Enterprise, with the SDP, SCTP, RTP and SRTP surface unlocked on top of the ICE/TURN connectivity Enterprise already gives you.
Manual SDP signaling, ICE/TURN connectivity, DTLS-SRTP encryption, SCTP data channels and RTP audio/video tracks on one component. Renegotiation, ICE restart and the W3C perfect-negotiation glare rule are built in.
View component →Set an ICE server, hook the SDP and ICE events, open a data channel, then create the offer. The same API in Delphi and C++ Builder.
uses
sgcP2P;
var
oRTC: TsgcRTCPeerConnection;
begin
oRTC := TsgcRTCPeerConnection.Create(nil);
oRTC.RTCOptions.ICEServers.AddURL('stun:stun.l.google.com:19302');
oRTC.OnLocalDescription := OnLocalDescriptionHandler;
oRTC.OnICECandidate := OnICECandidateHandler;
oRTC.OnConnectionStateChange := OnConnectionStateChangeHandler;
oRTC.OnDataChannel := OnDataChannelHandler;
oRTC.CreateDataChannel('chat'); // forces RTCOptions.DTLS on
oRTC.CreateOffer; // gathers ICE candidates, builds the SDP offer
end;
procedure TForm1.OnLocalDescriptionHandler(Sender: TObject;
const aType, aSDP: string);
begin
// send aType + aSDP to the remote peer over your own signaling channel
end;
procedure TForm1.OnDataChannelHandler(Sender: TObject;
aChannel: TsgcRTCDataChannel);
begin
aChannel.OnMessage := OnChannelMessageHandler;
aChannel.Send('hello');
end;
// includes: sgcP2P.hpp
TsgcRTCPeerConnection *oRTC = new TsgcRTCPeerConnection(NULL);
oRTC->RTCOptions->ICEServers->AddURL("stun:stun.l.google.com:19302");
oRTC->OnLocalDescription = OnLocalDescriptionHandler;
oRTC->OnICECandidate = OnICECandidateHandler;
oRTC->OnConnectionStateChange = OnConnectionStateChangeHandler;
oRTC->OnDataChannel = OnDataChannelHandler;
oRTC->CreateDataChannel("chat"); // forces RTCOptions->DTLS on
oRTC->CreateOffer(); // gathers ICE candidates, builds the SDP offer
void __fastcall TForm1::OnLocalDescriptionHandler(TObject *Sender,
const String aType, const String aSDP)
{
// send aType + aSDP to the remote peer over your own signaling channel
}
void __fastcall TForm1::OnDataChannelHandler(TObject *Sender,
TsgcRTCDataChannel *aChannel)
{
aChannel->OnMessage = OnChannelMessageHandler;
aChannel->Send("hello");
}
A standards-based media engine, not a proprietary transport.
Interactive Connectivity Establishment candidate gathering and nomination, and the STUN binding requests behind it. Exposed through TsgcICEClient and consumed automatically by TsgcRTCPeerConnection.
Relayed candidates through a TURN server when a direct or server-reflexive path is not reachable, via TsgcTURNClient.
The DTLS handshake that authenticates the peer connection and derives the SRTP keying material for encrypted media.
SCTP over DTLS with the DCEP open handshake, stream id parity by DTLS role, and ordered / partially-reliable delivery.
Real-time transport for audio and video and its encrypted profile, with RTCP sender/receiver reports, NACK, PLI and REMB feedback.
The offer/answer state machine behind CreateOffer / CreateAnswer / SetLocalDescription / SetRemoteDescription, including renegotiation and glare resolution.
sgcWebRTC is licensed as an add-on. All licenses include full source code, 1 year of updates and a 70% renewal discount.
€299
Single, Team and Site licenses available. Full source code included.
★ Requires sgcWebSockets Enterprise
Not available for Standard or Professional. Also included in the All-Access bundle.
View Pricing & OrderThe questions developers ask before adding real-time audio, video or data channels to a Delphi or C++ Builder application.
TsgcRTCPeerConnection component for ICE/TURN connectivity; sgcWebRTC adds the media engine on top of it — manual SDP offer/answer, DTLS-SRTP encrypted transport, SCTP data channels, and Opus/G.711 audio with VP8/H.264 video — so the component can actually open a peer connection with a browser and exchange media, not just relay signaling messages.CreateOffer / CreateAnswer build standard SDP and SetLocalDescription / SetRemoteDescription / AddIceCandidate consume it, following the JSEP state machine (RFC 8829) a browser expects. You carry the SDP and candidates over your own signaling channel, exactly as a browser application does through its signaling server.CreateDataChannel opens an RTCDataChannel over SCTP-over-DTLS (RFC 8831/8832), ordered or unordered, reliable or with a retransmit or lifetime limit. OnDataChannel fires for a channel the remote peer opened, and Send / SendBytes move text or binary payloads once the channel is open.TWebBrowser/TEdgeBrowser control) and driving its JavaScript WebRTC stack from Pascal. sgcWebRTC does not: TsgcRTCPeerConnection is compiled Object Pascal calling the operating system's own media APIs directly (Media Foundation on Windows, VideoToolbox on iOS/macOS, MediaCodec on Android), with no browser runtime, no embedded Chromium binary and no JavaScript bridge in the process. That keeps the binary small and lets the same component run on Android and iOS, and in headless services or kiosk devices with no browser installed at all.TsgcWSProtocol_WebRTC_Server) for the classic AppRTC-style browser-to-browser demo, but no .NET equivalent of TsgcRTCPeerConnection. sgcWebRTC itself is Delphi and C++ Builder only.Pair sgcWebRTC with our other Delphi, C++ Builder and .NET component libraries.
Enterprise WebSocket, HTTP/2, MQTT, AMQP and AI/LLM components. sgcWebRTC is an add-on to sgcWebSockets Enterprise.
Learn more →QUIC (RFC 9000) and HTTP/3 (RFC 9114) client and server components on the native OpenSSL 3.5 QUIC engine.
Learn more →89 data-aware server-side HTML/UI components for Delphi, C++ Builder and .NET, with Bootstrap 5 and htmx.
Learn more →Enterprise digital signatures — XAdES, PAdES, CAdES and ASiC with 10 key providers and 21 EU country profiles.
Learn more →OpenAPI 3.0 parser and SDK generator. Turn any OpenAPI spec into a strongly-typed Delphi client in seconds.
Learn more →Native Windows Hello, fingerprint and Windows Biometric Framework components for Delphi and C++ Builder.
Learn more →Updated Indy TCP/IP components with modern TLS, IPv6 and HTTP/2 support for Delphi 7 through 13.
Learn more →15 AI, LLM and MCP components for Delphi and C++ Builder. One chat component reaches OpenAI, Anthropic, Gemini, DeepSeek, Ollama, Grok and Mistral.
Learn more →MQTT 3.1.1 and 5.0, AMQP 0.9.1, AMQP 1.0, Apache Kafka and STOMP client components for Delphi and C++ Builder.
Learn more →