Commit 2ddfb2ff authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 117be772
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment