mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
fix(core): coding style
This commit is contained in:
parent
fc75fdef79
commit
6a3956494c
25 changed files with 152 additions and 120 deletions
|
|
@ -42,6 +42,8 @@
|
|||
#include "chat/real-time-text-chat-room-p.h"
|
||||
#include "content/content-type.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void linphone_core_disable_chat(LinphoneCore *lc, LinphoneReason deny_reason) {
|
||||
lc->chat_deny_code = deny_reason;
|
||||
}
|
||||
|
|
@ -236,9 +238,9 @@ int linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage
|
|||
|
||||
void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call) {
|
||||
if (linphone_core_realtime_text_enabled(lc)) {
|
||||
std::shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr =
|
||||
std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr =
|
||||
static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
L_GET_PRIVATE(rttcr)->realtimeTextReceived(character, call);
|
||||
//L_GET_PRIVATE(std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr)))->realtimeTextReceived(character, call);
|
||||
//L_GET_PRIVATE(static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr)))->realtimeTextReceived(character, call);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
call-transfer.cc
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
|
|
@ -85,7 +85,7 @@ void CallTransferCommand::exec(Daemon* app, const string& args)
|
|||
return;
|
||||
}
|
||||
if (linphone_call_transfer_to_another(call_to_transfer, call_to_transfer_to) == 0) {
|
||||
std::ostringstream ostr;
|
||||
ostringstream ostr;
|
||||
ostr << "Call ID: " << call_to_transfer_id << "\n";
|
||||
ostr << "Transfer to: " << call_to_transfer_to_id << "\n";
|
||||
app->sendResponse(Response(ostr.str(), Response::Ok));
|
||||
|
|
@ -93,7 +93,7 @@ void CallTransferCommand::exec(Daemon* app, const string& args)
|
|||
}
|
||||
} else {
|
||||
if (linphone_call_transfer(call_to_transfer, sip_uri_to_transfer_to.c_str()) == 0) {
|
||||
std::ostringstream ostr;
|
||||
ostringstream ostr;
|
||||
ostr << "Call ID: " << call_to_transfer_id << "\n";
|
||||
ostr << "Transfer to: " << sip_uri_to_transfer_to << "\n";
|
||||
app->sendResponse(Response(ostr.str(), Response::Ok));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
conference.cc
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
|
|
@ -79,7 +79,7 @@ void ConferenceCommand::exec(Daemon* app, const string& args) {
|
|||
}
|
||||
|
||||
if (ret == 0) {
|
||||
std::ostringstream ostr;
|
||||
ostringstream ostr;
|
||||
ostr << "Call ID: " << id << "\n";
|
||||
ostr << "Conference: " << subcommand << " OK" << "\n";
|
||||
app->sendResponse(Response(ostr.str(), Response::Ok));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
register-info.cc
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
|
|
@ -21,6 +21,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include <string>
|
||||
#include "register-info.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class RegisterInfoResponse: public Response {
|
||||
public:
|
||||
RegisterInfoResponse(): Response() {}
|
||||
|
|
@ -28,19 +30,19 @@ public:
|
|||
append(id, cfg);
|
||||
}
|
||||
void append(int id, const ::LinphoneProxyConfig *cfg) {
|
||||
std::ostringstream ost;
|
||||
ostringstream ost;
|
||||
ost << getBody();
|
||||
if (ost.tellp() > 0) ost << std::endl;
|
||||
ost << "Id: " << id << std::endl;
|
||||
ost << "Identity: " << linphone_proxy_config_get_identity(cfg) << std::endl;
|
||||
ost << "Proxy: " << linphone_proxy_config_get_server_addr(cfg) << std::endl;
|
||||
|
||||
if (ost.tellp() > 0) ost << endl;
|
||||
ost << "Id: " << id << endl;
|
||||
ost << "Identity: " << linphone_proxy_config_get_identity(cfg) << endl;
|
||||
ost << "Proxy: " << linphone_proxy_config_get_server_addr(cfg) << endl;
|
||||
|
||||
const char *route = linphone_proxy_config_get_route(cfg);
|
||||
if (route != NULL) {
|
||||
ost << "Route: " << route << std::endl;
|
||||
ost << "Route: " << route << endl;
|
||||
}
|
||||
|
||||
ost << "State: " << linphone_registration_state_to_string(linphone_proxy_config_get_state(cfg)) << std::endl;
|
||||
|
||||
ost << "State: " << linphone_registration_state_to_string(linphone_proxy_config_get_state(cfg)) << endl;
|
||||
setBody(ost.str());
|
||||
}
|
||||
};
|
||||
|
|
@ -72,9 +74,9 @@ RegisterInfoCommand::RegisterInfoCommand():
|
|||
"Reason: No register with such id."));
|
||||
}
|
||||
|
||||
void RegisterInfoCommand::exec(Daemon *app, const std::string& args) {
|
||||
std::string param;
|
||||
std::istringstream ist(args);
|
||||
void RegisterInfoCommand::exec(Daemon *app, const string& args) {
|
||||
string param;
|
||||
istringstream ist(args);
|
||||
ist >> param;
|
||||
if (ist.fail()) {
|
||||
app->sendResponse(Response("Missing parameter.", Response::Error));
|
||||
|
|
@ -93,10 +95,10 @@ void RegisterInfoCommand::exec(Daemon *app, const std::string& args) {
|
|||
int id;
|
||||
try {
|
||||
id = atoi(param.c_str());
|
||||
} catch (std::invalid_argument) {
|
||||
} catch (invalid_argument) {
|
||||
app->sendResponse(Response("Invalid ID.", Response::Error));
|
||||
return;
|
||||
} catch (std::out_of_range) {
|
||||
} catch (out_of_range) {
|
||||
app->sendResponse(Response("Out of range ID.", Response::Error));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
video.cc
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
|
|
@ -162,7 +162,7 @@ AutoVideo::AutoVideo():
|
|||
"Auto video OFF"));
|
||||
}
|
||||
|
||||
void AutoVideo::exec(Daemon* app, const std::string& args)
|
||||
void AutoVideo::exec(Daemon* app, const string& args)
|
||||
{
|
||||
|
||||
bool enable = (args.compare("on") == 0);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
daemon.cc
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
|
|
@ -331,11 +331,11 @@ Daemon::Daemon(const char *config_path, const char *factory_config_path, const c
|
|||
linphone_core_set_user_data(mLc, this);
|
||||
linphone_core_enable_video_capture(mLc,capture_video);
|
||||
linphone_core_enable_video_display(mLc,display_video);
|
||||
|
||||
|
||||
for(const bctbx_list_t *proxy = linphone_core_get_proxy_config_list(mLc); proxy != NULL; proxy = bctbx_list_next(proxy)) {
|
||||
updateProxyId((LinphoneProxyConfig *)bctbx_list_get_data(proxy));
|
||||
}
|
||||
|
||||
|
||||
initCommands();
|
||||
mUseStatsEvents=true;
|
||||
}
|
||||
|
|
@ -403,7 +403,7 @@ LinphoneAuthInfo *Daemon::findAuthInfo(int id) {
|
|||
}
|
||||
|
||||
int Daemon::updateAudioStreamId(AudioStream *audio_stream) {
|
||||
for (std::map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.begin(); it != mAudioStreams.end(); ++it) {
|
||||
for (map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.begin(); it != mAudioStreams.end(); ++it) {
|
||||
if (it->second->stream == audio_stream)
|
||||
return it->first;
|
||||
}
|
||||
|
|
@ -414,21 +414,21 @@ int Daemon::updateAudioStreamId(AudioStream *audio_stream) {
|
|||
}
|
||||
|
||||
AudioStreamAndOther *Daemon::findAudioStreamAndOther(int id) {
|
||||
std::map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.find(id);
|
||||
map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.find(id);
|
||||
if (it != mAudioStreams.end())
|
||||
return it->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AudioStream *Daemon::findAudioStream(int id) {
|
||||
std::map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.find(id);
|
||||
map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.find(id);
|
||||
if (it != mAudioStreams.end())
|
||||
return it->second->stream;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Daemon::removeAudioStream(int id) {
|
||||
std::map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.find(id);
|
||||
map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.find(id);
|
||||
if (it != mAudioStreams.end()) {
|
||||
mAudioStreams.erase(it);
|
||||
delete(it->second);
|
||||
|
|
@ -542,7 +542,7 @@ void Daemon::dtmfReceived(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
|
|||
}
|
||||
|
||||
void Daemon::iterateStreamStats() {
|
||||
for (std::map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.begin(); it != mAudioStreams.end(); ++it) {
|
||||
for (map<int, AudioStreamAndOther*>::iterator it = mAudioStreams.begin(); it != mAudioStreams.end(); ++it) {
|
||||
OrtpEvent *ev;
|
||||
while (it->second->queue && (NULL != (ev=ortp_ev_queue_get(it->second->queue)))){
|
||||
OrtpEventType evt=ortp_event_get_type(ev);
|
||||
|
|
@ -730,7 +730,7 @@ void Daemon::dumpCommandsHelpHtml(){
|
|||
cout<<"<h3>"<<"Description"<<"</h3>"<<endl;
|
||||
cout<<"<p>"<<htmlEscape((*it)->getDescription())<<"</p>"<<endl;
|
||||
cout<<"<h3>"<<"Examples"<<"</h3>"<<endl;
|
||||
const std::list<const DaemonCommandExample*> &examples=(*it)->getExamples();
|
||||
const list<const DaemonCommandExample*> &examples=(*it)->getExamples();
|
||||
cout<<"<p><i>";
|
||||
for(list<const DaemonCommandExample*>::const_iterator ex_it=examples.begin();ex_it!=examples.end();++ex_it){
|
||||
cout<<"<b>"<<htmlEscape("Linphone-daemon>")<<htmlEscape((*ex_it)->getCommand())<<"</b><br>"<<endl;
|
||||
|
|
@ -792,7 +792,7 @@ string Daemon::readLine(const string& prompt, bool *eof) {
|
|||
stringbuf outbuf;
|
||||
cin.get(outbuf);
|
||||
cin.clear();
|
||||
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
cin.ignore(numeric_limits<streamsize>::max(), '\n');
|
||||
return outbuf.str();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -851,7 +851,7 @@ void Daemon::enableLSD(bool enabled) {
|
|||
Daemon::~Daemon() {
|
||||
uninitCommands();
|
||||
|
||||
for (std::map<int, AudioStreamAndOther *>::iterator it = mAudioStreams.begin(); it != mAudioStreams.end(); ++it) {
|
||||
for (map<int, AudioStreamAndOther *>::iterator it = mAudioStreams.begin(); it != mAudioStreams.end(); ++it) {
|
||||
audio_stream_stop(it->second->stream);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -735,7 +735,7 @@ const char *linphone_call_get_remote_user_agent (LinphoneCall *call) {
|
|||
}
|
||||
|
||||
const char * linphone_call_get_remote_contact (LinphoneCall *call) {
|
||||
std::string contact = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteContact();
|
||||
string contact = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteContact();
|
||||
if (contact.empty())
|
||||
return nullptr;
|
||||
if (call->remoteContactCache)
|
||||
|
|
@ -745,7 +745,7 @@ const char * linphone_call_get_remote_contact (LinphoneCall *call) {
|
|||
}
|
||||
|
||||
const char *linphone_call_get_authentication_token (LinphoneCall *call) {
|
||||
std::string token = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAuthenticationToken();
|
||||
string token = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAuthenticationToken();
|
||||
return token.empty() ? nullptr : token.c_str();
|
||||
}
|
||||
|
||||
|
|
@ -1184,7 +1184,7 @@ void linphone_call_set_user_data (LinphoneCall *call, void *ud) {
|
|||
|
||||
LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg) {
|
||||
LinphoneCall *call = L_INIT(Call);
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(call, std::make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallOutgoing,
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(call, make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallOutgoing,
|
||||
*L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
|
||||
cfg, nullptr, L_GET_CPP_PTR_FROM_C_OBJECT(params)));
|
||||
call->currentParamsCache = linphone_call_params_new_for_wrapper();
|
||||
|
|
@ -1196,7 +1196,7 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres
|
|||
|
||||
LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, SalOp *op) {
|
||||
LinphoneCall *call = L_INIT(Call);
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(call, std::make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallIncoming,
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(call, make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallIncoming,
|
||||
*L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
|
||||
nullptr, op, nullptr));
|
||||
call->currentParamsCache = linphone_call_params_new_for_wrapper();
|
||||
|
|
|
|||
|
|
@ -498,8 +498,8 @@ void linphone_chat_message_send_display_notification(LinphoneChatMessage *cm) {
|
|||
}LinphoneStatus linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t character) {
|
||||
LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg);
|
||||
if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr))) {
|
||||
std::shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr =
|
||||
std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr =
|
||||
static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
|
||||
LinphoneCall *call = rttcr->getCall();
|
||||
LinphoneCore *lc = rttcr->getCore();
|
||||
const uint32_t new_line = 0x2028;
|
||||
|
|
|
|||
|
|
@ -269,9 +269,9 @@ void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) {
|
|||
LinphoneChatRoom *linphone_chat_room_new (LinphoneCore *core, const LinphoneAddress *addr) {
|
||||
LinphoneChatRoom *cr = L_INIT(ChatRoom);
|
||||
if (linphone_core_realtime_text_enabled(core))
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(cr, std::make_shared<LinphonePrivate::RealTimeTextChatRoom>(core, *L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(cr, make_shared<LinphonePrivate::RealTimeTextChatRoom>(core, *L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
|
||||
else
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(cr, std::make_shared<LinphonePrivate::BasicChatRoom>(core, *L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(cr, make_shared<LinphonePrivate::BasicChatRoom>(core, *L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
|
||||
L_GET_PRIVATE_FROM_C_OBJECT(cr)->setState(LinphonePrivate::ChatRoom::State::Instantiated);
|
||||
L_GET_PRIVATE_FROM_C_OBJECT(cr)->setState(LinphonePrivate::ChatRoom::State::Created);
|
||||
return cr;
|
||||
|
|
@ -284,7 +284,7 @@ LinphoneChatRoom *_linphone_client_group_chat_room_new (LinphoneCore *core) {
|
|||
LinphoneAddress *factoryAddr = linphone_address_new(factoryUri);
|
||||
LinphoneProxyConfig *proxy = linphone_core_lookup_known_proxy(core, factoryAddr);
|
||||
linphone_address_unref(factoryAddr);
|
||||
std::string from;
|
||||
string from;
|
||||
if (proxy)
|
||||
from = L_GET_CPP_PTR_FROM_C_OBJECT(linphone_proxy_config_get_identity_address(proxy))->asString();
|
||||
if (from.empty())
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class CallListener {
|
||||
public:
|
||||
virtual ~CallListener() = default;
|
||||
virtual ~CallListener () = default;
|
||||
|
||||
virtual void onAckBeingSent (LinphoneHeaders *headers) = 0;
|
||||
virtual void onAckReceived (LinphoneHeaders *headers) = 0;
|
||||
|
|
|
|||
|
|
@ -29,25 +29,39 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class CallPrivate : public ObjectPrivate, CallListener {
|
||||
class CallPrivate :
|
||||
public ObjectPrivate,
|
||||
CallListener {
|
||||
public:
|
||||
CallPrivate (LinphoneCall *call, LinphoneCore *core, LinphoneCallDir direction, const Address &from, const Address &to,
|
||||
LinphoneProxyConfig *cfg, SalOp *op, const MediaSessionParams *msp);
|
||||
CallPrivate (
|
||||
LinphoneCall *call,
|
||||
LinphoneCore *core,
|
||||
LinphoneCallDir direction,
|
||||
const Address &from,
|
||||
const Address &to,
|
||||
LinphoneProxyConfig *cfg,
|
||||
SalOp *op,
|
||||
const MediaSessionParams *msp
|
||||
);
|
||||
virtual ~CallPrivate ();
|
||||
|
||||
void initiateIncoming ();
|
||||
bool initiateOutgoing ();
|
||||
void iterate (time_t currentRealTime, bool oneSecondElapsed);
|
||||
void startIncomingNotification ();
|
||||
int startInvite (const Address *destination); /* If destination is nullptr, it is taken from the call log */
|
||||
|
||||
int startInvite (const Address *destination);
|
||||
|
||||
std::shared_ptr<CallSession> getActiveSession () const;
|
||||
bool getAudioMuted () const;
|
||||
Conference * getConference () const { return conference; }
|
||||
LinphoneProxyConfig * getDestProxy () const;
|
||||
IceSession * getIceSession () const;
|
||||
MediaStream * getMediaStream (LinphoneStreamType type) const;
|
||||
SalOp * getOp () const;
|
||||
Conference *getConference () const {
|
||||
return conference;
|
||||
}
|
||||
|
||||
LinphoneProxyConfig *getDestProxy () const;
|
||||
IceSession *getIceSession () const;
|
||||
MediaStream *getMediaStream (LinphoneStreamType type) const;
|
||||
SalOp *getOp () const;
|
||||
void setAudioMuted (bool value);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -23,16 +23,22 @@
|
|||
#include "conference/session/media-session-p.h"
|
||||
#include "logger/logger.h"
|
||||
|
||||
#include "call.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
using namespace std;
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
CallPrivate::CallPrivate (LinphoneCall *call, LinphoneCore *core, LinphoneCallDir direction, const Address &from, const Address &to,
|
||||
LinphoneProxyConfig *cfg, SalOp *op, const MediaSessionParams *msp) : lcall(call), core(core) {
|
||||
CallPrivate::CallPrivate (
|
||||
LinphoneCall *call,
|
||||
LinphoneCore *core,
|
||||
LinphoneCallDir direction,
|
||||
const Address &from,
|
||||
const Address &to,
|
||||
LinphoneProxyConfig *cfg,
|
||||
SalOp *op,
|
||||
const MediaSessionParams *msp
|
||||
) : lcall(call), core(core) {
|
||||
nextVideoFrameDecoded._func = nullptr;
|
||||
nextVideoFrameDecoded._user_data = nullptr;
|
||||
}
|
||||
|
|
@ -52,19 +58,19 @@ bool CallPrivate::getAudioMuted () const {
|
|||
return static_cast<MediaSession *>(getActiveSession().get())->getPrivate()->getAudioMuted();
|
||||
}
|
||||
|
||||
LinphoneProxyConfig * CallPrivate::getDestProxy () const {
|
||||
LinphoneProxyConfig *CallPrivate::getDestProxy () const {
|
||||
return getActiveSession()->getPrivate()->getDestProxy();
|
||||
}
|
||||
|
||||
IceSession * CallPrivate::getIceSession () const {
|
||||
IceSession *CallPrivate::getIceSession () const {
|
||||
return static_cast<MediaSession *>(getActiveSession().get())->getPrivate()->getIceSession();
|
||||
}
|
||||
|
||||
MediaStream * CallPrivate::getMediaStream (LinphoneStreamType type) const {
|
||||
MediaStream *CallPrivate::getMediaStream (LinphoneStreamType type) const {
|
||||
return static_cast<MediaSession *>(getActiveSession().get())->getPrivate()->getMediaStream(type);
|
||||
}
|
||||
|
||||
SalOp * CallPrivate::getOp () const {
|
||||
SalOp *CallPrivate::getOp () const {
|
||||
return getActiveSession()->getPrivate()->getOp();
|
||||
}
|
||||
|
||||
|
|
@ -119,16 +125,16 @@ void CallPrivate::onCallSetTerminated () {
|
|||
}
|
||||
if (linphone_core_del_call(core, lcall) != 0)
|
||||
lError() << "Could not remove the call from the list!!!";
|
||||
#if 0
|
||||
if (core->conf_ctx)
|
||||
linphone_conference_on_call_terminating(core->conf_ctx, lcall);
|
||||
if (lcall->ringing_beep){
|
||||
linphone_core_stop_dtmf(core);
|
||||
lcall->ringing_beep = false;
|
||||
}
|
||||
if (lcall->chat_room)
|
||||
linphone_chat_room_set_call(lcall->chat_room, nullptr);
|
||||
#endif
|
||||
#if 0
|
||||
if (core->conf_ctx)
|
||||
linphone_conference_on_call_terminating(core->conf_ctx, lcall);
|
||||
if (lcall->ringing_beep) {
|
||||
linphone_core_stop_dtmf(core);
|
||||
lcall->ringing_beep = false;
|
||||
}
|
||||
if (lcall->chat_room)
|
||||
linphone_chat_room_set_call(lcall->chat_room, nullptr);
|
||||
#endif // if 0
|
||||
if (!core->calls)
|
||||
ms_bandwidth_controller_reset_state(core->bw_controller);
|
||||
}
|
||||
|
|
@ -149,8 +155,8 @@ void CallPrivate::onCheckForAcceptation () {
|
|||
case LinphoneCallOutgoingProgress:
|
||||
case LinphoneCallOutgoingRinging:
|
||||
case LinphoneCallOutgoingEarlyMedia:
|
||||
lInfo() << "Already existing call [" << call << "] in state [" << linphone_call_state_to_string(linphone_call_get_state(call))
|
||||
<< "], canceling it before accepting new call [" << lcall << "]";
|
||||
lInfo() << "Already existing call [" << call << "] in state [" << linphone_call_state_to_string(linphone_call_get_state(call)) <<
|
||||
"], canceling it before accepting new call [" << lcall << "]";
|
||||
linphone_call_terminate(call);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -198,16 +204,24 @@ void CallPrivate::onFirstVideoFrameDecoded () {
|
|||
}
|
||||
|
||||
void CallPrivate::onResetFirstVideoFrameDecoded () {
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (lcall && nextVideoFrameDecoded._func)
|
||||
static_cast<MediaSession *>(getActiveSession().get())->resetFirstVideoFrameDecoded();
|
||||
#endif
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (lcall && nextVideoFrameDecoded._func)
|
||||
static_cast<MediaSession *>(getActiveSession().get())->resetFirstVideoFrameDecoded();
|
||||
#endif // ifdef VIDEO_ENABLED
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Call::Call (LinphoneCall *call, LinphoneCore *core, LinphoneCallDir direction, const Address &from, const Address &to,
|
||||
LinphoneProxyConfig *cfg, SalOp *op, const MediaSessionParams *msp) : Object(*new CallPrivate(call, core, direction, from, to, cfg, op, msp)) {
|
||||
Call::Call (
|
||||
LinphoneCall *call,
|
||||
LinphoneCore *core,
|
||||
LinphoneCallDir direction,
|
||||
const Address &from,
|
||||
const Address &to,
|
||||
LinphoneProxyConfig *cfg,
|
||||
SalOp *op,
|
||||
const MediaSessionParams *msp
|
||||
) : Object(*new CallPrivate(call, core, direction, from, to, cfg, op, msp)) {
|
||||
L_D(Call);
|
||||
const Address *myAddress = (direction == LinphoneCallIncoming) ? &to : &from;
|
||||
string confType = lp_config_get_string(linphone_core_get_config(core), "misc", "conference_type", "local");
|
||||
|
|
@ -273,12 +287,12 @@ void Call::stopRecording () {
|
|||
static_cast<MediaSession *>(d->getActiveSession().get())->stopRecording();
|
||||
}
|
||||
|
||||
LinphoneStatus Call::takePreviewSnapshot (const string& file) {
|
||||
LinphoneStatus Call::takePreviewSnapshot (const string &file) {
|
||||
L_D(Call);
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->takePreviewSnapshot(file);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::takeVideoSnapshot (const string& file) {
|
||||
LinphoneStatus Call::takeVideoSnapshot (const string &file) {
|
||||
L_D(Call);
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->takeVideoSnapshot(file);
|
||||
}
|
||||
|
|
@ -335,7 +349,7 @@ bool Call::getAllMuted () const {
|
|||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAllMuted();
|
||||
}
|
||||
|
||||
LinphoneCallStats * Call::getAudioStats () const {
|
||||
LinphoneCallStats *Call::getAudioStats () const {
|
||||
L_D(const Call);
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAudioStats();
|
||||
}
|
||||
|
|
@ -355,12 +369,12 @@ float Call::getAverageQuality () const {
|
|||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAverageQuality();
|
||||
}
|
||||
|
||||
LinphoneCore * Call::getCore () const {
|
||||
LinphoneCore *Call::getCore () const {
|
||||
L_D(const Call);
|
||||
return d->core;
|
||||
}
|
||||
|
||||
const MediaSessionParams * Call::getCurrentParams () const {
|
||||
const MediaSessionParams *Call::getCurrentParams () const {
|
||||
L_D(const Call);
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getCurrentParams();
|
||||
}
|
||||
|
|
@ -380,22 +394,22 @@ int Call::getDuration () const {
|
|||
return d->getActiveSession()->getDuration();
|
||||
}
|
||||
|
||||
const LinphoneErrorInfo * Call::getErrorInfo () const {
|
||||
const LinphoneErrorInfo *Call::getErrorInfo () const {
|
||||
L_D(const Call);
|
||||
return d->getActiveSession()->getErrorInfo();
|
||||
}
|
||||
|
||||
LinphoneCallLog * Call::getLog () const {
|
||||
LinphoneCallLog *Call::getLog () const {
|
||||
L_D(const Call);
|
||||
return d->getActiveSession()->getLog();
|
||||
}
|
||||
|
||||
RtpTransport * Call::getMetaRtcpTransport (int streamIndex) const {
|
||||
RtpTransport *Call::getMetaRtcpTransport (int streamIndex) const {
|
||||
L_D(const Call);
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getMetaRtcpTransport(streamIndex);
|
||||
}
|
||||
|
||||
RtpTransport * Call::getMetaRtpTransport (int streamIndex) const {
|
||||
RtpTransport *Call::getMetaRtpTransport (int streamIndex) const {
|
||||
L_D(const Call);
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getMetaRtpTransport(streamIndex);
|
||||
}
|
||||
|
|
@ -405,12 +419,12 @@ float Call::getMicrophoneVolumeGain () const {
|
|||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getMicrophoneVolumeGain();
|
||||
}
|
||||
|
||||
void * Call::getNativeVideoWindowId () const {
|
||||
void *Call::getNativeVideoWindowId () const {
|
||||
L_D(const Call);
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getNativeVideoWindowId();
|
||||
}
|
||||
|
||||
const MediaSessionParams * Call::getParams () const {
|
||||
const MediaSessionParams *Call::getParams () const {
|
||||
L_D(const Call);
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getMediaParams();
|
||||
}
|
||||
|
|
@ -430,7 +444,7 @@ float Call::getRecordVolume () const {
|
|||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getRecordVolume();
|
||||
}
|
||||
|
||||
const Address& Call::getRemoteAddress () const {
|
||||
const Address &Call::getRemoteAddress () const {
|
||||
L_D(const Call);
|
||||
return d->getActiveSession()->getRemoteAddress();
|
||||
}
|
||||
|
|
@ -445,7 +459,7 @@ string Call::getRemoteContact () const {
|
|||
return d->getActiveSession()->getRemoteContact();
|
||||
}
|
||||
|
||||
const MediaSessionParams * Call::getRemoteParams () const {
|
||||
const MediaSessionParams *Call::getRemoteParams () const {
|
||||
L_D(const Call);
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getRemoteParams();
|
||||
}
|
||||
|
|
@ -460,7 +474,7 @@ LinphoneCallState Call::getState () const {
|
|||
return d->getActiveSession()->getState();
|
||||
}
|
||||
|
||||
LinphoneCallStats * Call::getStats (LinphoneStreamType type) const {
|
||||
LinphoneCallStats *Call::getStats (LinphoneStreamType type) const {
|
||||
L_D(const Call);
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getStats(type);
|
||||
}
|
||||
|
|
@ -475,12 +489,12 @@ MSFormatType Call::getStreamType (int streamIndex) const {
|
|||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getStreamType(streamIndex);
|
||||
}
|
||||
|
||||
LinphoneCallStats * Call::getTextStats () const {
|
||||
LinphoneCallStats *Call::getTextStats () const {
|
||||
L_D(const Call);
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getTextStats();
|
||||
}
|
||||
|
||||
LinphoneCallStats * Call::getVideoStats () const {
|
||||
LinphoneCallStats *Call::getVideoStats () const {
|
||||
L_D(const Call);
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getVideoStats();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#ifndef _CALL_CALL_H_
|
||||
#define _CALL_CALL_H_
|
||||
|
||||
#include "address/address.h"
|
||||
#include "conference/params/media-session-params.h"
|
||||
#include "object/object.h"
|
||||
|
||||
|
|
@ -27,6 +26,7 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class Address;
|
||||
class CallPrivate;
|
||||
class CallSessionPrivate;
|
||||
class MediaSessionPrivate;
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ using namespace std;
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ChatMessagePrivate::ChatMessagePrivate (const std::shared_ptr<ChatRoom> &room)
|
||||
ChatMessagePrivate::ChatMessagePrivate (const shared_ptr<ChatRoom> &room)
|
||||
: chatRoom(room) {}
|
||||
|
||||
ChatMessagePrivate::~ChatMessagePrivate () {}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ChatMessage::ChatMessage (const std::shared_ptr<ChatRoom> &room) : Object(*new ChatMessagePrivate(room)) {}
|
||||
ChatMessage::ChatMessage (const shared_ptr<ChatRoom> &room) : Object(*new ChatMessagePrivate(room)) {}
|
||||
|
||||
ChatMessage::ChatMessage (ChatMessagePrivate &p) : Object(p) {}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ shared_ptr<ChatRoom> ChatMessage::getChatRoom () const {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
std::string ChatMessage::getExternalBodyUrl() const {
|
||||
string ChatMessage::getExternalBodyUrl() const {
|
||||
L_D(const ChatMessage);
|
||||
return d->externalBodyUrl;
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ void ChatMessage::setState(State state) {
|
|||
ms_message("Chat message %p: moving from state %s to %s", msg, linphone_chat_message_state_to_string(msg->state), linphone_chat_message_state_to_string(state));
|
||||
*/
|
||||
d->state = state;
|
||||
|
||||
|
||||
LinphoneChatMessage *msg = L_GET_C_BACK_PTR(this);
|
||||
/* TODO
|
||||
if (msg->message_state_changed_cb) {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ void ClientGroupChatRoom::onParticipantSetAdmin (const Address &addr, bool isAdm
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ClientGroupChatRoom::onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message) {
|
||||
void ClientGroupChatRoom::onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const string &message) {
|
||||
if (state == LinphoneCallConnected) {
|
||||
// TODO: Get the conference ID instead of the remote address
|
||||
onConferenceCreated(session.getRemoteAddress());
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ IsComposing::~IsComposing () {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
std::string IsComposing::marshal (bool isComposing) {
|
||||
string IsComposing::marshal (bool isComposing) {
|
||||
string content;
|
||||
|
||||
xmlBufferPtr buf = xmlBufferCreate();
|
||||
|
|
@ -192,7 +192,7 @@ unsigned int IsComposing::getRefreshTimerDuration () {
|
|||
|
||||
unsigned int IsComposing::getRemoteRefreshTimerDuration () {
|
||||
int remoteRefreshTimerDuration = lp_config_get_int(core->config, "sip", "composing_remote_refresh_timeout", defaultRemoteRefreshTimeout);
|
||||
return remoteRefreshTimerDuration < 0 ? 0 : static_cast<unsigned int>(remoteRefreshTimerDuration);
|
||||
return remoteRefreshTimerDuration < 0 ? 0 : static_cast<unsigned int>(remoteRefreshTimerDuration);
|
||||
}
|
||||
|
||||
void IsComposing::parse (xmlparsing_context_t *xmlCtx) {
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void Conference::onResetFirstVideoFrameDecoded (const CallSession &session) {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
std::shared_ptr<Participant> Conference::findParticipant (const Address &addr) {
|
||||
shared_ptr<Participant> Conference::findParticipant (const Address &addr) {
|
||||
for (const auto &participant : participants) {
|
||||
if (addr.equal(participant->getAddress()))
|
||||
return participant;
|
||||
|
|
|
|||
|
|
@ -82,10 +82,10 @@ protected:
|
|||
LinphoneCore *core = nullptr;
|
||||
CallListener *callListener = nullptr;
|
||||
|
||||
std::shared_ptr<Participant> activeParticipant = nullptr;
|
||||
std::string id;
|
||||
std::shared_ptr<Participant> me = nullptr;
|
||||
std::shared_ptr<Participant> activeParticipant;
|
||||
std::shared_ptr<Participant> me;
|
||||
std::list<std::shared_ptr<Participant>> participants;
|
||||
std::string id;
|
||||
|
||||
private:
|
||||
L_DISABLE_COPY(Conference);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public:
|
|||
private:
|
||||
Address addr;
|
||||
bool isAdmin = false;
|
||||
std::shared_ptr<CallSession> session = nullptr;
|
||||
std::shared_ptr<CallSession> session;
|
||||
|
||||
L_DECLARE_PUBLIC(Participant);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
virtual ~RemoteConference();
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Participant> focus = nullptr;
|
||||
std::shared_ptr<Participant> focus;
|
||||
|
||||
public:
|
||||
/* ConferenceInterface */
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ void CallSessionPrivate::setTerminated() {
|
|||
listener->onCallSessionSetTerminated(*q);
|
||||
}
|
||||
|
||||
LinphoneStatus CallSessionPrivate::startAcceptUpdate (LinphoneCallState nextState, const std::string &stateInfo) {
|
||||
LinphoneStatus CallSessionPrivate::startAcceptUpdate (LinphoneCallState nextState, const string &stateInfo) {
|
||||
sal_call_accept(op);
|
||||
setState(nextState, stateInfo);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -4348,7 +4348,7 @@ void MediaSession::resetFirstVideoFrameDecoded () {
|
|||
ms_filter_call_method_noarg(d->videoStream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
|
||||
}
|
||||
|
||||
LinphoneStatus MediaSession::takePreviewSnapshot (const std::string& file) {
|
||||
LinphoneStatus MediaSession::takePreviewSnapshot (const string& file) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_D(MediaSession);
|
||||
if (d->videoStream && d->videoStream->local_jpegwriter) {
|
||||
|
|
@ -4360,7 +4360,7 @@ LinphoneStatus MediaSession::takePreviewSnapshot (const std::string& file) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
LinphoneStatus MediaSession::takeVideoSnapshot (const std::string& file) {
|
||||
LinphoneStatus MediaSession::takeVideoSnapshot (const string& file) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_D(MediaSession);
|
||||
if (d->videoStream && d->videoStream->jpegwriter) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ const string &ContentType::getType () const {
|
|||
return d->type;
|
||||
}
|
||||
|
||||
bool ContentType::setType (const std::string &type) {
|
||||
bool ContentType::setType (const string &type) {
|
||||
L_D(ContentType);
|
||||
if (type.find('/') == string::npos) {
|
||||
d->type = type;
|
||||
|
|
@ -93,7 +93,7 @@ const string &ContentType::getSubType () const {
|
|||
return d->subType;
|
||||
}
|
||||
|
||||
bool ContentType::setSubType (const std::string &subType) {
|
||||
bool ContentType::setSubType (const string &subType) {
|
||||
L_D(ContentType);
|
||||
if (subType.find('/') == string::npos) {
|
||||
d->subType = subType;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ void Content::setContentDisposition (const string &contentDisposition) {
|
|||
d->contentDisposition = contentDisposition;
|
||||
}
|
||||
|
||||
const std::vector<char> &Content::getBody () const {
|
||||
const vector<char> &Content::getBody () const {
|
||||
L_D(const Content);
|
||||
return d->body;
|
||||
}
|
||||
|
|
@ -102,12 +102,12 @@ string Content::getBodyAsString () const {
|
|||
return string(d->body.begin(), d->body.end());
|
||||
}
|
||||
|
||||
void Content::setBody (const std::vector<char> &body) {
|
||||
void Content::setBody (const vector<char> &body) {
|
||||
L_D(Content);
|
||||
d->body = body;
|
||||
}
|
||||
|
||||
void Content::setBody (const std::string &body) {
|
||||
void Content::setBody (const string &body) {
|
||||
L_D(Content);
|
||||
d->body = vector<char>(body.cbegin(), body.cend());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class PropertyContainerPrivate {
|
||||
public:
|
||||
unordered_map<std::string, Variant> properties;
|
||||
unordered_map<string, Variant> properties;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue