summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicewebrtc.h
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-19 19:59:03 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-19 19:59:03 +0800
commit495f103000137b3288eaa05a4298fd33ceb3c2dc (patch)
tree19b79a5cb33275a874d24e923a04de7b9657401b /indra/newview/llvoicewebrtc.h
parentb7a79709003b1f7f0451ba577576040fc03e50f9 (diff)
parent0f3ffb0fad721740f20ed5c7a74f4ceade6d46b6 (diff)
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/newview/llvoicewebrtc.h')
-rw-r--r--indra/newview/llvoicewebrtc.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 2b9a113fcc..32127f9b17 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -55,7 +55,7 @@ class LLWebRTCProtocolParser;
class LLAvatarName;
class LLVoiceWebRTCConnection;
-typedef boost::shared_ptr<LLVoiceWebRTCConnection> connectionPtr_t;
+typedef std::shared_ptr<LLVoiceWebRTCConnection> connectionPtr_t;
extern const std::string WEBRTC_VOICE_SERVER_TYPE;
@@ -70,6 +70,7 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>,
virtual ~LLWebRTCVoiceClient();
public:
+ void cleanupSingleton() override;
/// @name LLVoiceModuleInterface virtual implementations
/// @see LLVoiceModuleInterface
//@{
@@ -88,6 +89,7 @@ public:
std::string sipURIFromID(const LLUUID &id) const override;
LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override;
+ void setHidden(bool hidden) override; // virtual
///////////////////
/// @name Logging
@@ -252,7 +254,7 @@ public:
bool mIsModeratorMuted;
LLUUID mRegion;
};
- typedef boost::shared_ptr<participantState> participantStatePtr_t;
+ typedef std::shared_ptr<participantState> participantStatePtr_t;
participantStatePtr_t findParticipantByID(const std::string &channelID, const LLUUID &id);
participantStatePtr_t addParticipantByID(const std::string& channelID, const LLUUID &id, const LLUUID& region);
@@ -265,10 +267,10 @@ public:
class sessionState
{
public:
- typedef boost::shared_ptr<sessionState> ptr_t;
- typedef boost::weak_ptr<sessionState> wptr_t;
+ typedef std::shared_ptr<sessionState> ptr_t;
+ typedef std::weak_ptr<sessionState> wptr_t;
- typedef boost::function<void(const ptr_t &)> sessionFunc_t;
+ typedef std::function<void(const ptr_t &)> sessionFunc_t;
static void addSession(const std::string &channelID, ptr_t& session);
virtual ~sessionState();
@@ -299,6 +301,7 @@ public:
static void for_each(sessionFunc_t func);
static void reapEmptySessions();
+ static void clearSessions();
bool isEmpty() { return mWebRTCConnections.empty(); }
@@ -318,7 +321,7 @@ public:
participantUUIDMap mParticipantsByUUID;
static bool hasSession(const std::string &sessionID)
- { return mSessions.find(sessionID) != mSessions.end(); }
+ { return sSessions.find(sessionID) != sSessions.end(); }
bool mHangupOnLastLeave; // notify observers after the session becomes empty.
bool mNotifyOnFirstJoin; // notify observers when the first peer joins.
@@ -329,14 +332,14 @@ public:
private:
- static std::map<std::string, ptr_t> mSessions; // canonical list of outstanding sessions.
+ static std::map<std::string, ptr_t> sSessions; // canonical list of outstanding sessions.
static void for_eachPredicate(const std::pair<std::string,
LLWebRTCVoiceClient::sessionState::wptr_t> &a,
sessionFunc_t func);
};
- typedef boost::shared_ptr<sessionState> sessionStatePtr_t;
+ typedef std::shared_ptr<sessionState> sessionStatePtr_t;
typedef std::map<std::string, sessionStatePtr_t> sessionMap;
class estateSessionState : public sessionState
@@ -480,8 +483,6 @@ private:
LLSD getAudioSessionChannelInfo();
- void setHidden(bool hidden) override; //virtual
-
void enforceTether();
void updateNeighboringRegions();
@@ -576,7 +577,8 @@ class LLVoiceWebRTCStats : public LLSingleton<LLVoiceWebRTCStats>
class LLVoiceWebRTCConnection :
public llwebrtc::LLWebRTCSignalingObserver,
- public llwebrtc::LLWebRTCDataObserver
+ public llwebrtc::LLWebRTCDataObserver,
+ public std::enable_shared_from_this<LLVoiceWebRTCConnection>
{
public:
LLVoiceWebRTCConnection(const LLUUID &regionID, const std::string &channelID);
@@ -610,7 +612,7 @@ class LLVoiceWebRTCConnection :
void processIceUpdates();
- void processIceUpdatesCoro();
+ static void processIceUpdatesCoro(connectionPtr_t connection);
virtual void setMuteMic(bool muted);
virtual void setSpeakerVolume(F32 volume);
@@ -620,7 +622,7 @@ class LLVoiceWebRTCConnection :
bool connectionStateMachine();
- virtual bool isSpatial() = 0;
+ virtual bool isSpatial() { return false; }
LLUUID getRegionID() { return mRegionID; }
@@ -677,13 +679,14 @@ class LLVoiceWebRTCConnection :
}
virtual void requestVoiceConnection() = 0;
- void requestVoiceConnectionCoro() { requestVoiceConnection(); }
+ static void requestVoiceConnectionCoro(connectionPtr_t connection) { connection->requestVoiceConnection(); }
- void breakVoiceConnectionCoro();
+ static void breakVoiceConnectionCoro(connectionPtr_t connection);
LLVoiceClientStatusObserver::EStatusType mCurrentStatus;
LLUUID mRegionID;
+ bool mPrimary;
LLUUID mViewerSession;
std::string mChannelID;