Commit Graph

17 Commits

Author SHA1 Message Date
Andreas Rheinhardt 19ffa2ff2d avfilter: Remove unnecessary formats.h inclusions
A filter needs formats.h iff it uses FILTER_QUERY_FUNC();
since lots of filters have been switched to use something
else than FILTER_QUERY_FUNC, they don't need it any more,
but removing this header has been forgotten.
This commit does this; files with formats.h inclusion went down
from 304 to 139 here (it were 449 before the preceding commit).

While just at it, also improve the other headers a bit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-07 09:21:13 +02:00
Andreas Rheinhardt 6d15643173 avfilter/internal: Don't include video.h
internal.h does not depend on video.h (and should not depend on it)
and therefore should not include video.h at all; instead all users
of video.h should include it directly.

Doing so also avoids unnecessary video.h inclusions in files that
don't need it, like most audio filters.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-07 09:21:13 +02:00
Haihao Xiang 2aad9765ef lavfi/overlay_vaapi: set input region for overlay video to NULL
Otherwise main and overlay videos share the same input region. Note NULL
pointer imples the whole overlay video will be processed.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-04-24 13:24:41 +08:00
Haihao Xiang faf0afb5d9 lavfi/overlay_vaapi: remove unnecessary code
VA-API filter is not required.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00
Haihao Xiang f1a8d3b0b6 lavfi/vaapi: remove duplicated code
Add a ff_ function to handle mulitple pipeline parameters. No functional
changes.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00
softworkz c8050d82a9 avfilter/overlay_vaapi: enable expressions for overlay parameters
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz ff075f5abb avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz 916447bf4c avfilter/overlay_vaapi: add framesync options
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz db6b376db9 avfilter/overlay_vaapi: remove redundant .get_buffer assignments
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz 7ebd6189a2 avfilter/overlay_vaapi: reformat options
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz 50aeaadad0 avfilter/overlay_vaapi: handle secondary null input
Currently segfaults in this case.

Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz 55cc8312cc avfilter/overlay_vaapi: remove double framesync init
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz e154d8931e avfilter/overlay_vaapi: build filter params just once
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
softworkz a847c82289 avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
Signed-off-by: softworkz <softworkz@hotmail.com>
2022-11-07 10:56:44 +08:00
Fei Wang 26890b6b67 lavfi/overlay_vaapi: set defalut alpha value as 1.0
The present default value of 0 will render the overlay video invisible.
A default of 1.0 is consistent with most common use cases.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-08-09 14:02:25 +08:00
Andreas Rheinhardt 2b2380c098 avfilter: Constify non-const filters
This makes the filters match their declaration in
libavfilter/allfilters.c; the earlier discrepancy was btw UB.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-01 21:29:01 +02:00
Xinpeng Sun 516496069d avfilter: add overlay vaapi filter
Overlay one video on the top of another.

It takes two inputs and has one output. The first input is the "main" video on
which the second input is overlaid. This filter requires same memory layout for
all the inputs.

An example command to use this filter to overlay overlay.mp4 at the top-left
corner of the main.mp4:

ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128 \
-hwaccel vaapi -hwaccel_device foo -hwaccel_output_format vaapi -c:v h264 -i main.mp4 \
-hwaccel vaapi -hwaccel_device foo -hwaccel_output_format vaapi -c:v h264 -i overlay.mp4 \
-filter_complex "[0:v][1:v]overlay_vaapi=0:0:100💯0.5[t1]" \
-map "[t1]" -an -c:v h264_vaapi -y out_vaapi.mp4

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Xinpeng Sun <xinpeng.sun@intel.com>
Signed-off-by: Zachary Zhou <zachary.zhou@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-17 16:32:17 +08:00