FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavfilter/vaapi_vpp.h
Date: 2024-05-03 15:42:48
Exec Total Coverage
Lines: 0 2 0.0%
Functions: 0 1 0.0%
Branches: 0 0 -%

Line Branch Exec Source
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"
26 #include "libavutil/hwcontext_vaapi.h"
27
28 #include "avfilter.h"
29
30 static 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
38 typedef struct VAAPIVPPContext {
39 const AVClass *class;
40
41 AVVAAPIDeviceContext *hwctx;
42 AVBufferRef *device_ref;
43
44 int valid_ids;
45 VAConfigID va_config;
46 VAContextID va_context;
47
48 AVBufferRef *input_frames_ref;
49 AVHWFramesContext *input_frames;
50 VARectangle input_region;
51
52 enum AVPixelFormat output_format;
53 int output_width; // computed width
54 int output_height; // computed height
55
56 VABufferID filter_buffers[VAProcFilterCount];
57 int nb_filter_buffers;
58
59 int passthrough;
60
61 int (*build_filter_params)(AVFilterContext *avctx);
62
63 void (*pipeline_uninit)(AVFilterContext *avctx);
64 } VAAPIVPPContext;
65
66 void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx);
67
68 void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx);
69
70 int ff_vaapi_vpp_query_formats(AVFilterContext *avctx);
71
72 void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx);
73
74 int ff_vaapi_vpp_config_input(AVFilterLink *inlink);
75
76 int ff_vaapi_vpp_config_output(AVFilterLink *outlink);
77
78 int ff_vaapi_vpp_init_params(AVFilterContext *avctx,
79 VAProcPipelineParameterBuffer *params,
80 const AVFrame *input_frame,
81 AVFrame *output_frame);
82
83 int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
84 int type,
85 const void *data,
86 size_t size,
87 int count);
88
89 int ff_vaapi_vpp_render_picture(AVFilterContext *avctx,
90 VAProcPipelineParameterBuffer *params,
91 AVFrame *output_frame);
92
93 int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx,
94 VAProcPipelineParameterBuffer *params_list,
95 int count,
96 AVFrame *output_frame);
97
98 #endif /* AVFILTER_VAAPI_VPP_H */
99