forked from mirrors/linphone-iphone
feat(general): remove class parameter of L_D and L_Q
This commit is contained in:
parent
21ddaf03d6
commit
c156730daa
34 changed files with 505 additions and 505 deletions
|
|
@ -125,8 +125,8 @@ inline const Object *getPublicHelper (const T *object, const ObjectPrivate *) {
|
|||
CLASS(const CLASS &) = delete; \
|
||||
CLASS &operator= (const CLASS &) = delete;
|
||||
|
||||
#define L_D(CLASS) CLASS ## Private * const d = getPrivate();
|
||||
#define L_Q(CLASS) CLASS * const q = getPublic();
|
||||
#define L_D() decltype(std::declval<decltype(*this)>().getPrivate()) const d = getPrivate();
|
||||
#define L_Q() decltype(std::declval<decltype(*this)>().getPublic()) const q = getPublic();
|
||||
|
||||
#define L_USE_DEFAULT_SHARE_IMPL(CLASS, PARENT_CLASS) \
|
||||
CLASS::CLASS (const CLASS &src) : PARENT_CLASS(*src.getPrivate()) {} \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
Address::Address (const string &address) : ClonableObject(*new AddressPrivate) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
if (!(d->internalAddress = sal_address_new(L_STRING_TO_C(address)))) {
|
||||
lWarning() << "Cannot create address, bad uri [" << address << "].";
|
||||
return;
|
||||
|
|
@ -39,20 +39,20 @@ Address::Address (const string &address) : ClonableObject(*new AddressPrivate) {
|
|||
}
|
||||
|
||||
Address::Address (const Address &src) : ClonableObject(*new AddressPrivate) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
SalAddress *salAddress = src.getPrivate()->internalAddress;
|
||||
if (salAddress)
|
||||
d->internalAddress = sal_address_clone(salAddress);
|
||||
}
|
||||
|
||||
Address::~Address () {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
if (d->internalAddress)
|
||||
sal_address_destroy(d->internalAddress);
|
||||
}
|
||||
|
||||
Address &Address::operator= (const Address &src) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
if (d->internalAddress)
|
||||
sal_address_destroy(d->internalAddress);
|
||||
|
|
@ -72,24 +72,24 @@ bool Address::operator< (const Address &address) const {
|
|||
}
|
||||
|
||||
bool Address::isValid () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return static_cast<bool>(d->internalAddress);
|
||||
}
|
||||
|
||||
const string &Address::getScheme () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
d->cache.scheme = L_C_TO_STRING(sal_address_get_scheme(d->internalAddress));
|
||||
return d->cache.scheme;
|
||||
}
|
||||
|
||||
const string &Address::getDisplayName () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
d->cache.displayName = L_C_TO_STRING(sal_address_get_display_name(d->internalAddress));
|
||||
return d->cache.displayName;
|
||||
}
|
||||
|
||||
bool Address::setDisplayName (const string &displayName) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -99,13 +99,13 @@ bool Address::setDisplayName (const string &displayName) {
|
|||
}
|
||||
|
||||
const string &Address::getUsername () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
d->cache.username = L_C_TO_STRING(sal_address_get_username(d->internalAddress));
|
||||
return d->cache.username;
|
||||
}
|
||||
|
||||
bool Address::setUsername (const string &username) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -115,13 +115,13 @@ bool Address::setUsername (const string &username) {
|
|||
}
|
||||
|
||||
const string &Address::getDomain () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
d->cache.domain = L_C_TO_STRING(sal_address_get_domain(d->internalAddress));
|
||||
return d->cache.domain;
|
||||
}
|
||||
|
||||
bool Address::setDomain (const string &domain) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -131,12 +131,12 @@ bool Address::setDomain (const string &domain) {
|
|||
}
|
||||
|
||||
int Address::getPort () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return d->internalAddress ? sal_address_get_port(d->internalAddress) : 0;
|
||||
}
|
||||
|
||||
bool Address::setPort (int port) {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -146,12 +146,12 @@ bool Address::setPort (int port) {
|
|||
}
|
||||
|
||||
Transport Address::getTransport () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return d->internalAddress ? static_cast<Transport>(sal_address_get_transport(d->internalAddress)) : Transport::Udp;
|
||||
}
|
||||
|
||||
bool Address::setTransport (Transport transport) {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -161,12 +161,12 @@ bool Address::setTransport (Transport transport) {
|
|||
}
|
||||
|
||||
bool Address::getSecure () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return d->internalAddress ? sal_address_is_secure(d->internalAddress) : false;
|
||||
}
|
||||
|
||||
bool Address::setSecure (bool enabled) {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -176,18 +176,18 @@ bool Address::setSecure (bool enabled) {
|
|||
}
|
||||
|
||||
bool Address::isSip () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return d->internalAddress ? sal_address_is_sip(d->internalAddress) : false;
|
||||
}
|
||||
|
||||
const string &Address::getMethodParam () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
d->cache.methodParam = L_C_TO_STRING(sal_address_get_method_param(d->internalAddress));
|
||||
return d->cache.methodParam;
|
||||
}
|
||||
|
||||
bool Address::setMethodParam (const string &methodParam) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -197,13 +197,13 @@ bool Address::setMethodParam (const string &methodParam) {
|
|||
}
|
||||
|
||||
const string &Address::getPassword () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
d->cache.password = L_C_TO_STRING(sal_address_get_password(d->internalAddress));
|
||||
return d->cache.password;
|
||||
}
|
||||
|
||||
bool Address::setPassword (const string &password) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -213,7 +213,7 @@ bool Address::setPassword (const string &password) {
|
|||
}
|
||||
|
||||
bool Address::clean () {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -223,7 +223,7 @@ bool Address::clean () {
|
|||
}
|
||||
|
||||
string Address::asString () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return "";
|
||||
|
|
@ -235,7 +235,7 @@ string Address::asString () const {
|
|||
}
|
||||
|
||||
string Address::asStringUriOnly () const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return "";
|
||||
|
|
@ -257,7 +257,7 @@ bool Address::weakEqual (const Address &address) const {
|
|||
}
|
||||
|
||||
const string &Address::getHeaderValue (const string &headerName) const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
const char *value = sal_address_get_header(d->internalAddress, L_STRING_TO_C(headerName));
|
||||
if (value) {
|
||||
|
|
@ -269,7 +269,7 @@ const string &Address::getHeaderValue (const string &headerName) const {
|
|||
}
|
||||
|
||||
bool Address::setHeader (const string &headerName, const string &headerValue) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -279,12 +279,12 @@ bool Address::setHeader (const string &headerName, const string &headerValue) {
|
|||
}
|
||||
|
||||
bool Address::hasParam (const string ¶mName) const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return sal_address_has_param(d->internalAddress, L_STRING_TO_C(paramName));
|
||||
}
|
||||
|
||||
const string &Address::getParamValue (const string ¶mName) const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
const char *value = sal_address_get_param(d->internalAddress, L_STRING_TO_C(paramName));
|
||||
if (value) {
|
||||
|
|
@ -296,7 +296,7 @@ const string &Address::getParamValue (const string ¶mName) const {
|
|||
}
|
||||
|
||||
bool Address::setParam (const string ¶mName, const string ¶mValue) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -306,7 +306,7 @@ bool Address::setParam (const string ¶mName, const string ¶mValue) {
|
|||
}
|
||||
|
||||
bool Address::setParams (const string ¶ms) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -316,12 +316,12 @@ bool Address::setParams (const string ¶ms) {
|
|||
}
|
||||
|
||||
bool Address::hasUriParam (const string &uriParamName) const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
return sal_address_has_uri_param(d->internalAddress, L_STRING_TO_C(uriParamName));
|
||||
}
|
||||
|
||||
const string &Address::getUriParamValue (const string &uriParamName) const {
|
||||
L_D(const Address);
|
||||
L_D();
|
||||
|
||||
const char *value = sal_address_get_uri_param(d->internalAddress, L_STRING_TO_C(uriParamName));
|
||||
if (value) {
|
||||
|
|
@ -333,7 +333,7 @@ const string &Address::getUriParamValue (const string &uriParamName) const {
|
|||
}
|
||||
|
||||
bool Address::setUriParam (const string &uriParamName, const string &uriParamValue) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
@ -343,7 +343,7 @@ bool Address::setUriParam (const string &uriParamName, const string &uriParamVal
|
|||
}
|
||||
|
||||
bool Address::setUriParams (const string &uriParams) {
|
||||
L_D(Address);
|
||||
L_D();
|
||||
|
||||
if (!d->internalAddress)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ Call::Call (
|
|||
SalOp *op,
|
||||
const MediaSessionParams *msp
|
||||
) : Object(*new CallPrivate(call, core, direction, from, to, cfg, op, msp)) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
const Address *myAddress = (direction == LinphoneCallIncoming) ? &to : &from;
|
||||
string confType = lp_config_get_string(linphone_core_get_config(core), "misc", "conference_type", "local");
|
||||
if (confType == "remote") {
|
||||
|
|
@ -238,296 +238,296 @@ Call::Call (
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneStatus Call::accept (const MediaSessionParams *msp) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->accept(msp);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::acceptEarlyMedia (const MediaSessionParams *msp) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->acceptEarlyMedia(msp);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::acceptUpdate (const MediaSessionParams *msp) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->acceptUpdate(msp);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::decline (LinphoneReason reason) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->decline(reason);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::decline (const LinphoneErrorInfo *ei) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->decline(ei);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::pause () {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->pause();
|
||||
}
|
||||
|
||||
LinphoneStatus Call::resume () {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->resume();
|
||||
}
|
||||
|
||||
void Call::sendVfuRequest () {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->sendVfuRequest();
|
||||
}
|
||||
|
||||
void Call::startRecording () {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->startRecording();
|
||||
}
|
||||
|
||||
void Call::stopRecording () {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->stopRecording();
|
||||
}
|
||||
|
||||
LinphoneStatus Call::takePreviewSnapshot (const string &file) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->takePreviewSnapshot(file);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::takeVideoSnapshot (const string &file) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->takeVideoSnapshot(file);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::terminate (const LinphoneErrorInfo *ei) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->terminate(ei);
|
||||
}
|
||||
|
||||
LinphoneStatus Call::update (const MediaSessionParams *msp) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->update(msp);
|
||||
}
|
||||
|
||||
void Call::zoomVideo (float zoomFactor, float *cx, float *cy) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->zoomVideo(zoomFactor, cx, cy);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool Call::cameraEnabled () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->cameraEnabled();
|
||||
}
|
||||
|
||||
bool Call::echoCancellationEnabled () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->echoCancellationEnabled();
|
||||
}
|
||||
|
||||
bool Call::echoLimiterEnabled () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->echoLimiterEnabled();
|
||||
}
|
||||
|
||||
void Call::enableCamera (bool value) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->enableCamera(value);
|
||||
}
|
||||
|
||||
void Call::enableEchoCancellation (bool value) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->enableEchoCancellation(value);
|
||||
}
|
||||
|
||||
void Call::enableEchoLimiter (bool value) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->enableEchoLimiter(value);
|
||||
}
|
||||
|
||||
bool Call::getAllMuted () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAllMuted();
|
||||
}
|
||||
|
||||
LinphoneCallStats *Call::getAudioStats () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAudioStats();
|
||||
}
|
||||
|
||||
string Call::getAuthenticationToken () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAuthenticationToken();
|
||||
}
|
||||
|
||||
bool Call::getAuthenticationTokenVerified () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAuthenticationTokenVerified();
|
||||
}
|
||||
|
||||
float Call::getAverageQuality () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getAverageQuality();
|
||||
}
|
||||
|
||||
LinphoneCore *Call::getCore () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->core;
|
||||
}
|
||||
|
||||
const MediaSessionParams *Call::getCurrentParams () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getCurrentParams();
|
||||
}
|
||||
|
||||
float Call::getCurrentQuality () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getCurrentQuality();
|
||||
}
|
||||
|
||||
LinphoneCallDir Call::getDirection () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getDirection();
|
||||
}
|
||||
|
||||
int Call::getDuration () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getDuration();
|
||||
}
|
||||
|
||||
const LinphoneErrorInfo *Call::getErrorInfo () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getErrorInfo();
|
||||
}
|
||||
|
||||
LinphoneCallLog *Call::getLog () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getLog();
|
||||
}
|
||||
|
||||
RtpTransport *Call::getMetaRtcpTransport (int streamIndex) const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getMetaRtcpTransport(streamIndex);
|
||||
}
|
||||
|
||||
RtpTransport *Call::getMetaRtpTransport (int streamIndex) const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getMetaRtpTransport(streamIndex);
|
||||
}
|
||||
|
||||
float Call::getMicrophoneVolumeGain () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getMicrophoneVolumeGain();
|
||||
}
|
||||
|
||||
void *Call::getNativeVideoWindowId () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getNativeVideoWindowId();
|
||||
}
|
||||
|
||||
const MediaSessionParams *Call::getParams () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getMediaParams();
|
||||
}
|
||||
|
||||
float Call::getPlayVolume () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getPlayVolume();
|
||||
}
|
||||
|
||||
LinphoneReason Call::getReason () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getReason();
|
||||
}
|
||||
|
||||
float Call::getRecordVolume () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getRecordVolume();
|
||||
}
|
||||
|
||||
const Address &Call::getRemoteAddress () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getRemoteAddress();
|
||||
}
|
||||
|
||||
string Call::getRemoteAddressAsString () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getRemoteAddressAsString();
|
||||
}
|
||||
|
||||
string Call::getRemoteContact () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getRemoteContact();
|
||||
}
|
||||
|
||||
const MediaSessionParams *Call::getRemoteParams () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getRemoteParams();
|
||||
}
|
||||
|
||||
float Call::getSpeakerVolumeGain () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getSpeakerVolumeGain();
|
||||
}
|
||||
|
||||
LinphoneCallState Call::getState () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return d->getActiveSession()->getState();
|
||||
}
|
||||
|
||||
LinphoneCallStats *Call::getStats (LinphoneStreamType type) const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getStats(type);
|
||||
}
|
||||
|
||||
int Call::getStreamCount () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<MediaSession *>(d->getActiveSession().get())->getStreamCount();
|
||||
}
|
||||
|
||||
MSFormatType Call::getStreamType (int streamIndex) const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getStreamType(streamIndex);
|
||||
}
|
||||
|
||||
LinphoneCallStats *Call::getTextStats () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getTextStats();
|
||||
}
|
||||
|
||||
LinphoneCallStats *Call::getVideoStats () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getVideoStats();
|
||||
}
|
||||
|
||||
bool Call::mediaInProgress () const {
|
||||
L_D(const Call);
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->mediaInProgress();
|
||||
}
|
||||
|
||||
void Call::setAuthenticationTokenVerified (bool value) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->setAuthenticationTokenVerified(value);
|
||||
}
|
||||
|
||||
void Call::setMicrophoneVolumeGain (float value) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->setMicrophoneVolumeGain(value);
|
||||
}
|
||||
|
||||
void Call::setNativeVideoWindowId (void *id) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->setNativeVideoWindowId(id);
|
||||
}
|
||||
|
||||
void Call::setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_data) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
d->nextVideoFrameDecoded._func = cb;
|
||||
d->nextVideoFrameDecoded._user_data = user_data;
|
||||
d->onResetFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void Call::setSpeakerVolumeGain (float value) {
|
||||
L_D(Call);
|
||||
L_D();
|
||||
static_cast<MediaSession *>(d->getActiveSession().get())->setSpeakerVolumeGain(value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ int BasicChatRoom::getNbParticipants () const {
|
|||
}
|
||||
|
||||
list<shared_ptr<Participant>> BasicChatRoom::getParticipants () const {
|
||||
L_D(const BasicChatRoom);
|
||||
L_D();
|
||||
list<shared_ptr<Participant>> l;
|
||||
l.push_back(make_shared<Participant>(d->peerAddress));
|
||||
return l;
|
||||
|
|
|
|||
|
|
@ -61,73 +61,73 @@ LinphoneChatMessage * ChatMessage::getBackPtr() {
|
|||
}
|
||||
|
||||
shared_ptr<ChatRoom> ChatMessage::getChatRoom () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->chatRoom;
|
||||
}
|
||||
|
||||
void ChatMessage::setChatRoom (shared_ptr<ChatRoom> chatRoom) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->chatRoom = chatRoom;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
string ChatMessage::getExternalBodyUrl() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->externalBodyUrl;
|
||||
}
|
||||
|
||||
void ChatMessage::setExternalBodyUrl(const string &url) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->externalBodyUrl = url;
|
||||
}
|
||||
|
||||
time_t ChatMessage::getTime () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->time;
|
||||
}
|
||||
void ChatMessage::setTime(time_t time) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->time = time;
|
||||
}
|
||||
|
||||
bool ChatMessage::isSecured () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->isSecured;
|
||||
}
|
||||
|
||||
void ChatMessage::setIsSecured(bool isSecured) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->isSecured = isSecured;
|
||||
}
|
||||
|
||||
ChatMessage::Direction ChatMessage::getDirection () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->direction;
|
||||
}
|
||||
|
||||
void ChatMessage::setDirection (ChatMessage::Direction dir) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->direction = dir;
|
||||
}
|
||||
|
||||
bool ChatMessage::isOutgoing () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->direction == Outgoing;
|
||||
}
|
||||
|
||||
bool ChatMessage::isIncoming () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->direction == Incoming;
|
||||
}
|
||||
|
||||
ChatMessage::State ChatMessage::getState() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->state;
|
||||
}
|
||||
|
||||
void ChatMessage::setState(State state) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
if (state != d->state && d->chatRoom) {
|
||||
if (((d->state == Displayed) || (d->state == DeliveredToUser))
|
||||
&& ((state == DeliveredToUser) || (state == Delivered) || (state == NotDelivered))) {
|
||||
|
|
@ -150,18 +150,18 @@ void ChatMessage::setState(State state) {
|
|||
}
|
||||
|
||||
string ChatMessage::getId () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->id;
|
||||
}
|
||||
|
||||
void ChatMessage::setId (string id) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->id = id;
|
||||
}
|
||||
|
||||
bool ChatMessage::isRead() const {
|
||||
return false;
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
LinphoneCore *lc = d->chatRoom->getCore();
|
||||
LinphoneImNotifPolicy *policy = linphone_core_get_im_notif_policy(lc);
|
||||
if (linphone_im_notif_policy_get_recv_imdn_displayed(policy) && d->state == Displayed) return true;
|
||||
|
|
@ -170,158 +170,158 @@ bool ChatMessage::isRead() const {
|
|||
}
|
||||
|
||||
string ChatMessage::getAppdata () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->appData;
|
||||
}
|
||||
|
||||
void ChatMessage::setAppdata (const string &appData) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->appData = appData;
|
||||
// TODO: store app data in db !
|
||||
// linphone_chat_message_store_appdata(msg);
|
||||
}
|
||||
|
||||
shared_ptr<Address> ChatMessage::getFromAddress () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->from;
|
||||
}
|
||||
|
||||
void ChatMessage::setFromAddress(shared_ptr<Address> from) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->from = from;
|
||||
}
|
||||
|
||||
shared_ptr<Address> ChatMessage::getToAddress () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->to;
|
||||
}
|
||||
|
||||
void ChatMessage::setToAddress(shared_ptr<Address> to) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->to = to;
|
||||
}
|
||||
|
||||
string ChatMessage::getFileTransferFilepath() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->fileTransferFilePath;
|
||||
}
|
||||
|
||||
void ChatMessage::setFileTransferFilepath(const string &path) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->fileTransferFilePath = path;
|
||||
}
|
||||
|
||||
bool ChatMessage::isToBeStored() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->isToBeStored;
|
||||
}
|
||||
|
||||
void ChatMessage::setIsToBeStored(bool store) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->isToBeStored = store;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
string ChatMessage::getContentType() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->cContentType;
|
||||
}
|
||||
|
||||
void ChatMessage::setContentType(string contentType) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->cContentType = contentType;
|
||||
}
|
||||
|
||||
string ChatMessage::getText() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->cText;
|
||||
}
|
||||
|
||||
void ChatMessage::setText(string text) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->cText = text;
|
||||
}
|
||||
|
||||
LinphoneContent * ChatMessage::getFileTransferInformation() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->cFileTransferInformation;
|
||||
}
|
||||
|
||||
void ChatMessage::setFileTransferInformation(LinphoneContent *content) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->cFileTransferInformation = content;
|
||||
}
|
||||
|
||||
unsigned int ChatMessage::getStorageId() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->storageId;
|
||||
}
|
||||
|
||||
void ChatMessage::setStorageId(unsigned int id) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->storageId = id;
|
||||
}
|
||||
|
||||
belle_http_request_t *ChatMessage::getHttpRequest() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->httpRequest;
|
||||
}
|
||||
|
||||
void ChatMessage::setHttpRequest(belle_http_request_t *request) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->httpRequest = request;
|
||||
}
|
||||
|
||||
SalOp *ChatMessage::getSalOp() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->salOp;
|
||||
}
|
||||
|
||||
void ChatMessage::setSalOp(SalOp *op) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->salOp = op;
|
||||
}
|
||||
|
||||
SalCustomHeader *ChatMessage::getSalCustomHeaders() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->salCustomHeaders;
|
||||
}
|
||||
|
||||
void ChatMessage::setSalCustomHeaders(SalCustomHeader *headers) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->salCustomHeaders = headers;
|
||||
}
|
||||
|
||||
void ChatMessage::addSalCustomHeader(string name, string value) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->salCustomHeaders = sal_custom_header_append(d->salCustomHeaders, name.c_str(), value.c_str());
|
||||
}
|
||||
|
||||
void ChatMessage::removeSalCustomHeader(string name) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
d->salCustomHeaders = sal_custom_header_remove(d->salCustomHeaders, name.c_str());
|
||||
}
|
||||
|
||||
string ChatMessage::getSalCustomHeaderValue(string name) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
return sal_custom_header_find(d->salCustomHeaders, name.c_str());
|
||||
}
|
||||
|
||||
const LinphoneErrorInfo * ChatMessage::getErrorInfo() const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
if (!d->errorInfo) d->errorInfo = linphone_error_info_new(); //let's do it mutable
|
||||
linphone_error_info_from_sal_op(d->errorInfo, d->salOp);
|
||||
return d->errorInfo;
|
||||
}
|
||||
|
||||
bool ChatMessage::isReadOnly () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
return d->isReadOnly;
|
||||
}
|
||||
|
||||
list<shared_ptr<const Content> > ChatMessage::getContents () const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
list<shared_ptr<const Content> > contents;
|
||||
for (const auto &content : d->contents)
|
||||
contents.push_back(content);
|
||||
|
|
@ -329,21 +329,21 @@ list<shared_ptr<const Content> > ChatMessage::getContents () const {
|
|||
}
|
||||
|
||||
void ChatMessage::addContent (const shared_ptr<Content> &content) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
if (d->isReadOnly) return;
|
||||
|
||||
d->contents.push_back(content);
|
||||
}
|
||||
|
||||
void ChatMessage::removeContent (const shared_ptr<const Content> &content) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
if (d->isReadOnly) return;
|
||||
|
||||
d->contents.remove(const_pointer_cast<Content>(content));
|
||||
}
|
||||
|
||||
string ChatMessage::getCustomHeaderValue (const string &headerName) const {
|
||||
L_D(const ChatMessage);
|
||||
L_D();
|
||||
try {
|
||||
return d->customHeaders.at(headerName);
|
||||
} catch (const exception &) {
|
||||
|
|
@ -353,14 +353,14 @@ string ChatMessage::getCustomHeaderValue (const string &headerName) const {
|
|||
}
|
||||
|
||||
void ChatMessage::addCustomHeader (const string &headerName, const string &headerValue) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
if (d->isReadOnly) return;
|
||||
|
||||
d->customHeaders[headerName] = headerValue;
|
||||
}
|
||||
|
||||
void ChatMessage::removeCustomHeader (const string &headerName) {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
if (d->isReadOnly) return;
|
||||
|
||||
d->customHeaders.erase(headerName);
|
||||
|
|
@ -379,7 +379,7 @@ void ChatMessage::updateState(State state) {
|
|||
}
|
||||
|
||||
void ChatMessage::send () {
|
||||
L_D(ChatMessage);
|
||||
L_D();
|
||||
|
||||
if (d->contents.size() > 1) {
|
||||
MultipartChatMessageModifier mcmm;
|
||||
|
|
@ -622,17 +622,17 @@ static void linphone_chat_process_response_headers_from_get_file(void *data, con
|
|||
belle_sip_message_t *response = BELLE_SIP_MESSAGE(event->response);
|
||||
belle_sip_body_handler_t *body_handler = NULL;
|
||||
size_t body_size = 0;
|
||||
|
||||
|
||||
if (msg->file_transfer_information == NULL) {
|
||||
ms_warning("No file transfer information for msg %p: creating...", msg);
|
||||
msg->file_transfer_information = linphone_chat_create_file_transfer_information_from_headers(response);
|
||||
}
|
||||
|
||||
|
||||
if (msg->file_transfer_information) {
|
||||
body_size = linphone_content_get_size(msg->file_transfer_information);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
body_handler = (belle_sip_body_handler_t *)belle_sip_user_body_handler_new(body_size, linphone_chat_message_file_transfer_on_progress, NULL, on_recv_body, NULL, on_recv_end, msg);
|
||||
if (msg->file_transfer_filepath != NULL) {
|
||||
belle_sip_user_body_handler_t *bh = (belle_sip_user_body_handler_t *)body_handler;
|
||||
|
|
@ -1072,7 +1072,7 @@ static int _linphone_chat_room_start_http_transfer(LinphoneChatMessage *msg, con
|
|||
}
|
||||
// keep a reference to the http request to be able to cancel it during upload
|
||||
belle_sip_object_ref(msg->http_request);
|
||||
|
||||
|
||||
// give msg to listener to be able to start the actual file upload when server answer a 204 No content
|
||||
msg->http_listener = belle_http_request_listener_create_from_callbacks(cbs, linphone_chat_message_ref(msg));
|
||||
belle_http_provider_send_request(linphone_chat_room_get_core(msg->chat_room)->http_provider, msg->http_request, msg->http_listener);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void ChatRoomPrivate::removeTransientMessage (LinphoneChatMessage *msg) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ChatRoomPrivate::release () {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
isComposingHandler.stopTimers();
|
||||
|
||||
for (auto &message : weakMessages)
|
||||
|
|
@ -107,7 +107,7 @@ void ChatRoomPrivate::release () {
|
|||
}
|
||||
|
||||
void ChatRoomPrivate::sendImdn (const string &content, LinphoneReason reason) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
|
||||
const char *identity = nullptr;
|
||||
LinphoneAddress *peer = linphone_address_new(peerAddress.asString().c_str());
|
||||
|
|
@ -182,7 +182,7 @@ int ChatRoomPrivate::getMessagesCount (bool unreadOnly) {
|
|||
}
|
||||
|
||||
void ChatRoomPrivate::setState (ChatRoom::State newState) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
if (newState != state) {
|
||||
state = newState;
|
||||
if (state == ChatRoom::State::Instantiated)
|
||||
|
|
@ -194,7 +194,7 @@ void ChatRoomPrivate::setState (ChatRoom::State newState) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ChatRoomPrivate::sendIsComposingNotification () {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
LinphoneImNotifPolicy *policy = linphone_core_get_im_notif_policy(core);
|
||||
if (linphone_im_notif_policy_get_send_is_composing(policy)) {
|
||||
LinphoneAddress *peer = linphone_address_new(peerAddress.asString().c_str());
|
||||
|
|
@ -261,7 +261,7 @@ void ChatRoomPrivate::sendIsComposingNotification () {
|
|||
* | 14 | secured flag
|
||||
*/
|
||||
int ChatRoomPrivate::createChatMessageFromDb (int argc, char **argv, char **colName) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
unsigned int storageId = (unsigned int)atoi(argv[0]);
|
||||
|
||||
/* Check if the message exists in the weak messages list, in which case we should return that one. */
|
||||
|
|
@ -388,7 +388,7 @@ void ChatRoomPrivate::storeOrUpdateMessage (LinphoneChatMessage *msg) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneReason ChatRoomPrivate::messageReceived (SalOp *op, const SalMessage *salMsg) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
|
||||
bool increaseMsgCount = true;
|
||||
LinphoneReason reason = LinphoneReasonNone;
|
||||
|
|
@ -502,7 +502,7 @@ end:
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ChatRoomPrivate::chatMessageReceived (LinphoneChatMessage *msg) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
if (!ContentType::isImdn(linphone_chat_message_get_content_type(msg)) && !ContentType::isImIsComposing(linphone_chat_message_get_content_type(msg))) {
|
||||
notifyChatMessageReceived(msg);
|
||||
remoteIsComposing = false;
|
||||
|
|
@ -512,7 +512,7 @@ void ChatRoomPrivate::chatMessageReceived (LinphoneChatMessage *msg) {
|
|||
}
|
||||
|
||||
void ChatRoomPrivate::imdnReceived (const string &text) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
Imdn::parse(*q, text);
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ void ChatRoomPrivate::isComposingReceived (const string &text) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ChatRoomPrivate::notifyChatMessageReceived (LinphoneChatMessage *msg) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(q);
|
||||
if (linphone_chat_message_get_text(msg)) {
|
||||
/* Legacy API */
|
||||
|
|
@ -537,7 +537,7 @@ void ChatRoomPrivate::notifyChatMessageReceived (LinphoneChatMessage *msg) {
|
|||
}
|
||||
|
||||
void ChatRoomPrivate::notifyStateChanged () {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(q);
|
||||
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr);
|
||||
LinphoneChatRoomCbsStateChangedCb cb = linphone_chat_room_cbs_get_state_changed(cbs);
|
||||
|
|
@ -546,7 +546,7 @@ void ChatRoomPrivate::notifyStateChanged () {
|
|||
}
|
||||
|
||||
void ChatRoomPrivate::notifyUndecryptableMessageReceived (LinphoneChatMessage *msg) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(q);
|
||||
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr);
|
||||
LinphoneChatRoomCbsUndecryptableMessageReceivedCb cb = linphone_chat_room_cbs_get_undecryptable_message_received(cbs);
|
||||
|
|
@ -563,7 +563,7 @@ void ChatRoomPrivate::onIsComposingStateChanged (bool isComposing) {
|
|||
}
|
||||
|
||||
void ChatRoomPrivate::onIsRemoteComposingStateChanged (bool isComposing) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
remoteIsComposing = isComposing;
|
||||
linphone_core_notify_is_composing_received(core, L_GET_C_BACK_PTR(q));
|
||||
}
|
||||
|
|
@ -581,7 +581,7 @@ ChatRoom::ChatRoom (ChatRoomPrivate &p) : Object(p) {}
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ChatRoom::compose () {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
if (!d->isComposing) {
|
||||
d->isComposing = true;
|
||||
d->sendIsComposingNotification();
|
||||
|
|
@ -591,7 +591,7 @@ void ChatRoom::compose () {
|
|||
}
|
||||
|
||||
LinphoneChatMessage *ChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
LinphoneChatMessage *msg = createMessage("");
|
||||
linphone_chat_message_set_text(msg, NULL);
|
||||
linphone_chat_message_set_file_transfer_information(msg, linphone_content_copy(initialContent));
|
||||
|
|
@ -621,7 +621,7 @@ LinphoneChatMessage *ChatRoom::createMessage (const string &message) {
|
|||
}
|
||||
|
||||
void ChatRoom::deleteHistory () {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
if (!d->core->db) return;
|
||||
string peer = d->peerAddress.asStringUriOnly();
|
||||
char *buf = sqlite3_mprintf("DELETE FROM history WHERE remoteContact = %Q;", peer.c_str());
|
||||
|
|
@ -631,7 +631,7 @@ void ChatRoom::deleteHistory () {
|
|||
}
|
||||
|
||||
void ChatRoom::deleteMessage (LinphoneChatMessage *msg) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
if (!d->core->db) return;
|
||||
char *buf = sqlite3_mprintf("DELETE FROM history WHERE id = %u;", linphone_chat_message_get_storage_id(msg));
|
||||
d->sqlRequest(d->core->db, buf);
|
||||
|
|
@ -643,7 +643,7 @@ void ChatRoom::deleteMessage (LinphoneChatMessage *msg) {
|
|||
}
|
||||
|
||||
LinphoneChatMessage *ChatRoom::findMessage (const string &messageId) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
LinphoneChatMessage *cm = nullptr;
|
||||
list<LinphoneChatMessage *> l = d->findMessages(messageId);
|
||||
if (!l.empty()) {
|
||||
|
|
@ -656,7 +656,7 @@ LinphoneChatMessage *ChatRoom::findMessage (const string &messageId) {
|
|||
}
|
||||
|
||||
LinphoneChatMessage * ChatRoom::findMessageWithDirection (const string &messageId, LinphoneChatMessageDir direction) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
LinphoneChatMessage *ret = nullptr;
|
||||
list<LinphoneChatMessage *> l = d->findMessages(messageId);
|
||||
for (auto &message : l) {
|
||||
|
|
@ -678,12 +678,12 @@ list<LinphoneChatMessage *> ChatRoom::getHistory (int nbMessages) {
|
|||
}
|
||||
|
||||
int ChatRoom::getHistorySize () {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
return d->getMessagesCount(false);
|
||||
}
|
||||
|
||||
list<LinphoneChatMessage *> ChatRoom::getHistoryRange (int startm, int endm) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
if (!d->core->db) return list<LinphoneChatMessage *>();
|
||||
string peer = d->peerAddress.asStringUriOnly();
|
||||
d->messages.clear();
|
||||
|
|
@ -739,17 +739,17 @@ list<LinphoneChatMessage *> ChatRoom::getHistoryRange (int startm, int endm) {
|
|||
}
|
||||
|
||||
int ChatRoom::getUnreadMessagesCount () {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
return d->getMessagesCount(true);
|
||||
}
|
||||
|
||||
bool ChatRoom::isRemoteComposing () const {
|
||||
L_D(const ChatRoom);
|
||||
L_D();
|
||||
return d->remoteIsComposing;
|
||||
}
|
||||
|
||||
void ChatRoom::markAsRead () {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
|
||||
if (!d->core->db) return;
|
||||
|
||||
|
|
@ -778,7 +778,7 @@ void ChatRoom::markAsRead () {
|
|||
}
|
||||
|
||||
void ChatRoom::sendMessage (LinphoneChatMessage *msg) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
|
||||
linphone_chat_message_set_outgoing(msg);
|
||||
|
||||
|
|
@ -921,19 +921,19 @@ void ChatRoom::sendMessage (LinphoneChatMessage *msg) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneCore *ChatRoom::getCore () const {
|
||||
L_D(const ChatRoom);
|
||||
L_D();
|
||||
return d->core;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const Address& ChatRoom::getPeerAddress () const {
|
||||
L_D(const ChatRoom);
|
||||
L_D();
|
||||
return d->peerAddress;
|
||||
}
|
||||
|
||||
ChatRoom::State ChatRoom::getState () const {
|
||||
L_D(const ChatRoom);
|
||||
L_D();
|
||||
return d->state;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ shared_ptr<Participant> ClientGroupChatRoom::addParticipant (const Address &addr
|
|||
}
|
||||
|
||||
void ClientGroupChatRoom::addParticipants (const list<Address> &addresses, const CallSessionParams *params, bool hasMedia) {
|
||||
L_D(ClientGroupChatRoom);
|
||||
L_D();
|
||||
if (addresses.empty())
|
||||
return;
|
||||
list<Address> sortedAddresses(addresses);
|
||||
|
|
@ -105,13 +105,13 @@ void ClientGroupChatRoom::removeParticipants (const list<shared_ptr<Participant>
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ClientGroupChatRoom::onConferenceCreated (const Address &addr) {
|
||||
L_D(ClientGroupChatRoom);
|
||||
L_D();
|
||||
conferenceAddress = addr;
|
||||
d->setState(ChatRoom::State::Created);
|
||||
}
|
||||
|
||||
void ClientGroupChatRoom::onConferenceTerminated (const Address &addr) {
|
||||
L_D(ClientGroupChatRoom);
|
||||
L_D();
|
||||
d->setState(ChatRoom::State::Terminated);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ bool Cpim::SubjectHeader::setValue (const string &value) {
|
|||
}
|
||||
|
||||
string Cpim::SubjectHeader::getLanguage () const {
|
||||
L_D(const SubjectHeader);
|
||||
L_D();
|
||||
return d->language;
|
||||
}
|
||||
|
||||
|
|
@ -82,14 +82,14 @@ bool Cpim::SubjectHeader::setLanguage (const string &language) {
|
|||
if (!language.empty() && !Parser::getInstance()->subjectHeaderLanguageIsValid(language))
|
||||
return false;
|
||||
|
||||
L_D(SubjectHeader);
|
||||
L_D();
|
||||
d->language = language;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
string Cpim::SubjectHeader::asString () const {
|
||||
L_D(const SubjectHeader);
|
||||
L_D();
|
||||
|
||||
string languageParam;
|
||||
if (!d->language.empty())
|
||||
|
|
@ -99,7 +99,7 @@ string Cpim::SubjectHeader::asString () const {
|
|||
}
|
||||
|
||||
void Cpim::SubjectHeader::force (const string &value, const string &language) {
|
||||
L_D(SubjectHeader);
|
||||
L_D();
|
||||
CoreHeader::force(value);
|
||||
d->language = language;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@ public:
|
|||
Cpim::GenericHeader::GenericHeader () : Header(*new GenericHeaderPrivate) {}
|
||||
|
||||
string Cpim::GenericHeader::getName () const {
|
||||
L_D(const GenericHeader);
|
||||
L_D();
|
||||
return d->name;
|
||||
}
|
||||
|
||||
bool Cpim::GenericHeader::setName (const string &name) {
|
||||
L_D(GenericHeader);
|
||||
L_D();
|
||||
|
||||
static const set<string> reserved = {
|
||||
"From", "To", "cc", "DateTime", "Subject", "NS", "Require"
|
||||
|
|
@ -68,12 +68,12 @@ bool Cpim::GenericHeader::setValue (const string &value) {
|
|||
}
|
||||
|
||||
Cpim::GenericHeader::ParameterList Cpim::GenericHeader::getParameters () const {
|
||||
L_D(const GenericHeader);
|
||||
L_D();
|
||||
return d->parameters;
|
||||
}
|
||||
|
||||
bool Cpim::GenericHeader::addParameter (const string &key, const string &value) {
|
||||
L_D(GenericHeader);
|
||||
L_D();
|
||||
|
||||
if (!Parser::getInstance()->headerParameterIsValid(key + "=" + value))
|
||||
return false;
|
||||
|
|
@ -83,17 +83,17 @@ bool Cpim::GenericHeader::addParameter (const string &key, const string &value)
|
|||
}
|
||||
|
||||
void Cpim::GenericHeader::removeParameter (const string &key, const string &value) {
|
||||
L_D(GenericHeader);
|
||||
L_D();
|
||||
d->parameters->remove(make_pair(key, value));
|
||||
}
|
||||
|
||||
bool Cpim::GenericHeader::isValid () const {
|
||||
L_D(const GenericHeader);
|
||||
L_D();
|
||||
return !d->name.empty() && !getValue().empty();
|
||||
}
|
||||
|
||||
string Cpim::GenericHeader::asString () const {
|
||||
L_D(const GenericHeader);
|
||||
L_D();
|
||||
|
||||
string parameters;
|
||||
for (const auto ¶meter : *d->parameters)
|
||||
|
|
@ -105,7 +105,7 @@ string Cpim::GenericHeader::asString () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void Cpim::GenericHeader::force (const string &name, const string &value, const string ¶meters) {
|
||||
L_D(GenericHeader);
|
||||
L_D();
|
||||
|
||||
// Set name/value.
|
||||
d->name = name;
|
||||
|
|
|
|||
|
|
@ -29,18 +29,18 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
Cpim::Header::Header (HeaderPrivate &p) : Object(p) {}
|
||||
|
||||
string Cpim::Header::getValue () const {
|
||||
L_D(const Header);
|
||||
L_D();
|
||||
return d->value;
|
||||
}
|
||||
|
||||
bool Cpim::Header::setValue (const string &value) {
|
||||
L_D(Header);
|
||||
L_D();
|
||||
d->value = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
string Cpim::Header::asString () const {
|
||||
L_D(const Header);
|
||||
L_D();
|
||||
return getName() + ": " + d->value + "\r\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ Cpim::Message::Message () : Object(*new MessagePrivate) {}
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
Cpim::Message::HeaderList Cpim::Message::getCpimHeaders () const {
|
||||
L_D(const Message);
|
||||
L_D();
|
||||
return d->cpimHeaders;
|
||||
}
|
||||
|
||||
bool Cpim::Message::addCpimHeader (const Header &cpimHeader) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
|
||||
if (!cpimHeader.isValid())
|
||||
return false;
|
||||
|
|
@ -62,7 +62,7 @@ bool Cpim::Message::addCpimHeader (const Header &cpimHeader) {
|
|||
}
|
||||
|
||||
void Cpim::Message::removeCpimHeader (const Header &cpimHeader) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
d->cpimHeaders->remove_if([&cpimHeader](const shared_ptr<const Header> &header) {
|
||||
return cpimHeader.getName() == header->getName() && cpimHeader.getValue() == header->getValue();
|
||||
});
|
||||
|
|
@ -71,12 +71,12 @@ void Cpim::Message::removeCpimHeader (const Header &cpimHeader) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
Cpim::Message::HeaderList Cpim::Message::getMessageHeaders () const {
|
||||
L_D(const Message);
|
||||
L_D();
|
||||
return d->messageHeaders;
|
||||
}
|
||||
|
||||
bool Cpim::Message::addMessageHeader (const Header &messageHeader) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
|
||||
if (!messageHeader.isValid())
|
||||
return false;
|
||||
|
|
@ -86,7 +86,7 @@ bool Cpim::Message::addMessageHeader (const Header &messageHeader) {
|
|||
}
|
||||
|
||||
void Cpim::Message::removeMessageHeader (const Header &messageHeader) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
d->messageHeaders->remove_if([&messageHeader](const shared_ptr<const Header> &header) {
|
||||
return messageHeader.getName() == header->getName() && messageHeader.getValue() == header->getValue();
|
||||
});
|
||||
|
|
@ -95,12 +95,12 @@ void Cpim::Message::removeMessageHeader (const Header &messageHeader) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
Cpim::Message::HeaderList Cpim::Message::getContentHeaders () const {
|
||||
L_D(const Message);
|
||||
L_D();
|
||||
return d->contentHeaders;
|
||||
}
|
||||
|
||||
bool Cpim::Message::addContentHeader (const Header &contentHeader) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
|
||||
if (!contentHeader.isValid())
|
||||
return false;
|
||||
|
|
@ -110,7 +110,7 @@ bool Cpim::Message::addContentHeader (const Header &contentHeader) {
|
|||
}
|
||||
|
||||
void Cpim::Message::removeContentHeader (const Header &contentHeader) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
d->contentHeaders->remove_if([&contentHeader](const shared_ptr<const Header> &header) {
|
||||
return contentHeader.getName() == header->getName() && contentHeader.getValue() == header->getValue();
|
||||
});
|
||||
|
|
@ -119,12 +119,12 @@ void Cpim::Message::removeContentHeader (const Header &contentHeader) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
string Cpim::Message::getContent () const {
|
||||
L_D(const Message);
|
||||
L_D();
|
||||
return d->content;
|
||||
}
|
||||
|
||||
bool Cpim::Message::setContent (const string &content) {
|
||||
L_D(Message);
|
||||
L_D();
|
||||
d->content = content;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ bool Cpim::Message::setContent (const string &content) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool Cpim::Message::isValid () const {
|
||||
L_D(const Message);
|
||||
L_D();
|
||||
|
||||
return find_if(d->cpimHeaders->cbegin(), d->cpimHeaders->cend(),
|
||||
[](const shared_ptr<const Header> &header) {
|
||||
|
|
@ -143,7 +143,7 @@ bool Cpim::Message::isValid () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
string Cpim::Message::asString () const {
|
||||
L_D(const Message);
|
||||
L_D();
|
||||
|
||||
string output;
|
||||
for (const auto &cpimHeader : *d->cpimHeaders)
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ public:
|
|||
};
|
||||
|
||||
Cpim::Parser::Parser () : Singleton(*new ParserPrivate) {
|
||||
L_D(Parser);
|
||||
L_D();
|
||||
|
||||
belr::ABNFGrammarBuilder builder;
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ Cpim::Parser::Parser () : Singleton(*new ParserPrivate) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
shared_ptr<Cpim::Message> Cpim::Parser::parseMessage (const string &input) {
|
||||
L_D(Parser);
|
||||
L_D();
|
||||
|
||||
typedef void (list<shared_ptr<HeaderNode> >::*pushPtr)(const shared_ptr<HeaderNode> &value);
|
||||
|
||||
|
|
@ -300,17 +300,17 @@ static bool headerIsValid (const shared_ptr<belr::Grammar> &grammar, const strin
|
|||
}
|
||||
|
||||
bool Cpim::Parser::headerNameIsValid (const string &headerName) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return headerIsValid(d->grammar, headerName + ": value\r\n");
|
||||
}
|
||||
|
||||
bool Cpim::Parser::headerValueIsValid (const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return headerIsValid(d->grammar, "key: " + headerValue + "\r\n");
|
||||
}
|
||||
|
||||
bool Cpim::Parser::headerParameterIsValid (const string &headerParameter) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return headerIsValid(d->grammar, "key:;" + headerParameter + " value\r\n");
|
||||
}
|
||||
|
||||
|
|
@ -338,19 +338,19 @@ static bool coreHeaderIsValid (
|
|||
|
||||
template<>
|
||||
bool Cpim::Parser::coreHeaderIsValid<Cpim::FromHeader>(const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "From", headerValue);
|
||||
}
|
||||
|
||||
template<>
|
||||
bool Cpim::Parser::coreHeaderIsValid<Cpim::ToHeader>(const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "To", headerValue);
|
||||
}
|
||||
|
||||
template<>
|
||||
bool Cpim::Parser::coreHeaderIsValid<Cpim::CcHeader>(const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "cc", headerValue);
|
||||
}
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ template<>
|
|||
bool Cpim::Parser::coreHeaderIsValid<Cpim::DateTimeHeader>(const string &headerValue) const {
|
||||
static const int daysInMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
if (!LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "DateTime", headerValue))
|
||||
return false;
|
||||
|
||||
|
|
@ -397,26 +397,26 @@ bool Cpim::Parser::coreHeaderIsValid<Cpim::DateTimeHeader>(const string &headerV
|
|||
|
||||
template<>
|
||||
bool Cpim::Parser::coreHeaderIsValid<Cpim::SubjectHeader>(const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "Subject", headerValue);
|
||||
}
|
||||
|
||||
template<>
|
||||
bool Cpim::Parser::coreHeaderIsValid<Cpim::NsHeader>(const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "NS", headerValue);
|
||||
}
|
||||
|
||||
template<>
|
||||
bool Cpim::Parser::coreHeaderIsValid<Cpim::RequireHeader>(const string &headerValue) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "Require", headerValue);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool Cpim::Parser::subjectHeaderLanguageIsValid (const string &language) const {
|
||||
L_D(const Parser);
|
||||
L_D();
|
||||
return LINPHONE_NAMESPACE::coreHeaderIsValid(d->grammar, "Subject", "SubjectValue", ";lang=" + language);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ RealTimeTextChatRoomPrivate::~RealTimeTextChatRoomPrivate () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void RealTimeTextChatRoomPrivate::realtimeTextReceived (uint32_t character, LinphoneCall *call) {
|
||||
L_Q(ChatRoom);
|
||||
L_Q();
|
||||
const uint32_t new_line = 0x2028;
|
||||
const uint32_t crlf = 0x0D0A;
|
||||
const uint32_t lf = 0x0A;
|
||||
|
|
@ -107,7 +107,7 @@ RealTimeTextChatRoom::RealTimeTextChatRoom (LinphoneCore *core, const Address &p
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void RealTimeTextChatRoom::sendMessage (LinphoneChatMessage *msg) {
|
||||
L_D(ChatRoom);
|
||||
L_D();
|
||||
if (d->call && linphone_call_params_realtime_text_enabled(linphone_call_get_current_params(d->call))) {
|
||||
uint32_t new_line = 0x2028;
|
||||
linphone_chat_message_put_char(msg, new_line);
|
||||
|
|
@ -118,7 +118,7 @@ void RealTimeTextChatRoom::sendMessage (LinphoneChatMessage *msg) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
uint32_t RealTimeTextChatRoom::getChar () const {
|
||||
L_D(const ChatRoom);
|
||||
L_D();
|
||||
if (!d->receivedRttCharacters.empty()) {
|
||||
for (auto &cmc : d->receivedRttCharacters) {
|
||||
if (!cmc->has_been_read) {
|
||||
|
|
@ -133,7 +133,7 @@ uint32_t RealTimeTextChatRoom::getChar () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneCall *RealTimeTextChatRoom::getCall () const {
|
||||
L_D(const ChatRoom);
|
||||
L_D();
|
||||
return d->call;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ int RealTimeTextChatRoom::getNbParticipants () const {
|
|||
}
|
||||
|
||||
list<shared_ptr<Participant>> RealTimeTextChatRoom::getParticipants () const {
|
||||
L_D(const RealTimeTextChatRoom);
|
||||
L_D();
|
||||
list<shared_ptr<Participant>> l;
|
||||
l.push_back(make_shared<Participant>(d->peerAddress));
|
||||
return l;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ void LocalConferenceEventHandlerPrivate::notifyAllExcept(string notify, const Ad
|
|||
// =============================================================================
|
||||
|
||||
LocalConferenceEventHandler::LocalConferenceEventHandler(LinphoneCore *core, LocalConference *localConf) : Object(*new LocalConferenceEventHandlerPrivate) {
|
||||
L_D(LocalConferenceEventHandler);
|
||||
L_D();
|
||||
xercesc::XMLPlatformUtils::Initialize();
|
||||
d->conf = localConf;
|
||||
d->core = core; // conf->getCore() ?
|
||||
|
|
@ -83,7 +83,7 @@ LocalConferenceEventHandler::~LocalConferenceEventHandler() {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
string LocalConferenceEventHandler::subscribeReceived(LinphoneEvent *lev) {
|
||||
L_D(LocalConferenceEventHandler);
|
||||
L_D();
|
||||
string entity = d->conf->getMe()->getAddress().asStringUriOnly();
|
||||
ConferenceType confInfo = ConferenceType(entity);
|
||||
UsersType users;
|
||||
|
|
@ -108,7 +108,7 @@ string LocalConferenceEventHandler::subscribeReceived(LinphoneEvent *lev) {
|
|||
}
|
||||
|
||||
string LocalConferenceEventHandler::notifyParticipantAdded(const Address &addr) {
|
||||
L_D(LocalConferenceEventHandler);
|
||||
L_D();
|
||||
string entity = d->conf->getMe()->getAddress().asStringUriOnly();
|
||||
ConferenceType confInfo = ConferenceType(entity);
|
||||
UsersType users;
|
||||
|
|
@ -130,7 +130,7 @@ string LocalConferenceEventHandler::notifyParticipantAdded(const Address &addr)
|
|||
}
|
||||
|
||||
string LocalConferenceEventHandler::notifyParticipantRemoved(const Address &addr) {
|
||||
L_D(LocalConferenceEventHandler);
|
||||
L_D();
|
||||
string entity = d->conf->getMe()->getAddress().asStringUriOnly();
|
||||
ConferenceType confInfo = ConferenceType(entity);
|
||||
UsersType users;
|
||||
|
|
@ -149,7 +149,7 @@ string LocalConferenceEventHandler::notifyParticipantRemoved(const Address &addr
|
|||
}
|
||||
|
||||
string LocalConferenceEventHandler::notifyParticipantSetAdmin(const Address &addr, bool isAdmin) {
|
||||
L_D(LocalConferenceEventHandler);
|
||||
L_D();
|
||||
string entity = d->conf->getMe()->getAddress().asStringUriOnly();
|
||||
ConferenceType confInfo = ConferenceType(entity);
|
||||
UsersType users;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ CallSessionParams::CallSessionParams (const CallSessionParams &src)
|
|||
: ClonableObject(*new CallSessionParamsPrivate(*src.getPrivate())) {}
|
||||
|
||||
CallSessionParams &CallSessionParams::operator= (const CallSessionParams &src) {
|
||||
L_D(CallSessionParams);
|
||||
L_D();
|
||||
if (this != &src)
|
||||
*d = *src.getPrivate();
|
||||
return *this;
|
||||
|
|
@ -90,7 +90,7 @@ CallSessionParams &CallSessionParams::operator= (const CallSessionParams &src) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallSessionParams::initDefault (LinphoneCore *core) {
|
||||
L_D(CallSessionParams);
|
||||
L_D();
|
||||
d->inConference = false;
|
||||
d->privacy = LinphonePrivacyDefault;
|
||||
}
|
||||
|
|
@ -98,41 +98,41 @@ void CallSessionParams::initDefault (LinphoneCore *core) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
const string& CallSessionParams::getSessionName () const {
|
||||
L_D(const CallSessionParams);
|
||||
L_D();
|
||||
return d->sessionName;
|
||||
}
|
||||
|
||||
void CallSessionParams::setSessionName (const string &sessionName) {
|
||||
L_D(CallSessionParams);
|
||||
L_D();
|
||||
d->sessionName = sessionName;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphonePrivacyMask CallSessionParams::getPrivacy () const {
|
||||
L_D(const CallSessionParams);
|
||||
L_D();
|
||||
return d->privacy;
|
||||
}
|
||||
|
||||
void CallSessionParams::setPrivacy (LinphonePrivacyMask privacy) {
|
||||
L_D(CallSessionParams);
|
||||
L_D();
|
||||
d->privacy = privacy;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallSessionParams::addCustomHeader (const string &headerName, const string &headerValue) {
|
||||
L_D(CallSessionParams);
|
||||
L_D();
|
||||
d->customHeaders = sal_custom_header_append(d->customHeaders, headerName.c_str(), headerValue.c_str());
|
||||
}
|
||||
|
||||
void CallSessionParams::clearCustomHeaders () {
|
||||
L_D(CallSessionParams);
|
||||
L_D();
|
||||
d->setCustomHeaders(nullptr);
|
||||
}
|
||||
|
||||
const char * CallSessionParams::getCustomHeader (const string &headerName) const {
|
||||
L_D(const CallSessionParams);
|
||||
L_D();
|
||||
return sal_custom_header_find(d->customHeaders, headerName.c_str());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ LinphoneMediaDirection MediaSessionParamsPrivate::salStreamDirToMediaDirection (
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParamsPrivate::adaptToNetwork (LinphoneCore *core, int pingTimeMs) {
|
||||
L_Q(MediaSessionParams);
|
||||
L_Q();
|
||||
if ((pingTimeMs > 0) && lp_config_get_int(linphone_core_get_config(core), "net", "activate_edge_workarounds", 0)) {
|
||||
lInfo() << "STUN server ping time is " << pingTimeMs << " ms";
|
||||
int threshold = lp_config_get_int(linphone_core_get_config(core), "net", "edge_ping_time", 500);
|
||||
|
|
@ -159,12 +159,12 @@ void MediaSessionParamsPrivate::adaptToNetwork (LinphoneCore *core, int pingTime
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
SalStreamDir MediaSessionParamsPrivate::getSalAudioDirection () const {
|
||||
L_Q(const MediaSessionParams);
|
||||
L_Q();
|
||||
return mediaDirectionToSalStreamDir(q->getAudioDirection());
|
||||
}
|
||||
|
||||
SalStreamDir MediaSessionParamsPrivate::getSalVideoDirection () const {
|
||||
L_Q(const MediaSessionParams);
|
||||
L_Q();
|
||||
return mediaDirectionToSalStreamDir(q->getVideoDirection());
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ MediaSessionParams::MediaSessionParams (const MediaSessionParams &src)
|
|||
: CallSessionParams(*new MediaSessionParamsPrivate(*src.getPrivate())) {}
|
||||
|
||||
MediaSessionParams &MediaSessionParams::operator= (const MediaSessionParams &src) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
CallSessionParams::operator=(src);
|
||||
*d = *src.getPrivate();
|
||||
|
|
@ -231,7 +231,7 @@ MediaSessionParams &MediaSessionParams::operator= (const MediaSessionParams &src
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParams::initDefault (LinphoneCore *core) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
CallSessionParams::initDefault(core);
|
||||
d->audioEnabled = true;
|
||||
d->videoEnabled = linphone_core_video_enabled(core) && core->video_policy.automatically_initiate;
|
||||
|
|
@ -256,220 +256,220 @@ void MediaSessionParams::initDefault (LinphoneCore *core) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MediaSessionParams::audioEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->audioEnabled;
|
||||
}
|
||||
|
||||
bool MediaSessionParams::audioMulticastEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->audioMulticastEnabled;
|
||||
}
|
||||
|
||||
void MediaSessionParams::enableAudio (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->audioEnabled = value;
|
||||
if (d->audioEnabled && (getAudioDirection() == LinphoneMediaDirectionInactive))
|
||||
setAudioDirection(LinphoneMediaDirectionSendRecv);
|
||||
}
|
||||
|
||||
void MediaSessionParams::enableAudioMulticast (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->audioMulticastEnabled = value;
|
||||
}
|
||||
|
||||
int MediaSessionParams::getAudioBandwidthLimit () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->audioBandwidthLimit;
|
||||
}
|
||||
|
||||
LinphoneMediaDirection MediaSessionParams::getAudioDirection () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->audioDirection;
|
||||
}
|
||||
|
||||
const OrtpPayloadType * MediaSessionParams::getUsedAudioCodec () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->usedAudioCodec;
|
||||
}
|
||||
|
||||
LinphonePayloadType * MediaSessionParams::getUsedAudioPayloadType () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->usedAudioCodec ? linphone_payload_type_new(nullptr, d->usedAudioCodec) : nullptr;
|
||||
}
|
||||
|
||||
void MediaSessionParams::setAudioBandwidthLimit (int value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->audioBandwidthLimit = value;
|
||||
}
|
||||
|
||||
void MediaSessionParams::setAudioDirection (LinphoneMediaDirection direction) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->audioDirection = direction;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParams::enableVideo (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->videoEnabled = value;
|
||||
if (d->videoEnabled && (getVideoDirection() == LinphoneMediaDirectionInactive))
|
||||
setVideoDirection(LinphoneMediaDirectionSendRecv);
|
||||
}
|
||||
|
||||
void MediaSessionParams::enableVideoMulticast (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->videoMulticastEnabled = value;
|
||||
}
|
||||
|
||||
float MediaSessionParams::getReceivedFps () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->receivedFps;
|
||||
}
|
||||
|
||||
LinphoneVideoDefinition * MediaSessionParams::getReceivedVideoDefinition () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->receivedVideoDefinition;
|
||||
}
|
||||
|
||||
float MediaSessionParams::getSentFps () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->sentFps;
|
||||
}
|
||||
|
||||
LinphoneVideoDefinition * MediaSessionParams::getSentVideoDefinition () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->sentVideoDefinition;
|
||||
}
|
||||
|
||||
const OrtpPayloadType * MediaSessionParams::getUsedVideoCodec () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->usedVideoCodec;
|
||||
}
|
||||
|
||||
LinphonePayloadType * MediaSessionParams::getUsedVideoPayloadType () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->usedVideoCodec ? linphone_payload_type_new(nullptr, d->usedVideoCodec) : nullptr;
|
||||
}
|
||||
|
||||
LinphoneMediaDirection MediaSessionParams::getVideoDirection () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->videoDirection;
|
||||
}
|
||||
|
||||
void MediaSessionParams::setVideoDirection (LinphoneMediaDirection direction) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->videoDirection = direction;
|
||||
}
|
||||
|
||||
bool MediaSessionParams::videoEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->videoEnabled;
|
||||
}
|
||||
|
||||
bool MediaSessionParams::videoMulticastEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->videoMulticastEnabled;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParams::enableRealtimeText (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->realtimeTextEnabled = value;
|
||||
}
|
||||
|
||||
const OrtpPayloadType * MediaSessionParams::getUsedRealtimeTextCodec () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->usedRealtimeTextCodec;
|
||||
}
|
||||
|
||||
LinphonePayloadType * MediaSessionParams::getUsedRealtimeTextPayloadType () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->usedRealtimeTextCodec ? linphone_payload_type_new(nullptr, d->usedRealtimeTextCodec) : nullptr;
|
||||
}
|
||||
|
||||
bool MediaSessionParams::realtimeTextEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->realtimeTextEnabled;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MediaSessionParams::avpfEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->avpfEnabled;
|
||||
}
|
||||
|
||||
void MediaSessionParams::enableAvpf (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->avpfEnabled = value;
|
||||
}
|
||||
|
||||
uint16_t MediaSessionParams::getAvpfRrInterval () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->avpfRrInterval;
|
||||
}
|
||||
|
||||
void MediaSessionParams::setAvpfRrInterval (uint16_t value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->avpfRrInterval = value;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MediaSessionParams::lowBandwidthEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->lowBandwidthEnabled;
|
||||
}
|
||||
|
||||
void MediaSessionParams::enableLowBandwidth (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->lowBandwidthEnabled = value;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const string& MediaSessionParams::getRecordFilePath () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->recordFilePath;
|
||||
}
|
||||
|
||||
void MediaSessionParams::setRecordFilePath (const string &path) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->recordFilePath = path;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MediaSessionParams::earlyMediaSendingEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->earlyMediaSendingEnabled;
|
||||
}
|
||||
|
||||
void MediaSessionParams::enableEarlyMediaSending (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->earlyMediaSendingEnabled = value;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParams::enableMandatoryMediaEncryption (bool value) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->mandatoryMediaEncryptionEnabled = value;
|
||||
}
|
||||
|
||||
LinphoneMediaEncryption MediaSessionParams::getMediaEncryption () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->encryption;
|
||||
}
|
||||
|
||||
bool MediaSessionParams::mandatoryMediaEncryptionEnabled () const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return d->mandatoryMediaEncryptionEnabled;
|
||||
}
|
||||
|
||||
void MediaSessionParams::setMediaEncryption (LinphoneMediaEncryption encryption) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->encryption = encryption;
|
||||
}
|
||||
|
||||
|
|
@ -491,34 +491,34 @@ const char * MediaSessionParams::getRtpProfile () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParams::addCustomSdpAttribute (const string &attributeName, const string &attributeValue) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->customSdpAttributes = sal_custom_sdp_attribute_append(d->customSdpAttributes, attributeName.c_str(), attributeValue.c_str());
|
||||
}
|
||||
|
||||
void MediaSessionParams::clearCustomSdpAttributes () {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->setCustomSdpAttributes(nullptr);
|
||||
}
|
||||
|
||||
const char * MediaSessionParams::getCustomSdpAttribute (const string &attributeName) const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return sal_custom_sdp_attribute_find(d->customSdpAttributes, attributeName.c_str());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionParams::addCustomSdpMediaAttribute (LinphoneStreamType lst, const string &attributeName, const string &attributeValue) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->customSdpMediaAttributes[lst] = sal_custom_sdp_attribute_append(d->customSdpMediaAttributes[lst], attributeName.c_str(), attributeValue.c_str());
|
||||
}
|
||||
|
||||
void MediaSessionParams::clearCustomSdpMediaAttributes (LinphoneStreamType lst) {
|
||||
L_D(MediaSessionParams);
|
||||
L_D();
|
||||
d->setCustomSdpMediaAttributes(lst, nullptr);
|
||||
}
|
||||
|
||||
const char * MediaSessionParams::getCustomSdpMediaAttribute (LinphoneStreamType lst, const string &attributeName) const {
|
||||
L_D(const MediaSessionParams);
|
||||
L_D();
|
||||
return sal_custom_sdp_attribute_find(d->customSdpMediaAttributes[lst], attributeName.c_str());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,26 +45,26 @@ shared_ptr<CallSession> ParticipantPrivate::getSession () const {
|
|||
// =============================================================================
|
||||
|
||||
Participant::Participant (const Address &addr) : Object(*new ParticipantPrivate) {
|
||||
L_D(Participant);
|
||||
L_D();
|
||||
d->addr = addr;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const Address& Participant::getAddress () const {
|
||||
L_D(const Participant);
|
||||
L_D();
|
||||
return d->addr;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool Participant::isAdmin () const {
|
||||
L_D(const Participant);
|
||||
L_D();
|
||||
return d->isAdmin;
|
||||
}
|
||||
|
||||
void Participant::setAdmin (bool isAdmin) {
|
||||
L_D(Participant);
|
||||
L_D();
|
||||
d->isAdmin = isAdmin;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@ public:
|
|||
|
||||
RemoteConferenceEventHandler::RemoteConferenceEventHandler(LinphoneCore *core, ConferenceListener *listener)
|
||||
: Object(*new RemoteConferenceEventHandlerPrivate) {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
xercesc::XMLPlatformUtils::Initialize();
|
||||
d->core = core;
|
||||
d->listener = listener;
|
||||
}
|
||||
|
||||
RemoteConferenceEventHandler::~RemoteConferenceEventHandler() {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
xercesc::XMLPlatformUtils::Terminate();
|
||||
if (d->lev)
|
||||
linphone_event_unref(d->lev);
|
||||
|
|
@ -60,7 +60,7 @@ RemoteConferenceEventHandler::~RemoteConferenceEventHandler() {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void RemoteConferenceEventHandler::subscribe(string confId) {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
d->confId = confId;
|
||||
LinphoneAddress *addr = linphone_address_new(d->confAddr.asString().c_str());
|
||||
d->lev = linphone_core_create_subscribe(d->core, addr, "Conference", 600);
|
||||
|
|
@ -73,12 +73,12 @@ void RemoteConferenceEventHandler::subscribe(string confId) {
|
|||
}
|
||||
|
||||
void RemoteConferenceEventHandler::unsubscribe() {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
linphone_event_terminate(d->lev);
|
||||
}
|
||||
|
||||
void RemoteConferenceEventHandler::notifyReceived(string xmlBody) {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
istringstream data(xmlBody);
|
||||
unique_ptr<ConferenceType> confInfo = parseConferenceInfo(data, Xsd::XmlSchema::Flags::dont_validate);
|
||||
if (confInfo->getEntity() == d->confAddr.asString()) {
|
||||
|
|
@ -109,12 +109,12 @@ void RemoteConferenceEventHandler::notifyReceived(string xmlBody) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
string RemoteConferenceEventHandler::getConfId() {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
return d->confId;
|
||||
}
|
||||
|
||||
void RemoteConferenceEventHandler::setConferenceAddress (const Address &addr) {
|
||||
L_D(RemoteConferenceEventHandler);
|
||||
L_D();
|
||||
d->confAddr = addr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void CallSessionPrivate::initializeParamsAccordingToIncomingCallParams () {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::setState(LinphoneCallState newState, const string &message) {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
if (state != newState){
|
||||
prevState = state;
|
||||
|
||||
|
|
@ -229,19 +229,19 @@ void CallSessionPrivate::accepted () {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::ackBeingSent (LinphoneHeaders *headers) {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
if (listener)
|
||||
listener->onAckBeingSent(*q, headers);
|
||||
}
|
||||
|
||||
void CallSessionPrivate::ackReceived (LinphoneHeaders *headers) {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
if (listener)
|
||||
listener->onAckReceived(*q, headers);
|
||||
}
|
||||
|
||||
bool CallSessionPrivate::failure () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
const SalErrorInfo *ei = sal_op_get_error_info(op);
|
||||
switch (ei->reason) {
|
||||
case SalReasonRedirect:
|
||||
|
|
@ -307,7 +307,7 @@ bool CallSessionPrivate::failure () {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::pingReply () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
if (state == LinphoneCallOutgoingInit) {
|
||||
pingReplied = true;
|
||||
if (isReadyForInvite())
|
||||
|
|
@ -316,7 +316,7 @@ void CallSessionPrivate::pingReply () {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::remoteRinging () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
/* Set privacy */
|
||||
q->getCurrentParams()->setPrivacy((LinphonePrivacyMask)sal_op_get_privacy(op));
|
||||
#if 0
|
||||
|
|
@ -401,7 +401,7 @@ void CallSessionPrivate::updated (bool isUpdate) {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::updatedByRemote () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
setState(LinphoneCallUpdatedByRemote,"Call updated by remote");
|
||||
if (deferUpdate) {
|
||||
if (state == LinphoneCallUpdatedByRemote)
|
||||
|
|
@ -423,7 +423,7 @@ void CallSessionPrivate::updating (bool isUpdate) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallSessionPrivate::accept (const CallSessionParams *params) {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
/* Try to be best-effort in giving real local or routable contact address */
|
||||
setContactOp();
|
||||
if (params) {
|
||||
|
|
@ -442,7 +442,7 @@ LinphoneStatus CallSessionPrivate::acceptUpdate (const CallSessionParams *csp, L
|
|||
}
|
||||
|
||||
LinphoneStatus CallSessionPrivate::checkForAcceptation () const {
|
||||
L_Q(const CallSession);
|
||||
L_Q();
|
||||
switch (state) {
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallIncomingEarlyMedia:
|
||||
|
|
@ -467,7 +467,7 @@ LinphoneStatus CallSessionPrivate::checkForAcceptation () const {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::handleIncomingReceivedStateInIncomingNotification () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
/* Try to be best-effort in giving real local or routable contact address for 100Rel case */
|
||||
setContactOp();
|
||||
sal_call_notify_ringing(op, false);
|
||||
|
|
@ -518,7 +518,7 @@ bool CallSessionPrivate::isUpdateAllowed (LinphoneCallState &nextState) const {
|
|||
* Called internally when reaching the Released state, to perform cleanups to break circular references.
|
||||
**/
|
||||
void CallSessionPrivate::setReleased () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
if (op) {
|
||||
/* Transfer the last error so that it can be obtained even in Released state */
|
||||
if (!nonOpError)
|
||||
|
|
@ -552,7 +552,7 @@ void CallSessionPrivate::setReleased () {
|
|||
* - update the call logs accordingly
|
||||
*/
|
||||
void CallSessionPrivate::setTerminated() {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
completeLog();
|
||||
if (listener)
|
||||
listener->onCallSessionSetTerminated(*q);
|
||||
|
|
@ -565,7 +565,7 @@ LinphoneStatus CallSessionPrivate::startAcceptUpdate (LinphoneCallState nextStat
|
|||
}
|
||||
|
||||
LinphoneStatus CallSessionPrivate::startUpdate () {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
string subject;
|
||||
if (q->getParams()->getPrivate()->getInConference())
|
||||
subject = "Conference";
|
||||
|
|
@ -617,7 +617,7 @@ void CallSessionPrivate::completeLog () {
|
|||
}
|
||||
|
||||
void CallSessionPrivate::createOpTo (const LinphoneAddress *to) {
|
||||
L_Q(CallSession);
|
||||
L_Q();
|
||||
if (op)
|
||||
sal_op_release(op);
|
||||
op = sal_op_new(core->sal);
|
||||
|
|
@ -673,7 +673,7 @@ CallSession::CallSession (CallSessionPrivate &p) : Object(p) {}
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneStatus CallSession::accept (const CallSessionParams *csp) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
LinphoneStatus result = d->checkForAcceptation();
|
||||
if (result < 0) return result;
|
||||
d->accept(csp);
|
||||
|
|
@ -681,7 +681,7 @@ LinphoneStatus CallSession::accept (const CallSessionParams *csp) {
|
|||
}
|
||||
|
||||
LinphoneStatus CallSession::acceptUpdate (const CallSessionParams *csp) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
if (d->state != LinphoneCallUpdatedByRemote) {
|
||||
lError() << "CallSession::acceptUpdate(): invalid state " << linphone_call_state_to_string(d->state) << " to call this method";
|
||||
return -1;
|
||||
|
|
@ -690,7 +690,7 @@ LinphoneStatus CallSession::acceptUpdate (const CallSessionParams *csp) {
|
|||
}
|
||||
|
||||
void CallSession::configure (LinphoneCallDir direction, LinphoneProxyConfig *cfg, SalOp *op, const Address &from, const Address &to) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
d->direction = direction;
|
||||
d->destProxy = cfg;
|
||||
LinphoneAddress *fromAddr = linphone_address_new(from.asString().c_str());
|
||||
|
|
@ -727,7 +727,7 @@ LinphoneStatus CallSession::decline (LinphoneReason reason) {
|
|||
}
|
||||
|
||||
LinphoneStatus CallSession::decline (const LinphoneErrorInfo *ei) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
SalErrorInfo sei;
|
||||
SalErrorInfo sub_sei;
|
||||
memset(&sei, 0, sizeof(sei));
|
||||
|
|
@ -751,7 +751,7 @@ LinphoneStatus CallSession::decline (const LinphoneErrorInfo *ei) {
|
|||
void CallSession::initiateIncoming () {}
|
||||
|
||||
bool CallSession::initiateOutgoing () {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
bool defer = false;
|
||||
d->setState(LinphoneCallOutgoingInit, "Starting outgoing call");
|
||||
d->log->start_date_time = ms_time(nullptr);
|
||||
|
|
@ -764,7 +764,7 @@ bool CallSession::initiateOutgoing () {
|
|||
}
|
||||
|
||||
void CallSession::iterate (time_t currentRealTime, bool oneSecondElapsed) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
int elapsed = (int)(currentRealTime - d->log->start_date_time);
|
||||
if ((d->state == LinphoneCallOutgoingInit) && (elapsed >= d->core->sip_conf.delayed_timeout)) {
|
||||
/* Start the call even if the OPTIONS reply did not arrive */
|
||||
|
|
@ -794,7 +794,7 @@ void CallSession::iterate (time_t currentRealTime, bool oneSecondElapsed) {
|
|||
}
|
||||
|
||||
void CallSession::startIncomingNotification () {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
if (d->listener)
|
||||
d->listener->onCallSessionAccepted(*this);
|
||||
/* Prevent the CallSession from being destroyed while we are notifying, if the user declines within the state callback */
|
||||
|
|
@ -827,7 +827,7 @@ void CallSession::startIncomingNotification () {
|
|||
}
|
||||
|
||||
int CallSession::startInvite (const Address *destination, const string &subject) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
/* Try to be best-effort in giving real local or routable contact address */
|
||||
d->setContactOp();
|
||||
string destinationStr;
|
||||
|
|
@ -858,7 +858,7 @@ int CallSession::startInvite (const Address *destination, const string &subject)
|
|||
}
|
||||
|
||||
LinphoneStatus CallSession::terminate (const LinphoneErrorInfo *ei) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
lInfo() << "Terminate CallSession [" << this << "] which is currently in state [" << linphone_call_state_to_string(d->state) << "]";
|
||||
SalErrorInfo sei;
|
||||
memset(&sei, 0, sizeof(sei));
|
||||
|
|
@ -891,7 +891,7 @@ LinphoneStatus CallSession::terminate (const LinphoneErrorInfo *ei) {
|
|||
}
|
||||
|
||||
LinphoneStatus CallSession::update (const CallSessionParams *csp) {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
LinphoneCallState nextState;
|
||||
LinphoneCallState initialState = d->state;
|
||||
if (!d->isUpdateAllowed(nextState))
|
||||
|
|
@ -909,12 +909,12 @@ LinphoneStatus CallSession::update (const CallSessionParams *csp) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneCallDir CallSession::getDirection () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
return d->direction;
|
||||
}
|
||||
|
||||
int CallSession::getDuration () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
switch (d->state) {
|
||||
case LinphoneCallEnd:
|
||||
case LinphoneCallError:
|
||||
|
|
@ -926,14 +926,14 @@ int CallSession::getDuration () const {
|
|||
}
|
||||
|
||||
const LinphoneErrorInfo * CallSession::getErrorInfo () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
if (!d->nonOpError)
|
||||
linphone_error_info_from_sal_op(d->ei, d->op);
|
||||
return d->ei;
|
||||
}
|
||||
|
||||
LinphoneCallLog * CallSession::getLog () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
return d->log;
|
||||
}
|
||||
|
||||
|
|
@ -942,7 +942,7 @@ LinphoneReason CallSession::getReason () const {
|
|||
}
|
||||
|
||||
const Address& CallSession::getRemoteAddress () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
return *L_GET_CPP_PTR_FROM_C_OBJECT((d->direction == LinphoneCallIncoming)
|
||||
? linphone_call_log_get_from(d->log) : linphone_call_log_get_to(d->log));
|
||||
}
|
||||
|
|
@ -952,7 +952,7 @@ string CallSession::getRemoteAddressAsString () const {
|
|||
}
|
||||
|
||||
string CallSession::getRemoteContact () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
if (d->op) {
|
||||
/* sal_op_get_remote_contact preserves header params */
|
||||
return sal_op_get_remote_contact(d->op);
|
||||
|
|
@ -961,7 +961,7 @@ string CallSession::getRemoteContact () const {
|
|||
}
|
||||
|
||||
const CallSessionParams * CallSession::getRemoteParams () {
|
||||
L_D(CallSession);
|
||||
L_D();
|
||||
if (d->op){
|
||||
const SalCustomHeader *ch = sal_op_get_recv_custom_header(d->op);
|
||||
if (ch) {
|
||||
|
|
@ -976,21 +976,21 @@ const CallSessionParams * CallSession::getRemoteParams () {
|
|||
}
|
||||
|
||||
LinphoneCallState CallSession::getState () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
return d->state;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
string CallSession::getRemoteUserAgent () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
if (d->op)
|
||||
return sal_op_get_remote_ua(d->op);
|
||||
return string();
|
||||
}
|
||||
|
||||
CallSessionParams * CallSession::getCurrentParams () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
d->updateCurrentParams();
|
||||
return d->currentParams;
|
||||
}
|
||||
|
|
@ -998,7 +998,7 @@ CallSessionParams * CallSession::getCurrentParams () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
const CallSessionParams * CallSession::getParams () const {
|
||||
L_D(const CallSession);
|
||||
L_D();
|
||||
return d->params;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ void MediaSessionPrivate::stunAuthRequestedCb (void *userData, const char *realm
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionPrivate::accepted () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
CallSessionPrivate::accepted();
|
||||
LinphoneTaskList tl;
|
||||
linphone_task_list_init(&tl);
|
||||
|
|
@ -245,7 +245,7 @@ void MediaSessionPrivate::ackReceived (LinphoneHeaders *headers) {
|
|||
}
|
||||
|
||||
bool MediaSessionPrivate::failure () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
const SalErrorInfo *ei = sal_op_get_error_info(op);
|
||||
switch (ei->reason) {
|
||||
case SalReasonRedirect:
|
||||
|
|
@ -326,7 +326,7 @@ void MediaSessionPrivate::pausedByRemote () {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::remoteRinging () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
/* Set privacy */
|
||||
q->getCurrentParams()->setPrivacy((LinphonePrivacyMask)sal_op_get_privacy(op));
|
||||
SalMediaDescription *md = sal_call_get_final_media_description(op);
|
||||
|
|
@ -409,7 +409,7 @@ void MediaSessionPrivate::updated (bool isUpdate) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::updating (bool isUpdate) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
SalMediaDescription *rmd = sal_call_get_remote_media_description(op);
|
||||
fixCallParams(rmd);
|
||||
if (state != LinphoneCallPaused) {
|
||||
|
|
@ -613,7 +613,7 @@ float MediaSessionPrivate::aggregateQualityRatings (float audioRating, float vid
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionPrivate::setState (LinphoneCallState newState, const string &message) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
/* Take a ref on the session otherwise it might get destroyed during the call to setState */
|
||||
shared_ptr<CallSession> session = static_pointer_cast<CallSession>(q->shared_from_this());
|
||||
CallSessionPrivate::setState(newState, message);
|
||||
|
|
@ -731,7 +731,7 @@ void MediaSessionPrivate::computeStreamsIndexes (const SalMediaDescription *md)
|
|||
* Fixing the params to proper values avoid request video by accident during internal call updates, pauses and resumes
|
||||
*/
|
||||
void MediaSessionPrivate::fixCallParams (SalMediaDescription *rmd) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (rmd) {
|
||||
computeStreamsIndexes(rmd);
|
||||
updateBiggestDesc(rmd);
|
||||
|
|
@ -1138,7 +1138,7 @@ void MediaSessionPrivate::selectOutgoingIpVersion () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSessionPrivate::forceStreamsDirAccordingToState (SalMediaDescription *md) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
for (int i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; i++) {
|
||||
SalStreamDescription *sd = &md->streams[i];
|
||||
switch (state) {
|
||||
|
|
@ -1191,7 +1191,7 @@ bool MediaSessionPrivate::generateB64CryptoKey (size_t keyLength, char *keyOut,
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::makeLocalMediaDescription () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
int maxIndex = 0;
|
||||
bool rtcpMux = lp_config_get_int(linphone_core_get_config(core), "rtp", "rtcp_mux", 0);
|
||||
SalMediaDescription *md = sal_media_description_new();
|
||||
|
|
@ -1527,7 +1527,7 @@ void MediaSessionPrivate::updateLocalMediaDescriptionFromIce () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
SalMulticastRole MediaSessionPrivate::getMulticastRole (SalStreamType type) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
SalMulticastRole multicastRole = SalMulticastInactive;
|
||||
if (op) {
|
||||
SalStreamDescription *streamDesc = nullptr;
|
||||
|
|
@ -1552,7 +1552,7 @@ SalMulticastRole MediaSessionPrivate::getMulticastRole (SalStreamType type) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::joinMulticastGroup (int streamIndex, MediaStream *ms) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (!mediaPorts[streamIndex].multicastIp.empty())
|
||||
media_stream_join_multicast_group(ms, mediaPorts[streamIndex].multicastIp.c_str());
|
||||
else
|
||||
|
|
@ -1844,7 +1844,7 @@ void MediaSessionPrivate::unsetRtpProfile (int streamIndex) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::updateAllocatedAudioBandwidth (const PayloadType *pt, int maxbw) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
audioBandwidth = PayloadTypeHandler::getAudioPayloadTypeBandwidth(pt, maxbw);
|
||||
lInfo() << "Audio bandwidth for CallSession [" << q << "] is " << audioBandwidth;
|
||||
}
|
||||
|
|
@ -1905,7 +1905,7 @@ void MediaSessionPrivate::clearEarlyMediaDestinations () {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::configureAdaptiveRateControl (MediaStream *ms, const OrtpPayloadType *pt, bool videoWillBeUsed) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
bool enabled = linphone_core_adaptive_rate_control_enabled(core);
|
||||
if (!enabled) {
|
||||
media_stream_enable_adaptive_bitrate_control(ms, false);
|
||||
|
|
@ -2062,7 +2062,7 @@ void MediaSessionPrivate::freeResources () {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::handleIceEvents (OrtpEvent *ev) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
OrtpEventType evt = ortp_event_get_type(ev);
|
||||
OrtpEventData *evd = ortp_event_get_data(ev);
|
||||
if (evt == ORTP_EVENT_ICE_SESSION_PROCESSING_FINISHED) {
|
||||
|
|
@ -2186,7 +2186,7 @@ void MediaSessionPrivate::handleStreamEvents (int streamIndex) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::initializeAudioStream () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (audioStream)
|
||||
return;
|
||||
if (!sessions[mainAudioStreamIndex].rtp_session) {
|
||||
|
|
@ -2339,7 +2339,7 @@ void MediaSessionPrivate::initializeTextStream () {
|
|||
|
||||
void MediaSessionPrivate::initializeVideoStream () {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (videoStream)
|
||||
return;
|
||||
if (!sessions[mainVideoStreamIndex].rtp_session) {
|
||||
|
|
@ -2509,7 +2509,7 @@ void MediaSessionPrivate::postConfigureAudioStream (AudioStream *stream, bool mu
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::postConfigureAudioStreams (bool muted) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
postConfigureAudioStream(audioStream, muted);
|
||||
if (linphone_core_dtmf_received_has_listener(core))
|
||||
audio_stream_play_received_dtmfs(audioStream, false);
|
||||
|
|
@ -2694,7 +2694,7 @@ void MediaSessionPrivate::startAudioStream (LinphoneCallState targetState, bool
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::startStreams (LinphoneCallState targetState) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
switch (targetState) {
|
||||
case LinphoneCallIncomingEarlyMedia:
|
||||
if (linphone_core_get_remote_ringback_tone(core)) {
|
||||
|
|
@ -2774,7 +2774,7 @@ void MediaSessionPrivate::startStreams (LinphoneCallState targetState) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::startTextStream () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
const SalStreamDescription *tstream = sal_media_description_find_best_stream(resultDesc, SalText);
|
||||
if (tstream && (tstream->dir != SalStreamInactive) && (tstream->rtp_port != 0)) {
|
||||
const char *rtpAddr = tstream->rtp_addr[0] != '\0' ? tstream->rtp_addr : resultDesc->addr;
|
||||
|
|
@ -2811,7 +2811,7 @@ void MediaSessionPrivate::startTextStream () {
|
|||
|
||||
void MediaSessionPrivate::startVideoStream (LinphoneCallState targetState) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
bool reusedPreview = false;
|
||||
/* Shutdown preview */
|
||||
MSFilter *source = nullptr;
|
||||
|
|
@ -2955,7 +2955,7 @@ void MediaSessionPrivate::startVideoStream (LinphoneCallState targetState) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::stopAudioStream () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (audioStream) {
|
||||
updateReportingMediaInfo(LINPHONE_CALL_STATS_AUDIO);
|
||||
media_stream_reclaim_sessions(&audioStream->ms, &sessions[mainAudioStreamIndex]);
|
||||
|
|
@ -3027,7 +3027,7 @@ void MediaSessionPrivate::stopStreams () {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::stopTextStream () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (textStream) {
|
||||
updateReportingMediaInfo(LINPHONE_CALL_STATS_TEXT);
|
||||
media_stream_reclaim_sessions(&textStream->ms, &sessions[mainTextStreamIndex]);
|
||||
|
|
@ -3046,7 +3046,7 @@ void MediaSessionPrivate::stopTextStream () {
|
|||
|
||||
void MediaSessionPrivate::stopVideoStream () {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (videoStream) {
|
||||
updateReportingMediaInfo(LINPHONE_CALL_STATS_VIDEO);
|
||||
media_stream_reclaim_sessions(&videoStream->ms, &sessions[mainVideoStreamIndex]);
|
||||
|
|
@ -3066,7 +3066,7 @@ void MediaSessionPrivate::stopVideoStream () {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::tryEarlyMediaForking (SalMediaDescription *md) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
lInfo() << "Early media response received from another branch, checking if media can be forked to this new destination";
|
||||
for (int i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; i++) {
|
||||
if (!sal_stream_description_active(&resultDesc->streams[i]))
|
||||
|
|
@ -3098,7 +3098,7 @@ void MediaSessionPrivate::tryEarlyMediaForking (SalMediaDescription *md) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::updateFrozenPayloads (SalMediaDescription *result) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
for (int i = 0; i < result->nb_streams; i++) {
|
||||
for (bctbx_list_t *elem = result->streams[i].payloads; elem != nullptr; elem = bctbx_list_next(elem)) {
|
||||
OrtpPayloadType *pt = reinterpret_cast<OrtpPayloadType *>(bctbx_list_get_data(elem));
|
||||
|
|
@ -3113,7 +3113,7 @@ void MediaSessionPrivate::updateFrozenPayloads (SalMediaDescription *result) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::updateStreams (SalMediaDescription *newMd, LinphoneCallState targetState) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (!((state == LinphoneCallIncomingEarlyMedia) && linphone_core_get_ring_during_incoming_early_media(core)))
|
||||
linphone_core_stop_ringing(core);
|
||||
if (!newMd) {
|
||||
|
|
@ -3282,7 +3282,7 @@ void MediaSessionPrivate::audioStreamAuthTokenReady (const string &authToken, bo
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::audioStreamEncryptionChanged (bool encrypted) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
propagateEncryptionChanged();
|
||||
|
||||
#ifdef VIDEO_ENABLED
|
||||
|
|
@ -3317,7 +3317,7 @@ unsigned int MediaSessionPrivate::getNbActiveStreams () const {
|
|||
}
|
||||
|
||||
bool MediaSessionPrivate::isEncryptionMandatory () const {
|
||||
L_Q(const MediaSession);
|
||||
L_Q();
|
||||
if (params->getMediaEncryption() == LinphoneMediaEncryptionDTLS) {
|
||||
lInfo() << "Forced encryption mandatory on CallSession [" << q << "] due to SRTP-DTLS";
|
||||
return true;
|
||||
|
|
@ -3345,7 +3345,7 @@ int MediaSessionPrivate::mediaParametersChanged (SalMediaDescription *oldMd, Sal
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::propagateEncryptionChanged () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (!allStreamsEncrypted()) {
|
||||
lInfo() << "Some streams are not encrypted";
|
||||
q->getCurrentParams()->setMediaEncryption(LinphoneMediaEncryptionNone);
|
||||
|
|
@ -3396,7 +3396,7 @@ void MediaSessionPrivate::updateRtpStats (LinphoneCallStats *stats, int streamIn
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MediaSessionPrivate::mediaReportEnabled (int statsType) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if (!qualityReportingEnabled())
|
||||
return false;
|
||||
if ((statsType == LINPHONE_CALL_STATS_VIDEO) && !q->getCurrentParams()->videoEnabled())
|
||||
|
|
@ -3445,7 +3445,7 @@ void MediaSessionPrivate::updateReportingCallState () {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::updateReportingMediaInfo (int statsType) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
/* op might be already released if hanging up in state LinphoneCallOutgoingInit */
|
||||
if (!op || !mediaReportEnabled(statsType))
|
||||
return;
|
||||
|
|
@ -3577,7 +3577,7 @@ void MediaSessionPrivate::executeBackgroundTasks (bool oneSecondElapsed) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::reportBandwidth () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
reportBandwidthForStream(&audioStream->ms, LinphoneStreamTypeAudio);
|
||||
reportBandwidthForStream(&videoStream->ms, LinphoneStreamTypeVideo);
|
||||
reportBandwidthForStream(&textStream->ms, LinphoneStreamTypeText);
|
||||
|
|
@ -3631,7 +3631,7 @@ void MediaSessionPrivate::abort (const string &errorMsg) {
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::handleIncomingReceivedStateInIncomingNotification () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
/* Try to be best-effort in giving real local or routable contact address for 100Rel case */
|
||||
setContactOp();
|
||||
bool proposeEarlyMedia = lp_config_get_int(linphone_core_get_config(core), "sip", "incoming_calls_early_media", false);
|
||||
|
|
@ -3655,7 +3655,7 @@ bool MediaSessionPrivate::isReadyForInvite () const {
|
|||
}
|
||||
|
||||
LinphoneStatus MediaSessionPrivate::pause () {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
if ((state != LinphoneCallStreamsRunning) && (state != LinphoneCallPausedByRemote)) {
|
||||
lWarning() << "Cannot pause this MediaSession, it is not active";
|
||||
return -1;
|
||||
|
|
@ -3874,7 +3874,7 @@ void MediaSessionPrivate::accept (const MediaSessionParams *csp) {
|
|||
}
|
||||
|
||||
LinphoneStatus MediaSessionPrivate::acceptUpdate (const CallSessionParams *csp, LinphoneCallState nextState, const string &stateInfo) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
SalMediaDescription *desc = sal_call_get_remote_media_description(op);
|
||||
bool keepSdpVersion = lp_config_get_int(linphone_core_get_config(core), "sip", "keep_sdp_version", 0);
|
||||
if (keepSdpVersion && (desc->session_id == remoteSessionId) && (desc->session_ver == remoteSessionVer)) {
|
||||
|
|
@ -3915,7 +3915,7 @@ LinphoneStatus MediaSessionPrivate::acceptUpdate (const CallSessionParams *csp,
|
|||
|
||||
#ifdef VIDEO_ENABLED
|
||||
void MediaSessionPrivate::videoStreamEventCb (const MSFilter *f, const unsigned int eventId, const void *args) {
|
||||
L_Q(MediaSession);
|
||||
L_Q();
|
||||
switch (eventId) {
|
||||
case MS_VIDEO_DECODER_DECODING_ERRORS:
|
||||
lWarning() << "MS_VIDEO_DECODER_DECODING_ERRORS";
|
||||
|
|
@ -4000,14 +4000,14 @@ void MediaSessionPrivate::stunAuthRequestedCb (const char *realm, const char *no
|
|||
|
||||
MediaSession::MediaSession (const Conference &conference, const CallSessionParams *params, CallSessionListener *listener)
|
||||
: CallSession(*new MediaSessionPrivate(conference, params, listener)) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
d->iceAgent = new IceAgent(*this);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
LinphoneStatus MediaSession::accept (const MediaSessionParams *msp) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
LinphoneStatus result = d->checkForAcceptation();
|
||||
if (result < 0) return result;
|
||||
|
||||
|
|
@ -4036,7 +4036,7 @@ LinphoneStatus MediaSession::accept (const MediaSessionParams *msp) {
|
|||
}
|
||||
|
||||
LinphoneStatus MediaSession::acceptEarlyMedia (const MediaSessionParams *msp) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->state != LinphoneCallIncomingReceived) {
|
||||
lError() << "Bad state " << linphone_call_state_to_string(d->state) << " for MediaSession::acceptEarlyMedia()";
|
||||
return -1;
|
||||
|
|
@ -4059,7 +4059,7 @@ LinphoneStatus MediaSession::acceptEarlyMedia (const MediaSessionParams *msp) {
|
|||
}
|
||||
|
||||
LinphoneStatus MediaSession::acceptUpdate (const MediaSessionParams *msp) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->expectMediaInAck) {
|
||||
lError() << "MediaSession::acceptUpdate() is not possible during a late offer incoming reINVITE (INVITE without SDP)";
|
||||
return -1;
|
||||
|
|
@ -4070,7 +4070,7 @@ LinphoneStatus MediaSession::acceptUpdate (const MediaSessionParams *msp) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSession::configure (LinphoneCallDir direction, LinphoneProxyConfig *cfg, SalOp *op, const Address &from, const Address &to) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
CallSession::configure (direction, cfg, op, from, to);
|
||||
|
||||
if (d->destProxy)
|
||||
|
|
@ -4120,7 +4120,7 @@ void MediaSession::configure (LinphoneCallDir direction, LinphoneProxyConfig *cf
|
|||
}
|
||||
|
||||
void MediaSession::initiateIncoming () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
CallSession::initiateIncoming();
|
||||
d->initializeStreams();
|
||||
if (d->natPolicy) {
|
||||
|
|
@ -4130,7 +4130,7 @@ void MediaSession::initiateIncoming () {
|
|||
}
|
||||
|
||||
bool MediaSession::initiateOutgoing () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
bool defer = CallSession::initiateOutgoing();
|
||||
d->initializeStreams();
|
||||
if (linphone_nat_policy_ice_enabled(d->natPolicy)) {
|
||||
|
|
@ -4145,7 +4145,7 @@ bool MediaSession::initiateOutgoing () {
|
|||
}
|
||||
|
||||
void MediaSession::iterate (time_t currentRealTime, bool oneSecondElapsed) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
int elapsed = (int)(currentRealTime - d->log->start_date_time);
|
||||
d->executeBackgroundTasks(oneSecondElapsed);
|
||||
if ((d->state == LinphoneCallOutgoingInit) && (elapsed >= d->core->sip_conf.delayed_timeout)) {
|
||||
|
|
@ -4158,7 +4158,7 @@ void MediaSession::iterate (time_t currentRealTime, bool oneSecondElapsed) {
|
|||
}
|
||||
|
||||
LinphoneStatus MediaSession::pause () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
LinphoneStatus result = d->pause();
|
||||
if (result == 0)
|
||||
d->pausedByApp = true;
|
||||
|
|
@ -4166,7 +4166,7 @@ LinphoneStatus MediaSession::pause () {
|
|||
}
|
||||
|
||||
LinphoneStatus MediaSession::resume () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->state != LinphoneCallPaused) {
|
||||
lWarning() << "we cannot resume a call that has not been established and paused before";
|
||||
return -1;
|
||||
|
|
@ -4211,7 +4211,7 @@ LinphoneStatus MediaSession::resume () {
|
|||
|
||||
void MediaSession::sendVfuRequest () {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
MediaSessionParams *currentParams = getCurrentParams();
|
||||
if ((currentParams->avpfEnabled() || currentParams->getPrivate()->implicitRtcpFbEnabled())
|
||||
&& d->videoStream && media_stream_get_state(&d->videoStream->ms) == MSStreamStarted) { // || sal_media_description_has_implicit_avpf((const SalMediaDescription *)call->resultdesc)
|
||||
|
|
@ -4227,7 +4227,7 @@ void MediaSession::sendVfuRequest () {
|
|||
}
|
||||
|
||||
void MediaSession::startIncomingNotification () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
d->makeLocalMediaDescription();
|
||||
sal_call_set_local_media_description(d->op, d->localDesc);
|
||||
SalMediaDescription *md = sal_call_get_final_media_description(d->op);
|
||||
|
|
@ -4250,7 +4250,7 @@ void MediaSession::startIncomingNotification () {
|
|||
}
|
||||
|
||||
int MediaSession::startInvite (const Address *destination, const string &subject) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
linphone_core_stop_dtmf_stream(d->core);
|
||||
d->makeLocalMediaDescription();
|
||||
if (d->core->ringstream && d->core->sound_conf.play_sndcard && d->core->sound_conf.capt_sndcard) {
|
||||
|
|
@ -4280,7 +4280,7 @@ int MediaSession::startInvite (const Address *destination, const string &subject
|
|||
}
|
||||
|
||||
void MediaSession::startRecording () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->params->getRecordFilePath().empty()) {
|
||||
lError() << "MediaSession::startRecording(): no output file specified. Use linphone_call_params_set_record_file()";
|
||||
return;
|
||||
|
|
@ -4291,14 +4291,14 @@ void MediaSession::startRecording () {
|
|||
}
|
||||
|
||||
void MediaSession::stopRecording () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream && !d->params->getPrivate()->getInConference())
|
||||
audio_stream_mixed_record_stop(d->audioStream);
|
||||
d->recordActive = false;
|
||||
}
|
||||
|
||||
LinphoneStatus MediaSession::update (const MediaSessionParams *msp) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
LinphoneCallState nextState;
|
||||
LinphoneCallState initialState = d->state;
|
||||
if (!d->isUpdateAllowed(nextState))
|
||||
|
|
@ -4343,14 +4343,14 @@ LinphoneStatus MediaSession::update (const MediaSessionParams *msp) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void MediaSession::resetFirstVideoFrameDecoded () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->videoStream && d->videoStream->ms.decoder)
|
||||
ms_filter_call_method_noarg(d->videoStream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
|
||||
}
|
||||
|
||||
LinphoneStatus MediaSession::takePreviewSnapshot (const string& file) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->videoStream && d->videoStream->local_jpegwriter) {
|
||||
const char *filepath = file.empty() ? nullptr : file.c_str();
|
||||
return ms_filter_call_method(d->videoStream->local_jpegwriter, MS_JPEG_WRITER_TAKE_SNAPSHOT, (void *)filepath);
|
||||
|
|
@ -4362,7 +4362,7 @@ LinphoneStatus MediaSession::takePreviewSnapshot (const string& file) {
|
|||
|
||||
LinphoneStatus MediaSession::takeVideoSnapshot (const string& file) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->videoStream && d->videoStream->jpegwriter) {
|
||||
const char *filepath = file.empty() ? nullptr : file.c_str();
|
||||
return ms_filter_call_method(d->videoStream->jpegwriter, MS_JPEG_WRITER_TAKE_SNAPSHOT, (void *)filepath);
|
||||
|
|
@ -4373,7 +4373,7 @@ LinphoneStatus MediaSession::takeVideoSnapshot (const string& file) {
|
|||
}
|
||||
|
||||
void MediaSession::zoomVideo (float zoomFactor, float *cx, float *cy) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->videoStream && d->videoStream->output) {
|
||||
if (zoomFactor < 1)
|
||||
zoomFactor = 1;
|
||||
|
|
@ -4395,12 +4395,12 @@ void MediaSession::zoomVideo (float zoomFactor, float *cx, float *cy) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool MediaSession::cameraEnabled () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
return d->cameraEnabled;
|
||||
}
|
||||
|
||||
bool MediaSession::echoCancellationEnabled () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream && d->audioStream->ec) {
|
||||
bool val;
|
||||
ms_filter_call_method(d->audioStream->ec, MS_ECHO_CANCELLER_GET_BYPASS_MODE, &val);
|
||||
|
|
@ -4410,7 +4410,7 @@ bool MediaSession::echoCancellationEnabled () const {
|
|||
}
|
||||
|
||||
bool MediaSession::echoLimiterEnabled () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream)
|
||||
return d->audioStream->el_type !=ELInactive;
|
||||
else
|
||||
|
|
@ -4418,7 +4418,7 @@ bool MediaSession::echoLimiterEnabled () const {
|
|||
}
|
||||
|
||||
void MediaSession::enableCamera (bool value) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
#ifdef VIDEO_ENABLED
|
||||
d->cameraEnabled = value;
|
||||
switch (d->state) {
|
||||
|
|
@ -4440,7 +4440,7 @@ void MediaSession::enableCamera (bool value) {
|
|||
}
|
||||
|
||||
void MediaSession::enableEchoCancellation (bool value) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream && d->audioStream->ec) {
|
||||
bool bypassMode = !value;
|
||||
ms_filter_call_method(d->audioStream->ec, MS_ECHO_CANCELLER_SET_BYPASS_MODE, &bypassMode);
|
||||
|
|
@ -4448,7 +4448,7 @@ void MediaSession::enableEchoCancellation (bool value) {
|
|||
}
|
||||
|
||||
void MediaSession::enableEchoLimiter (bool value) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream) {
|
||||
if (value) {
|
||||
string type = lp_config_get_string(linphone_core_get_config(d->core), "sound", "el_type", "mic");
|
||||
|
|
@ -4462,7 +4462,7 @@ void MediaSession::enableEchoLimiter (bool value) {
|
|||
}
|
||||
|
||||
bool MediaSession::getAllMuted () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
return d->allMuted;
|
||||
}
|
||||
|
||||
|
|
@ -4471,17 +4471,17 @@ LinphoneCallStats * MediaSession::getAudioStats () const {
|
|||
}
|
||||
|
||||
string MediaSession::getAuthenticationToken () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
return d->authToken;
|
||||
}
|
||||
|
||||
bool MediaSession::getAuthenticationTokenVerified () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
return d->authTokenVerified;
|
||||
}
|
||||
|
||||
float MediaSession::getAverageQuality () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
float audioRating = -1.f;
|
||||
float videoRating = -1.f;
|
||||
if (d->audioStream)
|
||||
|
|
@ -4492,13 +4492,13 @@ float MediaSession::getAverageQuality () const {
|
|||
}
|
||||
|
||||
MediaSessionParams * MediaSession::getCurrentParams () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
d->updateCurrentParams();
|
||||
return d->currentParams;
|
||||
}
|
||||
|
||||
float MediaSession::getCurrentQuality () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
float audioRating = -1.f;
|
||||
float videoRating = -1.f;
|
||||
if (d->audioStream)
|
||||
|
|
@ -4509,12 +4509,12 @@ float MediaSession::getCurrentQuality () const {
|
|||
}
|
||||
|
||||
const MediaSessionParams * MediaSession::getMediaParams () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
return d->params;
|
||||
}
|
||||
|
||||
RtpTransport * MediaSession::getMetaRtcpTransport (int streamIndex) const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if ((streamIndex < 0) || (streamIndex >= getStreamCount()))
|
||||
return nullptr;
|
||||
RtpTransport *metaRtp;
|
||||
|
|
@ -4524,7 +4524,7 @@ RtpTransport * MediaSession::getMetaRtcpTransport (int streamIndex) const {
|
|||
}
|
||||
|
||||
RtpTransport * MediaSession::getMetaRtpTransport (int streamIndex) const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if ((streamIndex < 0) || (streamIndex >= getStreamCount()))
|
||||
return nullptr;
|
||||
RtpTransport *metaRtp;
|
||||
|
|
@ -4534,7 +4534,7 @@ RtpTransport * MediaSession::getMetaRtpTransport (int streamIndex) const {
|
|||
}
|
||||
|
||||
float MediaSession::getMicrophoneVolumeGain () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream)
|
||||
return audio_stream_get_sound_card_input_gain(d->audioStream);
|
||||
else {
|
||||
|
|
@ -4544,7 +4544,7 @@ float MediaSession::getMicrophoneVolumeGain () const {
|
|||
}
|
||||
|
||||
void * MediaSession::getNativeVideoWindowId () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->videoWindowId) {
|
||||
/* The video id was previously set by the app */
|
||||
return d->videoWindowId;
|
||||
|
|
@ -4559,12 +4559,12 @@ void * MediaSession::getNativeVideoWindowId () const {
|
|||
}
|
||||
|
||||
const CallSessionParams * MediaSession::getParams () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
return d->params;
|
||||
}
|
||||
|
||||
float MediaSession::getPlayVolume () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream && d->audioStream->volrecv) {
|
||||
float vol = 0;
|
||||
ms_filter_call_method(d->audioStream->volrecv, MS_VOLUME_GET, &vol);
|
||||
|
|
@ -4574,7 +4574,7 @@ float MediaSession::getPlayVolume () const {
|
|||
}
|
||||
|
||||
float MediaSession::getRecordVolume () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream && d->audioStream->volsend && !d->audioMuted && (d->state == LinphoneCallStreamsRunning)) {
|
||||
float vol = 0;
|
||||
ms_filter_call_method(d->audioStream->volsend, MS_VOLUME_GET, &vol);
|
||||
|
|
@ -4584,7 +4584,7 @@ float MediaSession::getRecordVolume () const {
|
|||
}
|
||||
|
||||
const MediaSessionParams * MediaSession::getRemoteParams () {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->op){
|
||||
SalMediaDescription *md = sal_call_get_remote_media_description(d->op);
|
||||
if (md) {
|
||||
|
|
@ -4637,7 +4637,7 @@ const MediaSessionParams * MediaSession::getRemoteParams () {
|
|||
}
|
||||
|
||||
float MediaSession::getSpeakerVolumeGain () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream)
|
||||
return audio_stream_get_sound_card_output_gain(d->audioStream);
|
||||
else {
|
||||
|
|
@ -4647,7 +4647,7 @@ float MediaSession::getSpeakerVolumeGain () const {
|
|||
}
|
||||
|
||||
LinphoneCallStats * MediaSession::getStats (LinphoneStreamType type) const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if (type == LinphoneStreamTypeUnknown)
|
||||
return nullptr;
|
||||
LinphoneCallStats *stats = nullptr;
|
||||
|
|
@ -4679,7 +4679,7 @@ int MediaSession::getStreamCount () const {
|
|||
}
|
||||
|
||||
MSFormatType MediaSession::getStreamType (int streamIndex) const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
/* TODO: Revisit when multiple media streams will be implemented */
|
||||
if (streamIndex == d->mainVideoStreamIndex)
|
||||
return MSVideo;
|
||||
|
|
@ -4699,7 +4699,7 @@ LinphoneCallStats * MediaSession::getVideoStats () const {
|
|||
}
|
||||
|
||||
bool MediaSession::mediaInProgress () const {
|
||||
L_D(const MediaSession);
|
||||
L_D();
|
||||
if ((linphone_call_stats_get_ice_state(d->audioStats) == LinphoneIceStateInProgress)
|
||||
|| (linphone_call_stats_get_ice_state(d->videoStats) == LinphoneIceStateInProgress)
|
||||
|| (linphone_call_stats_get_ice_state(d->textStats) == LinphoneIceStateInProgress))
|
||||
|
|
@ -4709,7 +4709,7 @@ bool MediaSession::mediaInProgress () const {
|
|||
}
|
||||
|
||||
void MediaSession::setAuthenticationTokenVerified (bool value) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (!d->audioStream || !media_stream_started(&d->audioStream->ms)) {
|
||||
lError() << "MediaSession::setAuthenticationTokenVerified(): No audio stream or not started";
|
||||
return;
|
||||
|
|
@ -4727,7 +4727,7 @@ void MediaSession::setAuthenticationTokenVerified (bool value) {
|
|||
}
|
||||
|
||||
void MediaSession::setMicrophoneVolumeGain (float value) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if(d->audioStream)
|
||||
audio_stream_set_sound_card_input_gain(d->audioStream, value);
|
||||
else
|
||||
|
|
@ -4735,7 +4735,7 @@ void MediaSession::setMicrophoneVolumeGain (float value) {
|
|||
}
|
||||
|
||||
void MediaSession::setNativeVideoWindowId (void *id) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
d->videoWindowId = id;
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (d->videoStream)
|
||||
|
|
@ -4744,7 +4744,7 @@ void MediaSession::setNativeVideoWindowId (void *id) {
|
|||
}
|
||||
|
||||
void MediaSession::setSpeakerVolumeGain (float value) {
|
||||
L_D(MediaSession);
|
||||
L_D();
|
||||
if (d->audioStream)
|
||||
audio_stream_set_sound_card_output_gain(d->audioStream, value);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public:
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
ContentType::ContentType (const string &contentType) : ClonableObject(*new ContentTypePrivate) {
|
||||
L_D(ContentType);
|
||||
L_D();
|
||||
|
||||
size_t pos = contentType.find('/');
|
||||
if (pos == string::npos)
|
||||
|
|
@ -47,7 +47,7 @@ ContentType::ContentType (const string &contentType) : ClonableObject(*new Conte
|
|||
}
|
||||
|
||||
ContentType::ContentType (const string &type, const string &subType) : ClonableObject(*new ContentTypePrivate) {
|
||||
L_D(ContentType);
|
||||
L_D();
|
||||
|
||||
if (setType(type)) {
|
||||
if (!setSubType(subType))
|
||||
|
|
@ -75,12 +75,12 @@ bool ContentType::operator== (const string &contentType) {
|
|||
}
|
||||
|
||||
const string &ContentType::getType () const {
|
||||
L_D(const ContentType);
|
||||
L_D();
|
||||
return d->type;
|
||||
}
|
||||
|
||||
bool ContentType::setType (const string &type) {
|
||||
L_D(ContentType);
|
||||
L_D();
|
||||
if (type.find('/') == string::npos) {
|
||||
d->type = type;
|
||||
return true;
|
||||
|
|
@ -89,12 +89,12 @@ bool ContentType::setType (const string &type) {
|
|||
}
|
||||
|
||||
const string &ContentType::getSubType () const {
|
||||
L_D(const ContentType);
|
||||
L_D();
|
||||
return d->subType;
|
||||
}
|
||||
|
||||
bool ContentType::setSubType (const string &subType) {
|
||||
L_D(ContentType);
|
||||
L_D();
|
||||
if (subType.find('/') == string::npos) {
|
||||
d->subType = subType;
|
||||
return true;
|
||||
|
|
@ -103,12 +103,12 @@ bool ContentType::setSubType (const string &subType) {
|
|||
}
|
||||
|
||||
bool ContentType::isValid () const {
|
||||
L_D(const ContentType);
|
||||
L_D();
|
||||
return !d->type.empty() && !d->subType.empty();
|
||||
}
|
||||
|
||||
string ContentType::asString () const {
|
||||
L_D(const ContentType);
|
||||
L_D();
|
||||
return isValid() ? d->type + "/" + d->subType : "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,19 +39,19 @@ public:
|
|||
Content::Content () : ClonableObject(*new ContentPrivate) {}
|
||||
|
||||
Content::Content (const Content &src) : ClonableObject(*new ContentPrivate) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->body = src.getBody();
|
||||
d->contentType = src.getContentType();
|
||||
}
|
||||
|
||||
Content::Content (Content &&src) : ClonableObject(*new ContentPrivate) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->body = move(src.getPrivate()->body);
|
||||
d->contentType = move(src.getPrivate()->contentType);
|
||||
}
|
||||
|
||||
Content &Content::operator= (const Content &src) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
d->body = src.getBody();
|
||||
d->contentType = src.getContentType();
|
||||
|
|
@ -61,65 +61,65 @@ Content &Content::operator= (const Content &src) {
|
|||
}
|
||||
|
||||
Content &Content::operator= (Content &&src) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->body = move(src.getPrivate()->body);
|
||||
d->contentType = move(src.getPrivate()->contentType);
|
||||
return *this;
|
||||
}
|
||||
|
||||
const ContentType &Content::getContentType () const {
|
||||
L_D(const Content);
|
||||
L_D();
|
||||
return d->contentType;
|
||||
}
|
||||
|
||||
void Content::setContentType (const ContentType &contentType) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->contentType = contentType;
|
||||
}
|
||||
|
||||
void Content::setContentType (const string &contentType) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->contentType = ContentType(contentType);
|
||||
}
|
||||
|
||||
const string &Content::getContentDisposition () const {
|
||||
L_D(const Content);
|
||||
L_D();
|
||||
return d->contentDisposition;
|
||||
}
|
||||
|
||||
void Content::setContentDisposition (const string &contentDisposition) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->contentDisposition = contentDisposition;
|
||||
}
|
||||
|
||||
const vector<char> &Content::getBody () const {
|
||||
L_D(const Content);
|
||||
L_D();
|
||||
return d->body;
|
||||
}
|
||||
|
||||
string Content::getBodyAsString () const {
|
||||
L_D(const Content);
|
||||
L_D();
|
||||
return string(d->body.begin(), d->body.end());
|
||||
}
|
||||
|
||||
void Content::setBody (const vector<char> &body) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->body = body;
|
||||
}
|
||||
|
||||
void Content::setBody (const string &body) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
d->body = vector<char>(body.cbegin(), body.cend());
|
||||
}
|
||||
|
||||
void Content::setBody (const void *buffer, size_t size) {
|
||||
L_D(Content);
|
||||
L_D();
|
||||
const char *start = static_cast<const char *>(buffer);
|
||||
d->body = vector<char>(start, start + size);
|
||||
}
|
||||
|
||||
size_t Content::getSize () const {
|
||||
L_D(const Content);
|
||||
L_D();
|
||||
return d->body.size();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
AbstractDb::AbstractDb (AbstractDbPrivate &p) : Object(*new AbstractDbPrivate) {}
|
||||
|
||||
bool AbstractDb::connect (Backend backend, const string ¶meters) {
|
||||
L_D(AbstractDb);
|
||||
L_D();
|
||||
|
||||
d->backend = backend;
|
||||
d->dbSession = DbSessionProvider::getInstance()->getSession(
|
||||
|
|
@ -51,12 +51,12 @@ bool AbstractDb::connect (Backend backend, const string ¶meters) {
|
|||
}
|
||||
|
||||
bool AbstractDb::isConnected () const {
|
||||
L_D(const AbstractDb);
|
||||
L_D();
|
||||
return d->dbSession;
|
||||
}
|
||||
|
||||
AbstractDb::Backend AbstractDb::getBackend () const {
|
||||
L_D(const AbstractDb);
|
||||
L_D();
|
||||
return d->backend;
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ void AbstractDb::init () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
string AbstractDb::primaryKeyAutoIncrementStr (const string &type) const {
|
||||
L_D(const AbstractDb);
|
||||
L_D();
|
||||
|
||||
switch (d->backend) {
|
||||
case Mysql:
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void EventsDb::init () {
|
||||
L_D(EventsDb);
|
||||
L_D();
|
||||
soci::session *session = d->dbSession.getBackendSession<soci::session>();
|
||||
|
||||
*session <<
|
||||
|
|
@ -344,7 +344,7 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
}
|
||||
|
||||
int EventsDb::getEventsCount (FilterMask mask) const {
|
||||
L_D(const EventsDb);
|
||||
L_D();
|
||||
|
||||
if (!isConnected()) {
|
||||
lWarning() << "Unable to get events count. Not connected.";
|
||||
|
|
@ -366,7 +366,7 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
}
|
||||
|
||||
int EventsDb::getMessagesCount (const string &remoteAddress) const {
|
||||
L_D(const EventsDb);
|
||||
L_D();
|
||||
|
||||
if (!isConnected()) {
|
||||
lWarning() << "Unable to get messages count. Not connected.";
|
||||
|
|
@ -393,7 +393,7 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
|
|||
}
|
||||
|
||||
int EventsDb::getUnreadMessagesCount (const string &remoteAddress) const {
|
||||
L_D(const EventsDb);
|
||||
L_D();
|
||||
|
||||
if (!isConnected()) {
|
||||
lWarning() << "Unable to get unread messages count. Not connected.";
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public:
|
|||
DbSessionProvider::DbSessionProvider () : Singleton(*new DbSessionProviderPrivate) {}
|
||||
|
||||
DbSession DbSessionProvider::getSession (const string &uri) {
|
||||
L_D(DbSessionProvider);
|
||||
L_D();
|
||||
|
||||
#ifdef SOCI_ENABLED
|
||||
DbSession session(DbSession::Soci);
|
||||
|
|
|
|||
|
|
@ -25,24 +25,24 @@ using namespace std;
|
|||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
DbSession::DbSession (Type type) : ClonableObject(*new DbSessionPrivate) {
|
||||
L_D(DbSession);
|
||||
L_D();
|
||||
d->type = type;
|
||||
}
|
||||
|
||||
L_USE_DEFAULT_SHARE_IMPL(DbSession, ClonableObject);
|
||||
|
||||
DbSession::operator bool () const {
|
||||
L_D(const DbSession);
|
||||
L_D();
|
||||
return d->isValid;
|
||||
}
|
||||
|
||||
DbSession::Type DbSession::getBackendType () const {
|
||||
L_D(const DbSession);
|
||||
L_D();
|
||||
return d->type;
|
||||
}
|
||||
|
||||
void *DbSession::getBackendSession () const {
|
||||
L_D(const DbSession);
|
||||
L_D();
|
||||
return d->backendSession.get();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public:
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
CallEvent::CallEvent (Type type, const shared_ptr<Call> &call) : EventLog(*new CallEventPrivate, type) {
|
||||
L_D(CallEvent);
|
||||
L_D();
|
||||
L_ASSERT(call);
|
||||
L_ASSERT(type == Type::CallStart || type == Type::CallEnd);
|
||||
d->call = call;
|
||||
|
|
@ -42,7 +42,7 @@ CallEvent::CallEvent (Type type, const shared_ptr<Call> &call) : EventLog(*new C
|
|||
CallEvent::CallEvent (const CallEvent &src) : CallEvent(src.getType(), src.getCall()) {}
|
||||
|
||||
CallEvent &CallEvent::operator= (const CallEvent &src) {
|
||||
L_D(CallEvent);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
EventLog::operator=(src);
|
||||
d->call = src.getPrivate()->call;
|
||||
|
|
@ -52,7 +52,7 @@ CallEvent &CallEvent::operator= (const CallEvent &src) {
|
|||
}
|
||||
|
||||
shared_ptr<Call> CallEvent::getCall () const {
|
||||
L_D(const CallEvent);
|
||||
L_D();
|
||||
return d->call;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public:
|
|||
|
||||
ChatMessageEvent::ChatMessageEvent (const shared_ptr<ChatMessage> &chatMessage) :
|
||||
EventLog(*new ChatMessageEventPrivate, EventLog::Type::ChatMessage) {
|
||||
L_D(ChatMessageEvent);
|
||||
L_D();
|
||||
L_ASSERT(chatMessage);
|
||||
d->chatMessage = chatMessage;
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ ChatMessageEvent::ChatMessageEvent (const shared_ptr<ChatMessage> &chatMessage)
|
|||
ChatMessageEvent::ChatMessageEvent (const ChatMessageEvent &src) : ChatMessageEvent(src.getChatMessage()) {}
|
||||
|
||||
ChatMessageEvent &ChatMessageEvent::operator= (const ChatMessageEvent &src) {
|
||||
L_D(ChatMessageEvent);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
EventLog::operator=(src);
|
||||
d->chatMessage = src.getPrivate()->chatMessage;
|
||||
|
|
@ -52,7 +52,7 @@ ChatMessageEvent &ChatMessageEvent::operator= (const ChatMessageEvent &src) {
|
|||
}
|
||||
|
||||
shared_ptr<ChatMessage> ChatMessageEvent::getChatMessage () const {
|
||||
L_D(const ChatMessageEvent);
|
||||
L_D();
|
||||
return d->chatMessage;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
ConferenceEvent::ConferenceEvent (Type type, const Address &address) :
|
||||
EventLog(*new ConferenceEventPrivate, type) {
|
||||
L_D(ConferenceEvent);
|
||||
L_D();
|
||||
L_ASSERT(type == Type::ConferenceCreated || type == Type::ConferenceDestroyed);
|
||||
d->address = address;
|
||||
}
|
||||
|
|
@ -36,12 +36,12 @@ ConferenceEvent::ConferenceEvent (const ConferenceEvent &src) : ConferenceEvent(
|
|||
|
||||
ConferenceEvent::ConferenceEvent (ConferenceEventPrivate &p, Type type, const Address &address) :
|
||||
EventLog(p, type) {
|
||||
L_D(ConferenceEvent);
|
||||
L_D();
|
||||
d->address = address;
|
||||
}
|
||||
|
||||
ConferenceEvent &ConferenceEvent::operator= (const ConferenceEvent &src) {
|
||||
L_D(ConferenceEvent);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
EventLog::operator=(src);
|
||||
d->address = src.getPrivate()->address;
|
||||
|
|
@ -51,7 +51,7 @@ ConferenceEvent &ConferenceEvent::operator= (const ConferenceEvent &src) {
|
|||
}
|
||||
|
||||
const Address &ConferenceEvent::getAddress () const {
|
||||
L_D(const ConferenceEvent);
|
||||
L_D();
|
||||
return d->address;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (
|
|||
const Address &conferenceAddress,
|
||||
const Address &participantAddress
|
||||
) : ConferenceEvent(*new ConferenceParticipantEventPrivate, type, conferenceAddress) {
|
||||
L_D(ConferenceParticipantEvent);
|
||||
L_D();
|
||||
L_ASSERT(
|
||||
type == Type::ConferenceParticipantAdded ||
|
||||
type == Type::ConferenceParticipantRemoved ||
|
||||
|
|
@ -52,7 +52,7 @@ ConferenceParticipantEvent::ConferenceParticipantEvent (const ConferenceParticip
|
|||
ConferenceParticipantEvent(src.getType(), src.getAddress(), src.getParticipantAddress()) {}
|
||||
|
||||
ConferenceParticipantEvent &ConferenceParticipantEvent::operator= (const ConferenceParticipantEvent &src) {
|
||||
L_D(ConferenceParticipantEvent);
|
||||
L_D();
|
||||
if (this != &src) {
|
||||
ConferenceEvent::operator=(src);
|
||||
d->participantAddress = src.getPrivate()->participantAddress;
|
||||
|
|
@ -62,7 +62,7 @@ ConferenceParticipantEvent &ConferenceParticipantEvent::operator= (const Confere
|
|||
}
|
||||
|
||||
const Address &ConferenceParticipantEvent::getParticipantAddress () const {
|
||||
L_D(const ConferenceParticipantEvent);
|
||||
L_D();
|
||||
return d->participantAddress;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@ EventLog::EventLog () : ClonableObject(*new EventLogPrivate) {}
|
|||
EventLog::EventLog (const EventLog &) : ClonableObject(*new EventLogPrivate) {}
|
||||
|
||||
EventLog::EventLog (EventLogPrivate &p, Type type) : ClonableObject(*new EventLogPrivate) {
|
||||
L_D(EventLog);
|
||||
L_D();
|
||||
d->type = type;
|
||||
}
|
||||
|
||||
EventLog &EventLog::operator= (const EventLog &src) {
|
||||
L_D(EventLog);
|
||||
L_D();
|
||||
if (this != &src)
|
||||
d->type = src.getPrivate()->type;
|
||||
return *this;
|
||||
}
|
||||
|
||||
EventLog::Type EventLog::getType () const {
|
||||
L_D(const EventLog);
|
||||
L_D();
|
||||
return d->type;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ public:
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
Logger::Logger (Level level) : Object(*new LoggerPrivate) {
|
||||
L_D(Logger);
|
||||
L_D();
|
||||
d->level = level;
|
||||
}
|
||||
|
||||
Logger::~Logger () {
|
||||
L_D(Logger);
|
||||
L_D();
|
||||
|
||||
const string str = d->os.str();
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ Logger::~Logger () {
|
|||
}
|
||||
|
||||
ostringstream &Logger::getOutput () {
|
||||
L_D(Logger);
|
||||
L_D();
|
||||
return d->os;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,18 +49,18 @@ PropertyContainer &PropertyContainer::operator= (const PropertyContainer &) {
|
|||
}
|
||||
|
||||
Variant PropertyContainer::getProperty (const string &name) const {
|
||||
L_D(const PropertyContainer);
|
||||
L_D();
|
||||
auto it = d->properties.find(name);
|
||||
return it == d->properties.cend() ? Variant() : it->second;
|
||||
}
|
||||
|
||||
void PropertyContainer::setProperty (const string &name, const Variant &value) {
|
||||
L_D(PropertyContainer);
|
||||
L_D();
|
||||
d->properties[name] = value;
|
||||
}
|
||||
|
||||
void PropertyContainer::setProperty (const string &name, Variant &&value) {
|
||||
L_D(PropertyContainer);
|
||||
L_D();
|
||||
d->properties[name] = move(value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ Variant::Variant () {
|
|||
}
|
||||
|
||||
Variant::Variant (Type type) : Variant() {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->setType(type);
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ Variant::Variant (const Variant &src) {
|
|||
L_ASSERT(!mPrivate);
|
||||
mPrivate = new VariantPrivate();
|
||||
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
|
||||
int type = src.getPrivate()->getType();
|
||||
d->setType(type);
|
||||
|
|
@ -112,72 +112,72 @@ Variant::Variant (Variant &&src) {
|
|||
}
|
||||
|
||||
Variant::Variant (int value) : Variant(Int) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.i = value;
|
||||
}
|
||||
|
||||
Variant::Variant (unsigned int value) : Variant(UnsignedInt) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.ui = value;
|
||||
}
|
||||
|
||||
Variant::Variant (short value) : Variant(Short) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.s = value;
|
||||
}
|
||||
|
||||
Variant::Variant (unsigned short value) : Variant(UnsignedShort) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.us = value;
|
||||
}
|
||||
|
||||
Variant::Variant (long value) : Variant(Long) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.l = value;
|
||||
}
|
||||
|
||||
Variant::Variant (unsigned long value) : Variant(UnsignedLong) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.ul = value;
|
||||
}
|
||||
|
||||
Variant::Variant (long long value) : Variant(LongLong) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.ll = value;
|
||||
}
|
||||
|
||||
Variant::Variant (unsigned long long value) : Variant(UnsignedLongLong) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.ull = value;
|
||||
}
|
||||
|
||||
Variant::Variant (char value) : Variant(Char) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.c = value;
|
||||
}
|
||||
|
||||
Variant::Variant (bool value) : Variant(Bool) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.b = value;
|
||||
}
|
||||
|
||||
Variant::Variant (double value) : Variant(Double) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.d = value;
|
||||
}
|
||||
|
||||
Variant::Variant (float value) : Variant(Float) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->value.f = value;
|
||||
}
|
||||
|
||||
Variant::Variant (const string &value) : Variant(String) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
*d->value.str = value;
|
||||
}
|
||||
|
||||
Variant::~Variant () {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
|
||||
// Note: Private data can be stolen by copy operator (r-value).
|
||||
// It can be null, but it useless to test it.
|
||||
|
|
@ -200,7 +200,7 @@ bool Variant::operator<= (const Variant &variant) const {
|
|||
}
|
||||
|
||||
Variant &Variant::operator= (const Variant &variant) {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
|
||||
if (this != &variant) {
|
||||
// Update type.
|
||||
|
|
@ -245,12 +245,12 @@ bool Variant::operator>= (const Variant &variant) const {
|
|||
}
|
||||
|
||||
bool Variant::isValid () const {
|
||||
L_D(const Variant);
|
||||
L_D();
|
||||
return d->getType() != Invalid;
|
||||
}
|
||||
|
||||
void Variant::clear () {
|
||||
L_D(Variant);
|
||||
L_D();
|
||||
d->setType(Invalid);
|
||||
}
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ static inline void *getValueAsGeneric (const VariantPrivate &p, bool *soFarSoGoo
|
|||
void Variant::getValue (int type, void *value, bool *soFarSoGood) const {
|
||||
L_ASSERT(type > Invalid && type != MaxDefaultTypes);
|
||||
|
||||
L_D(const Variant);
|
||||
L_D();
|
||||
|
||||
*soFarSoGood = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue