FFmpeg
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 
30 // ARGB black, for VAProcPipelineParameterBuffer.output_background_color.
31 #define VAAPI_VPP_BACKGROUND_BLACK 0xff000000
32 
33 typedef struct VAAPIVPPContext {
34  const AVClass *class;
35 
38 
39  int valid_ids;
40  VAConfigID va_config;
41  VAContextID va_context;
42 
45  VARectangle input_region;
46 
48  int output_width; // computed width
49  int output_height; // computed height
50 
51  VABufferID filter_buffers[VAProcFilterCount];
53 
55 
58 
60 
62 
64 
66 
68 
70 
72  VAProcPipelineParameterBuffer *params,
73  const AVFrame *input_frame,
75 
77  int type,
78  const void *data,
79  size_t size,
80  int count);
81 
83  VAProcPipelineParameterBuffer *params,
85 
86 #endif /* AVFILTER_VAAPI_VPP_H */
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
VAAPIVPPContext::input_frames_ref
AVBufferRef * input_frames_ref
Definition: vaapi_vpp.h:43
ff_vaapi_vpp_init_params
int ff_vaapi_vpp_init_params(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, const AVFrame *input_frame, AVFrame *output_frame)
Definition: vaapi_vpp.c:515
ff_vaapi_vpp_ctx_init
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
Definition: vaapi_vpp.c:666
ff_vaapi_vpp_make_param_buffers
int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx, int type, const void *data, size_t size, int count)
Definition: vaapi_vpp.c:563
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
count
void INT64 INT64 count
Definition: avisynth_c.h:767
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:295
VAAPIVPPContext::input_frames
AVHWFramesContext * input_frames
Definition: vaapi_vpp.h:44
data
const char data[16]
Definition: mxf.c:91
VAAPIVPPContext::build_filter_params
int(* build_filter_params)(AVFilterContext *avctx)
Definition: vaapi_vpp.h:54
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
ff_vaapi_vpp_ctx_uninit
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:680
VAAPIVPPContext::output_width
int output_width
Definition: vaapi_vpp.h:48
VAAPIVPPContext::output_format
enum AVPixelFormat output_format
Definition: vaapi_vpp.h:47
VAAPIVPPContext::hwctx
AVVAAPIDeviceContext * hwctx
Definition: vaapi_vpp.h:36
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
ff_vaapi_vpp_config_input
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
ff_vaapi_vpp_pipeline_uninit
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:44
size
int size
Definition: twinvq_data.h:11134
output_frame
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Definition: h264dec.c:837
VAAPIVPPContext::valid_ids
int valid_ids
Definition: vaapi_vpp.h:39
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
VAAPIVPPContext::output_height
int output_height
Definition: vaapi_vpp.h:49
ff_vaapi_vpp_config_output
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
Definition: vaapi_vpp.c:95
VAAPIVPPContext::filter_buffers
VABufferID filter_buffers[VAProcFilterCount]
Definition: vaapi_vpp.h:51
AVHWFramesContext
This struct describes a set or pool of "hardware" frames (i.e.
Definition: hwcontext.h:123
hwcontext_vaapi.h
VAAPIVPPContext
Definition: vaapi_vpp.h:33
params
const char const char * params
Definition: avisynth_c.h:867
VAAPIVPPContext::va_context
VAContextID va_context
Definition: vaapi_vpp.h:41
avfilter.h
VAAPIVPPContext::va_config
VAConfigID va_config
Definition: vaapi_vpp.h:40
VAAPIVPPContext::pipeline_uninit
void(* pipeline_uninit)(AVFilterContext *avctx)
Definition: vaapi_vpp.h:56
AVFilterContext
An instance of a filter.
Definition: avfilter.h:338
VAAPIVPPContext::nb_filter_buffers
int nb_filter_buffers
Definition: vaapi_vpp.h:52
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:81
VAAPIVPPContext::input_region
VARectangle input_region
Definition: vaapi_vpp.h:45
ff_vaapi_vpp_render_picture
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, AVFrame *output_frame)
Definition: vaapi_vpp.c:592
hwcontext.h
AVVAAPIDeviceContext
VAAPI connection details.
Definition: hwcontext_vaapi.h:68
VAAPIVPPContext::device_ref
AVBufferRef * device_ref
Definition: vaapi_vpp.h:37
int
int
Definition: ffmpeg_filter.c:191