<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I've placed the Signed-Off version for master, in a thread with "vlc-master" in the subject:<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    [vlc-devel] [PATCH] vlc-master modules/video_filter/rotate.c: add pf_video_mouse input filter</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It's the same patch otherwise.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> vlc-devel <vlc-devel-bounces@videolan.org> on behalf of Thomas Guillem <thomas@gllm.fr><br>
<b>Sent:</b> Thursday, November 26, 2020 4:29 AM<br>
<b>To:</b> Mailing list for VLC media player developers <vlc-devel@videolan.org><br>
<b>Subject:</b> Re: [vlc-devel] [PATCH] modules/video_filter/rotate.c: add pf_video_mouse input filter</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">LGTM<br>
<br>
On Wed, Nov 25, 2020, at 09:38, Yuri Sevatz wrote:<br>
> Add input rotation for mouse events in the rotate video filter.<br>
> <br>
> Previously the rotate video filter would not rotate mouse events,<br>
> which would cause confusion if another video filter taking mouse<br>
> input was chained before rotate (e.g. zoom, puzzle, etc), and<br>
> clicks headed for those in-filter actions would have to go to<br>
> their pre-rotated positions in order for VLC to accept them.<br>
> ---<br>
>  modules/video_filter/rotate.c | 40 ++++++++++++++++++++++++++++++++++-<br>
>  1 file changed, 39 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/modules/video_filter/rotate.c b/modules/video_filter/rotate.c<br>
> index e4232cce2c..35d2208321 100644<br>
> --- a/modules/video_filter/rotate.c<br>
> +++ b/modules/video_filter/rotate.c<br>
> @@ -35,6 +35,7 @@<br>
>  #include <vlc_common.h><br>
>  #include <vlc_plugin.h><br>
>  #include <vlc_filter.h><br>
> +#include <vlc_mouse.h><br>
>  #include <vlc_picture.h><br>
>  #include "filter_picture.h"<br>
>  #include "../control/motionlib.h"<br>
> @@ -44,6 +45,8 @@<br>
>   *****************************************************************************/<br>
>  static int  Create    ( filter_t * );<br>
>  <br>
> +static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse,<br>
> +                  const vlc_mouse_t *p_old );<br>
>  static picture_t *FilterPacked( filter_t *, picture_t * );<br>
>  VIDEO_FILTER_WRAPPER_CLOSE(Filter, Destroy)<br>
>  <br>
> @@ -118,7 +121,7 @@ static void fetch_trigo( filter_sys_t *sys, int <br>
> *i_sin, int *i_cos )<br>
>  <br>
>  static const struct vlc_filter_operations packed_filter_ops =<br>
>  {<br>
> -    .filter_video = FilterPacked, .close = Destroy,<br>
> +    .filter_video = FilterPacked, .video_mouse = Mouse, .close = Destroy,<br>
>  };<br>
>  <br>
>  /*****************************************************************************<br>
> @@ -198,6 +201,41 @@ static void Destroy( filter_t *p_filter )<br>
>      free( p_sys );<br>
>  }<br>
>  <br>
> +/*****************************************************************************<br>
> + *<br>
> + *****************************************************************************/<br>
> +static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse,<br>
> +                  const vlc_mouse_t *p_old )<br>
> +{<br>
> +    VLC_UNUSED( p_old );<br>
> +<br>
> +    const video_format_t *p_fmt = &p_filter->fmt_out.video;<br>
> +    filter_sys_t *p_sys = p_filter->p_sys;<br>
> +<br>
> +    const int i_x = p_mouse->i_x;<br>
> +    const int i_y = p_mouse->i_y;<br>
> +<br>
> +    if( p_sys->p_motion != NULL )<br>
> +    {<br>
> +        int i_angle = motion_get_angle( p_sys->p_motion );<br>
> +        store_trigo( p_sys, i_angle / 20.f );<br>
> +    }<br>
> +<br>
> +    int i_sin, i_cos;<br>
> +    fetch_trigo( p_sys, &i_sin, &i_cos );<br>
> +<br>
> +    p_mouse->i_x = ( p_fmt->i_visible_width >> 1 );<br>
> +    p_mouse->i_y = ( p_fmt->i_visible_height >> 1 );<br>
> +<br>
> +    const int i_rx = ( i_x - p_mouse->i_x );<br>
> +    const int i_ry = ( i_y - p_mouse->i_y );<br>
> +<br>
> +    p_mouse->i_x += ( ( i_rx * i_cos - i_ry * i_sin )>> 12 );<br>
> +    p_mouse->i_y += ( ( i_rx * i_sin + i_ry * i_cos )>> 12 );<br>
> +<br>
> +    return VLC_SUCCESS;<br>
> +}<br>
> +<br>
>  /*****************************************************************************<br>
>   *<br>
>   *****************************************************************************/<br>
> -- <br>
> 2.29.2<br>
> <br>
> _______________________________________________<br>
> vlc-devel mailing list<br>
> To unsubscribe or modify your subscription options:<br>
> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></div>
</span></font></div>
</body>
</html>