summaryrefslogtreecommitdiff
path: root/indra/llwebrtc/llwebrtc.h
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-03-30 21:58:00 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-03-30 21:58:00 -0700
commitcdae5ebc168d95a304b9905de7b66381723e402f (patch)
treee565e4ed62be6f3f5d0c01fcdeb328c363512297 /indra/llwebrtc/llwebrtc.h
parent8d14df5984382de0aea12ba5d8ef4eba22b9976e (diff)
Add UI for managing echo cancellation, AGC, and noise control.
Plumb audio settings through from webrtc to the sound preferences UI (still needs some tweaking, of course.) Also, choose stun servers based on grid. Ultimately, the stun stun servers will be passed up via login or something.
Diffstat (limited to 'indra/llwebrtc/llwebrtc.h')
-rw-r--r--indra/llwebrtc/llwebrtc.h46
1 files changed, 42 insertions, 4 deletions
diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h
index be2e5cdf68..f3a33435c9 100644
--- a/indra/llwebrtc/llwebrtc.h
+++ b/indra/llwebrtc/llwebrtc.h
@@ -99,10 +99,32 @@ class LLWebRTCDevicesObserver
// to enumerate, set, and get notifications of changes
// for both capture (microphone) and render (speaker)
// devices.
+
class LLWebRTCDeviceInterface
{
public:
-
+ struct AudioConfig {
+
+ bool mAGC { true };
+
+ bool mEchoCancellation { true };
+
+ // TODO: The various levels of noise suppression are configured
+ // on the APM which would require setting config on the APM.
+ // We should pipe the various values through
+ // later.
+ typedef enum {
+ NOISE_SUPPRESSION_LEVEL_NONE = 0,
+ NOISE_SUPPRESSION_LEVEL_LOW,
+ NOISE_SUPPRESSION_LEVEL_MODERATE,
+ NOISE_SUPPRESSION_LEVEL_HIGH,
+ NOISE_SUPPRESSION_LEVEL_VERY_HIGH
+ } ENoiseSuppressionLevel;
+ ENoiseSuppressionLevel mNoiseSuppressionLevel { NOISE_SUPPRESSION_LEVEL_VERY_HIGH };
+ };
+
+ virtual void setAudioConfig(AudioConfig config) = 0;
+
// instructs webrtc to refresh the device list.
virtual void refreshDevices() = 0;
@@ -194,19 +216,35 @@ class LLWebRTCSignalingObserver
virtual void OnDataChannelReady(LLWebRTCDataInterface *data_interface) = 0;
};
-
// LLWebRTCPeerConnectionInterface representsd a connection to a peer,
// in most cases a Secondlife WebRTC server. This interface
// allows for management of this peer connection.
class LLWebRTCPeerConnectionInterface
{
public:
+
+ struct InitOptions
+ {
+ // equivalent of PeerConnectionInterface::IceServer
+ struct IceServers {
+ // Valid formats are described in RFC7064 and RFC7065.
+ // Urls should containe dns hostnames (not IP addresses)
+ // as the TLS certificate policy is 'secure.'
+ // and we do not currentply support TLS extensions.
+ std::vector<std::string> mUrls;
+ std::string mUserName;
+ std::string mPassword;
+ };
+
+ std::vector<IceServers> mServers;
+ };
+
+ virtual bool initializeConnection(InitOptions options = InitOptions()) = 0;
+ virtual bool shutdownConnection() = 0;
virtual void setSignalingObserver(LLWebRTCSignalingObserver* observer) = 0;
virtual void unsetSignalingObserver(LLWebRTCSignalingObserver* observer) = 0;
- virtual bool initializeConnection() = 0;
- virtual bool shutdownConnection() = 0;
virtual void AnswerAvailable(const std::string &sdp) = 0;
};