Commit e5d63eff authored by Simon Morlat's avatar Simon Morlat

document linphone_call_zoom_video and put it in the right place.

parent c6eaf5a2
......@@ -2092,3 +2092,38 @@ void linphone_call_set_transfer_state(LinphoneCall* call, LinphoneCallState stat
bool_t linphone_call_is_in_conference(const LinphoneCall *call) {
return call->params.in_conference;
}
/**
* Perform a zoom of the video displayed during a 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.
*
* cx and cy are updated in return in case their coordinates were to excentrated for the requested zoom factor. The zoom ensures that all the screen is fullfilled with the video.
**/
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy) {
VideoStream* vstream = call->videostream;
if (vstream) {
float zoom[3];
if (zoom_factor < 1)
zoom_factor = 1;
float halfsize = 0.5 * 1.0 / zoom_factor;
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;
zoom[0] = zoom_factor;
zoom[1] = *cx;
zoom[2] = *cy;
ms_filter_call_method(vstream->output, MS_VIDEO_DISPLAY_ZOOM, &zoom);
}else ms_warning("Could not apply zoom: video output wasn't activated.");
}
......@@ -5181,30 +5181,7 @@ void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *para
params->in_conference=FALSE;
}
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy) {
VideoStream* vstream = call->videostream;
if (vstream) {
float zoom[3];
if (zoom_factor < 1)
zoom_factor = 1;
float halfsize = 0.5 * 1.0 / zoom_factor;
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;
zoom[0] = zoom_factor;
zoom[1] = *cx;
zoom[2] = *cy;
ms_filter_call_method(vstream->output, MS_VIDEO_DISPLAY_ZOOM, &zoom);
}else ms_warning("Could not apply zoom: video output wasn't activated.");
}
void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) {
if (lc->device_id) ms_free(lc->device_id);
......
......@@ -390,6 +390,7 @@ void *linphone_call_get_user_pointer(LinphoneCall *call);
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
void linphone_call_set_next_video_frame_decoded_callback(LinphoneCall *call, LinphoneCallCbFunc cb, void* user_data);
LinphoneCallState linphone_call_get_transfer_state(LinphoneCall *call);
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy);
/**
* Return TRUE if this call is currently part of a conference
*@param call #LinphoneCall
......@@ -1428,8 +1429,6 @@ typedef struct LinphoneTunnel LinphoneTunnel;
*/
LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc);
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy);
void linphone_core_set_sip_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_sip_dscp(const LinphoneCore *lc);
......
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