Commit 71282b25 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Implement Call::setParams().

parent 89ed9cae
......@@ -1102,14 +1102,7 @@ const bctbx_list_t *linphone_call_get_callbacks_list(const LinphoneCall *call) {
}
void linphone_call_set_params (LinphoneCall *call, const LinphoneCallParams *params) {
#if 0
if ( call->state == LinphoneCallOutgoingInit || call->state == LinphoneCallIncomingReceived){
_linphone_call_set_new_params(call, params);
}
else {
ms_error("linphone_call_set_params() invalid state %s to call this function", linphone_call_state_to_string(call->state));
}
#endif
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setParams(L_GET_CPP_PTR_FROM_C_OBJECT(params));
}
const LinphoneCallParams *linphone_call_get_params (LinphoneCall *call) {
......
......@@ -525,6 +525,11 @@ void Call::setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_d
d->onResetFirstVideoFrameDecoded();
}
void Call::setParams (const MediaSessionParams *msp) {
L_D();
static_cast<MediaSession *>(d->getActiveSession().get())->setParams(msp);
}
void Call::setSpeakerVolumeGain (float value) {
L_D();
static_cast<MediaSession *>(d->getActiveSession().get())->setSpeakerVolumeGain(value);
......
......@@ -100,6 +100,7 @@ public:
void setMicrophoneVolumeGain (float value);
void setNativeVideoWindowId (void *id);
void setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_data);
void setParams (const MediaSessionParams *msp);
void setSpeakerVolumeGain (float value);
protected:
......
......@@ -4826,6 +4826,14 @@ void MediaSession::setNativeVideoWindowId (void *id) {
#endif
}
void MediaSession::setParams (const MediaSessionParams *msp) {
L_D();
if ((d->state == LinphoneCallOutgoingInit) || (d->state == LinphoneCallIncomingReceived))
d->setParams(msp ? new MediaSessionParams(*msp) : nullptr);
else
lError() << "MediaSession::setParams(): Invalid state %s", linphone_call_state_to_string(d->state);
}
void MediaSession::setSpeakerVolumeGain (float value) {
L_D();
if (d->audioStream)
......
......@@ -96,6 +96,7 @@ public:
void setAuthenticationTokenVerified (bool value);
void setMicrophoneVolumeGain (float value);
void setNativeVideoWindowId (void *id);
void setParams (const MediaSessionParams *msp);
void setSpeakerVolumeGain (float value);
private:
......
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