VA-API/XvBA backend improvements.

This commit is contained in:
Johns 2012-07-27 19:15:48 +02:00
parent 8b0d8d8446
commit 9ec077ec8a

17
video.c
View File

@ -1271,9 +1271,10 @@ static void AutoCropDetect(AutoCropCtx * autocrop, int width, int height,
#ifdef USE_VAAPI #ifdef USE_VAAPI
static int VaapiBuggyVdpau; ///< fix libva-driver-vdpau bugs static char VaapiBuggyXvBA; ///< fix xvba-video bugs
static int VaapiBuggyIntel; ///< fix libva-driver-intel bugs static char VaapiBuggyVdpau; ///< fix libva-driver-vdpau bugs
static int VaapiNewIntel; ///< new libva-driver-intel driver static char VaapiBuggyIntel; ///< fix libva-driver-intel bugs
static char VaapiNewIntel; ///< new libva-driver-intel driver
static VADisplay *VaDisplay; ///< VA-API display static VADisplay *VaDisplay; ///< VA-API display
@ -1591,7 +1592,10 @@ static VASurfaceID VaapiGetSurface(VaapiDecoder * decoder)
surface = decoder->SurfacesFree[i]; surface = decoder->SurfacesFree[i];
if (vaQuerySurfaceStatus(decoder->VaDisplay, surface, &status) if (vaQuerySurfaceStatus(decoder->VaDisplay, surface, &status)
!= VA_STATUS_SUCCESS) { != VA_STATUS_SUCCESS) {
Error(_("video/vaapi: vaQuerySurface failed\n")); // this fails with XvBA und mpeg softdecoder
if (!VaapiBuggyXvBA) {
Error(_("video/vaapi: vaQuerySurface failed\n"));
}
status = VASurfaceReady; status = VASurfaceReady;
} }
// surface still in use, try next // surface still in use, try next
@ -2111,6 +2115,8 @@ static int VaapiInit(const char *display_name)
display_name); display_name);
return 0; return 0;
} }
// XvBA needs this:
setenv("DISPLAY", display_name, 1);
if (vaInitialize(VaDisplay, &major, &minor) != VA_STATUS_SUCCESS) { if (vaInitialize(VaDisplay, &major, &minor) != VA_STATUS_SUCCESS) {
Error(_("video/vaapi: Can't inititialize VA-API on '%s'\n"), Error(_("video/vaapi: Can't inititialize VA-API on '%s'\n"),
@ -2130,6 +2136,9 @@ static int VaapiInit(const char *display_name)
setenv("VDPAU_VIDEO_PUTSURFACE_FAST", "0", 0); setenv("VDPAU_VIDEO_PUTSURFACE_FAST", "0", 0);
VaapiBuggyVdpau = 1; VaapiBuggyVdpau = 1;
} }
if (strstr(s, "XvBA")) {
VaapiBuggyXvBA = 1;
}
if (strstr(s, "Intel i965")) { if (strstr(s, "Intel i965")) {
VaapiBuggyIntel = 1; VaapiBuggyIntel = 1;
} }