From 97cf7634208bbc87c491b299f5636ead7e965804 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 12 Dec 2017 21:40:09 +0530 Subject: [PATCH] sendrecv: Add a Google STUN server to the configuration Without this, the example will only work on link-local and localhost networks. --- webrtc/sendrecv/gst/webrtc-sendrecv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webrtc/sendrecv/gst/webrtc-sendrecv.c b/webrtc/sendrecv/gst/webrtc-sendrecv.c index bab104702e..c823f651c9 100644 --- a/webrtc/sendrecv/gst/webrtc-sendrecv.c +++ b/webrtc/sendrecv/gst/webrtc-sendrecv.c @@ -250,6 +250,7 @@ on_negotiation_needed (GstElement * element, gpointer user_data) g_signal_emit_by_name (webrtc1, "create-offer", NULL, promise); } +#define STUN_SERVER " stun-server=stun://stun.l.google.com:19302 " #define RTP_CAPS_OPUS "application/x-rtp,media=audio,encoding-name=OPUS,payload=" #define RTP_CAPS_VP8 "application/x-rtp,media=video,encoding-name=VP8,payload=" @@ -260,7 +261,7 @@ start_pipeline (void) GError *error = NULL; pipe1 = - gst_parse_launch ("webrtcbin name=sendrecv " + gst_parse_launch ("webrtcbin name=sendrecv " STUN_SERVER "videotestsrc pattern=ball ! queue ! vp8enc deadline=1 ! rtpvp8pay ! " "queue ! " RTP_CAPS_VP8 "96 ! sendrecv. " "audiotestsrc wave=red-noise ! queue ! opusenc ! rtpopuspay ! "