Commit 096d8764 authored by Sylvain Berfini's avatar Sylvain Berfini

Added method to trace mutex locks + improved destroying of linphonecore

parent ea236c0e
#pragma once
#include "Utils.h"
namespace Linphone
{
namespace Core
......
......@@ -13,7 +13,7 @@ using namespace Windows::Phone::Networking::Voip;
VoipPhoneCall^ CallController::OnIncomingCallReceived(Linphone::Core::LinphoneCall^ call, Platform::String^ contactName, Platform::String^ contactNumber, IncomingCallViewDismissedCallback^ incomingCallViewDismissedCallback)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
VoipPhoneCall^ incomingCall = nullptr;
this->call = call;
......@@ -73,7 +73,7 @@ VoipPhoneCall^ CallController::OnIncomingCallReceived(Linphone::Core::LinphoneCa
void CallController::OnAcceptCallRequested(VoipPhoneCall^ incomingCall, CallAnswerEventArgs^ args)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
incomingCall->NotifyCallActive();
......@@ -101,7 +101,7 @@ void CallController::OnAcceptCallRequested(VoipPhoneCall^ incomingCall, CallAnsw
void CallController::OnRejectCallRequested(VoipPhoneCall^ incomingCall, CallRejectEventArgs^ args)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
if (this->onIncomingCallViewDismissed != nullptr) {
this->onIncomingCallViewDismissed();
......@@ -117,7 +117,7 @@ void CallController::OnRejectCallRequested(VoipPhoneCall^ incomingCall, CallReje
VoipPhoneCall^ CallController::NewOutgoingCall(Platform::String^ number)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
VoipPhoneCall^ outgoingCall = nullptr;
this->call = call;
......@@ -160,7 +160,7 @@ VoipPhoneCall^ CallController::NewIncomingCallForCustomIncomingCallView(Platform
IncomingCallViewDismissedCallback^ CallController::IncomingCallViewDismissed::get()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
IncomingCallViewDismissedCallback^ cb = this->onIncomingCallViewDismissed;
gApiLock.Unlock();
return cb;
......@@ -168,14 +168,14 @@ IncomingCallViewDismissedCallback^ CallController::IncomingCallViewDismissed::ge
void CallController::IncomingCallViewDismissed::set(IncomingCallViewDismissedCallback^ cb)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
this->onIncomingCallViewDismissed = cb;
gApiLock.Unlock();
}
Platform::Boolean CallController::CustomIncomingCallView::get()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean value = this->customIncomingCallView;
gApiLock.Unlock();
return value;
......@@ -183,14 +183,14 @@ Platform::Boolean CallController::CustomIncomingCallView::get()
void CallController::CustomIncomingCallView::set(Platform::Boolean value)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
this->customIncomingCallView = value;
gApiLock.Unlock();
}
DeclineReason CallController::DeclineReason::get()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::DeclineReason value = this->declineReason;
gApiLock.Unlock();
return value;
......@@ -198,7 +198,7 @@ DeclineReason CallController::DeclineReason::get()
void CallController::DeclineReason::set(Linphone::Core::DeclineReason value)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
this->declineReason = value;
gApiLock.Unlock();
}
......
......@@ -25,7 +25,7 @@ Globals^ Globals::singleton = nullptr;
void Globals::StartServer(const Platform::Array<Platform::String^>^ outOfProcServerClassNames)
{
// Make sure only one API call is in progress at a time
gApiLock.Lock();
TRACE; gApiLock.Lock();
std::unique_ptr<PFNGETACTIVATIONFACTORY[]> activationFactoryCallbacks;
std::unique_ptr<HSTRING[]> hOutOfProcServerClassNames;
......@@ -116,7 +116,7 @@ Globals^ Globals::Instance::get()
if (Globals::singleton == nullptr)
{
// Make sure only one API call is in progress at a time
gApiLock.Lock();
TRACE; gApiLock.Lock();
if (Globals::singleton == nullptr)
{
......@@ -135,7 +135,7 @@ LinphoneCoreFactory^ Globals::LinphoneCoreFactory::get()
if (this->linphoneCoreFactory == nullptr)
{
// Make sure only one API call is in progress at a time
gApiLock.Lock();
TRACE; gApiLock.Lock();
if (this->linphoneCoreFactory == nullptr)
{
......@@ -158,7 +158,7 @@ Linphone::Core::CallController^ Globals::CallController::get()
if (this->callController == nullptr)
{
// Make sure only one API call is in progress at a time
gApiLock.Lock();
TRACE; gApiLock.Lock();
if (this->callController == nullptr)
{
......@@ -177,7 +177,7 @@ Linphone::Core::BackgroundModeLogger^ Globals::BackgroundModeLogger::get()
if (this->backgroundModeLogger == nullptr)
{
// Make sure only one API call is in progress at a time
gApiLock.Lock();
TRACE; gApiLock.Lock();
if (this->backgroundModeLogger == nullptr)
{
......@@ -197,7 +197,7 @@ Mediastreamer2::WP8Video::IVideoRenderer^ Globals::VideoRenderer::get()
void Globals::VideoRenderer::set(Mediastreamer2::WP8Video::IVideoRenderer^ value)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
this->videoRenderer = value;
gApiLock.Unlock();
}
......
......@@ -4,7 +4,7 @@
Platform::String^ Linphone::Core::LinphoneAuthInfo::GetUsername()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ username = Utils::cctops(linphone_auth_info_get_username(this->auth_info));
gApiLock.Unlock();
return username;
......@@ -12,7 +12,7 @@ Platform::String^ Linphone::Core::LinphoneAuthInfo::GetUsername()
void Linphone::Core::LinphoneAuthInfo::SetUsername(Platform::String^ username)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char *cc = Linphone::Core::Utils::pstoccs(username);
linphone_auth_info_set_username(this->auth_info, cc);
delete(cc);
......@@ -21,7 +21,7 @@ void Linphone::Core::LinphoneAuthInfo::SetUsername(Platform::String^ username)
Platform::String^ Linphone::Core::LinphoneAuthInfo::GetUserId()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ userid = Utils::cctops(linphone_auth_info_get_userid(this->auth_info));
gApiLock.Unlock();
return userid;
......@@ -29,7 +29,7 @@ Platform::String^ Linphone::Core::LinphoneAuthInfo::GetUserId()
void Linphone::Core::LinphoneAuthInfo::SetUserId(Platform::String^ userid)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char *cc = Linphone::Core::Utils::pstoccs(userid);
linphone_auth_info_set_userid(this->auth_info, cc);
delete(cc);
......@@ -38,7 +38,7 @@ void Linphone::Core::LinphoneAuthInfo::SetUserId(Platform::String^ userid)
Platform::String^ Linphone::Core::LinphoneAuthInfo::GetPassword()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ password = Utils::cctops(linphone_auth_info_get_passwd(this->auth_info));
gApiLock.Unlock();
return password;
......@@ -46,7 +46,7 @@ Platform::String^ Linphone::Core::LinphoneAuthInfo::GetPassword()
void Linphone::Core::LinphoneAuthInfo::SetPassword(Platform::String^ password)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char *cc = Linphone::Core::Utils::pstoccs(password);
linphone_auth_info_set_passwd(this->auth_info, cc);
delete(cc);
......@@ -55,7 +55,7 @@ void Linphone::Core::LinphoneAuthInfo::SetPassword(Platform::String^ password)
Platform::String^ Linphone::Core::LinphoneAuthInfo::GetRealm()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ realm = Utils::cctops(linphone_auth_info_get_realm(this->auth_info));
gApiLock.Unlock();
return realm;
......@@ -63,7 +63,7 @@ Platform::String^ Linphone::Core::LinphoneAuthInfo::GetRealm()
void Linphone::Core::LinphoneAuthInfo::SetRealm(Platform::String^ realm)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char *cc = Linphone::Core::Utils::pstoccs(realm);
linphone_auth_info_set_realm(this->auth_info, cc);
delete(cc);
......@@ -72,7 +72,7 @@ void Linphone::Core::LinphoneAuthInfo::SetRealm(Platform::String^ realm)
Platform::String^ Linphone::Core::LinphoneAuthInfo::GetHa1()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ ha1 = Utils::cctops(linphone_auth_info_get_ha1(this->auth_info));
gApiLock.Unlock();
return ha1;
......@@ -80,7 +80,7 @@ Platform::String^ Linphone::Core::LinphoneAuthInfo::GetHa1()
void Linphone::Core::LinphoneAuthInfo::SetHa1(Platform::String^ ha1)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char *cc = Linphone::Core::Utils::pstoccs(ha1);
linphone_auth_info_set_ha1(this->auth_info, cc);
delete(cc);
......@@ -89,7 +89,7 @@ void Linphone::Core::LinphoneAuthInfo::SetHa1(Platform::String^ ha1)
Linphone::Core::LinphoneAuthInfo::LinphoneAuthInfo(Platform::String^ username, Platform::String^ userid, Platform::String^ password, Platform::String^ ha1, Platform::String^ realm, Platform::String^ domain)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char* cc_username = Utils::pstoccs(username);
const char* cc_password = Utils::pstoccs(password);
const char* cc_realm = Utils::pstoccs(realm);
......
......@@ -12,7 +12,7 @@ using namespace Windows::Phone::Networking::Voip;
Linphone::Core::LinphoneCallState Linphone::Core::LinphoneCall::GetState()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::LinphoneCallState state = (Linphone::Core::LinphoneCallState)linphone_call_get_state(this->call);
gApiLock.Unlock();
return state;
......@@ -20,7 +20,7 @@ Linphone::Core::LinphoneCallState Linphone::Core::LinphoneCall::GetState()
Linphone::Core::LinphoneAddress^ Linphone::Core::LinphoneCall::GetRemoteAddress()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const ::LinphoneAddress *addr = linphone_call_get_remote_address(this->call);
Linphone::Core::LinphoneAddress^ address = (Linphone::Core::LinphoneAddress^)Linphone::Core::Utils::CreateLinphoneAddress((void*)addr);
gApiLock.Unlock();
......@@ -29,7 +29,7 @@ Linphone::Core::LinphoneAddress^ Linphone::Core::LinphoneCall::GetRemoteAddress(
Linphone::Core::CallDirection Linphone::Core::LinphoneCall::GetDirection()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::CallDirection direction = (Linphone::Core::CallDirection)linphone_call_get_dir(this->call);
gApiLock.Unlock();
return direction;
......@@ -37,7 +37,7 @@ Linphone::Core::CallDirection Linphone::Core::LinphoneCall::GetDirection()
Linphone::Core::LinphoneCallLog^ Linphone::Core::LinphoneCall::GetCallLog()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::LinphoneCallLog^ log = (Linphone::Core::LinphoneCallLog^) Linphone::Core::Utils::CreateLinphoneCallLog(linphone_call_get_call_log(this->call));
gApiLock.Unlock();
return log;
......@@ -45,7 +45,7 @@ Linphone::Core::LinphoneCallLog^ Linphone::Core::LinphoneCall::GetCallLog()
Linphone::Core::LinphoneCallStats^ Linphone::Core::LinphoneCall::GetAudioStats()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::LinphoneCallStats^ stats = (Linphone::Core::LinphoneCallStats^) Linphone::Core::Utils::CreateLinphoneCallStats(this->call, (int)Linphone::Core::MediaType::Audio);
gApiLock.Unlock();
return stats;
......@@ -53,7 +53,7 @@ Linphone::Core::LinphoneCallStats^ Linphone::Core::LinphoneCall::GetAudioStats()
Linphone::Core::LinphoneCallParams^ Linphone::Core::LinphoneCall::GetRemoteParams()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::LinphoneCallParams^ params = nullptr;
if (linphone_call_get_remote_params(this->call) != nullptr) {
params = (Linphone::Core::LinphoneCallParams^) Linphone::Core::Utils::CreateLinphoneCallParams(linphone_call_params_copy(linphone_call_get_remote_params(this->call)));
......@@ -64,7 +64,7 @@ Linphone::Core::LinphoneCallParams^ Linphone::Core::LinphoneCall::GetRemoteParam
Linphone::Core::LinphoneCallParams^ Linphone::Core::LinphoneCall::GetCurrentParamsCopy()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::LinphoneCallParams^ params = (Linphone::Core::LinphoneCallParams^) Linphone::Core::Utils::CreateLinphoneCallParams(linphone_call_params_copy(linphone_call_get_current_params(this->call)));
gApiLock.Unlock();
return params;
......@@ -72,14 +72,14 @@ Linphone::Core::LinphoneCallParams^ Linphone::Core::LinphoneCall::GetCurrentPara
void Linphone::Core::LinphoneCall::EnableEchoCancellation(Platform::Boolean enable)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_enable_echo_cancellation(this->call, enable);
gApiLock.Unlock();
}
Platform::Boolean Linphone::Core::LinphoneCall::IsEchoCancellationEnabled()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean enabled = (linphone_call_echo_cancellation_enabled(this->call) == TRUE);
gApiLock.Unlock();
return enabled;
......@@ -87,14 +87,14 @@ Platform::Boolean Linphone::Core::LinphoneCall::IsEchoCancellationEnabled()
void Linphone::Core::LinphoneCall::EnableEchoLimiter(Platform::Boolean enable)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_enable_echo_limiter(this->call, enable);
gApiLock.Unlock();
}
Platform::Boolean Linphone::Core::LinphoneCall::IsEchoLimiterEnabled()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean enabled = (linphone_call_echo_limiter_enabled(this->call) == TRUE);
gApiLock.Unlock();
return enabled;
......@@ -102,7 +102,7 @@ Platform::Boolean Linphone::Core::LinphoneCall::IsEchoLimiterEnabled()
int Linphone::Core::LinphoneCall::GetDuration()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
int duration = linphone_call_get_duration(this->call);
gApiLock.Unlock();
return duration;
......@@ -110,7 +110,7 @@ int Linphone::Core::LinphoneCall::GetDuration()
float Linphone::Core::LinphoneCall::GetCurrentQuality()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float quality = linphone_call_get_current_quality(this->call);
gApiLock.Unlock();
return quality;
......@@ -118,7 +118,7 @@ float Linphone::Core::LinphoneCall::GetCurrentQuality()
float Linphone::Core::LinphoneCall::GetAverageQuality()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float quality = linphone_call_get_average_quality(this->call);
gApiLock.Unlock();
return quality;
......@@ -126,7 +126,7 @@ float Linphone::Core::LinphoneCall::GetAverageQuality()
Platform::String^ Linphone::Core::LinphoneCall::GetAuthenticationToken()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ token = Linphone::Core::Utils::cctops(linphone_call_get_authentication_token(this->call));
gApiLock.Unlock();
return token;
......@@ -134,7 +134,7 @@ Platform::String^ Linphone::Core::LinphoneCall::GetAuthenticationToken()
Platform::Boolean Linphone::Core::LinphoneCall::IsAuthenticationTokenVerified()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean verified = (linphone_call_get_authentication_token_verified(this->call) == TRUE);
gApiLock.Unlock();
return verified;
......@@ -142,14 +142,14 @@ Platform::Boolean Linphone::Core::LinphoneCall::IsAuthenticationTokenVerified()
void Linphone::Core::LinphoneCall::SetAuthenticationTokenVerified(Platform::Boolean verified)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_set_authentication_token_verified(this->call, verified);
gApiLock.Unlock();
}
Platform::Boolean Linphone::Core::LinphoneCall::IsInConference()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean inConference = (linphone_call_is_in_conference(this->call) == TRUE);
gApiLock.Unlock();
return inConference;
......@@ -157,7 +157,7 @@ Platform::Boolean Linphone::Core::LinphoneCall::IsInConference()
float Linphone::Core::LinphoneCall::GetPlayVolume()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float volume = linphone_call_get_play_volume(this->call);
gApiLock.Unlock();
return volume;
......@@ -165,7 +165,7 @@ float Linphone::Core::LinphoneCall::GetPlayVolume()
Platform::String^ Linphone::Core::LinphoneCall::GetRemoteUserAgent()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ userAgent = Linphone::Core::Utils::cctops(linphone_call_get_remote_user_agent(this->call));
gApiLock.Unlock();
return userAgent;
......@@ -173,7 +173,7 @@ Platform::String^ Linphone::Core::LinphoneCall::GetRemoteUserAgent()
Platform::String^ Linphone::Core::LinphoneCall::GetRemoteContact()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::String^ contact = Linphone::Core::Utils::cctops(linphone_call_get_remote_contact(this->call));
gApiLock.Unlock();
return contact;
......@@ -199,23 +199,23 @@ Platform::Object^ Linphone::Core::LinphoneCall::GetCallStartTimeFromContext()
}
Platform::Boolean Linphone::Core::LinphoneCall::IsCameraEnabled()
{
gApiLock.Lock();
{
TRACE; gApiLock.Lock();
Platform::Boolean enabled = (linphone_call_camera_enabled(this->call) == TRUE);
gApiLock.Unlock();
return enabled;
}
void Linphone::Core::LinphoneCall::EnableCamera(Platform::Boolean enable)
{
gApiLock.Lock();
{
TRACE; gApiLock.Lock();
linphone_call_enable_camera(this->call, enable);
gApiLock.Unlock();
}
Linphone::Core::LinphoneCallStats^ Linphone::Core::LinphoneCall::GetVideoStats()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::LinphoneCallStats^ stats = (Linphone::Core::LinphoneCallStats^) Linphone::Core::Utils::CreateLinphoneCallStats(this->call, (int)Linphone::Core::MediaType::Video);
gApiLock.Unlock();
return stats;
......@@ -223,7 +223,7 @@ Linphone::Core::LinphoneCallStats^ Linphone::Core::LinphoneCall::GetVideoStats()
void Linphone::Core::LinphoneCall::SendVFURequest()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_send_vfu_request(this->call);
gApiLock.Unlock();
}
......@@ -235,20 +235,20 @@ Windows::Phone::Networking::Voip::VoipPhoneCall^ Linphone::Core::LinphoneCall::C
Linphone::Core::LinphoneCall::LinphoneCall(::LinphoneCall *call) :
call(call)
{
gApiLock.Lock();
{
TRACE; gApiLock.Lock();
RefToPtrProxy<LinphoneCall^> *proxy = new RefToPtrProxy<LinphoneCall^>(this);
linphone_call_set_user_pointer(this->call, proxy);
linphone_call_set_user_data(this->call, proxy);
this->callContext = nullptr;
gApiLock.Unlock();
}
Linphone::Core::LinphoneCall::~LinphoneCall()
{
gApiLock.Lock();
{
TRACE; gApiLock.Lock();
this->callContext = nullptr;
linphone_call_unref(call);
RefToPtrProxy<LinphoneCall^> *proxy = reinterpret_cast< RefToPtrProxy<LinphoneCall^> *>(linphone_call_get_user_pointer(this->call));
RefToPtrProxy<LinphoneCall^> *proxy = reinterpret_cast< RefToPtrProxy<LinphoneCall^> *>(linphone_call_get_user_data(this->call));
delete proxy;
gApiLock.Unlock();
}
......@@ -5,14 +5,14 @@
void Linphone::Core::LinphoneCallParams::SetAudioBandwidth(int value)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_params_set_audio_bandwidth_limit(this->params, value);
gApiLock.Unlock();
}
Linphone::Core::MediaEncryption Linphone::Core::LinphoneCallParams::GetMediaEncryption()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::MediaEncryption enc = (Linphone::Core::MediaEncryption) linphone_call_params_get_media_encryption(this->params);
gApiLock.Unlock();
return enc;
......@@ -20,14 +20,14 @@ Linphone::Core::MediaEncryption Linphone::Core::LinphoneCallParams::GetMediaEncr
void Linphone::Core::LinphoneCallParams::SetMediaEncryption(Linphone::Core::MediaEncryption menc)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_params_set_media_encryption(this->params, (LinphoneMediaEncryption) menc);
gApiLock.Unlock();
}
Linphone::Core::PayloadType^ Linphone::Core::LinphoneCallParams::GetUsedAudioCodec()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::PayloadType^ payloadType = nullptr;
const ::PayloadType *pt = linphone_call_params_get_used_audio_codec(this->params);
if (pt != nullptr) {
......@@ -39,14 +39,14 @@ Linphone::Core::PayloadType^ Linphone::Core::LinphoneCallParams::GetUsedAudioCod
void Linphone::Core::LinphoneCallParams::EnableLowBandwidth(Platform::Boolean enable)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_params_enable_low_bandwidth(this->params, enable);
gApiLock.Unlock();
}
Platform::Boolean Linphone::Core::LinphoneCallParams::IsLowBandwidthEnabled()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean enabled = (linphone_call_params_low_bandwidth_enabled(this->params) == TRUE);
gApiLock.Unlock();
return enabled;
......@@ -54,7 +54,7 @@ Platform::Boolean Linphone::Core::LinphoneCallParams::IsLowBandwidthEnabled()
Platform::Boolean Linphone::Core::LinphoneCallParams::IsVideoEnabled()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean enabled = (linphone_call_params_video_enabled(this->params) == TRUE);
gApiLock.Unlock();
return enabled;
......@@ -62,14 +62,14 @@ Platform::Boolean Linphone::Core::LinphoneCallParams::IsVideoEnabled()
void Linphone::Core::LinphoneCallParams::EnableVideo(Platform::Boolean enable)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_call_params_enable_video(this->params, enable);
gApiLock.Unlock();
}
Linphone::Core::PayloadType^ Linphone::Core::LinphoneCallParams::GetUsedVideoCodec()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Linphone::Core::PayloadType^ payloadType = nullptr;
const ::PayloadType *pt = linphone_call_params_get_used_video_codec(this->params);
if (pt != nullptr) {
......
......@@ -71,7 +71,7 @@ float Linphone::Core::LinphoneCallStats::GetLocalLateRate()
Linphone::Core::LinphoneCallStats::LinphoneCallStats(::LinphoneCall *call, Linphone::Core::MediaType mediaType) :
call(call)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const ::LinphoneCallStats *stats = nullptr;
if (mediaType == MediaType::Audio) {
stats = linphone_call_get_audio_stats(this->call);
......@@ -84,7 +84,7 @@ Linphone::Core::LinphoneCallStats::LinphoneCallStats(::LinphoneCall *call, Linph
Linphone::Core::LinphoneCallStats::LinphoneCallStats(::LinphoneCallStats *callStats)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
FillStats(callStats);
gApiLock.Unlock();
}
......@@ -96,7 +96,7 @@ Linphone::Core::LinphoneCallStats::~LinphoneCallStats()
float Linphone::Core::LinphoneCallStats::GetSenderLossRate(const ::LinphoneCallStats *stats)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float value = linphone_call_stats_get_sender_loss_rate(stats);
gApiLock.Unlock();
return value;
......@@ -104,7 +104,7 @@ float Linphone::Core::LinphoneCallStats::GetSenderLossRate(const ::LinphoneCallS
float Linphone::Core::LinphoneCallStats::GetReceiverLossRate(const ::LinphoneCallStats *stats)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float value = linphone_call_stats_get_receiver_loss_rate(stats);
gApiLock.Unlock();
return value;
......@@ -112,7 +112,7 @@ float Linphone::Core::LinphoneCallStats::GetReceiverLossRate(const ::LinphoneCal
float Linphone::Core::LinphoneCallStats::GetSenderInterarrivalJitter(const ::LinphoneCallStats *stats)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float value = linphone_call_stats_get_sender_interarrival_jitter(stats, this->call);
gApiLock.Unlock();
return value;
......@@ -120,7 +120,7 @@ float Linphone::Core::LinphoneCallStats::GetSenderInterarrivalJitter(const ::Lin
float Linphone::Core::LinphoneCallStats::GetReceiverInterarrivalJitter(const ::LinphoneCallStats *stats)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
float value = linphone_call_stats_get_receiver_interarrival_jitter(stats, this->call);
gApiLock.Unlock();
return value;
......@@ -128,7 +128,7 @@ float Linphone::Core::LinphoneCallStats::GetReceiverInterarrivalJitter(const ::L
int64 Linphone::Core::LinphoneCallStats::GetLatePacketsCumulativeNumber(const ::LinphoneCallStats *stats)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
int64 value = linphone_call_stats_get_late_packets_cumulative_number(stats, this->call);
gApiLock.Unlock();
return value;
......
......@@ -24,7 +24,7 @@ Platform::String^ Linphone::Core::LinphoneChatMessage::GetExternalBodyUrl()
void Linphone::Core::LinphoneChatMessage::SetExternalBodyUrl(Platform::String^ url)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char* body = Linphone::Core::Utils::pstoccs(url);
linphone_chat_message_set_external_body_url(this->message, body);
delete(body);
......
......@@ -27,7 +27,7 @@ static void chat_room_callback(::LinphoneChatMessage* msg, ::LinphoneChatMessage
void Linphone::Core::LinphoneChatRoom::SendMessage(Linphone::Core::LinphoneChatMessage^ message, Linphone::Core::LinphoneChatMessageListener^ listener)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
RefToPtrProxy<LinphoneChatMessageListener^> *listenerPtr = new RefToPtrProxy<LinphoneChatMessageListener^>(listener);
linphone_chat_room_send_message2(this->room, message->message, chat_room_callback, listenerPtr);
gApiLock.Unlock();
......@@ -35,7 +35,7 @@ void Linphone::Core::LinphoneChatRoom::SendMessage(Linphone::Core::LinphoneChatM
Linphone::Core::LinphoneChatMessage^ Linphone::Core::LinphoneChatRoom::CreateLinphoneChatMessage(Platform::String^ message)
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
const char* msg = Linphone::Core::Utils::pstoccs(message);
Linphone::Core::LinphoneChatMessage^ chatMessage = (Linphone::Core::LinphoneChatMessage^) Linphone::Core::Utils::CreateLinphoneChatMessage(linphone_chat_room_create_message(this->room, msg));
delete(msg);
......@@ -45,7 +45,7 @@ Linphone::Core::LinphoneChatMessage^ Linphone::Core::LinphoneChatRoom::CreateLin
Platform::Boolean Linphone::Core::LinphoneChatRoom::IsRemoteComposing()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
Platform::Boolean isComposing = (linphone_chat_room_is_remote_composing(this->room) == TRUE);
gApiLock.Unlock();
return isComposing;
......@@ -53,7 +53,7 @@ Platform::Boolean Linphone::Core::LinphoneChatRoom::IsRemoteComposing()
void Linphone::Core::LinphoneChatRoom::Compose()
{
gApiLock.Lock();
TRACE; gApiLock.Lock();
linphone_chat_room_compose(this->room);
gApiLock.Unlock();
}
......
This diff is collapsed.
......@@ -6,38 +6,38 @@
#include "LpConfig.h"
#include "Server.h"
using namespace Linphone::Core;
using namespace Linphone::Core;
using namespace Platform;
#define MAX_TRACE_SIZE 2048
#define MAX_SUITE_NAME_SIZE 128
static void nativeOutputTraceHandler(OutputTraceLevel lev, const char *fmt, va_list args)
{
if (Globals::Instance->LinphoneCoreFactory->OutputTraceListener) {
wchar_t wstr[MAX_TRACE_SIZE];
std::string str;
str.resize(MAX_TRACE_SIZE);
size_t len = vsnprintf((char *)str.c_str(), MAX_TRACE_SIZE, fmt, args);
if (len >= MAX_TRACE_SIZE) ((char *)str.c_str())[MAX_TRACE_SIZE - 1] = '\0';
mbstowcs(wstr, str.c_str(), sizeof(wstr));
String^ msg = ref new String(wstr);
Globals::Instance->LinphoneCoreFactory->OutputTraceListener->OutputTrace(lev, msg);
#define MAX_TRACE_SIZE 2048
#define MAX_SUITE_NAME_SIZE 128
static void nativeOutputTraceHandler(OutputTraceLevel lev, const char *fmt, va_list args)
{
if (Globals::Instance->LinphoneCoreFactory->OutputTraceListener) {
wchar_t wstr[MAX_TRACE_SIZE];
std::string str;
str.resize(MAX_TRACE_SIZE);
size_t len = vsnprintf((char *)str.c_str(), MAX_TRACE_SIZE, fmt, args);
if (len >= MAX_TRACE_SIZE) ((char *)str.c_str())[MAX_TRACE_SIZE - 1] = '\0';
mbstowcs(wstr, str.c_str(), sizeof(wstr));
String^ msg = ref new String(wstr);
Globals::Instance->LinphoneCoreFactory->OutputTraceListener->OutputTrace(lev, msg);
}
}
static void LinphoneNativeOutputTraceHandler(OrtpLogLevel lev, const char *fmt, va_list args)
{
OutputTraceLevel level = OutputTraceLevel::Message;
char fmt2[MAX_TRACE_SIZE];
snprintf(fmt2, MAX_TRACE_SIZE, "%s\n", fmt);
}
static void LinphoneNativeOutputTraceHandler(OrtpLogLevel lev, const char *fmt, va_list args)
{
OutputTraceLevel level = OutputTraceLevel::Message;
char fmt2[MAX_TRACE_SIZE];
snprintf(fmt2, MAX_TRACE_SIZE, "%s\n", fmt);
if (lev == ORTP_DEBUG) level = OutputTraceLevel::Debug;
else if (lev == ORTP_MESSAGE) level = OutputTraceLevel::Message;
else if (lev == ORTP_TRACE) level = OutputTraceLevel::Message;
else if (lev == ORTP_WARNING) level = OutputTraceLevel::Warning;
else if (lev == ORTP_ERROR) level = OutputTraceLevel::Error;
else if (lev == ORTP_FATAL) level = OutputTraceLevel::Error;
nativeOutputTraceHandler(level, fmt2, args);
else if (lev == ORTP_FATAL) level = OutputTraceLevel::Error;
nativeOutputTraceHandler(level, fmt2, args);
}
void LinphoneCoreFactory::CreateLinphoneCore(Linphone::Core::LinphoneCoreListener^ listener)
......@@ -47,7 +47,7 @@ void LinphoneCoreFactory::CreateLinphoneCore(Linphone::Core::LinphoneCoreListene