Commit 3ba7c9e7 authored by Ghislain MARY's avatar Ghislain MARY

Implement video methods of LinphoneCall, LinphoneCallLog and LinphoneCallParams.

parent 33972455
......@@ -192,6 +192,36 @@ Platform::Object^ Linphone::Core::LinphoneCall::GetCallStartTimeFromContext()
return nullptr;
}
Platform::Boolean Linphone::Core::LinphoneCall::IsCameraEnabled()
{
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();
linphone_call_enable_camera(this->call, enable);
gApiLock.Unlock();
}
Linphone::Core::LinphoneCallStats^ Linphone::Core::LinphoneCall::GetVideoStats()
{
gApiLock.Lock();
Linphone::Core::LinphoneCallStats^ stats = (Linphone::Core::LinphoneCallStats^) Linphone::Core::Utils::CreateLinphoneCallStats(this->call, (int)Linphone::Core::MediaType::Video);
gApiLock.Unlock();
return stats;
}
void Linphone::Core::LinphoneCall::SendVFURequest()
{
gApiLock.Lock();
linphone_call_send_vfu_request(this->call);
gApiLock.Unlock();
}
Platform::Object^ Linphone::Core::LinphoneCall::CallContext::get()
{
return this->callContext;
......
......@@ -166,6 +166,29 @@ namespace Linphone
/// </summary>
Platform::Object^ GetCallStartTimeFromContext();
/// <summary>
/// Tells whether video captured from the camera is sent to the remote party.
/// </summary>
/// <returns>true if video capture from the camera is sent to the remote party, false otherwise</returns>
Platform::Boolean IsCameraEnabled();
/// <summary>
/// Enable or disable sending video captured from the camera to the remote party.
/// </summary>
/// <param name="enable">A boolean value telling whether to enable or disable sending video captured from the camera</param>
void EnableCamera(Platform::Boolean enable);
/// <summary>
/// Gets the video statistics associated with this call.
/// </summary>
/// <returns>The video statistics associated with the call</returns>
LinphoneCallStats^ GetVideoStats();
/// <summary>
/// Requests remote side to send us a Video Fast Update.
/// </summary>
void SendVFURequest();
/// <summary>
/// Gets the CallContext object (native VoipPhoneCall)
/// </summary>
......
......@@ -40,6 +40,11 @@ Platform::String^ Linphone::Core::LinphoneCallLog::GetCallId()
return Linphone::Core::Utils::cctops(linphone_call_log_get_call_id(this->callLog));
}
Platform::Boolean Linphone::Core::LinphoneCallLog::WasVideoEnabled()
{
return (linphone_call_log_video_enabled(this->callLog) == TRUE);
}
Linphone::Core::LinphoneCallLog::LinphoneCallLog(::LinphoneCallLog *cl) :
callLog(cl)
{
......
......@@ -57,6 +57,12 @@ namespace Linphone
/// </summary>
Platform::String^ GetCallId();
/// <summary>
/// Tells whether video was enabled at the end of the call.
/// </summary>
/// <returns>true if video was enabled at the end of the call, false otherwise</returns>
Platform::Boolean WasVideoEnabled();
private:
friend class Linphone::Core::Utils;
friend ref class Linphone::Core::LinphoneCore;
......
......@@ -52,6 +52,33 @@ Platform::Boolean Linphone::Core::LinphoneCallParams::IsLowBandwidthEnabled()
return enabled;
}
Platform::Boolean Linphone::Core::LinphoneCallParams::IsVideoEnabled()
{
gApiLock.Lock();
Platform::Boolean enabled = (linphone_call_params_video_enabled(this->params) == TRUE);
gApiLock.Unlock();
return enabled;
}
void Linphone::Core::LinphoneCallParams::EnableVideo(Platform::Boolean enable)
{
gApiLock.Lock();
linphone_call_params_enable_video(this->params, enable);
gApiLock.Unlock();
}
Linphone::Core::PayloadType^ Linphone::Core::LinphoneCallParams::GetUsedVideoCodec()
{
gApiLock.Lock();
Linphone::Core::PayloadType^ payloadType = nullptr;
const ::PayloadType *pt = linphone_call_params_get_used_video_codec(this->params);
if (pt != nullptr) {
payloadType = (Linphone::Core::PayloadType^) Linphone::Core::Utils::CreatePayloadType((void*)pt);
}
gApiLock.Unlock();
return payloadType;
}
Linphone::Core::LinphoneCallParams::LinphoneCallParams(::LinphoneCallParams *call_params) :
params(call_params)
{
......
......@@ -56,6 +56,24 @@ namespace Linphone
/// <returns>A boolean value telling whether the low bandwidth mode is enabled or not</returns>
Platform::Boolean IsLowBandwidthEnabled();
/// <summary>
/// Tells whether video is enabled.
/// </summary>
/// <returns>A boolean value telling whether video is enabled or not</returns>
Platform::Boolean IsVideoEnabled();
/// <summary>
/// Enable or disable video.
/// </summary>
/// <param name="enable">A boolean value telling whether video should be enabled or disabled</param>
void EnableVideo(Platform::Boolean enable);
/// <summary>
/// Returns the PayloadType currently in use for the video stream.
/// </summary>
/// <returns>The payload type currently in use for the video stream</returns>
PayloadType^ GetUsedVideoCodec();
private:
friend class Linphone::Core::Utils;
friend ref class Linphone::Core::LinphoneCore;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment