VA-API branch staging support.

This commit is contained in:
Johns 2012-02-22 16:50:35 +01:00
parent 73b93f1aba
commit 7382bd60ff

21
video.c
View File

@ -130,6 +130,11 @@ typedef enum
#ifdef USE_GLX #ifdef USE_GLX
#include <va/va_glx.h> #include <va/va_glx.h>
#endif #endif
#ifndef VA_SURFACE_ATTRIB_SETTABLE
/// make source compatible with old libva
#define vaCreateSurfaces(d, f, w, h, s, ns, a, na) \
vaCreateSurfaces(d, w, h, f, ns, s)
#endif
#endif #endif
#ifdef USE_VDPAU #ifdef USE_VDPAU
@ -1461,9 +1466,9 @@ static void VaapiCreateSurfaces(VaapiDecoder * decoder, int width, int height)
decoder->SurfaceFreeN = decoder->SurfacesNeeded; decoder->SurfaceFreeN = decoder->SurfacesNeeded;
// VA_RT_FORMAT_YUV420 VA_RT_FORMAT_YUV422 VA_RT_FORMAT_YUV444 // VA_RT_FORMAT_YUV420 VA_RT_FORMAT_YUV422 VA_RT_FORMAT_YUV444
if (vaCreateSurfaces(decoder->VaDisplay, width, height, if (vaCreateSurfaces(decoder->VaDisplay, VA_RT_FORMAT_YUV420, width,
VA_RT_FORMAT_YUV420, decoder->SurfaceFreeN, height, decoder->SurfacesFree, decoder->SurfaceFreeN,
decoder->SurfacesFree) != VA_STATUS_SUCCESS) { NULL, 0) != VA_STATUS_SUCCESS) {
Fatal(_("video/vaapi: can't create %d surfaces\n"), Fatal(_("video/vaapi: can't create %d surfaces\n"),
decoder->SurfaceFreeN); decoder->SurfaceFreeN);
// FIXME: write error handler / fallback // FIXME: write error handler / fallback
@ -1927,8 +1932,8 @@ static void Vaapi1080i(void)
Error(_("codec: can't create config")); Error(_("codec: can't create config"));
return; return;
} }
if (vaCreateSurfaces(VaDisplay, 1920, 1080, VA_RT_FORMAT_YUV420, 32, if (vaCreateSurfaces(VaDisplay, VA_RT_FORMAT_YUV420, 1920, 1080,
surfaces) != VA_STATUS_SUCCESS) { surfaces, 32, NULL, 0) != VA_STATUS_SUCCESS) {
Error(_("video/vaapi: can't create surfaces\n")); Error(_("video/vaapi: can't create surfaces\n"));
return; return;
} }
@ -3057,9 +3062,9 @@ static void VaapiBlackSurface(VaapiDecoder * decoder)
} }
if (decoder->BlackSurface == VA_INVALID_ID) { if (decoder->BlackSurface == VA_INVALID_ID) {
if (vaCreateSurfaces(decoder->VaDisplay, VideoWindowWidth, if (vaCreateSurfaces(decoder->VaDisplay, VA_RT_FORMAT_YUV420,
VideoWindowHeight, VA_RT_FORMAT_YUV420, 1, VideoWindowWidth, VideoWindowHeight,
&decoder->BlackSurface) != VA_STATUS_SUCCESS) { &decoder->BlackSurface, 1, NULL, 0) != VA_STATUS_SUCCESS) {
Error(_("video/vaapi: can't create a surface\n")); Error(_("video/vaapi: can't create a surface\n"));
return; return;
} }