Mercurial > libavcodec.hg
annotate vaapi.h @ 9292:f0732d44f655 libavcodec
Improve VA API buffers allocation logic. This also reduces struct vaapi_context
down to ~60 bytes vs. a few KBs before, and gets rid of explicit VA data types.
author | gb |
---|---|
date | Tue, 31 Mar 2009 08:33:02 +0000 |
parents | 238dd89b7ac3 |
children | bf264662cd6b |
rev | line source |
---|---|
9225 | 1 /* |
2 * Video Acceleration API (shared data between FFmpeg and the video player) | |
3 * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 | |
4 * | |
5 * Copyright (C) 2008-2009 Splitted-Desktop Systems | |
6 * | |
7 * This file is part of FFmpeg. | |
8 * | |
9 * FFmpeg is free software; you can redistribute it and/or | |
10 * modify it under the terms of the GNU Lesser General Public | |
11 * License as published by the Free Software Foundation; either | |
12 * version 2.1 of the License, or (at your option) any later version. | |
13 * | |
14 * FFmpeg 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 GNU | |
17 * Lesser General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU Lesser General Public | |
20 * License along with FFmpeg; if not, write to the Free Software | |
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
22 */ | |
23 | |
24 #ifndef AVCODEC_VAAPI_H | |
25 #define AVCODEC_VAAPI_H | |
26 | |
27 #include <stdint.h> | |
9289
238dd89b7ac3
Add required va/va.h header, should fix 'make checkheaders'.
diego
parents:
9225
diff
changeset
|
28 #include <va/va.h> |
9225 | 29 |
30 /** | |
31 * \defgroup VAAPI_Decoding VA API Decoding | |
32 * \ingroup Decoder | |
33 * @{ | |
34 */ | |
35 | |
36 /** | |
37 * This structure is used to share data between the FFmpeg library and | |
38 * the client video application. | |
39 * This shall be zero-allocated and available as | |
40 * AVCodecContext.hwaccel_context. All user members can be set once | |
41 * during initialization or through each AVCodecContext.get_buffer() | |
42 * function call. In any case, they must be valid prior to calling | |
43 * decoding functions. | |
44 */ | |
45 struct vaapi_context { | |
46 /** | |
47 * Window system dependent data | |
48 * | |
49 * - encoding: unused | |
50 * - decoding: Set by user | |
51 */ | |
52 void *display; | |
53 | |
54 /** | |
55 * Configuration ID | |
56 * | |
57 * - encoding: unused | |
58 * - decoding: Set by user | |
59 */ | |
60 uint32_t config_id; | |
61 | |
62 /** | |
63 * Context ID (video decode pipeline) | |
64 * | |
65 * - encoding: unused | |
66 * - decoding: Set by user | |
67 */ | |
68 uint32_t context_id; | |
69 | |
70 /** | |
71 * VAPictureParameterBuffer ID | |
72 * | |
73 * - encoding: unused | |
74 * - decoding: Set by libavcodec | |
75 */ | |
9292
f0732d44f655
Improve VA API buffers allocation logic. This also reduces struct vaapi_context
gb
parents:
9289
diff
changeset
|
76 uint32_t pic_param_buf_id; |
9225 | 77 |
78 /** | |
79 * VAIQMatrixBuffer ID | |
80 * | |
81 * - encoding: unused | |
82 * - decoding: Set by libavcodec | |
83 */ | |
9292
f0732d44f655
Improve VA API buffers allocation logic. This also reduces struct vaapi_context
gb
parents:
9289
diff
changeset
|
84 uint32_t iq_matrix_buf_id; |
9225 | 85 |
86 /** | |
87 * VABitPlaneBuffer ID (for VC-1 decoding) | |
88 * | |
89 * - encoding: unused | |
90 * - decoding: Set by libavcodec | |
91 */ | |
9292
f0732d44f655
Improve VA API buffers allocation logic. This also reduces struct vaapi_context
gb
parents:
9289
diff
changeset
|
92 uint32_t bitplane_buf_id; |
9225 | 93 |
94 /** | |
95 * Slice parameter/data buffer IDs | |
96 * | |
97 * - encoding: unused | |
98 * - decoding: Set by libavcodec | |
99 */ | |
9292
f0732d44f655
Improve VA API buffers allocation logic. This also reduces struct vaapi_context
gb
parents:
9289
diff
changeset
|
100 uint32_t *slice_buf_ids; |
9225 | 101 |
102 /** | |
103 * Number of effective slice buffer IDs to send to the HW | |
104 * | |
105 * - encoding: unused | |
106 * - decoding: Set by libavcodec | |
107 */ | |
108 unsigned int n_slice_buf_ids; | |
109 | |
110 /** | |
111 * Size of pre-allocated slice_buf_ids | |
112 * | |
113 * - encoding: unused | |
114 * - decoding: Set by libavcodec | |
115 */ | |
116 unsigned int slice_buf_ids_alloc; | |
117 | |
118 /** | |
119 * Pointer to VASliceParameterBuffers | |
120 * | |
121 * - encoding: unused | |
122 * - decoding: Set by libavcodec | |
123 */ | |
124 void *slice_params; | |
125 | |
126 /** | |
127 * Size of a VASliceParameterBuffer element | |
128 * | |
129 * - encoding: unused | |
130 * - decoding: Set by libavcodec | |
131 */ | |
132 unsigned int slice_param_size; | |
133 | |
134 /** | |
135 * Size of pre-allocated slice_params | |
136 * | |
137 * - encoding: unused | |
138 * - decoding: Set by libavcodec | |
139 */ | |
140 unsigned int slice_params_alloc; | |
141 | |
142 /** | |
143 * Number of slices currently filled in | |
144 * | |
145 * - encoding: unused | |
146 * - decoding: Set by libavcodec | |
147 */ | |
148 unsigned int slice_count; | |
149 | |
150 /** | |
151 * Pointer to slice data buffer base | |
152 * - encoding: unused | |
153 * - decoding: Set by libavcodec | |
154 */ | |
155 const uint8_t *slice_data; | |
156 | |
157 /** | |
158 * Current size of slice data | |
159 * | |
160 * - encoding: unused | |
161 * - decoding: Set by libavcodec | |
162 */ | |
163 uint32_t slice_data_size; | |
164 }; | |
165 | |
166 /* @} */ | |
167 | |
168 #endif /* AVCODEC_VAAPI_H */ |