1 --- xine-lib-1.2.3/src/xine-engine/accel_vaapi.h.orig 1970-01-01 01:00:00.000000000 +0100
2 +++ xine-lib-1.2.3/src/xine-engine/accel_vaapi.h 2013-07-20 18:26:54.064253047 +0200
5 + * Copyright (C) 2008 the xine project
7 + * This file is part of xine, a free video player.
9 + * xine is free software; you can redistribute it and/or modify
10 + * it under the terms of the GNU General Public License as published by
11 + * the Free Software Foundation; either version 2 of the License, or
12 + * (at your option) any later version.
14 + * xine is distributed in the hope that it will be useful,
15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 + * GNU General Public License for more details.
19 + * You should have received a copy of the GNU General Public License
20 + * along with this program; if not, write to the Free Software
21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
24 + * Common acceleration definitions for vaapi
29 +#ifndef HAVE_XINE_ACCEL_VAAPI_H
30 +#define HAVE_XINE_ACCEL_VAAPI_H
40 +#include <va/va_x11.h>
42 +#ifdef HAVE_FFMPEG_AVUTIL_H
43 +# include <avcodec.h>
45 +# include <libavcodec/avcodec.h>
48 +#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32)
52 +# define pp_context pp_context_t
53 +# define pp_mode pp_mode_t
56 +#define NUM_OUTPUT_SURFACES 22
58 +#define SURFACE_FREE 0
59 +#define SURFACE_ALOC 1
60 +#define SURFACE_RELEASE 2
61 +#define SURFACE_RENDER 3
62 +#define SURFACE_RENDER_RELEASE 5
64 +struct vaapi_equalizer {
65 + VADisplayAttribute brightness;
66 + VADisplayAttribute contrast;
67 + VADisplayAttribute hue;
68 + VADisplayAttribute saturation;
71 +typedef struct ff_vaapi_context_s ff_vaapi_context_t;
73 +struct ff_vaapi_context_s {
74 + VADisplay va_display;
75 + VAContextID va_context_id;
76 + VAConfigID va_config_id;
82 + unsigned int va_colorspace;
83 + VAImage va_subpic_image;
84 + VASubpictureID va_subpic_id;
85 + int va_subpic_width;
86 + int va_subpic_height;
89 + unsigned int soft_head;
90 + unsigned int valid_context;
91 + unsigned int va_head;
92 + unsigned int va_soft_head;
93 + vo_driver_t *driver;
94 + unsigned int last_sub_image_fmt;
95 + VASurfaceID last_sub_surface_id;
96 + struct vaapi_equalizer va_equalizer;
97 + VAImageFormat *va_image_formats;
98 + int va_num_image_formats;
99 + VAImageFormat *va_subpic_formats;
100 + int va_num_subpic_formats;
103 +typedef struct ff_vaapi_surface_s ff_vaapi_surface_t;
104 +typedef struct vaapi_accel_s vaapi_accel_t;
106 +struct ff_vaapi_surface_s {
107 + unsigned int index;
108 + vaapi_accel_t *accel;
109 + VASurfaceID va_surface_id;
110 + unsigned int status;
113 +struct vaapi_accel_s {
114 + unsigned int index;
115 + vo_frame_t *vo_frame;
118 + int (*avcodec_decode_video2)(vo_frame_t *frame_gen, AVCodecContext *avctx, AVFrame *picture,
119 + int *got_picture_ptr, AVPacket *avpkt);
121 + int (*avcodec_decode_video)(vo_frame_t *frame_gen, AVCodecContext *avctx, AVFrame *picture,
122 + int *got_picture_ptr, uint8_t *buf, int buf_size);
124 + VAStatus (*vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height, int softrender);
125 + int (*profile_from_imgfmt)(vo_frame_t *frame_gen, enum PixelFormat pix_fmt, int codec_id, int vaapi_mpeg_sofdec);
126 + ff_vaapi_context_t *(*get_context)(vo_frame_t *frame_gen);
127 + int (*guarded_render)(vo_frame_t *frame_gen);
128 + ff_vaapi_surface_t *(*get_vaapi_surface)(vo_frame_t *frame_gen);
129 + void (*render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
130 + void (*release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);