summary refs log tree commit diff
path: root/src/WebRTCSession.h
diff options
context:
space:
mode:
authortrilene <trilene@runbox.com>2020-08-01 14:31:10 -0400
committertrilene <trilene@runbox.com>2020-08-01 14:31:10 -0400
commite3e7595babbea739c9fac12ae3da6da368f1e08e (patch)
tree99643d4339babb7476df8da82102cf1a57aa16e1 /src/WebRTCSession.h
parentImprove TURN server retrieval (diff)
downloadnheko-e3e7595babbea739c9fac12ae3da6da368f1e08e.tar.xz
clang-format
Diffstat (limited to 'src/WebRTCSession.h')
-rw-r--r--src/WebRTCSession.h53
1 files changed, 28 insertions, 25 deletions
diff --git a/src/WebRTCSession.h b/src/WebRTCSession.h
index d79047a8..6b54f370 100644
--- a/src/WebRTCSession.h
+++ b/src/WebRTCSession.h
@@ -14,52 +14,55 @@ class WebRTCSession : public QObject
         Q_OBJECT
 
 public:
-        enum class State {
-          ICEFAILED,
-          DISCONNECTED,
-          INITIATING,
-          INITIATED,
-          OFFERSENT,
-          ANSWERSENT,
-          CONNECTING,
-          CONNECTED
+        enum class State
+        {
+                DISCONNECTED,
+                ICEFAILED,
+                INITIATING,
+                INITIATED,
+                OFFERSENT,
+                ANSWERSENT,
+                CONNECTING,
+                CONNECTED
         };
 
-        static WebRTCSession& instance()
+        static WebRTCSession &instance()
         {
-          static WebRTCSession instance;
-          return instance;
+                static WebRTCSession instance;
+                return instance;
         }
 
         bool init(std::string *errorMessage = nullptr);
-        State state() const {return state_;} 
+        State state() const { return state_; }
 
         bool createOffer();
         bool acceptOffer(const std::string &sdp);
         bool acceptAnswer(const std::string &sdp);
-        void acceptICECandidates(const std::vector<mtx::events::msg::CallCandidates::Candidate>&);
+        void acceptICECandidates(const std::vector<mtx::events::msg::CallCandidates::Candidate> &);
 
         bool toggleMuteAudioSrc(bool &isMuted);
         void end();
 
-        void setStunServer(const std::string &stunServer) {stunServer_ = stunServer;}
-        void setTurnServers(const std::vector<std::string> &uris) {turnServers_ = uris;}
+        void setStunServer(const std::string &stunServer) { stunServer_ = stunServer; }
+        void setTurnServers(const std::vector<std::string> &uris) { turnServers_ = uris; }
 
 signals:
-        void offerCreated(const std::string &sdp, const std::vector<mtx::events::msg::CallCandidates::Candidate>&);
-        void answerCreated(const std::string &sdp, const std::vector<mtx::events::msg::CallCandidates::Candidate>&);
-        void newICECandidate(const mtx::events::msg::CallCandidates::Candidate&);
+        void offerCreated(const std::string &sdp,
+                          const std::vector<mtx::events::msg::CallCandidates::Candidate> &);
+        void answerCreated(const std::string &sdp,
+                           const std::vector<mtx::events::msg::CallCandidates::Candidate> &);
+        void newICECandidate(const mtx::events::msg::CallCandidates::Candidate &);
         void stateChanged(WebRTCSession::State); // explicit qualifier necessary for Qt
 
 private slots:
-        void setState(State state) {state_ = state;}
+        void setState(State state) { state_ = state; }
 
 private:
         WebRTCSession();
 
-        bool initialised_ = false;
-        State state_ = State::DISCONNECTED;
-        GstElement *pipe_ = nullptr;
+        bool initialised_   = false;
+        State state_        = State::DISCONNECTED;
+        GstElement *pipe_   = nullptr;
         GstElement *webrtc_ = nullptr;
         std::string stunServer_;
         std::vector<std::string> turnServers_;
@@ -68,6 +71,6 @@ private:
         bool createPipeline(int opusPayloadType);
 
 public:
-        WebRTCSession(WebRTCSession const&) = delete;
-        void operator=(WebRTCSession const&) = delete;
+        WebRTCSession(WebRTCSession const &) = delete;
+        void operator=(WebRTCSession const &) = delete;
 };