Treat adhoc/p2p as primary connections
parent
bb2994d9ba
commit
8e61bc80c0
|
|
@ -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;
|
||||
//@}
|
||||
|
||||
/////////////////////////
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue