[vlc-commits] XCB/XVideo: request correct picture format from the adaptor

Rémi Denis-Courmont git at videolan.org
Sat Dec 13 18:18:26 CET 2014


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 12 17:02:45 2014 +0200| [2ddfb2ffe0e72fe35ae874f880a3a9a74eb31a86] | committer: Jean-Baptiste Kempf

XCB/XVideo: request correct picture format from the adaptor

This is bug compatibility for XVideo drivers that scale the whole
picture rather than the source rectangle (the XVideo 2 specification
does not really state which behaviour is correct).

This works because the video output core only applies crop parameters
*after* the vout display plugin is activated. This is brittle though:
the A/R and crop parameters should probably be passed as configuration
like zoom.

(cherry picked from commit 4aa17707fc63c59ea173347d9b695a9a415822fe)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/xcb/xvideo.c |   32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 32f207b..e60baf6 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -314,38 +314,20 @@ FindFormat (vlc_object_t *obj, xcb_connection_t *conn, video_format_t *fmt,
         if (!BetterFormat (chroma, chromav, &rank))
             continue;
 
-        /* VLC pads scanline to 16 pixels internally */
-        unsigned width = (fmt->i_width + 31) & ~31;
-        unsigned height = (fmt->i_height + 15) & ~15;
         xcb_xv_query_image_attributes_reply_t *i;
         i = xcb_xv_query_image_attributes_reply (conn,
             xcb_xv_query_image_attributes (conn, a->base_id, f->id,
-                                           width, height), NULL);
+                                           fmt->i_visible_width,
+                                           fmt->i_visible_height), NULL);
         if (i == NULL)
             continue;
 
-        if (i->width != width || i->height != height)
-        {
-            msg_Warn (obj, "incompatible size %ux%u -> %"PRIu32"x%"PRIu32,
-                      fmt->i_width, fmt->i_height,
-                      i->width, i->height);
-            var_Create (obj->p_libvlc, "xvideo-res-error", VLC_VAR_BOOL);
-            if (!var_GetBool (obj->p_libvlc, "xvideo-res-error"))
-            {
-                dialog_FatalWait (obj, _("Video acceleration not available"),
-                    _("The XVideo rendering acceleration driver does not "
-                      "support the required resolution of %ux%u pixels but "
-                      "%"PRIu32"x%"PRIu32" pixels instead.\n"
-                      "Acceleration will thus be disabled. Performance may "
-                      "be degraded severely if the resolution is large."),
-                                  width, height, i->width, i->height);
-                var_SetBool (obj->p_libvlc, "xvideo-res-error", true);
-            }
-            free (i);
-            continue;
-        }
-
         fmt->i_chroma = chroma;
+        fmt->i_x_offset = 0;
+        fmt->i_y_offset = 0;
+        fmt->i_width = i->width;
+        fmt->i_height = i->height;
+
         if (f->type == XCB_XV_IMAGE_FORMAT_INFO_TYPE_RGB)
         {
             fmt->i_rmask = f->red_mask;



More information about the vlc-commits mailing list