[vlc-commits] XCB/X11: reorient video

Matthias Keiser git at videolan.org
Thu Mar 13 21:16:52 CET 2014


vlc | branch: master | Matthias Keiser <matthias at tristan-inc.com> | Thu Mar  6 01:12:32 2014 +0100| [e288457407307aa295620fc6bfd44bf550025fb6] | committer: Rémi Denis-Courmont

XCB/X11: reorient video

(Note that the pointer position is not reoriented, this comes with a
later patch in the series for all XCB video outputs.)

Modified-and-...
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e288457407307aa295620fc6bfd44bf550025fb6
---

 modules/video_output/xcb/x11.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index b2e782e..8fdbee1 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -140,6 +140,7 @@ static int Open (vlc_object_t *obj)
             continue; /* no better than earlier format */
 
         fmt_pic = vd->fmt;
+        video_format_ApplyRotation(&fmt_pic, &vd->fmt);
 
         /* Check that the pixmap format is supported by VLC. */
         switch (fmt->depth)
@@ -533,13 +534,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;
     }
 



More information about the vlc-commits mailing list