Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2018-06-21 15:50:28 +0300
committerTim-Philipp Müller <tim@centricular.com>2020-07-10 18:46:30 +0300
commit41f41f1fdd368a5ee2fe8c4ed4f2b4a45bfa6357 (patch)
tree9ffee7d8052eda42335c2e689a39facccb4c88e9 /tests
parentb333e32e18daf8a17417bd999592781ffbf07fbe (diff)
rpicamsrc: webrtc example: Add a STUN server to the configuration
To let the webrtc example work through NAT firewalls
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/rpicamsrc/webrtc-unidirectional-h264.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c b/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c
index 9538ede27..b8a716d1d 100644
--- a/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c
+++ b/tests/examples/rpicamsrc/webrtc-unidirectional-h264.c
@@ -15,6 +15,7 @@
#define RTP_PAYLOAD_TYPE "96"
#define SOUP_HTTP_PORT 57778
+#define STUN_SERVER "stun.l.google.com:19302"
@@ -150,7 +151,8 @@ const gchar *html_source = " \n \
\n \
window.onload = function() { \n \
var vidstream = document.getElementById(\"stream\"); \n \
- playStream(vidstream, null, null, null, null, function (errmsg) { console.error(errmsg); }); \n \
+ var config = { 'iceServers': [{ 'urls': 'stun:" STUN_SERVER "' }] }; \n\
+ playStream(vidstream, null, null, null, config, function (errmsg) { console.error(errmsg); }); \n \
}; \n \
\n \
</script> \n \
@@ -182,8 +184,8 @@ create_receiver_entry (SoupWebsocketConnection * connection)
G_CALLBACK (soup_websocket_message_cb), (gpointer) receiver_entry);
error = NULL;
- receiver_entry->pipeline = gst_parse_launch ("webrtcbin name=webrtcbin "
- "rpicamsrc bitrate=300000 annotation-mode=12 ! video/x-h264,profile=baseline,width=640,height=480 ! queue max-size-time=100000000 ! h264parse ! "
+ receiver_entry->pipeline = gst_parse_launch ("webrtcbin name=webrtcbin stun-server=stun://" STUN_SERVER " "
+ "rpicamsrc bitrate=600000 annotation-mode=12 preview=false ! video/x-h264,profile=constrained-baseline,width=640,height=360,level=3.0 ! queue max-size-time=100000000 ! h264parse ! "
"rtph264pay config-interval=-1 name=payloader ! "
"application/x-rtp,media=video,encoding-name=H264,payload="
RTP_PAYLOAD_TYPE " ! webrtcbin. ", &error);