Commit 59ed757f authored by Ronan Abhamon's avatar Ronan Abhamon

feat(src/components/call/CallModel): accept incoming video call

parent 30774f23
...@@ -62,9 +62,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) { ...@@ -62,9 +62,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) {
m_paused_by_user = false; m_paused_by_user = false;
break; break;
case linphone::CallStateUpdatedByRemote: { case linphone::CallStateUpdatedByRemote:
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
if ( if (
!m_linphone_call->getCurrentParams()->videoEnabled() && !m_linphone_call->getCurrentParams()->videoEnabled() &&
m_linphone_call->getRemoteParams()->videoEnabled() m_linphone_call->getRemoteParams()->videoEnabled()
...@@ -72,9 +70,8 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) { ...@@ -72,9 +70,8 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) {
CoreManager::getInstance()->getCore()->deferCallUpdate(m_linphone_call); CoreManager::getInstance()->getCore()->deferCallUpdate(m_linphone_call);
emit videoRequested(); emit videoRequested();
} }
}
break; break;
default: default:
break; break;
...@@ -99,11 +96,21 @@ void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &call_params) { ...@@ -99,11 +96,21 @@ void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &call_params) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CallModel::accept () { void CallModel::accept () {
CoreManager::getInstance()->getCore()->acceptCall(m_linphone_call); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::CallParams> params = core->createCallParams(m_linphone_call);
params->enableVideo(false);
setRecordFile(params);
core->acceptCallWithParams(m_linphone_call, params);
} }
void CallModel::acceptWithVideo () { void CallModel::acceptWithVideo () {
// TODO shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::CallParams> params = core->createCallParams(m_linphone_call);
params->enableVideo(true);
setRecordFile(params);
core->acceptCallWithParams(m_linphone_call, params);
} }
void CallModel::terminate () { void CallModel::terminate () {
...@@ -115,10 +122,11 @@ void CallModel::transfer () { ...@@ -115,10 +122,11 @@ void CallModel::transfer () {
} }
void CallModel::acceptVideoRequest () { void CallModel::acceptVideoRequest () {
shared_ptr<linphone::CallParams> params = CoreManager::getInstance()->getCore()->createCallParams(m_linphone_call); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::CallParams> params = core->createCallParams(m_linphone_call);
params->enableVideo(true); params->enableVideo(true);
CoreManager::getInstance()->getCore()->acceptCallUpdate(m_linphone_call, params); core->acceptCallUpdate(m_linphone_call, params);
} }
void CallModel::rejectVideoRequest () { void CallModel::rejectVideoRequest () {
...@@ -274,10 +282,11 @@ void CallModel::setVideoEnabled (bool status) { ...@@ -274,10 +282,11 @@ void CallModel::setVideoEnabled (bool status) {
if (status == getVideoEnabled()) if (status == getVideoEnabled())
return; return;
shared_ptr<linphone::CallParams> params = CoreManager::getInstance()->getCore()->createCallParams(m_linphone_call); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::CallParams> params = core->createCallParams(m_linphone_call);
params->enableVideo(status); params->enableVideo(status);
CoreManager::getInstance()->getCore()->updateCall(m_linphone_call, params); core->updateCall(m_linphone_call, params);
} }
bool CallModel::getUpdating () const { bool CallModel::getUpdating () const {
......
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