FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vaapi.h
Go to the documentation of this file.
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 /**
28  * @file
29  * @ingroup lavc_codec_hwaccel_vaapi
30  * Public libavcodec VA API header.
31  */
32 
33 #include <stdint.h>
34 #include "libavutil/attributes.h"
35 #include "version.h"
36 
37 /**
38  * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
39  * @ingroup lavc_codec_hwaccel
40  * @{
41  */
42 
43 /**
44  * This structure is used to share data between the FFmpeg library and
45  * the client video application.
46  * This shall be zero-allocated and available as
47  * AVCodecContext.hwaccel_context. All user members can be set once
48  * during initialization or through each AVCodecContext.get_buffer()
49  * function call. In any case, they must be valid prior to calling
50  * decoding functions.
51  */
52 struct vaapi_context {
53  /**
54  * Window system dependent data
55  *
56  * - encoding: unused
57  * - decoding: Set by user
58  */
59  void *display;
60 
61  /**
62  * Configuration ID
63  *
64  * - encoding: unused
65  * - decoding: Set by user
66  */
67  uint32_t config_id;
68 
69  /**
70  * Context ID (video decode pipeline)
71  *
72  * - encoding: unused
73  * - decoding: Set by user
74  */
75  uint32_t context_id;
76 
77 #if FF_API_VAAPI_CONTEXT
78  /**
79  * VAPictureParameterBuffer ID
80  *
81  * - encoding: unused
82  * - decoding: Set by libavcodec
83  */
85  uint32_t pic_param_buf_id;
86 
87  /**
88  * VAIQMatrixBuffer ID
89  *
90  * - encoding: unused
91  * - decoding: Set by libavcodec
92  */
94  uint32_t iq_matrix_buf_id;
95 
96  /**
97  * VABitPlaneBuffer ID (for VC-1 decoding)
98  *
99  * - encoding: unused
100  * - decoding: Set by libavcodec
101  */
103  uint32_t bitplane_buf_id;
104 
105  /**
106  * Slice parameter/data buffer IDs
107  *
108  * - encoding: unused
109  * - decoding: Set by libavcodec
110  */
112  uint32_t *slice_buf_ids;
113 
114  /**
115  * Number of effective slice buffer IDs to send to the HW
116  *
117  * - encoding: unused
118  * - decoding: Set by libavcodec
119  */
121  unsigned int n_slice_buf_ids;
122 
123  /**
124  * Size of pre-allocated slice_buf_ids
125  *
126  * - encoding: unused
127  * - decoding: Set by libavcodec
128  */
130  unsigned int slice_buf_ids_alloc;
131 
132  /**
133  * Pointer to VASliceParameterBuffers
134  *
135  * - encoding: unused
136  * - decoding: Set by libavcodec
137  */
140 
141  /**
142  * Size of a VASliceParameterBuffer element
143  *
144  * - encoding: unused
145  * - decoding: Set by libavcodec
146  */
148  unsigned int slice_param_size;
149 
150  /**
151  * Size of pre-allocated slice_params
152  *
153  * - encoding: unused
154  * - decoding: Set by libavcodec
155  */
157  unsigned int slice_params_alloc;
158 
159  /**
160  * Number of slices currently filled in
161  *
162  * - encoding: unused
163  * - decoding: Set by libavcodec
164  */
166  unsigned int slice_count;
167 
168  /**
169  * Pointer to slice data buffer base
170  * - encoding: unused
171  * - decoding: Set by libavcodec
172  */
175 
176  /**
177  * Current size of slice data
178  *
179  * - encoding: unused
180  * - decoding: Set by libavcodec
181  */
183  uint32_t slice_data_size;
184 #endif
185 };
186 
187 /* @} */
188 
189 #endif /* AVCODEC_VAAPI_H */
attribute_deprecated unsigned int slice_params_alloc
Size of pre-allocated slice_params.
Definition: vaapi.h:157
attribute_deprecated unsigned int slice_param_size
Size of a VASliceParameterBuffer element.
Definition: vaapi.h:148
uint32_t context_id
Context ID (video decode pipeline)
Definition: vaapi.h:75
This structure is used to share data between the FFmpeg library and the client video application...
Definition: vaapi.h:52
Macro definitions for various function/variable attributes.
uint8_t
Libavcodec version macros.
attribute_deprecated uint32_t iq_matrix_buf_id
VAIQMatrixBuffer ID.
Definition: vaapi.h:94
attribute_deprecated uint32_t bitplane_buf_id
VABitPlaneBuffer ID (for VC-1 decoding)
Definition: vaapi.h:103
attribute_deprecated uint32_t pic_param_buf_id
VAPictureParameterBuffer ID.
Definition: vaapi.h:85
attribute_deprecated uint32_t slice_data_size
Current size of slice data.
Definition: vaapi.h:183
attribute_deprecated unsigned int n_slice_buf_ids
Number of effective slice buffer IDs to send to the HW.
Definition: vaapi.h:121
void * display
Window system dependent data.
Definition: vaapi.h:59
attribute_deprecated uint32_t * slice_buf_ids
Slice parameter/data buffer IDs.
Definition: vaapi.h:112
#define attribute_deprecated
Definition: attributes.h:94
attribute_deprecated void * slice_params
Pointer to VASliceParameterBuffers.
Definition: vaapi.h:139
attribute_deprecated unsigned int slice_buf_ids_alloc
Size of pre-allocated slice_buf_ids.
Definition: vaapi.h:130
attribute_deprecated unsigned int slice_count
Number of slices currently filled in.
Definition: vaapi.h:166
attribute_deprecated const uint8_t * slice_data
Pointer to slice data buffer base.
Definition: vaapi.h:174
uint32_t config_id
Configuration ID.
Definition: vaapi.h:67