FFmpeg
Loading...
Searching...
No Matches
vaapi_vpp.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 AVFILTER_VAAPI_VPP_H
20#define AVFILTER_VAAPI_VPP_H
21
22#include <va/va.h>
23#include <va/va_vpp.h>
24
25#include "libavutil/hwcontext.h"
27
28#include "avfilter.h"
29
30static inline VASurfaceID ff_vaapi_vpp_get_surface_id(const AVFrame *frame)
31{
32 return (uintptr_t)frame->data[3];
33}
34
35// ARGB black, for VAProcPipelineParameterBuffer.output_background_color.
36#define VAAPI_VPP_BACKGROUND_BLACK 0xff000000
37
38typedef struct VAAPIVPPContext {
39 const AVClass *class;
40
43
45 VAConfigID va_config;
46 VAContextID va_context;
47
50 VARectangle input_region;
51
53 int output_width; // computed width
54 int output_height; // computed height
55
56 VABufferID filter_buffers[VAProcFilterCount];
58
60
62
65
67
69
71 AVFilterFormatsConfig **cfg_in,
72 AVFilterFormatsConfig **cfg_out);
73
75
77
79
81 VAProcPipelineParameterBuffer *params,
82 const AVFrame *input_frame,
84
86 int type,
87 const void *data,
88 size_t size,
89 int count);
90
92 VAProcPipelineParameterBuffer *params,
94
96 VAProcPipelineParameterBuffer *params_list,
97 int count,
99
100#endif /* AVFILTER_VAAPI_VPP_H */
SwsAArch64OpImplParams params
Definition ops.c:51
Main libavfilter public API header.
static AVFrame * frame
cl_device_type type
API-specific header for AV_HWDEVICE_TYPE_VAAPI.
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Definition h264dec.c:860
const char data[16]
Definition mxf.c:149
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
A reference to a data buffer.
Definition buffer.h:82
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
Lists of formats / etc.
Definition avfilter.h:120
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
This struct describes a set or pool of "hardware" frames (i.e.
Definition hwcontext.h:118
VAAPI connection details.
VAConfigID va_config
Definition vaapi_vpp.h:45
VABufferID filter_buffers[VAProcFilterCount]
Definition vaapi_vpp.h:56
int nb_filter_buffers
Definition vaapi_vpp.h:57
void(* pipeline_uninit)(AVFilterContext *avctx)
Definition vaapi_vpp.h:63
enum AVPixelFormat output_format
Definition vaapi_vpp.h:52
int(* build_filter_params)(AVFilterContext *avctx)
Definition vaapi_vpp.h:61
AVBufferRef * input_frames_ref
Definition vaapi_vpp.h:48
VARectangle input_region
Definition vaapi_vpp.h:50
VAContextID va_context
Definition vaapi_vpp.h:46
AVBufferRef * device_ref
Definition vaapi_vpp.h:42
AVHWFramesContext * input_frames
Definition vaapi_vpp.h:49
AVVAAPIDeviceContext * hwctx
Definition vaapi_vpp.h:41
int size
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
Definition vaapi_vpp.c:97
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition vaapi_vpp.c:71
int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition vaapi_vpp.c:29
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx)
Definition vaapi_vpp.c:45
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
Definition vaapi_vpp.c:714
int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx, int type, const void *data, size_t size, int count)
Definition vaapi_vpp.c:582
static VASurfaceID ff_vaapi_vpp_get_surface_id(const AVFrame *frame)
Definition vaapi_vpp.h:30
int ff_vaapi_vpp_init_params(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, const AVFrame *input_frame, AVFrame *output_frame)
Definition vaapi_vpp.c:533
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, AVFrame *output_frame)
Definition vaapi_vpp.c:707
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition vaapi_vpp.c:728
int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params_list, int count, AVFrame *output_frame)
Definition vaapi_vpp.c:639