Le jeudi 27 novembre 2014, 11:39:52 maximilian attems a écrit :
> xf86-video-intel upstream says:
> "it's a bug in vlc.
> they are supplying an image larger than the surface they wish to scale
> and then complain when the extra pixels are sampled during scaling.
> the issue is that they are not initialising those extra pixels
> correctly - it should be padded." -ickle

That is a rather innovative way to word it.

VLC supplies an image larger than the source rectangle that it wishes to 
scale. The Intel seems to blend pixels from outside the source rectangle.

How is that a VLC bug?!

> Hence keep bugging vlc guys, will close xorg driver bug report.

It is not the first time that someone blames VLC for not working around quirks 
in the Intel graphic drivers.

You can try this work around, which fills invisible pixels that the Intel 
drivers incorrectly blends with the visible pixels.

If Intel cannot provide working XVideo, they should not provide an XVideo 
adapter in X11 (or alternatively, not provide the XVideo extension at all). 
VLC will happily fallback to OpenGL then.

-- 
Rémi
>From 10b8ee4a591045e6bab92fb01d7332baf922a41a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <r...@remlab.net>
Date: Sun, 30 Nov 2014 13:01:59 +0200
Subject: [PATCH] XCB/XVideo: fill invisible padding in pictures

Some brain-damaged XVideo drivers blend pixels outside the source
rectangle and the pixels within the source rectangle around the bottom
and/or right edge. That makes no sense since the source rectangle is
in whole pixels.

This partly works around the driver bug by filling the padding lines
and columns.
---
 modules/video_output/xcb/xvideo.c | 44 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index bddc52b..de2e17d 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -99,7 +99,8 @@ struct vout_display_sys_t
 };
 
 static picture_pool_t *Pool (vout_display_t *, unsigned);
-static void Display (vout_display_t *, picture_t *, subpicture_t *subpicture);
+static void Prepare (vout_display_t *, picture_t *, subpicture_t *);
+static void Display (vout_display_t *, picture_t *, subpicture_t *);
 static int Control (vout_display_t *, int, va_list);
 static void Manage (vout_display_t *);
 
@@ -583,7 +584,7 @@ static int Open (vlc_object_t *obj)
     vd->info = info;
 
     vd->pool = Pool;
-    vd->prepare = NULL;
+    vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
     vd->manage = Manage;
@@ -689,6 +690,45 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
     return p_sys->pool;
 }
 
+/* TODO: factor this out as a helper function for several vouts? */
+static void Prepare (vout_display_t *vd, picture_t *pic, subpicture_t *subpic)
+{
+    for (int i = 0; i < pic->i_planes; i++)
+    {
+        plane_t *p = pic->p + i;
+        uint8_t *dst;
+        const uint8_t *src;
+
+        dst = p->p_pixels + p->i_pitch * p->i_visible_lines;
+        src = dst - p->i_pitch;
+
+        for (int y = p->i_visible_lines; y < p->i_lines; y++)
+        {
+            memcpy(dst, src, p->i_pitch);
+            dst += p->i_pitch;
+        }
+
+        dst = p->p_pixels + p->i_visible_pitch;
+        src = dst - p->i_pixel_pitch;
+
+        for (int y = 0; y < p->i_lines; y++)
+        {
+            for (int x = p->i_visible_pitch; x < p->i_pitch;
+                 x += p->i_pixel_pitch)
+            {
+                memcpy(dst, src, p->i_pixel_pitch);
+                dst += p->i_pixel_pitch;
+            }
+
+            src += p->i_pitch;
+            dst = src + p->i_pixel_pitch;
+        }
+    }
+
+    (void) vd;
+    (void) subpic;
+}
+
 /**
  * Sends an image to the X server.
  */
-- 
1.9.1

_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to