]> sjero.net Git - linphone/commitdiff
document linphone_call_zoom_video and put it in the right place.
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 17 Oct 2012 12:35:34 +0000 (14:35 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 17 Oct 2012 12:36:15 +0000 (14:36 +0200)
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h

index a930b1bed6bd8d5b7e78b4c00bbbb9ef03721d9c..32dc9d59c37a398208c554c8a7300a5046f7074e 100644 (file)
@@ -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.");
+}
+
index 7159edd6f1c6dd6ba687b23a5309fc231c0e86ea..d96a1905b50dfb23cdf7a874b2b03d960f1fb516 100644 (file)
@@ -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);
index 1849c083b8d3de35845aa9e2259c5642b433617f..ad52c559f4955079f0276743ec6e1eb7b3daf843 100644 (file)
@@ -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);