]> git.sesse.net Git - vlc/blobdiff - src/control/video.c
libvlc_video_get_cursor: get the current mouse video coordinates
[vlc] / src / control / video.c
index e9f8ed728caea2ceb7145a8bd3d4cd273e9943c0..db90825c92744bdd3e4bbbbe25e959f900f6146b 100644 (file)
@@ -186,6 +186,19 @@ int libvlc_video_get_width( libvlc_media_player_t *p_mi )
     return width;
 }
 
+int libvlc_video_get_cursor( libvlc_media_player_t *mp, unsigned num,
+                             int *px, int *py )
+{
+    vout_thread_t *p_vout = GetVout (mp, num);
+    if (p_vout == NULL)
+        return -1;
+
+    *px = var_GetInteger (p_vout, "mouse-x");
+    *py = var_GetInteger (p_vout, "mouse-y");
+    vlc_object_release (p_vout);
+    return 0;
+}
+
 unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi )
 {
     size_t n;