mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 16:49:20 +00:00
Add function to create a client group chat room.
This commit is contained in:
parent
a7b9d99f62
commit
a5ce479aa3
25 changed files with 211 additions and 205 deletions
|
|
@ -37,8 +37,9 @@
|
|||
|
||||
#include "c-wrapper/c-tools.h"
|
||||
#include "chat/basic-chat-room.h"
|
||||
#include "chat/real-time-text-chat-room-p.h"
|
||||
#include "chat/client-group-chat-room.h"
|
||||
#include "chat/real-time-text-chat-room.h"
|
||||
#include "chat/real-time-text-chat-room-p.h"
|
||||
#include "content/content-type.h"
|
||||
|
||||
struct _LinphoneChatRoom{
|
||||
|
|
@ -255,6 +256,15 @@ LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAd
|
|||
return ret;
|
||||
}
|
||||
|
||||
LinphoneChatRoom * linphone_core_create_client_group_chat_room(LinphoneCore *lc, bctbx_list_t *addresses) {
|
||||
LinphoneChatRoom *cr = belle_sip_object_new(LinphoneChatRoom);
|
||||
std::list<LinphonePrivate::Address> l = L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(addresses, Address);
|
||||
LinphonePrivate::Address me; // TODO
|
||||
cr->cr = new LinphonePrivate::ClientGroupChatRoom(lc, me, l);
|
||||
L_GET_PRIVATE(cr->cr)->setCBackPointer(cr);
|
||||
return cr;
|
||||
}
|
||||
|
||||
void linphone_core_delete_chat_room(LinphoneCore *lc, LinphoneChatRoom *cr) {
|
||||
if (bctbx_list_find(lc->chatrooms, cr)) {
|
||||
lc->chatrooms = bctbx_list_remove(lc->chatrooms, cr);
|
||||
|
|
|
|||
|
|
@ -457,6 +457,8 @@ LINPHONE_PUBLIC void linphone_chat_message_set_user_data(LinphoneChatMessage* me
|
|||
**/
|
||||
LINPHONE_PUBLIC LinphoneChatRoom* linphone_chat_message_get_chat_room(LinphoneChatMessage *msg);
|
||||
|
||||
LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(LinphoneCore *lc, bctbx_list_t *addresses);
|
||||
|
||||
LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
|
|||
chat/real-time-text-chat-room-p.h
|
||||
chat/real-time-text-chat-room.h
|
||||
conference/conference-listener.h
|
||||
conference/conference-p.h
|
||||
conference/conference.h
|
||||
conference/local-conference.h
|
||||
conference/params/call-session-params-p.h
|
||||
|
|
|
|||
|
|
@ -116,8 +116,8 @@ public:
|
|||
template<typename T>
|
||||
static inline bctbx_list_t * getCListFromCppList (std::list<T> cppList) {
|
||||
bctbx_list_t *result = nullptr;
|
||||
for (auto it = cppList.begin(); it != cppList.end(); it++)
|
||||
result = bctbx_list_append(result, *it);
|
||||
for (const auto &value : cppList)
|
||||
result = bctbx_list_append(result, value);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +129,14 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
static inline std::list<T> getCppListOfCppObjFromCListOfStructPtr (bctbx_list_t *cList) {
|
||||
std::list<T> result;
|
||||
for (auto it = cList; it; it = bctbx_list_next(it))
|
||||
result.push_back(*getCppPtrFromC<T>(reinterpret_cast<U *>(bctbx_list_get_data(it))));
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
Wrapper ();
|
||||
|
||||
|
|
@ -217,5 +225,7 @@ LINPHONE_END_NAMESPACE
|
|||
LINPHONE_NAMESPACE::Wrapper::getCListFromCppList<TYPE *>(LIST)
|
||||
#define L_GET_CPP_LIST_FROM_C_LIST(LIST, TYPE) \
|
||||
LINPHONE_NAMESPACE::Wrapper::getCppListFromCList<TYPE *>(LIST)
|
||||
#define L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(LIST, TYPE) \
|
||||
LINPHONE_NAMESPACE::Wrapper::getCppListOfCppObjFromCListOfStructPtr<LINPHONE_NAMESPACE::TYPE, Linphone ## TYPE>(LIST)
|
||||
|
||||
#endif // ifndef _C_TOOLS_H_
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class CallListener {
|
||||
public:
|
||||
virtual ~CallListener() = default;
|
||||
|
||||
virtual void onAckBeingSent (LinphoneHeaders *headers) = 0;
|
||||
virtual void onAckReceived (LinphoneHeaders *headers) = 0;
|
||||
virtual void onCallSetReleased () = 0;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ using namespace std;
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
BasicChatRoomPrivate::BasicChatRoomPrivate (LinphoneCore *core, const Address &peerAddress) : ChatRoomPrivate(core, peerAddress) {}
|
||||
BasicChatRoomPrivate::BasicChatRoomPrivate (LinphoneCore *core, const Address &peerAddress) : ChatRoomPrivate(core) {
|
||||
this->peerAddress = peerAddress;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class ChatRoomPrivate : public ObjectPrivate, public IsComposingListener {
|
||||
public:
|
||||
ChatRoomPrivate (LinphoneCore *core, const Address &peerAddress);
|
||||
ChatRoomPrivate (LinphoneCore *core);
|
||||
virtual ~ChatRoomPrivate ();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ using namespace std;
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
ChatRoomPrivate::ChatRoomPrivate (LinphoneCore *core, const Address &peerAddress)
|
||||
: core(core), peerAddress(peerAddress), isComposingHandler(core, this) {}
|
||||
ChatRoomPrivate::ChatRoomPrivate (LinphoneCore *core)
|
||||
: core(core), isComposingHandler(core, this) {}
|
||||
|
||||
ChatRoomPrivate::~ChatRoomPrivate () {
|
||||
for (auto it = transientMessages.begin(); it != transientMessages.end(); it++) {
|
||||
|
|
@ -538,7 +538,7 @@ void ChatRoomPrivate::onIsComposingRefreshNeeded () {
|
|||
|
||||
// =============================================================================
|
||||
|
||||
ChatRoom::ChatRoom (LinphoneCore *core, const Address &peerAddress) : Object(*new ChatRoomPrivate(core, peerAddress)) {}
|
||||
ChatRoom::ChatRoom (LinphoneCore *core) : Object(*new ChatRoomPrivate(core)) {}
|
||||
|
||||
ChatRoom::ChatRoom (ChatRoomPrivate &p) : Object(p) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class ChatRoomPrivate;
|
|||
|
||||
class ChatRoom : public Object, public ConferenceInterface {
|
||||
public:
|
||||
ChatRoom (LinphoneCore *core, const Address &peerAddress);
|
||||
ChatRoom (LinphoneCore *core);
|
||||
virtual ~ChatRoom () = default;
|
||||
|
||||
void compose ();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class ClientGroupChatRoomPrivate : public ChatRoomPrivate {
|
||||
public:
|
||||
ClientGroupChatRoomPrivate (LinphoneCore *core, const Address &peerAddress);
|
||||
ClientGroupChatRoomPrivate (LinphoneCore *core);
|
||||
virtual ~ClientGroupChatRoomPrivate () = default;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -17,14 +17,55 @@
|
|||
*/
|
||||
|
||||
#include "client-group-chat-room-p.h"
|
||||
#include "conference/participant-p.h"
|
||||
#include "logger/logger.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
using namespace std;
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
ClientGroupChatRoomPrivate::ClientGroupChatRoomPrivate (LinphoneCore *core, const Address &peerAddress) : ChatRoomPrivate(core, peerAddress) {}
|
||||
// =============================================================================
|
||||
|
||||
ClientGroupChatRoomPrivate::ClientGroupChatRoomPrivate (LinphoneCore *core) : ChatRoomPrivate(core) {}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
ClientGroupChatRoom::ClientGroupChatRoom (LinphoneCore *core, const Address &me, std::list<Address> &addresses)
|
||||
: ChatRoom(*new ChatRoomPrivate(core)), RemoteConference(core, me, nullptr) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
shared_ptr<Participant> ClientGroupChatRoom::addParticipant (const Address &addr, const shared_ptr<CallSessionParams> params, bool hasMedia) {
|
||||
activeParticipant = make_shared<Participant>(addr);
|
||||
activeParticipant->getPrivate()->createSession(*this, params, hasMedia, this);
|
||||
return activeParticipant;
|
||||
}
|
||||
|
||||
void ClientGroupChatRoom::addParticipants (const list<Address> &addresses, const shared_ptr<CallSessionParams> params, bool hasMedia) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
const string& ClientGroupChatRoom::getId () const {
|
||||
return id;
|
||||
}
|
||||
|
||||
int ClientGroupChatRoom::getNbParticipants () const {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
list<shared_ptr<Participant>> ClientGroupChatRoom::getParticipants () const {
|
||||
return participants;
|
||||
}
|
||||
|
||||
void ClientGroupChatRoom::removeParticipant (const shared_ptr<Participant> participant) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void ClientGroupChatRoom::removeParticipants (const list<shared_ptr<Participant>> participants) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "private.h"
|
||||
|
||||
#include "chat/chat-room.h"
|
||||
#include "conference/remote-conference.h"
|
||||
|
||||
#include "linphone/types.h"
|
||||
|
||||
|
|
@ -32,11 +33,12 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class ClientGroupChatRoomPrivate;
|
||||
|
||||
class ClientGroupChatRoom : public ChatRoom {
|
||||
class ClientGroupChatRoom : public ChatRoom, public RemoteConference {
|
||||
public:
|
||||
ClientGroupChatRoom (LinphoneCore *core, const Address &peerAddress);
|
||||
ClientGroupChatRoom (LinphoneCore *core, const Address &me, std::list<Address> &addresses);
|
||||
virtual ~ClientGroupChatRoom () = default;
|
||||
|
||||
public:
|
||||
/* ConferenceInterface */
|
||||
std::shared_ptr<Participant> addParticipant (const Address &addr, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
|
||||
void addParticipants (const std::list<Address> &addresses, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
|
||||
|
|
@ -44,7 +46,7 @@ public:
|
|||
int getNbParticipants () const;
|
||||
std::list<std::shared_ptr<Participant>> getParticipants () const;
|
||||
void removeParticipant (const std::shared_ptr<Participant> participant);
|
||||
void removeParticipants (const std::list<const std::shared_ptr<Participant>> participants);
|
||||
void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(ClientGroupChatRoom);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class IsComposingListener {
|
||||
public:
|
||||
virtual ~IsComposingListener() = default;
|
||||
|
||||
virtual void onIsComposingStateChanged (bool isComposing) = 0;
|
||||
virtual void onIsRemoteComposingStateChanged (bool isComposing) = 0;
|
||||
virtual void onIsComposingRefreshNeeded () = 0;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ using namespace std;
|
|||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
RealTimeTextChatRoomPrivate::RealTimeTextChatRoomPrivate (LinphoneCore *core, const Address &peerAddress)
|
||||
: ChatRoomPrivate(core, peerAddress) {}
|
||||
: ChatRoomPrivate(core) {
|
||||
this->peerAddress = peerAddress;
|
||||
}
|
||||
|
||||
RealTimeTextChatRoomPrivate::~RealTimeTextChatRoomPrivate () {
|
||||
if (!receivedRttCharacters.empty()) {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class ConferenceInterface {
|
||||
public:
|
||||
virtual ~ConferenceInterface() = default;
|
||||
|
||||
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const std::shared_ptr<CallSessionParams> params, bool hasMedia) = 0;
|
||||
virtual void addParticipants (const std::list<Address> &addresses, const std::shared_ptr<CallSessionParams> params, bool hasMedia) = 0;
|
||||
virtual const std::string& getId () const = 0;
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* conference-p.h
|
||||
* Copyright (C) 2017 Belledonne Communications SARL
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _CONFERENCE_P_H_
|
||||
#define _CONFERENCE_P_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "object/object-p.h"
|
||||
|
||||
#include "conference/conference.h"
|
||||
#include "conference/participant.h"
|
||||
#include "conference/session/call-session-listener.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class ConferencePrivate : public ObjectPrivate, CallSessionListener {
|
||||
public:
|
||||
virtual ~ConferencePrivate () = default;
|
||||
|
||||
LinphoneCore * getCore () const { return core; }
|
||||
|
||||
private:
|
||||
/* CallSessionListener */
|
||||
virtual void onAckBeingSent (const CallSession &session, LinphoneHeaders *headers);
|
||||
virtual void onAckReceived (const CallSession &session, LinphoneHeaders *headers);
|
||||
virtual void onCallSessionAccepted (const CallSession &session);
|
||||
virtual void onCallSessionSetReleased (const CallSession &session);
|
||||
virtual void onCallSessionSetTerminated (const CallSession &session);
|
||||
virtual void onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message);
|
||||
virtual void onIncomingCallSessionStarted (const CallSession &session);
|
||||
virtual void onEncryptionChanged (const CallSession &session, bool activated, const std::string &authToken);
|
||||
virtual void onStatsUpdated (const LinphoneCallStats *stats);
|
||||
virtual void onResetCurrentSession (const CallSession &session);
|
||||
virtual void onSetCurrentSession (const CallSession &session);
|
||||
virtual void onFirstVideoFrameDecoded (const CallSession &session);
|
||||
virtual void onResetFirstVideoFrameDecoded (const CallSession &session);
|
||||
|
||||
private:
|
||||
LinphoneCore *core = nullptr;
|
||||
CallListener *callListener = nullptr;
|
||||
|
||||
std::shared_ptr<Participant> activeParticipant = nullptr;
|
||||
std::string id;
|
||||
std::shared_ptr<Participant> me = nullptr;
|
||||
std::list<std::shared_ptr<Participant>> participants;
|
||||
|
||||
L_DECLARE_PUBLIC(Conference);
|
||||
};
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
||||
#endif // ifndef _CONFERENCE_P_H_
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "conference-p.h"
|
||||
#include "participant-p.h"
|
||||
|
||||
#include "conference.h"
|
||||
|
|
@ -27,86 +26,23 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
// =============================================================================
|
||||
|
||||
void ConferencePrivate::onAckBeingSent (const CallSession &session, LinphoneHeaders *headers) {
|
||||
if (callListener)
|
||||
callListener->onAckBeingSent(headers);
|
||||
Conference::Conference (LinphoneCore *core, const Address &myAddress, CallListener *listener)
|
||||
: core(core), callListener(listener) {
|
||||
me = make_shared<Participant>(myAddress);
|
||||
}
|
||||
|
||||
void ConferencePrivate::onAckReceived (const CallSession &session, LinphoneHeaders *headers) {
|
||||
if (callListener)
|
||||
callListener->onAckReceived(headers);
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
shared_ptr<Participant> Conference::getActiveParticipant () const {
|
||||
return activeParticipant;
|
||||
}
|
||||
|
||||
void ConferencePrivate::onCallSessionAccepted (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onIncomingCallToBeAdded();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onCallSessionSetReleased (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onCallSetReleased();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onCallSessionSetTerminated (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onCallSetTerminated();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const string &message) {
|
||||
if (callListener)
|
||||
callListener->onCallStateChanged(state, message);
|
||||
}
|
||||
|
||||
void ConferencePrivate::onIncomingCallSessionStarted (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onIncomingCallStarted();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onEncryptionChanged (const CallSession &session, bool activated, const string &authToken) {
|
||||
if (callListener)
|
||||
callListener->onEncryptionChanged(activated, authToken);
|
||||
}
|
||||
|
||||
void ConferencePrivate::onStatsUpdated (const LinphoneCallStats *stats) {
|
||||
if (callListener)
|
||||
callListener->onStatsUpdated(stats);
|
||||
}
|
||||
|
||||
void ConferencePrivate::onResetCurrentSession (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onResetCurrentCall();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onSetCurrentSession (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onSetCurrentCall();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onFirstVideoFrameDecoded (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void ConferencePrivate::onResetFirstVideoFrameDecoded (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onResetFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Conference::Conference (ConferencePrivate &p, LinphoneCore *core, const Address &myAddress, CallListener *listener)
|
||||
: Object(p) {
|
||||
L_D(Conference);
|
||||
d->core = core;
|
||||
d->callListener = listener;
|
||||
d->me = make_shared<Participant>(myAddress);
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
shared_ptr<Participant> Conference::addParticipant (const Address &addr, const shared_ptr<CallSessionParams> params, bool hasMedia) {
|
||||
L_D(Conference);
|
||||
d->activeParticipant = make_shared<Participant>(addr);
|
||||
d->activeParticipant->getPrivate()->createSession(*this, params, hasMedia, d);
|
||||
return d->activeParticipant;
|
||||
activeParticipant = make_shared<Participant>(addr);
|
||||
activeParticipant->getPrivate()->createSession(*this, params, hasMedia, this);
|
||||
return activeParticipant;
|
||||
}
|
||||
|
||||
void Conference::addParticipants (const list<Address> &addresses, const shared_ptr<CallSessionParams> params, bool hasMedia) {
|
||||
|
|
@ -114,8 +50,7 @@ void Conference::addParticipants (const list<Address> &addresses, const shared_p
|
|||
}
|
||||
|
||||
const string& Conference::getId () const {
|
||||
L_D(const Conference);
|
||||
return d->id;
|
||||
return id;
|
||||
}
|
||||
|
||||
int Conference::getNbParticipants () const {
|
||||
|
|
@ -124,8 +59,7 @@ int Conference::getNbParticipants () const {
|
|||
}
|
||||
|
||||
list<shared_ptr<Participant>> Conference::getParticipants () const {
|
||||
L_D(const Conference);
|
||||
return d->participants;
|
||||
return participants;
|
||||
}
|
||||
|
||||
void Conference::removeParticipant (const shared_ptr<Participant> participant) {
|
||||
|
|
@ -136,14 +70,71 @@ void Conference::removeParticipants (const list<shared_ptr<Participant>> partici
|
|||
// TODO
|
||||
}
|
||||
|
||||
shared_ptr<Participant> Conference::getActiveParticipant () const {
|
||||
L_D(const Conference);
|
||||
return d->activeParticipant;
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void Conference::onAckBeingSent (const CallSession &session, LinphoneHeaders *headers) {
|
||||
if (callListener)
|
||||
callListener->onAckBeingSent(headers);
|
||||
}
|
||||
|
||||
shared_ptr<Participant> Conference::getMe () const {
|
||||
L_D(const Conference);
|
||||
return d->me;
|
||||
void Conference::onAckReceived (const CallSession &session, LinphoneHeaders *headers) {
|
||||
if (callListener)
|
||||
callListener->onAckReceived(headers);
|
||||
}
|
||||
|
||||
void Conference::onCallSessionAccepted (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onIncomingCallToBeAdded();
|
||||
}
|
||||
|
||||
void Conference::onCallSessionSetReleased (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onCallSetReleased();
|
||||
}
|
||||
|
||||
void Conference::onCallSessionSetTerminated (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onCallSetTerminated();
|
||||
}
|
||||
|
||||
void Conference::onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const string &message) {
|
||||
if (callListener)
|
||||
callListener->onCallStateChanged(state, message);
|
||||
}
|
||||
|
||||
void Conference::onIncomingCallSessionStarted (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onIncomingCallStarted();
|
||||
}
|
||||
|
||||
void Conference::onEncryptionChanged (const CallSession &session, bool activated, const string &authToken) {
|
||||
if (callListener)
|
||||
callListener->onEncryptionChanged(activated, authToken);
|
||||
}
|
||||
|
||||
void Conference::onStatsUpdated (const LinphoneCallStats *stats) {
|
||||
if (callListener)
|
||||
callListener->onStatsUpdated(stats);
|
||||
}
|
||||
|
||||
void Conference::onResetCurrentSession (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onResetCurrentCall();
|
||||
}
|
||||
|
||||
void Conference::onSetCurrentSession (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onSetCurrentCall();
|
||||
}
|
||||
|
||||
void Conference::onFirstVideoFrameDecoded (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void Conference::onResetFirstVideoFrameDecoded (const CallSession &session) {
|
||||
if (callListener)
|
||||
callListener->onResetFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "conference/conference-interface.h"
|
||||
#include "conference/params/call-session-params.h"
|
||||
#include "conference/participant.h"
|
||||
#include "conference/session/call-session-listener.h"
|
||||
|
||||
#include "linphone/types.h"
|
||||
|
||||
|
|
@ -34,16 +35,20 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class ConferencePrivate;
|
||||
class CallSessionPrivate;
|
||||
|
||||
class Conference : public Object, public ConferenceInterface {
|
||||
class Conference : public ConferenceInterface, public CallSessionListener {
|
||||
friend class CallSessionPrivate;
|
||||
|
||||
public:
|
||||
std::shared_ptr<Participant> getActiveParticipant () const;
|
||||
std::shared_ptr<Participant> getMe () const;
|
||||
virtual ~Conference() = default;
|
||||
|
||||
std::shared_ptr<Participant> getActiveParticipant () const;
|
||||
std::shared_ptr<Participant> getMe () const { return me; }
|
||||
|
||||
LinphoneCore * getCore () const { return core; }
|
||||
|
||||
public:
|
||||
/* ConferenceInterface */
|
||||
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
|
||||
virtual void addParticipants (const std::list<Address> &addresses, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
|
||||
|
|
@ -53,11 +58,35 @@ public:
|
|||
virtual void removeParticipant (const std::shared_ptr<Participant> participant);
|
||||
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> participants);
|
||||
|
||||
private:
|
||||
/* CallSessionListener */
|
||||
virtual void onAckBeingSent (const CallSession &session, LinphoneHeaders *headers);
|
||||
virtual void onAckReceived (const CallSession &session, LinphoneHeaders *headers);
|
||||
virtual void onCallSessionAccepted (const CallSession &session);
|
||||
virtual void onCallSessionSetReleased (const CallSession &session);
|
||||
virtual void onCallSessionSetTerminated (const CallSession &session);
|
||||
virtual void onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message);
|
||||
virtual void onIncomingCallSessionStarted (const CallSession &session);
|
||||
virtual void onEncryptionChanged (const CallSession &session, bool activated, const std::string &authToken);
|
||||
virtual void onStatsUpdated (const LinphoneCallStats *stats);
|
||||
virtual void onResetCurrentSession (const CallSession &session);
|
||||
virtual void onSetCurrentSession (const CallSession &session);
|
||||
virtual void onFirstVideoFrameDecoded (const CallSession &session);
|
||||
virtual void onResetFirstVideoFrameDecoded (const CallSession &session);
|
||||
|
||||
protected:
|
||||
explicit Conference (ConferencePrivate &p, LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);
|
||||
explicit Conference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);
|
||||
|
||||
protected:
|
||||
LinphoneCore *core = nullptr;
|
||||
CallListener *callListener = nullptr;
|
||||
|
||||
std::shared_ptr<Participant> activeParticipant = nullptr;
|
||||
std::string id;
|
||||
std::shared_ptr<Participant> me = nullptr;
|
||||
std::list<std::shared_ptr<Participant>> participants;
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(Conference);
|
||||
L_DISABLE_COPY(Conference);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -16,21 +16,13 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "conference-p.h"
|
||||
|
||||
#include "local-conference.h"
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
// =============================================================================
|
||||
|
||||
class LocalConferencePrivate : public ConferencePrivate {
|
||||
public:
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LocalConference::LocalConference (LinphoneCore *core, const Address &myAddress, CallListener *listener)
|
||||
: Conference(*new LocalConferencePrivate, core, myAddress, listener) {}
|
||||
: Conference(core, myAddress, listener) {}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -25,14 +25,11 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class LocalConferencePrivate;
|
||||
|
||||
class LocalConference : public Conference {
|
||||
public:
|
||||
LocalConference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(LocalConference);
|
||||
L_DISABLE_COPY(LocalConference);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class ClientGroupChatRoom;
|
||||
class ParticipantPrivate;
|
||||
|
||||
class Participant : public Object {
|
||||
friend class Call;
|
||||
friend class CallPrivate;
|
||||
friend class ClientGroupChatRoom;
|
||||
friend class Conference;
|
||||
friend class MediaSessionPrivate;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,21 +16,13 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "conference-p.h"
|
||||
|
||||
#include "remote-conference.h"
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
// =============================================================================
|
||||
|
||||
class RemoteConferencePrivate : public ConferencePrivate {
|
||||
public:
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
|
||||
RemoteConference::RemoteConference (LinphoneCore *core, const Address &myAddress, CallListener *listener)
|
||||
: Conference(*new RemoteConferencePrivate, core, myAddress, listener) {}
|
||||
: Conference(core, myAddress, listener) {}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -25,14 +25,12 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class RemoteConferencePrivate;
|
||||
|
||||
class RemoteConference : public Conference {
|
||||
public:
|
||||
RemoteConference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);
|
||||
virtual ~RemoteConference() = default;
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(RemoteConference);
|
||||
L_DISABLE_COPY(RemoteConference);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class CallSessionListener {
|
||||
public:
|
||||
virtual ~CallSessionListener() = default;
|
||||
|
||||
virtual void onAckBeingSent (const CallSession &session, LinphoneHeaders *headers) = 0;
|
||||
virtual void onAckReceived (const CallSession &session, LinphoneHeaders *headers) = 0;
|
||||
virtual void onCallSessionAccepted (const CallSession &session) = 0;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include "address/address-p.h"
|
||||
#include "conference/session/call-session-p.h"
|
||||
#include "call/call-p.h"
|
||||
#include "conference/conference-p.h"
|
||||
#include "conference/params/call-session-params-p.h"
|
||||
|
||||
#include "conference/session/call-session.h"
|
||||
|
|
@ -45,7 +44,7 @@ CallSessionPrivate::CallSessionPrivate (const Conference &conference, const shar
|
|||
if (params)
|
||||
this->params = make_shared<CallSessionParams>(*params.get());
|
||||
currentParams = make_shared<CallSessionParams>();
|
||||
core = conference.getPrivate()->getCore();
|
||||
core = conference.getCore();
|
||||
ei = linphone_error_info_new();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue