diff --git a/include/linphone/api/c-call.h b/include/linphone/api/c-call.h index fe3c2c7680e49f6661d1761e7881351dbceea595..da3dbaaa5ab28a62ac953a34ee62e0833884bb3c 100644 --- a/include/linphone/api/c-call.h +++ b/include/linphone/api/c-call.h @@ -272,11 +272,21 @@ LINPHONE_PUBLIC LinphoneCallState linphone_call_get_transfer_state (LinphoneCall * @param zoom_factor a floating point number describing the zoom factor. A value 1.0 corresponds to no zoom applied. * @param cx a floating point number pointing the horizontal center of the zoom to be applied. This value should be between 0.0 and 1.0. * @param cy a floating point number pointing the vertical center of the zoom to be applied. This value should be between 0.0 and 1.0. - * + * @deprecated use linphone_call_zoom instead * cx and cy are updated in return in case their coordinates were too excentrated for the requested zoom factor. The zoom ensures that all the screen is fullfilled with the video. **/ LINPHONE_PUBLIC void linphone_call_zoom_video (LinphoneCall *call, float zoom_factor, float *cx, float *cy); +/** + * Perform a zoom of the video displayed during a call. + * The zoom ensures that all the screen is fullfilled with the video. + * @param call the call. + * @param zoom_factor a floating point number describing the zoom factor. A value 1.0 corresponds to no zoom applied. + * @param cx a floating point number pointing the horizontal center of the zoom to be applied. This value should be between 0.0 and 1.0. + * @param cy a floating point number pointing the vertical center of the zoom to be applied. This value should be between 0.0 and 1.0. +**/ +LINPHONE_PUBLIC void linphone_call_zoom (LinphoneCall *call, float zoom_factor, float cx, float cy); + /** * Send the specified dtmf. * diff --git a/src/c-wrapper/api/c-call.cpp b/src/c-wrapper/api/c-call.cpp index c6d722faeef8ed5926f751cb2f126948dfacc81e..3f1d1300207ad2973b3821436abcc8677999e6c5 100644 --- a/src/c-wrapper/api/c-call.cpp +++ b/src/c-wrapper/api/c-call.cpp @@ -765,6 +765,10 @@ void linphone_call_zoom_video (LinphoneCall* call, float zoom_factor, float* cx, L_GET_CPP_PTR_FROM_C_OBJECT(call)->zoomVideo(zoom_factor, cx, cy); } +void linphone_call_zoom (LinphoneCall *call, float zoom_factor, float cx, float cy) { + L_GET_CPP_PTR_FROM_C_OBJECT(call)->zoomVideo(zoom_factor, cx, cy); +} + LinphoneStatus linphone_call_send_dtmf (LinphoneCall *call, char dtmf) { #if 0 if (!call){ diff --git a/src/call/call.cpp b/src/call/call.cpp index 1d3ded3e7afece2ce9ef69e54d3839ba1c158107..ea85c024d57466bde43c98cf0608195ab5233be1 100644 --- a/src/call/call.cpp +++ b/src/call/call.cpp @@ -315,6 +315,10 @@ LinphoneStatus Call::update (const MediaSessionParams *msp) { } void Call::zoomVideo (float zoomFactor, float *cx, float *cy) { + zoomVideo(zoomFactor, *cx, *cy); +} + +void Call::zoomVideo (float zoomFactor, float cx, float cy) { L_D(); static_cast(d->getActiveSession().get())->zoomVideo(zoomFactor, cx, cy); } diff --git a/src/call/call.h b/src/call/call.h index ee10154f836815aabd9bbe461257c2bf913ab19f..a3d840c871d0fa5b641610423460ac605b2635ef 100644 --- a/src/call/call.h +++ b/src/call/call.h @@ -64,6 +64,7 @@ public: LinphoneStatus terminate (const LinphoneErrorInfo *ei = nullptr); LinphoneStatus update (const MediaSessionParams *msp = nullptr); void zoomVideo (float zoomFactor, float *cx, float *cy); + void zoomVideo (float zoomFactor, float cx, float cy); bool cameraEnabled () const; bool echoCancellationEnabled () const; diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 524ecaab1e7b1a92977922ebd7149ff75f277614..e51fc70699dfabe7f8e5230d7f33c76f8daaab45 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -4381,20 +4381,24 @@ LinphoneStatus MediaSession::takeVideoSnapshot (const string& file) { } void MediaSession::zoomVideo (float zoomFactor, float *cx, float *cy) { + zoomVideo(zoomFactor, *cx, *cy); +} + +void MediaSession::zoomVideo (float zoomFactor, float cx, float cy) { L_D(); if (d->videoStream && d->videoStream->output) { if (zoomFactor < 1) zoomFactor = 1; float halfsize = 0.5f * 1.0f / zoomFactor; - if ((*cx - halfsize) < 0) - *cx = 0 + halfsize; - if ((*cx + halfsize) > 1) - *cx = 1 - halfsize; - if ((*cy - halfsize) < 0) - *cy = 0 + halfsize; - if ((*cy + halfsize) > 1) - *cy = 1 - halfsize; - float zoom[3] = { zoomFactor, *cx, *cy }; + if ((cx - halfsize) < 0) + cx = 0 + halfsize; + if ((cx + halfsize) > 1) + cx = 1 - halfsize; + if ((cy - halfsize) < 0) + cy = 0 + halfsize; + if ((cy + halfsize) > 1) + cy = 1 - halfsize; + float zoom[3] = { zoomFactor, cx, cy }; ms_filter_call_method(d->videoStream->output, MS_VIDEO_DISPLAY_ZOOM, &zoom); } else lWarning() << "Could not apply zoom: video output wasn't activated"; diff --git a/src/conference/session/media-session.h b/src/conference/session/media-session.h index af3a6c44420a18124202c0d5640b8d96d289197b..2ef160ab521275e04fa2d33bcebbfb912d1252e9 100644 --- a/src/conference/session/media-session.h +++ b/src/conference/session/media-session.h @@ -58,6 +58,7 @@ public: LinphoneStatus takePreviewSnapshot (const std::string& file); LinphoneStatus takeVideoSnapshot (const std::string& file); void zoomVideo (float zoomFactor, float *cx, float *cy); + void zoomVideo (float zoomFactor, float cx, float cy); bool cameraEnabled () const; bool echoCancellationEnabled () const; diff --git a/wrappers/java/migration.sh b/wrappers/java/migration.sh index 2e83169b7ad4ae7b3c553e8d02ad6cf9de18a536..532e04f0469716d41d46e5a228f389fedcd155a2 100644 --- a/wrappers/java/migration.sh +++ b/wrappers/java/migration.sh @@ -231,11 +231,12 @@ eval "$SED_START 's/getCountryName()/getCountry()/g' $SED_END" eval "$SED_START 's/getMSFactory()/getMediastreamerFactory()/g' $SED_END" eval "$SED_START 's/accountCreator.getPrefix(/org.linphone.core.Utils::getPrefixFromE164(/g' $SED_END" eval "$SED_START 's/proxyConfig.lookupCCCFromIso(/org.linphone.core.Utils::getCccFromIso(/g' $SED_END" +eval "$SED_START 's/linkPhoneNumberWithAccount()/linkAccount()/g' $SED_END" +eval "$SED_START 's/zoomVideo(/zoom(/g' $SED_END" #Changes in library required #Tunnel #LinphoneBuffer -#Call.zoomVideo() #AccountCreator.updatePassword #Android specifics not wrapped automatically