summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2020-08-23 17:55:18 +0000
committerGitHub <noreply@github.com>2020-08-23 17:55:18 +0000
commit898297a7b0d315d9b3f3ff9edb9c52b5dd89db67 (patch)
tree69be0640104d1582db037612665b0e90346567c3
parentMerge pull request #262 from bqv/patch-1 (diff)
parentUnder GStreamer >= 1.17 gather all candidates before sending offer/answer (diff)
downloadnheko-898297a7b0d315d9b3f3ff9edb9c52b5dd89db67.tar.xz
Merge pull request #263 from trilene/voip
Under GStreamer >= 1.17 gather all candidates before sending offer/answer
-rw-r--r--src/WebRTCSession.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/WebRTCSession.cpp b/src/WebRTCSession.cpp
index 2248fb1a..b4e7eeb3 100644
--- a/src/WebRTCSession.cpp
+++ b/src/WebRTCSession.cpp
@@ -223,18 +223,19 @@ addLocalICECandidate(GstElement *webrtc G_GNUC_UNUSED,
 {
         nhlog::ui()->debug("WebRTC: local candidate: (m-line:{}):{}", mlineIndex, candidate);
 
+#if GST_CHECK_VERSION(1, 17, 0)
+        localcandidates_.push_back({"audio", (uint16_t)mlineIndex, candidate});
+        return;
+#else
         if (WebRTCSession::instance().state() >= WebRTCSession::State::OFFERSENT) {
                 emit WebRTCSession::instance().newICECandidate(
                   {"audio", (uint16_t)mlineIndex, candidate});
                 return;
         }
 
-        localcandidates_.push_back({"audio", (uint16_t)mlineIndex, candidate});
-
         // GStreamer v1.16: webrtcbin's notify::ice-gathering-state triggers
         // GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE too early. Fixed in v1.17.
         // Use a 100ms timeout in the meantime
-#if !GST_CHECK_VERSION(1, 17, 0)
         static guint timerid = 0;
         if (timerid)
                 g_source_remove(timerid);
@@ -447,6 +448,7 @@ WebRTCSession::startPipeline(int opusPayloadType)
                 g_object_set(webrtc_, "stun-server", stunServer_.c_str(), nullptr);
         }
 
+
         for (const auto &uri : turnServers_) {
                 nhlog::ui()->info("WebRTC: setting TURN server: {}", uri);
                 gboolean udata;