xine-lib  1.2.9
accel_vaapi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Edgar Hucek <gimli|@dark-green.com>
3  * Copyright (C) 2012-2016 xine developers
4  *
5  * This file is part of xine, a free video player.
6  *
7  * xine is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * xine is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
20  *
21  *
22  * Common acceleration definitions for vaapi
23  *
24  *
25  */
26 
27 #ifndef HAVE_XINE_ACCEL_VAAPI_H
28 #define HAVE_XINE_ACCEL_VAAPI_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #ifdef HAVE_CONFIG_H
35 #include "config.h"
36 #endif
37 
38 #include <va/va.h>
39 
40 #define SURFACE_FREE 0
41 #define SURFACE_ALOC 1
42 #define SURFACE_RELEASE 2
43 #define SURFACE_RENDER 3
44 #define SURFACE_RENDER_RELEASE 5
45 
47  VADisplayAttribute brightness;
48  VADisplayAttribute contrast;
49  VADisplayAttribute hue;
50  VADisplayAttribute saturation;
51 };
52 
55 
57  VADisplay va_display;
58  VAContextID va_context_id;
59  VAConfigID va_config_id;
60  int width;
61  int height;
62  unsigned int valid_context;
63 
64  /* decoding surfaces */
65  VASurfaceID *va_surface_ids;
67  unsigned int va_head;
68 
70  VAImageFormat *va_image_formats;
72 };
73 
75 
77  unsigned int index;
78  VASurfaceID va_surface_id;
79  unsigned int status;
80 };
81 
82  /*
83  *
84  */
85 
86 #define IMGFMT_VAAPI 0x56410000 /* 'VA'00 */
87 #define IMGFMT_VAAPI_MASK 0xFFFF0000
88 #define IMGFMT_VAAPI_CODEC_MASK 0x000000F0
89 #define IMGFMT_VAAPI_CODEC(fmt) ((fmt) & IMGFMT_VAAPI_CODEC_MASK)
90 #define IMGFMT_VAAPI_CODEC_MPEG2 (0x10)
91 #define IMGFMT_VAAPI_CODEC_MPEG4 (0x20)
92 #define IMGFMT_VAAPI_CODEC_H264 (0x30)
93 #define IMGFMT_VAAPI_CODEC_VC1 (0x40)
94 #define IMGFMT_VAAPI_CODEC_HEVC (0x50)
95 #define IMGFMT_VAAPI_MPEG2 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2)
96 #define IMGFMT_VAAPI_MPEG2_IDCT (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|1)
97 #define IMGFMT_VAAPI_MPEG2_MOCO (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|2)
98 #define IMGFMT_VAAPI_MPEG4 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4)
99 #define IMGFMT_VAAPI_H263 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4|1)
100 #define IMGFMT_VAAPI_H264 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_H264)
101 #define IMGFMT_VAAPI_HEVC (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_HEVC)
102 #define IMGFMT_VAAPI_HEVC_MAIN10 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_HEVC|1)
103 #define IMGFMT_VAAPI_VC1 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1)
104 #define IMGFMT_VAAPI_WMV3 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1|1)
105 
107  unsigned int index;
108 
109  int (*lock_vaapi)(vo_frame_t *frame_gen);
110  void (*unlock_vaapi)(vo_frame_t *frame_gen);
111 
112  VAStatus (*vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height);
113  int (*profile_from_imgfmt)(vo_frame_t *frame_gen, unsigned img_fmt);
114  ff_vaapi_context_t *(*get_context)(vo_frame_t *frame_gen);
115  int (*guarded_render)(vo_frame_t *frame_gen);
116  ff_vaapi_surface_t *(*get_vaapi_surface)(vo_frame_t *frame_gen);
117  void (*render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
118  void (*release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
119 };
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif
126 
int(* profile_from_imgfmt)(vo_frame_t *frame_gen, unsigned img_fmt)
Definition: accel_vaapi.h:113
void(* unlock_vaapi)(vo_frame_t *frame_gen)
Definition: accel_vaapi.h:110
unsigned int index
Definition: accel_vaapi.h:77
unsigned int height
Definition: gfontrle.c:5
int va_num_image_formats
Definition: accel_vaapi.h:71
VADisplayAttribute contrast
Definition: accel_vaapi.h:48
VADisplay va_display
Definition: accel_vaapi.h:57
int(* lock_vaapi)(vo_frame_t *frame_gen)
Definition: accel_vaapi.h:109
Definition: accel_vaapi.h:46
VAConfigID va_config_id
Definition: accel_vaapi.h:59
unsigned int valid_context
Definition: accel_vaapi.h:62
VADisplayAttribute brightness
Definition: accel_vaapi.h:47
Definition: accel_vaapi.h:56
unsigned int status
Definition: accel_vaapi.h:79
VAContextID va_context_id
Definition: accel_vaapi.h:58
VAImageFormat * va_image_formats
Definition: accel_vaapi.h:70
unsigned int index
Definition: accel_vaapi.h:107
Definition: video_out.h:50
Definition: accel_vaapi.h:76
VADisplayAttribute hue
Definition: accel_vaapi.h:49
Definition: accel_vaapi.h:106
vo_driver_t * driver
Definition: accel_vaapi.h:69
void(* release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface)
Definition: accel_vaapi.h:118
Definition: video_out.h:60
unsigned int va_head
Definition: accel_vaapi.h:67
VADisplayAttribute saturation
Definition: accel_vaapi.h:50
int width
Definition: accel_vaapi.h:60
VASurfaceID va_surface_id
Definition: accel_vaapi.h:78
VASurfaceID * va_surface_ids
Definition: accel_vaapi.h:65
int(* guarded_render)(vo_frame_t *frame_gen)
Definition: accel_vaapi.h:115
VAStatus(* vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height)
Definition: accel_vaapi.h:112
unsigned int width
Definition: gfontrle.c:4
void(* render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface)
Definition: accel_vaapi.h:117
ff_vaapi_surface_t * va_render_surfaces
Definition: accel_vaapi.h:66
int height
Definition: accel_vaapi.h:61