]> sjero.net Git - linphone/commitdiff
Add video zoom API
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Tue, 17 Apr 2012 09:13:29 +0000 (11:13 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Tue, 17 Apr 2012 09:13:52 +0000 (11:13 +0200)
coreapi/linphonecore.c
coreapi/linphonecore.h
mediastreamer2

index fd1fe7d1cf0b8108a9a5519f910f8c7640ebe0c0..f7d78a025bef09a96e442bc0cd0cfbaf44ca6da2 100644 (file)
@@ -4776,3 +4776,26 @@ 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;
+    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);
+}
+
index 0bca75ce9cc48d341420e696fceb431ce254faf1..a5a1e8c0cf6fd8a570258078a390c60fbea35d64 100644 (file)
@@ -1131,6 +1131,8 @@ typedef struct LinphoneTunnel LinphoneTunnel;
 * get tunnel instance if available
 */
 LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc);
+    
+    void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float cx, float cy);
 
 #ifdef __cplusplus
 }
index da89da8f938e658ef713511e2ff653bce4b7d423..c194c9209bf6c96d419c0513f979ca1114ff3111 160000 (submodule)
@@ -1 +1 @@
-Subproject commit da89da8f938e658ef713511e2ff653bce4b7d423
+Subproject commit c194c9209bf6c96d419c0513f979ca1114ff3111