[vlc-devel] [PATCH 11/11] make xcb_x11 and xcb_glx vout modules handle rotated movies.
Rémi Denis-Courmont
remi at remlab.net
Thu Mar 13 20:55:53 CET 2014
Le jeudi 6 mars 2014, 01:12:32 Matthias Keiser a écrit :
> ---
> modules/video_output/xcb/events.c | 7 +------
> modules/video_output/xcb/x11.c | 14 ++++++++++----
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/modules/video_output/xcb/events.c
> b/modules/video_output/xcb/events.c index efb3adb..d3ad55c 100644
> --- a/modules/video_output/xcb/events.c
> +++ b/modules/video_output/xcb/events.c
> @@ -232,12 +232,7 @@ static void HandleMotionNotify (vout_display_t *vd,
> xcb_connection_t *conn, if (place.width <= 0 || place.height <= 0)
> return;
>
> - const int x = vd->source.i_x_offset +
> - (int64_t)(ev->event_x - place.x) * vd->source.i_visible_width /
> place.width; - const int y = vd->source.i_y_offset +
> - (int64_t)(ev->event_y - place.y) * vd->source.i_visible_height/
> place.height; -
> - vout_display_SendEventMouseMoved (vd, x, y);
> + vout_display_SendMouseMovedDisplayCoordinates(vd, ORIENT_NORMAL,
> ev->event_x, ev->event_y, &place); }
This should probably be split out to a different patch because it affects at
least 4 different outputs (X11, XVideo, GLX and VDPAU).
>
> static void HandleVisibilityNotify (vout_display_t *vd, bool *visible,
> diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
> index b2e782e..6b01bed 100644
> --- a/modules/video_output/xcb/x11.c
> +++ b/modules/video_output/xcb/x11.c
> @@ -112,6 +112,9 @@ static int Open (vlc_object_t *obj)
> vd->sys = sys;
> sys->pool = NULL;
>
> + video_format_t fmt = vd->fmt;
Please don't shadow variables.
> + video_format_ApplyRotation(&fmt, &vd->fmt);
This has no effects since this computation never gets stored. Also the display
configuration is wrong; the window is created with an inverted aspect ratio in
case of quarter angle rotation. So does the video area.
I don't know if this is a core or plugin issue.
> +
> /* Get window, connect to X server */
> xcb_connection_t *conn;
> const xcb_screen_t *scr;
> @@ -533,13 +536,16 @@ static int Control (vout_display_t *vd, int query,
> va_list ap) vout_display_place_t place;
> vout_display_PlacePicture (&place, &vd->source, vd->cfg, false);
>
> - vd->fmt.i_width = vd->source.i_width * place.width /
> vd->source.i_visible_width; - vd->fmt.i_height = vd->source.i_height
> * place.height / vd->source.i_visible_height; + video_format_t
> source_rot;
> + video_format_ApplyRotation(&vd->source, &source_rot);
> +
> + vd->fmt.i_width = source_rot.i_width * place.width /
> source_rot.i_visible_width; + vd->fmt.i_height = source_rot.i_height
> * place.height / source_rot.i_visible_height;
>
> vd->fmt.i_visible_width = place.width;
> vd->fmt.i_visible_height = place.height;
> - vd->fmt.i_x_offset = vd->source.i_x_offset * place.width /
> vd->source.i_visible_width; - vd->fmt.i_y_offset =
> vd->source.i_y_offset * place.height / vd->source.i_visible_height; +
> vd->fmt.i_x_offset = source_rot.i_x_offset * place.width /
> source_rot.i_visible_width; + vd->fmt.i_y_offset =
> source_rot.i_y_offset * place.height / source_rot.i_visible_height; return
> VLC_SUCCESS;
> }
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list