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 #if FF_API_STRUCT_VAAPI_CONTEXT
38 
39 /**
40  * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
41  * @ingroup lavc_codec_hwaccel
42  * @{
43  */
44 
45 /**
46  * This structure is used to share data between the FFmpeg library and
47  * the client video application.
48  * This shall be zero-allocated and available as
49  * AVCodecContext.hwaccel_context. All user members can be set once
50  * during initialization or through each AVCodecContext.get_buffer()
51  * function call. In any case, they must be valid prior to calling
52  * decoding functions.
53  *
54  * Deprecated: use AVCodecContext.hw_frames_ctx instead.
55  */
57 struct vaapi_context {
58  /**
59  * Window system dependent data
60  *
61  * - encoding: unused
62  * - decoding: Set by user
63  */
64  void *display;
65 
66  /**
67  * Configuration ID
68  *
69  * - encoding: unused
70  * - decoding: Set by user
71  */
72  uint32_t config_id;
73 
74  /**
75  * Context ID (video decode pipeline)
76  *
77  * - encoding: unused
78  * - decoding: Set by user
79  */
80  uint32_t context_id;
81 
82 #if FF_API_VAAPI_CONTEXT
83  /**
84  * VAPictureParameterBuffer ID
85  *
86  * - encoding: unused
87  * - decoding: Set by libavcodec
88  */
90  uint32_t pic_param_buf_id;
91 
92  /**
93  * VAIQMatrixBuffer ID
94  *
95  * - encoding: unused
96  * - decoding: Set by libavcodec
97  */
99  uint32_t iq_matrix_buf_id;
100 
101  /**
102  * VABitPlaneBuffer ID (for VC-1 decoding)
103  *
104  * - encoding: unused
105  * - decoding: Set by libavcodec
106  */
108  uint32_t bitplane_buf_id;
109 
110  /**
111  * Slice parameter/data buffer IDs
112  *
113  * - encoding: unused
114  * - decoding: Set by libavcodec
115  */
117  uint32_t *slice_buf_ids;
118 
119  /**
120  * Number of effective slice buffer IDs to send to the HW
121  *
122  * - encoding: unused
123  * - decoding: Set by libavcodec
124  */
126  unsigned int n_slice_buf_ids;
127 
128  /**
129  * Size of pre-allocated slice_buf_ids
130  *
131  * - encoding: unused
132  * - decoding: Set by libavcodec
133  */
135  unsigned int slice_buf_ids_alloc;
136 
137  /**
138  * Pointer to VASliceParameterBuffers
139  *
140  * - encoding: unused
141  * - decoding: Set by libavcodec
142  */
145 
146  /**
147  * Size of a VASliceParameterBuffer element
148  *
149  * - encoding: unused
150  * - decoding: Set by libavcodec
151  */
153  unsigned int slice_param_size;
154 
155  /**
156  * Size of pre-allocated slice_params
157  *
158  * - encoding: unused
159  * - decoding: Set by libavcodec
160  */
162  unsigned int slice_params_alloc;
163 
164  /**
165  * Number of slices currently filled in
166  *
167  * - encoding: unused
168  * - decoding: Set by libavcodec
169  */
171  unsigned int slice_count;
172 
173  /**
174  * Pointer to slice data buffer base
175  * - encoding: unused
176  * - decoding: Set by libavcodec
177  */
180 
181  /**
182  * Current size of slice data
183  *
184  * - encoding: unused
185  * - decoding: Set by libavcodec
186  */
188  uint32_t slice_data_size;
189 #endif
190 };
191 
192 /* @} */
193 
194 #endif /* FF_API_STRUCT_VAAPI_CONTEXT */
195 
196 #endif /* AVCODEC_VAAPI_H */
attribute_deprecated unsigned int slice_params_alloc
Size of pre-allocated slice_params.
Definition: vaapi.h:162
attribute_deprecated unsigned int slice_param_size
Size of a VASliceParameterBuffer element.
Definition: vaapi.h:153
uint32_t context_id
Context ID (video decode pipeline)
Definition: vaapi.h:80
This structure is used to share data between the FFmpeg library and the client video application...
Definition: vaapi.h:57
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:99
attribute_deprecated uint32_t bitplane_buf_id
VABitPlaneBuffer ID (for VC-1 decoding)
Definition: vaapi.h:108
attribute_deprecated uint32_t pic_param_buf_id
VAPictureParameterBuffer ID.
Definition: vaapi.h:90
attribute_deprecated uint32_t slice_data_size
Current size of slice data.
Definition: vaapi.h:188
attribute_deprecated unsigned int n_slice_buf_ids
Number of effective slice buffer IDs to send to the HW.
Definition: vaapi.h:126
void * display
Window system dependent data.
Definition: vaapi.h:64
attribute_deprecated uint32_t * slice_buf_ids
Slice parameter/data buffer IDs.
Definition: vaapi.h:117
#define attribute_deprecated
Definition: attributes.h:94
attribute_deprecated void * slice_params
Pointer to VASliceParameterBuffers.
Definition: vaapi.h:144
attribute_deprecated unsigned int slice_buf_ids_alloc
Size of pre-allocated slice_buf_ids.
Definition: vaapi.h:135
attribute_deprecated unsigned int slice_count
Number of slices currently filled in.
Definition: vaapi.h:171
attribute_deprecated const uint8_t * slice_data
Pointer to slice data buffer base.
Definition: vaapi.h:179
uint32_t config_id
Configuration ID.
Definition: vaapi.h:72