Treat adhoc/p2p as primary connections

meow-7.2.2
Roxie Linden 2024-01-29 21:25:13 -08:00
parent bb2994d9ba
commit 8e61bc80c0
3 changed files with 25 additions and 17 deletions

View File

@ -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;
//@}
/////////////////////////

View File

@ -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;
}
}
}

View File

@ -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;