diff --git a/src/chat/client-group-chat-room.cpp b/src/chat/client-group-chat-room.cpp index 5deeb9b26..4966fcee0 100644 --- a/src/chat/client-group-chat-room.cpp +++ b/src/chat/client-group-chat-room.cpp @@ -54,8 +54,7 @@ shared_ptr ClientGroupChatRoomPrivate::createSession () { ClientGroupChatRoom::ClientGroupChatRoom (LinphoneCore *core, const Address &me, const string &subject) : ChatRoom(*new ClientGroupChatRoomPrivate(core)), RemoteConference(core, me, nullptr) { - string factoryUri = linphone_core_get_conference_factory_uri(core); - focus = ObjectFactory::create(factoryUri); + focus = ObjectFactory::create(Address(linphone_core_get_conference_factory_uri(core))); this->subject = subject; } @@ -227,12 +226,12 @@ void ClientGroupChatRoom::onSubjectChanged (const std::string &subject) { // ----------------------------------------------------------------------------- -void ClientGroupChatRoom::onCallSessionSetReleased (const std::shared_ptr session) { +void ClientGroupChatRoom::onCallSessionSetReleased (const std::shared_ptr &session) { if (session == focus->getPrivate()->getSession()) focus->getPrivate()->removeSession(); } -void ClientGroupChatRoom::onCallSessionStateChanged (const std::shared_ptr session, LinphoneCallState state, const string &message) { +void ClientGroupChatRoom::onCallSessionStateChanged (const std::shared_ptr &session, LinphoneCallState state, const string &message) { L_D(); if (state == LinphoneCallConnected) { if (d->state == ChatRoom::State::CreationPending) { diff --git a/src/chat/client-group-chat-room.h b/src/chat/client-group-chat-room.h index a535f751d..eaf212f52 100644 --- a/src/chat/client-group-chat-room.h +++ b/src/chat/client-group-chat-room.h @@ -65,8 +65,8 @@ private: private: /* CallSessionListener */ - void onCallSessionSetReleased (const std::shared_ptr session) override; - void onCallSessionStateChanged (const std::shared_ptr session, LinphoneCallState state, const std::string &message) override; + void onCallSessionSetReleased (const std::shared_ptr &session) override; + void onCallSessionStateChanged (const std::shared_ptr &session, LinphoneCallState state, const std::string &message) override; private: L_DECLARE_PRIVATE(ClientGroupChatRoom); diff --git a/src/conference/conference.cpp b/src/conference/conference.cpp index eb274d158..d6e626088 100644 --- a/src/conference/conference.cpp +++ b/src/conference/conference.cpp @@ -93,47 +93,47 @@ void Conference::setSubject (const string &subject) { // ----------------------------------------------------------------------------- -void Conference::onAckBeingSent (const std::shared_ptr session, LinphoneHeaders *headers) { +void Conference::onAckBeingSent (const std::shared_ptr &session, LinphoneHeaders *headers) { if (callListener) callListener->onAckBeingSent(headers); } -void Conference::onAckReceived (const std::shared_ptr session, LinphoneHeaders *headers) { +void Conference::onAckReceived (const std::shared_ptr &session, LinphoneHeaders *headers) { if (callListener) callListener->onAckReceived(headers); } -void Conference::onCallSessionAccepted (const std::shared_ptr session) { +void Conference::onCallSessionAccepted (const std::shared_ptr &session) { if (callListener) callListener->onIncomingCallToBeAdded(); } -void Conference::onCallSessionSetReleased (const std::shared_ptr session) { +void Conference::onCallSessionSetReleased (const std::shared_ptr &session) { if (callListener) callListener->onCallSetReleased(); } -void Conference::onCallSessionSetTerminated (const std::shared_ptr session) { +void Conference::onCallSessionSetTerminated (const std::shared_ptr &session) { if (callListener) callListener->onCallSetTerminated(); } -void Conference::onCallSessionStateChanged (const std::shared_ptr session, LinphoneCallState state, const string &message) { +void Conference::onCallSessionStateChanged (const std::shared_ptr &session, LinphoneCallState state, const string &message) { if (callListener) callListener->onCallStateChanged(state, message); } -void Conference::onCheckForAcceptation (const std::shared_ptr session) { +void Conference::onCheckForAcceptation (const std::shared_ptr &session) { if (callListener) callListener->onCheckForAcceptation(); } -void Conference::onIncomingCallSessionStarted (const std::shared_ptr session) { +void Conference::onIncomingCallSessionStarted (const std::shared_ptr &session) { if (callListener) callListener->onIncomingCallStarted(); } -void Conference::onEncryptionChanged (const std::shared_ptr session, bool activated, const string &authToken) { +void Conference::onEncryptionChanged (const std::shared_ptr &session, bool activated, const string &authToken) { if (callListener) callListener->onEncryptionChanged(activated, authToken); } @@ -143,22 +143,22 @@ void Conference::onStatsUpdated (const LinphoneCallStats *stats) { callListener->onStatsUpdated(stats); } -void Conference::onResetCurrentSession (const std::shared_ptr session) { +void Conference::onResetCurrentSession (const std::shared_ptr &session) { if (callListener) callListener->onResetCurrentCall(); } -void Conference::onSetCurrentSession (const std::shared_ptr session) { +void Conference::onSetCurrentSession (const std::shared_ptr &session) { if (callListener) callListener->onSetCurrentCall(); } -void Conference::onFirstVideoFrameDecoded (const std::shared_ptr session) { +void Conference::onFirstVideoFrameDecoded (const std::shared_ptr &session) { if (callListener) callListener->onFirstVideoFrameDecoded(); } -void Conference::onResetFirstVideoFrameDecoded (const std::shared_ptr session) { +void Conference::onResetFirstVideoFrameDecoded (const std::shared_ptr &session) { if (callListener) callListener->onResetFirstVideoFrameDecoded(); } @@ -173,7 +173,7 @@ shared_ptr Conference::findParticipant (const Address &addr) const return nullptr; } -shared_ptr Conference::findParticipant (const shared_ptr session) { +shared_ptr Conference::findParticipant (const shared_ptr &session) { for (const auto &participant : participants) { if (participant->getPrivate()->getSession() == session) return participant; diff --git a/src/conference/conference.h b/src/conference/conference.h index 5dafd55f2..2ee2c452d 100644 --- a/src/conference/conference.h +++ b/src/conference/conference.h @@ -62,26 +62,26 @@ public: private: /* CallSessionListener */ - void onAckBeingSent (const std::shared_ptr session, LinphoneHeaders *headers) override; - void onAckReceived (const std::shared_ptr session, LinphoneHeaders *headers) override; - void onCallSessionAccepted (const std::shared_ptr session) override; - void onCallSessionSetReleased (const std::shared_ptr session) override; - void onCallSessionSetTerminated (const std::shared_ptr session) override; - void onCallSessionStateChanged (const std::shared_ptr session, LinphoneCallState state, const std::string &message) override; - void onCheckForAcceptation (const std::shared_ptr session) override; - void onIncomingCallSessionStarted (const std::shared_ptr session) override; - void onEncryptionChanged (const std::shared_ptr session, bool activated, const std::string &authToken) override; + void onAckBeingSent (const std::shared_ptr &session, LinphoneHeaders *headers) override; + void onAckReceived (const std::shared_ptr &session, LinphoneHeaders *headers) override; + void onCallSessionAccepted (const std::shared_ptr &session) override; + void onCallSessionSetReleased (const std::shared_ptr &session) override; + void onCallSessionSetTerminated (const std::shared_ptr &session) override; + void onCallSessionStateChanged (const std::shared_ptr &session, LinphoneCallState state, const std::string &message) override; + void onCheckForAcceptation (const std::shared_ptr &session) override; + void onIncomingCallSessionStarted (const std::shared_ptr &session) override; + void onEncryptionChanged (const std::shared_ptr &session, bool activated, const std::string &authToken) override; void onStatsUpdated (const LinphoneCallStats *stats) override; - void onResetCurrentSession (const std::shared_ptr session) override; - void onSetCurrentSession (const std::shared_ptr session) override; - void onFirstVideoFrameDecoded (const std::shared_ptr session) override; - void onResetFirstVideoFrameDecoded (const std::shared_ptr session) override; + void onResetCurrentSession (const std::shared_ptr &session) override; + void onSetCurrentSession (const std::shared_ptr &session) override; + void onFirstVideoFrameDecoded (const std::shared_ptr &session) override; + void onResetFirstVideoFrameDecoded (const std::shared_ptr &session) override; protected: explicit Conference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr); std::shared_ptr findParticipant (const Address &addr) const; - std::shared_ptr findParticipant (const std::shared_ptr session); + std::shared_ptr findParticipant (const std::shared_ptr &session); bool isMe (const Address &addr) const ; protected: diff --git a/src/conference/participant.cpp b/src/conference/participant.cpp index 83544da5e..6cfe04a0f 100644 --- a/src/conference/participant.cpp +++ b/src/conference/participant.cpp @@ -43,9 +43,14 @@ shared_ptr ParticipantPrivate::createSession ( // ============================================================================= -Participant::Participant (const Address &addr) : Object(*new ParticipantPrivate) { +Participant::Participant (const Address &address) : Object(*new ParticipantPrivate) { L_D(); - d->addr = addr; + d->addr = address; +} + +Participant::Participant (Address &&address) : Object(*new ParticipantPrivate) { + L_D(); + d->addr = move(address); } // ----------------------------------------------------------------------------- diff --git a/src/conference/participant.h b/src/conference/participant.h index f0916fc1b..dd5de40ad 100644 --- a/src/conference/participant.h +++ b/src/conference/participant.h @@ -43,7 +43,8 @@ class Participant : public Object { friend class RemoteConference; public: - Participant (const Address &addr); + Participant (const Address &address); + Participant (Address &&address); const Address& getAddress () const; diff --git a/src/conference/session/call-session-listener.h b/src/conference/session/call-session-listener.h index 5529e62fa..8b6d72edf 100644 --- a/src/conference/session/call-session-listener.h +++ b/src/conference/session/call-session-listener.h @@ -28,24 +28,24 @@ class LINPHONE_PUBLIC CallSessionListener { public: virtual ~CallSessionListener() = default; - virtual void onAckBeingSent (const std::shared_ptr session, LinphoneHeaders *headers) = 0; - virtual void onAckReceived (const std::shared_ptr session, LinphoneHeaders *headers) = 0; - virtual void onCallSessionAccepted (const std::shared_ptr session) = 0; - virtual void onCallSessionSetReleased (const std::shared_ptr session) = 0; - virtual void onCallSessionSetTerminated (const std::shared_ptr session) = 0; - virtual void onCallSessionStateChanged (const std::shared_ptr session, LinphoneCallState state, const std::string &message) = 0; - virtual void onCheckForAcceptation (const std::shared_ptr session) = 0; - virtual void onIncomingCallSessionStarted (const std::shared_ptr session) = 0; + virtual void onAckBeingSent (const std::shared_ptr &session, LinphoneHeaders *headers) = 0; + virtual void onAckReceived (const std::shared_ptr &session, LinphoneHeaders *headers) = 0; + virtual void onCallSessionAccepted (const std::shared_ptr &session) = 0; + virtual void onCallSessionSetReleased (const std::shared_ptr &session) = 0; + virtual void onCallSessionSetTerminated (const std::shared_ptr &session) = 0; + virtual void onCallSessionStateChanged (const std::shared_ptr &session, LinphoneCallState state, const std::string &message) = 0; + virtual void onCheckForAcceptation (const std::shared_ptr &session) = 0; + virtual void onIncomingCallSessionStarted (const std::shared_ptr &session) = 0; - virtual void onEncryptionChanged (const std::shared_ptr session, bool activated, const std::string &authToken) = 0; + virtual void onEncryptionChanged (const std::shared_ptr &session, bool activated, const std::string &authToken) = 0; virtual void onStatsUpdated (const LinphoneCallStats *stats) = 0; - virtual void onResetCurrentSession (const std::shared_ptr session) = 0; - virtual void onSetCurrentSession (const std::shared_ptr session) = 0; + virtual void onResetCurrentSession (const std::shared_ptr &session) = 0; + virtual void onSetCurrentSession (const std::shared_ptr &session) = 0; - virtual void onFirstVideoFrameDecoded (const std::shared_ptr session) = 0; - virtual void onResetFirstVideoFrameDecoded (const std::shared_ptr session) = 0; + virtual void onFirstVideoFrameDecoded (const std::shared_ptr &session) = 0; + virtual void onResetFirstVideoFrameDecoded (const std::shared_ptr &session) = 0; }; LINPHONE_END_NAMESPACE