FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vaapi_decode.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVCODEC_VAAPI_DECODE_H
20 #define AVCODEC_VAAPI_DECODE_H
21 
22 #include <va/va.h>
23 
24 #include "libavutil/frame.h"
25 #include "libavutil/hwcontext.h"
27 
28 #include "avcodec.h"
29 
30 #include "version.h"
31 #if FF_API_STRUCT_VAAPI_CONTEXT
32 #include "vaapi.h"
33 #endif
34 
35 static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
36 {
37  return (uintptr_t)pic->data[3];
38 }
39 
40 enum {
42 };
43 
44 typedef struct VAAPIDecodePicture {
45  VASurfaceID output_surface;
46 
49 
50  int nb_slices;
51  VABufferID *slice_buffers;
54 
55 typedef struct VAAPIDecodeContext {
56  VAConfigID va_config;
57  VAContextID va_context;
58 
59 #if FF_API_STRUCT_VAAPI_CONTEXT
65 #endif
66 
69 
72 
75 
76  VASurfaceAttrib pixel_format_attribute;
78 
79 
81  VAAPIDecodePicture *pic,
82  int type,
83  const void *data,
84  size_t size);
85 
87  VAAPIDecodePicture *pic,
88  const void *params_data,
89  size_t params_size,
90  const void *slice_data,
91  size_t slice_size);
92 
94  VAAPIDecodePicture *pic);
96  VAAPIDecodePicture *pic);
97 
100 
102  AVBufferRef *hw_frames_ctx);
103 
104 #endif /* AVCODEC_VAAPI_DECODE_H */
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition: hwcontext.h:60
VAAPI-specific data associated with a frame pool.
This structure describes decoded (raw) audio or video data.
Definition: frame.h:226
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
Definition: vaapi_decode.h:35
VASurfaceAttrib pixel_format_attribute
Definition: vaapi_decode.h:76
FF_ENABLE_DEPRECATION_WARNINGS AVHWDeviceContext * device
Definition: vaapi_decode.h:67
This structure is used to share data between the FFmpeg library and the client video application...
Definition: vaapi.h:56
int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, const void *params_data, size_t params_size, const void *slice_data, size_t slice_size)
Definition: vaapi_decode.c:58
API-specific header for AV_HWDEVICE_TYPE_VAAPI.
AVHWFramesContext * frames
Definition: vaapi_decode.h:70
int ff_vaapi_decode_uninit(AVCodecContext *avctx)
Definition: vaapi_decode.c:699
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
Definition: vaapi_decode.c:150
AVVAAPIDeviceContext * hwctx
Definition: vaapi_decode.h:68
enum AVPixelFormat surface_format
Definition: vaapi_decode.h:73
ptrdiff_t size
Definition: opengl_enc.c:101
Libavcodec version macros.
AVVAAPIFramesContext * hwfc
Definition: vaapi_decode.h:71
FF_DISABLE_DEPRECATION_WARNINGS int have_old_context
Definition: vaapi_decode.h:61
reference-counted frame API
AVBufferRef * device_ref
Definition: vaapi_decode.h:63
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
Definition: vaapi_decode.c:224
VABufferID * slice_buffers
Definition: vaapi_decode.h:51
struct vaapi_context * old_context
Definition: vaapi_decode.h:62
VABufferID param_buffers[MAX_PARAM_BUFFERS]
Definition: vaapi_decode.h:48
VASurfaceID output_surface
Definition: vaapi_decode.h:45
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:1533
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
Definition: vaapi_decode.c:29
GLint GLenum type
Definition: opengl_enc.c:105
Public libavcodec VA API header.
This struct describes a set or pool of "hardware" frames (i.e.
Definition: hwcontext.h:123
int ff_vaapi_decode_init(AVCodecContext *avctx)
Definition: vaapi_decode.c:610
VAContextID va_context
Definition: vaapi_decode.h:57
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:240
int ff_vaapi_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Definition: vaapi_decode.c:586
A reference to a data buffer.
Definition: buffer.h:81
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:84
VAConfigID va_config
Definition: vaapi_decode.h:56
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:85
VAAPI connection details.
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64