1 /*
2 * Video Acceleration API (video decoding)
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
26
27 /**
28 * @addtogroup VAAPI_Decoding
29 *
30 * @{
31 */
32
34 {
35 unsigned int i;
36 for (i = 0; i < n_buffers; i++) {
37 if (buffers[i]) {
38 vaDestroyBuffer(display, buffers[i]);
39 buffers[i] = 0;
40 }
41 }
42 }
43
45 {
46 VABufferID va_buffers[3];
47 unsigned int n_va_buffers = 0;
48
50 return 0;
51
54
58 }
59
63 }
64
66 surface) != VA_STATUS_SUCCESS)
67 return -1;
68
70 va_buffers, n_va_buffers) != VA_STATUS_SUCCESS)
71 return -1;
72
76 return -1;
77
79 return -1;
80
81 return 0;
82 }
83
85 {
86 VABufferID *slice_buf_ids;
87 VABufferID slice_param_buf_id, slice_data_buf_id;
88
90 return 0;
91
92 slice_buf_ids =
96 if (!slice_buf_ids)
97 return -1;
99
100 slice_param_buf_id = 0;
102 VASliceParameterBufferType,
105 &slice_param_buf_id) != VA_STATUS_SUCCESS)
106 return -1;
108
109 slice_data_buf_id = 0;
111 VASliceDataBufferType,
114 &slice_data_buf_id) != VA_STATUS_SUCCESS)
115 return -1;
118
121 return 0;
122 }
123
125 {
127
128 *buf_id = 0;
130 type, size, 1, NULL, buf_id) == VA_STATUS_SUCCESS)
131 vaMapBuffer(vactx->
display, *buf_id, &data);
132
134 }
135
137 {
139 }
140
142 {
144 }
145
147 {
149 }
150
152 {
154 VASliceParameterBufferBase *slice_param;
155
160 return NULL;
162 }
163
164 slice_params =
168 if (!slice_params)
169 return NULL;
171
173 slice_param->slice_data_size =
size;
175 slice_param->slice_data_flag = VA_SLICE_DATA_FLAG_ALL;
176
179 return slice_param;
180 }
181
183 {
185
186 av_dlog(avctx,
"ff_vaapi_common_end_frame()\n");
187
198 }
199
200 /* @} */