Annotation of /trunk/xine-lib/accel_vaapi.h
Parent Directory | Revision Log
Revision 2194 -
(hide annotations)
(download)
Mon Jun 10 14:57:45 2013 UTC (11 years, 3 months ago) by niro
File MIME type: text/plain
File size: 4077 byte(s)
Mon Jun 10 14:57:45 2013 UTC (11 years, 3 months ago) by niro
File MIME type: text/plain
File size: 4077 byte(s)
-added missing include
1 | niro | 2194 | /* |
2 | * Copyright (C) 2008 the xine project | ||
3 | * | ||
4 | * This file is part of xine, a free video player. | ||
5 | * | ||
6 | * xine is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * xine is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
19 | * | ||
20 | * | ||
21 | * Common acceleration definitions for vdpau | ||
22 | * | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | #ifndef HAVE_XINE_ACCEL_VAAPI_H | ||
27 | #define HAVE_XINE_ACCEL_VAAPI_H | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | extern "C" { | ||
31 | #endif | ||
32 | |||
33 | #ifdef HAVE_CONFIG_H | ||
34 | #include "config.h" | ||
35 | #endif | ||
36 | |||
37 | #include <va/va_x11.h> | ||
38 | #include <pthread.h> | ||
39 | #ifdef HAVE_FFMPEG_AVUTIL_H | ||
40 | # include <avcodec.h> | ||
41 | #else | ||
42 | # include <libavcodec/avcodec.h> | ||
43 | #endif | ||
44 | |||
45 | #if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32) | ||
46 | # define AVVIDEO 2 | ||
47 | #else | ||
48 | # define AVVIDEO 1 | ||
49 | # define pp_context pp_context_t | ||
50 | # define pp_mode pp_mode_t | ||
51 | #endif | ||
52 | |||
53 | #define NUM_OUTPUT_SURFACES 22 | ||
54 | |||
55 | #define SURFACE_FREE 0 | ||
56 | #define SURFACE_ALOC 1 | ||
57 | #define SURFACE_RELEASE 2 | ||
58 | #define SURFACE_RENDER 3 | ||
59 | #define SURFACE_RENDER_RELEASE 5 | ||
60 | |||
61 | struct vaapi_equalizer { | ||
62 | VADisplayAttribute brightness; | ||
63 | VADisplayAttribute contrast; | ||
64 | VADisplayAttribute hue; | ||
65 | VADisplayAttribute saturation; | ||
66 | }; | ||
67 | |||
68 | typedef struct ff_vaapi_context_s ff_vaapi_context_t; | ||
69 | |||
70 | struct ff_vaapi_context_s { | ||
71 | VADisplay va_display; | ||
72 | VAContextID va_context_id; | ||
73 | VAConfigID va_config_id; | ||
74 | int width; | ||
75 | int height; | ||
76 | int sw_width; | ||
77 | int sw_height; | ||
78 | int va_profile; | ||
79 | unsigned int va_colorspace; | ||
80 | VAImage va_subpic_image; | ||
81 | VASubpictureID va_subpic_id; | ||
82 | int va_subpic_width; | ||
83 | int va_subpic_height; | ||
84 | int is_bound; | ||
85 | void *gl_surface; | ||
86 | unsigned int soft_head; | ||
87 | unsigned int valid_context; | ||
88 | unsigned int va_head; | ||
89 | unsigned int va_soft_head; | ||
90 | vo_driver_t *driver; | ||
91 | unsigned int last_sub_image_fmt; | ||
92 | VASurfaceID last_sub_surface_id; | ||
93 | struct vaapi_equalizer va_equalizer; | ||
94 | VAImageFormat *va_image_formats; | ||
95 | int va_num_image_formats; | ||
96 | VAImageFormat *va_subpic_formats; | ||
97 | int va_num_subpic_formats; | ||
98 | }; | ||
99 | |||
100 | typedef struct ff_vaapi_surface_s ff_vaapi_surface_t; | ||
101 | typedef struct vaapi_accel_s vaapi_accel_t; | ||
102 | |||
103 | struct ff_vaapi_surface_s { | ||
104 | unsigned int index; | ||
105 | vaapi_accel_t *accel; | ||
106 | VASurfaceID va_surface_id; | ||
107 | unsigned int status; | ||
108 | }; | ||
109 | |||
110 | struct vaapi_accel_s { | ||
111 | unsigned int index; | ||
112 | vo_frame_t *vo_frame; | ||
113 | |||
114 | #if AVVIDEO > 1 | ||
115 | int (*avcodec_decode_video2)(vo_frame_t *frame_gen, AVCodecContext *avctx, AVFrame *picture, | ||
116 | int *got_picture_ptr, AVPacket *avpkt); | ||
117 | #else | ||
118 | int (*avcodec_decode_video)(vo_frame_t *frame_gen, AVCodecContext *avctx, AVFrame *picture, | ||
119 | int *got_picture_ptr, uint8_t *buf, int buf_size); | ||
120 | #endif | ||
121 | VAStatus (*vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height, int softrender); | ||
122 | int (*profile_from_imgfmt)(vo_frame_t *frame_gen, enum PixelFormat pix_fmt, int codec_id, int vaapi_mpeg_sofdec); | ||
123 | ff_vaapi_context_t *(*get_context)(vo_frame_t *frame_gen); | ||
124 | int (*guarded_render)(vo_frame_t *frame_gen); | ||
125 | ff_vaapi_surface_t *(*get_vaapi_surface)(vo_frame_t *frame_gen); | ||
126 | void (*render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface); | ||
127 | void (*release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface); | ||
128 | }; | ||
129 | |||
130 | #ifdef __cplusplus | ||
131 | } | ||
132 | #endif | ||
133 | |||
134 | #endif | ||
135 |