xine-lib 1.2.11
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
31extern "C" {
32#endif
33
34#include <va/va.h>
35
36#define SURFACE_FREE 0
37#define SURFACE_ALOC 1
38#define SURFACE_RELEASE 2
39#define SURFACE_RENDER 3
40#define SURFACE_RENDER_RELEASE 5
41
43 VADisplayAttribute brightness;
44 VADisplayAttribute contrast;
45 VADisplayAttribute hue;
46 VADisplayAttribute saturation;
47};
48
51
53 VADisplay va_display;
54 VAContextID va_context_id;
55 VAConfigID va_config_id;
56 int width;
57 int height;
58 unsigned int valid_context;
59
60 /* decoding surfaces */
61 VASurfaceID *va_surface_ids;
63 unsigned int va_head;
64
66 VAImageFormat *va_image_formats;
68};
69
71
73 unsigned int index;
74 VASurfaceID va_surface_id;
75 unsigned int status;
76};
77
78 /*
79 *
80 */
81
82#define IMGFMT_VAAPI 0x56410000 /* 'VA'00 */
83#define IMGFMT_VAAPI_MASK 0xFFFF0000
84#define IMGFMT_VAAPI_CODEC_MASK 0x000000F0
85#define IMGFMT_VAAPI_CODEC(fmt) ((fmt) & IMGFMT_VAAPI_CODEC_MASK)
86#define IMGFMT_VAAPI_CODEC_MPEG2 (0x10)
87#define IMGFMT_VAAPI_CODEC_MPEG4 (0x20)
88#define IMGFMT_VAAPI_CODEC_H264 (0x30)
89#define IMGFMT_VAAPI_CODEC_VC1 (0x40)
90#define IMGFMT_VAAPI_CODEC_HEVC (0x50)
91#define IMGFMT_VAAPI_MPEG2 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2)
92#define IMGFMT_VAAPI_MPEG2_IDCT (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|1)
93#define IMGFMT_VAAPI_MPEG2_MOCO (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|2)
94#define IMGFMT_VAAPI_MPEG4 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4)
95#define IMGFMT_VAAPI_H263 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4|1)
96#define IMGFMT_VAAPI_H264 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_H264)
97#define IMGFMT_VAAPI_HEVC (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_HEVC)
98#define IMGFMT_VAAPI_HEVC_MAIN10 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_HEVC|1)
99#define IMGFMT_VAAPI_VC1 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1)
100#define IMGFMT_VAAPI_WMV3 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1|1)
101
103 int (*lock_vaapi)(vo_frame_t *frame_gen);
104 void (*unlock_vaapi)(vo_frame_t *frame_gen);
105
106 VAStatus (*vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height);
107 int (*profile_from_imgfmt)(vo_frame_t *frame_gen, unsigned img_fmt);
108 ff_vaapi_context_t *(*get_context)(vo_frame_t *frame_gen);
109 int (*guarded_render)(vo_frame_t *frame_gen);
110 ff_vaapi_surface_t *(*get_vaapi_surface)(vo_frame_t *frame_gen);
111 void (*render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
112 void (*release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
113};
114
116 unsigned int index;
117
118 const struct vaapi_accel_funcs_s *f;
119};
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif
126
unsigned int height
Definition: gfontrle.c:5
unsigned int width
Definition: gfontrle.c:4
Definition: accel_vaapi.h:52
VAConfigID va_config_id
Definition: accel_vaapi.h:55
int va_num_image_formats
Definition: accel_vaapi.h:67
VADisplay va_display
Definition: accel_vaapi.h:53
vo_driver_t * driver
Definition: accel_vaapi.h:65
int width
Definition: accel_vaapi.h:56
VASurfaceID * va_surface_ids
Definition: accel_vaapi.h:61
VAImageFormat * va_image_formats
Definition: accel_vaapi.h:66
ff_vaapi_surface_t * va_render_surfaces
Definition: accel_vaapi.h:62
int height
Definition: accel_vaapi.h:57
VAContextID va_context_id
Definition: accel_vaapi.h:54
unsigned int valid_context
Definition: accel_vaapi.h:58
unsigned int va_head
Definition: accel_vaapi.h:63
Definition: accel_vaapi.h:72
unsigned int status
Definition: accel_vaapi.h:75
unsigned int index
Definition: accel_vaapi.h:73
VASurfaceID va_surface_id
Definition: accel_vaapi.h:74
Definition: accel_vaapi.h:102
int(* guarded_render)(vo_frame_t *frame_gen)
Definition: accel_vaapi.h:109
VAStatus(* vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height)
Definition: accel_vaapi.h:106
void(* unlock_vaapi)(vo_frame_t *frame_gen)
Definition: accel_vaapi.h:104
int(* lock_vaapi)(vo_frame_t *frame_gen)
Definition: accel_vaapi.h:103
int(* profile_from_imgfmt)(vo_frame_t *frame_gen, unsigned img_fmt)
Definition: accel_vaapi.h:107
void(* release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface)
Definition: accel_vaapi.h:112
void(* render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface)
Definition: accel_vaapi.h:111
Definition: accel_vaapi.h:115
const struct vaapi_accel_funcs_s * f
Definition: accel_vaapi.h:118
unsigned int index
Definition: accel_vaapi.h:116
Definition: accel_vaapi.h:42
VADisplayAttribute hue
Definition: accel_vaapi.h:45
VADisplayAttribute saturation
Definition: accel_vaapi.h:46
VADisplayAttribute brightness
Definition: accel_vaapi.h:43
VADisplayAttribute contrast
Definition: accel_vaapi.h:44
Definition: video_out.h:50
Definition: video_out.h:59