summary refs log tree commit diff
path: root/src/WebRTCSession.h
diff options
context:
space:
mode:
authortrilene <trilene@runbox.com>2020-08-05 17:56:44 -0400
committertrilene <trilene@runbox.com>2020-08-05 17:56:44 -0400
commitdf65093374c6c77f789e10b20144b3426c4358ac (patch)
tree9f0ca791eabc1adc2b931f5903707f31d8e8af0e /src/WebRTCSession.h
parentConditionally compile against upcoming GStreamer release (diff)
downloadnheko-df65093374c6c77f789e10b20144b3426c4358ac.tar.xz
Add audio input device selector
Diffstat (limited to 'src/WebRTCSession.h')
-rw-r--r--src/WebRTCSession.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/WebRTCSession.h b/src/WebRTCSession.h
index 6b54f370..56d76fa8 100644
--- a/src/WebRTCSession.h
+++ b/src/WebRTCSession.h
@@ -7,6 +7,7 @@
 
 #include "mtx/events/voip.hpp"
 
+typedef struct _GList GList;
 typedef struct _GstElement GstElement;
 
 class WebRTCSession : public QObject
@@ -46,6 +47,9 @@ public:
         void setStunServer(const std::string &stunServer) { stunServer_ = stunServer; }
         void setTurnServers(const std::vector<std::string> &uris) { turnServers_ = uris; }
 
+        std::vector<std::string> getAudioSourceNames(const std::string &defaultDevice);
+        void setAudioSource(int audioDeviceIndex) { audioSourceIndex_ = audioDeviceIndex; }
+
 signals:
         void offerCreated(const std::string &sdp,
                           const std::vector<mtx::events::msg::CallCandidates::Candidate> &);
@@ -66,9 +70,12 @@ private:
         GstElement *webrtc_ = nullptr;
         std::string stunServer_;
         std::vector<std::string> turnServers_;
+        GList *audioSources_  = nullptr;
+        int audioSourceIndex_ = -1;
 
         bool startPipeline(int opusPayloadType);
         bool createPipeline(int opusPayloadType);
+        void refreshDevices();
 
 public:
         WebRTCSession(WebRTCSession const &) = delete;