2 * This file is part of FFmpeg.
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.
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.
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
19 #ifndef AVFILTER_VAAPI_VPP_H
20 #define AVFILTER_VAAPI_VPP_H
23 #include <va/va_vpp.h>
25 #include "libavutil/hwcontext.h"
26 #include "libavutil/hwcontext_vaapi.h"
30 typedef struct VAAPIVPPContext {
33 AVVAAPIDeviceContext *hwctx;
34 AVBufferRef *device_ref;
38 VAContextID va_context;
40 AVBufferRef *input_frames_ref;
41 AVHWFramesContext *input_frames;
43 enum AVPixelFormat output_format;
44 int output_width; // computed width
45 int output_height; // computed height
47 VABufferID filter_buffers[VAProcFilterCount];
48 int nb_filter_buffers;
50 int (*build_filter_params)(AVFilterContext *avctx);
52 void (*pipeline_uninit)(AVFilterContext *avctx);
55 void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx);
57 void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx);
59 int ff_vaapi_vpp_query_formats(AVFilterContext *avctx);
61 void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx);
63 int ff_vaapi_vpp_config_input(AVFilterLink *inlink);
65 int ff_vaapi_vpp_config_output(AVFilterLink *outlink);
67 int ff_vaapi_vpp_colour_standard(enum AVColorSpace av_cs);
69 int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
75 int ff_vaapi_vpp_render_picture(AVFilterContext *avctx,
76 VAProcPipelineParameterBuffer *params,
77 VASurfaceID output_surface);
79 #endif /* AVFILTER_VAAPI_VPP_H */