<!DOCTYPE html><html><head><title></title><style type="text/css">
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hello, applied, thanks !<br></div><div><br></div><div>PS: If you are the author, we don't need that the patch is signed-off by the same author.<br></div><div><br></div><div>On Sat, Nov 28, 2020, at 08:20, Yuri Sevatz wrote:<br></div><blockquote type="cite" id="qt" style=""><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<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);">It's the same patch otherwise.<br></div><div id="qt-appendonsend"><br></div><div><hr style="display:inline-block;width:98%;"><br></div><div id="qt-divRplyFwdMsg" dir="ltr"><div><span class="font" style="font-family:Calibri, sans-serif;"><span class="colour" style="color:rgb(0, 0, 0);"><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</span></span> </div><div> <br></div></div><div class="qt-BodyFragment"><span class="size" style="font-size:13px;"><span style=""><span class="size" style="font-size:11pt;"><div class="qt-PlainText"><div>LGTM<br></div><div> <br></div><div> On Wed, Nov 25, 2020, at 09:38, Yuri Sevatz wrote:<br></div><div> > Add input rotation for mouse events in the rotate video filter.<br></div><div> > <br></div><div> > Previously the rotate video filter would not rotate mouse events,<br></div><div> > which would cause confusion if another video filter taking mouse<br></div><div> > input was chained before rotate (e.g. zoom, puzzle, etc), and<br></div><div> > clicks headed for those in-filter actions would have to go to<br></div><div> > their pre-rotated positions in order for VLC to accept them.<br></div><div> > ---<br></div><div> >  modules/video_filter/rotate.c | 40 ++++++++++++++++++++++++++++++++++-<br></div><div> >  1 file changed, 39 insertions(+), 1 deletion(-)<br></div><div> > <br></div><div> > diff --git a/modules/video_filter/rotate.c b/modules/video_filter/rotate.c<br></div><div> > index e4232cce2c..35d2208321 100644<br></div><div> > --- a/modules/video_filter/rotate.c<br></div><div> > +++ b/modules/video_filter/rotate.c<br></div><div> > @@ -35,6 +35,7 @@<br></div><div> >  #include <vlc_common.h><br></div><div> >  #include <vlc_plugin.h><br></div><div> >  #include <vlc_filter.h><br></div><div> > +#include <vlc_mouse.h><br></div><div> >  #include <vlc_picture.h><br></div><div> >  #include "filter_picture.h"<br></div><div> >  #include "../control/motionlib.h"<br></div><div> > @@ -44,6 +45,8 @@<br></div><div> >   *****************************************************************************/<br></div><div> >  static int  Create    ( filter_t * );<br></div><div> >  <br></div><div> > +static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse,<br></div><div> > +                  const vlc_mouse_t *p_old );<br></div><div> >  static picture_t *FilterPacked( filter_t *, picture_t * );<br></div><div> >  VIDEO_FILTER_WRAPPER_CLOSE(Filter, Destroy)<br></div><div> >  <br></div><div> > @@ -118,7 +121,7 @@ static void fetch_trigo( filter_sys_t *sys, int <br></div><div> > *i_sin, int *i_cos )<br></div><div> >  <br></div><div> >  static const struct vlc_filter_operations packed_filter_ops =<br></div><div> >  {<br></div><div> > -    .filter_video = FilterPacked, .close = Destroy,<br></div><div> > +    .filter_video = FilterPacked, .video_mouse = Mouse, .close = Destroy,<br></div><div> >  };<br></div><div> >  <br></div><div> >  /*****************************************************************************<br></div><div> > @@ -198,6 +201,41 @@ static void Destroy( filter_t *p_filter )<br></div><div> >      free( p_sys );<br></div><div> >  }<br></div><div> >  <br></div><div> > +/*****************************************************************************<br></div><div> > + *<br></div><div> > + *****************************************************************************/<br></div><div> > +static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse,<br></div><div> > +                  const vlc_mouse_t *p_old )<br></div><div> > +{<br></div><div> > +    VLC_UNUSED( p_old );<br></div><div> > +<br></div><div> > +    const video_format_t *p_fmt = &p_filter->fmt_out.video;<br></div><div> > +    filter_sys_t *p_sys = p_filter->p_sys;<br></div><div> > +<br></div><div> > +    const int i_x = p_mouse->i_x;<br></div><div> > +    const int i_y = p_mouse->i_y;<br></div><div> > +<br></div><div> > +    if( p_sys->p_motion != NULL )<br></div><div> > +    {<br></div><div> > +        int i_angle = motion_get_angle( p_sys->p_motion );<br></div><div> > +        store_trigo( p_sys, i_angle / 20.f );<br></div><div> > +    }<br></div><div> > +<br></div><div> > +    int i_sin, i_cos;<br></div><div> > +    fetch_trigo( p_sys, &i_sin, &i_cos );<br></div><div> > +<br></div><div> > +    p_mouse->i_x = ( p_fmt->i_visible_width >> 1 );<br></div><div> > +    p_mouse->i_y = ( p_fmt->i_visible_height >> 1 );<br></div><div> > +<br></div><div> > +    const int i_rx = ( i_x - p_mouse->i_x );<br></div><div> > +    const int i_ry = ( i_y - p_mouse->i_y );<br></div><div> > +<br></div><div> > +    p_mouse->i_x += ( ( i_rx * i_cos - i_ry * i_sin )>> 12 );<br></div><div> > +    p_mouse->i_y += ( ( i_rx * i_sin + i_ry * i_cos )>> 12 );<br></div><div> > +<br></div><div> > +    return VLC_SUCCESS;<br></div><div> > +}<br></div><div> > +<br></div><div> >  /*****************************************************************************<br></div><div> >   *<br></div><div> >   *****************************************************************************/<br></div><div> > -- <br></div><div> > 2.29.2<br></div><div> > <br></div><div> > _______________________________________________<br></div><div> > vlc-devel mailing list<br></div><div> > To unsubscribe or modify your subscription options:<br></div><div> > <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div><div> _______________________________________________<br></div><div> vlc-devel mailing list<br></div><div> To unsubscribe or modify your subscription options:<br></div><div> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></div></span></span></span></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><br></div></body></html>