diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-01-29 21:25:13 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-08 18:35:21 -0800 |
commit | 02423047646cfc7d410e223611033d488f1c26b0 (patch) | |
tree | b92da89347cdb51163cf6660d47ca915646f8a29 /indra/newview | |
parent | 0e6103e3a943c7f7726a93535048c634eb85eefc (diff) |
Treat adhoc/p2p as primary connections
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llvoicevivox.h | 13 | ||||
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llvoicewebrtc.h | 9 |
3 files changed, 25 insertions, 17 deletions
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index e3ab99c675..bd1f18aec6 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -154,17 +154,18 @@ public: /// @name invitations //@{ // start a voice channel with the specified user - virtual void callUser(const LLUUID &uuid); - virtual bool isValidChannel(std::string &channelHandle); - virtual bool answerInvite(std::string &channelHandle); - virtual void declineInvite(std::string &channelHandle); + bool hasP2PInterface() override { return true; } + void callUser(const LLUUID &uuid); + bool isValidChannel(std::string &channelHandle) override; + bool answerInvite(std::string &channelHandle) override; + void declineInvite(std::string &channelHandle) override; //@} ///////////////////////// /// @name Volume/gain //@{ - virtual void setVoiceVolume(F32 volume); - virtual void setMicGain(F32 volume); + void setVoiceVolume(F32 volume) override; + void setMicGain(F32 volume) override; //@} ///////////////////////// diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index fcdd818757..a5c647c675 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2853,7 +2853,7 @@ void LLVoiceWebRTCConnection::OnDataReceived(const std::string &data, bool binar } new_participant |= joined; - if (!participant && joined && primary) + if (!participant && joined && (primary || !isSpatial())) { participant = LLWebRTCVoiceClient::getInstance()->addParticipantByID(mChannelID, agent_id); } @@ -2861,19 +2861,19 @@ void LLVoiceWebRTCConnection::OnDataReceived(const std::string &data, bool binar { if (voice_data[participant_id].get("l", Json::Value(false)).asBool()) { - if (agent_id != gAgentID) - { + if (agent_id != gAgentID) + { LLWebRTCVoiceClient::getInstance()->removeParticipantByID(mChannelID, agent_id); - } + } } else { - F32 level = (F32) (voice_data[participant_id].get("p", Json::Value(participant->mLevel)).asInt()) / 128; - // convert to decibles - participant->mLevel = level; - /* WebRTC appears to have deprecated VAD, but it's still in the Audio Processing Module so maybe we - can use it at some point when we actually process frames. */ - participant->mIsSpeaking = participant->mLevel > SPEAKING_AUDIO_LEVEL; + F32 level = (F32) (voice_data[participant_id].get("p", Json::Value(participant->mLevel)).asInt()) / 128; + // convert to decibles + participant->mLevel = level; + /* WebRTC appears to have deprecated VAD, but it's still in the Audio Processing Module so maybe we + can use it at some point when we actually process frames. */ + participant->mIsSpeaking = participant->mLevel > SPEAKING_AUDIO_LEVEL; } } } diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index f81c8c556e..38d867db8d 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -150,8 +150,9 @@ public: bool setSpatialChannel(const std::string &uri, const std::string &credentials) override { + leaveNonSpatialChannel(); // this is a vivox-related call - return false; + return true; } void leaveNonSpatialChannel() override; @@ -775,6 +776,8 @@ class LLVoiceWebRTCConnection : bool connectionStateMachine(); + virtual bool isSpatial() = 0; + LLUUID getRegionID() { return mRegionID; } void shutDown() @@ -875,6 +878,8 @@ class LLVoiceWebRTCSpatialConnection : void setMuteMic(bool muted) override; + bool isSpatial() override { return true; } + protected: @@ -890,6 +895,8 @@ class LLVoiceWebRTCAdHocConnection : public LLVoiceWebRTCConnection virtual ~LLVoiceWebRTCAdHocConnection(); + bool isSpatial() override { return false; } + protected: bool requestVoiceConnection() override; |