Commit 4af25812 authored by Timo Rothenpieler's avatar Timo Rothenpieler Committed by Denis Charmet

Make vaapi decoder compatible with latest libva changes

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit dc4b64c97b82d4d590ccf7fa1c938435cc26d98e)

Conflicts:
	modules/codec/avcodec/vaapi.c
parent 0429744d
/***************************************************************************** /*****************************************************************************
* vaapi.c: VAAPI helpers for the ffmpeg decoder * vaapi.c: VAAPI helpers for the ffmpeg decoder
***************************************************************************** *****************************************************************************
* Copyright (C) 2009 Laurent Aimar * Copyright (C) 2009 Laurent Aimar
* $Id$ * $Id$
* *
* Authors: Laurent Aimar <fenrir_AT_ videolan _DOT_ org> * Authors: Laurent Aimar <fenrir_AT_ videolan _DOT_ org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
...@@ -45,6 +45,11 @@ ...@@ -45,6 +45,11 @@
#include <libavcodec/vaapi.h> #include <libavcodec/vaapi.h>
#ifndef VA_SURFACE_ATTRIB_SETTABLE
#define vaCreateSurfaces(d, f, w, h, s, ns, a, na) \
vaCreateSurfaces(d, w, h, f, ns, s)
#endif
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <va/va_x11.h> #include <va/va_x11.h>
...@@ -246,8 +251,8 @@ static int CreateSurfaces( vlc_va_vaapi_t *p_va, void **pp_hw_ctx, vlc_fourcc_t ...@@ -246,8 +251,8 @@ static int CreateSurfaces( vlc_va_vaapi_t *p_va, void **pp_hw_ctx, vlc_fourcc_t
/* Create surfaces */ /* Create surfaces */
VASurfaceID pi_surface_id[p_va->i_surface_count]; VASurfaceID pi_surface_id[p_va->i_surface_count];
if( vaCreateSurfaces( p_va->p_display, i_width, i_height, VA_RT_FORMAT_YUV420, if( vaCreateSurfaces( p_va->p_display, VA_RT_FORMAT_YUV420, i_width, i_height,
p_va->i_surface_count, pi_surface_id ) ) pi_surface_id, p_va->i_surface_count, NULL, 0 ) )
{ {
for( int i = 0; i < p_va->i_surface_count; i++ ) for( int i = 0; i < p_va->i_surface_count; i++ )
p_va->p_surface[i].i_id = VA_INVALID_SURFACE; p_va->p_surface[i].i_id = VA_INVALID_SURFACE;
......
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