summaryrefslogtreecommitdiff
path: root/libavfilter/vf_drawbox.c
Commit message (Collapse)AuthorAge
* avfilter/vf_drawbox: remove redefinition of DrawBoxContext typedefJames Almer2022-04-12
| | | | | | | | It's forbidden in C99. Should fix compilation with old non C11 compilers. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_drawbox: add packed rgb supportPaul B Mahol2022-04-08
|
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_drawbox: Use formats list instead of query functionAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, an AVFilter's lists of input and output AVFilterPads were terminated by a sentinel and the only way to get the length of these lists was by using avfilter_pad_count(). This has two drawbacks: first, sizeof(AVFilterPad) is not negligible (i.e. 64B on 64bit systems); second, getting the size involves a function call instead of just reading the data. This commit therefore changes this. The sentinels are removed and new private fields nb_inputs and nb_outputs are added to AVFilter that contain the number of elements of the respective AVFilterPad array. Given that AVFilter.(in|out)puts are the only arrays of zero-terminated AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads are not zero-terminated and they already have a size field) the argument to avfilter_pad_count() is always one of these lists, so it just has to find the filter the list belongs to and read said number. This is slower than before, but a replacement function that just reads the internal numbers that users are expected to switch to will be added soon; and furthermore, avfilter_pad_count() is probably never called in hot loops anyway. This saves about 49KiB from the binary; notice that these sentinels are not in .bss despite being zeroed: they are in .data.rel.ro due to the non-sentinels. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/internal: Replace AVFilterPad.needs_writable by flagsAndreas Rheinhardt2021-08-17
| | | | | | | It will be useful in the future when more flags are added. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-13
| | | | | | | | | | | Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavfi/vf_drawbox.c: fix CID 1485004Ting Fu2021-06-09
| | | | | | | CID 1485004: Uninitialized variables (UNINIT) Using uninitialized value "x" when calling "*pixel_belongs_to_region". Signed-off-by: Ting Fu <ting.fu@intel.com>
* libavfilter: vf_drawbox filter support draw box with detection bounding ↵Ting Fu2021-05-26
| | | | | | | | | | | | boxes in side_data This feature can be used with dnn detection by setting vf_drawbox's option box_source=side_data_detection_bboxes, for example: ./ffmpeg -i face.jpeg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:\ input=data:output=detection_out:labels=face-detection-adas-0001.label,\ drawbox=box_source=side_data_detection_bboxes -y face_detect.jpeg Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/drawbox: refine codeTing Fu2021-05-26
| | | | | | Extract common code of filter_frame() and drawgrid_filter_frame() to draw_region(). Signed-off-by: Ting Fu <ting.fu@intel.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/drawbox: fix formatting after d64cbd4fdaGyan Doshi2021-02-05
|
* remove CHAR_MIN/CHAR_MAX usagePaul B Mahol2020-03-17
| | | | It is not needed at all.
* Remove redundant ;Michael Niedermayer2019-12-10
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_drawbox: use ff_filter_process_command()Paul B Mahol2019-10-14
|
* avfilter/vf_drawbox: implement process_commandPaul B Mahol2019-10-01
|
* avfilter/vf_drawbox: reduce code duplicationPaul B Mahol2019-10-01
|
* avfilter/drawbox+drawgrid - add option to prevent overwriting of source pixelsGyan Doshi2017-12-14
| | | | | | | | | | If the user-supplied color in drawbox and drawgrid filters is non-opaque, the box & grid painting overwrites the input's pixels (including alpha). Users typically expect the alpha of the specified color to only act as a key for compositing on top of the main input. Added option allows users to select between replacement and composition. Tested and documented.
* avfilter/drawbox: rename variable for maximum thicknessGyan Doshi2017-11-28
| | | | | | | | | The present value name for maximum thickness is 'max' which results in a parse error of any thickness expression containing 'max(val1,val2)'. Value renamed to 'fill'. Tested locally and documented. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_drawbox: reindentPaul B Mahol2016-02-17
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_drawbox: add alpha pixel formats supportPaul B Mahol2016-02-17
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: handle error in query_formats() of a bunch of random video filtersClément Bœsch2015-03-16
|
* avfilter/vf_drawbox: Fix handling of max valuesMichael Niedermayer2015-03-02
| | | | | | Fixes Ticket4332 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '58400ac133bcfb6bf8196b4e5208bc178307739b'Michael Niedermayer2014-04-19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '58400ac133bcfb6bf8196b4e5208bc178307739b': lavfi: name anonymous structs Conflicts: libavfilter/buffersink.c libavfilter/f_select.c libavfilter/src_movie.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_overlay.c libavfilter/vf_showinfo.c libavfilter/vf_unsharp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: name anonymous structsVittorio Giovara2014-04-19
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavfi: do not export the filters from shared objects Conflicts: libavfilter/af_amix.c libavfilter/af_anull.c libavfilter/asrc_anullsrc.c libavfilter/f_select.c libavfilter/f_settb.c libavfilter/split.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_blackframe.c libavfilter/vf_colorbalance.c libavfilter/vf_copy.c libavfilter/vf_crop.c libavfilter/vf_cropdetect.c libavfilter/vf_drawbox.c libavfilter/vf_format.c libavfilter/vf_framestep.c libavfilter/vf_frei0r.c libavfilter/vf_hflip.c libavfilter/vf_libopencv.c libavfilter/vf_lut.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_unsharp.c libavfilter/vf_vflip.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: do not export the filters from shared objectsAnton Khirnov2013-10-28
| |
* | avfilter: various cosmeticsPaul B Mahol2013-09-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter: remove redundant .get_(audio/video)_buffer initializationsPaul B Mahol2013-09-07
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | vf_drawbox: give all v_log() a contextMichael Niedermayer2013-06-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vf_drawbox: avoid declaration in for() argumentsMichael Niedermayer2013-06-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | enabled expressions on x, y, w, h and t parameters for drawgrid and drawbox, ↵Mark Visser2013-06-25
| | | | | | | | added examples
* | drawbox: Respect thickness parameterJean Delvare2013-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The drawbox video filter is drawing lines one pixel thinner than requested. The default thickness is 4 pixel but in fact the lines drawn by default are only 3 pixel wide. Change the comparisons in the code to fix this off-by-one bug. Also change the default thickness from 4 to 3 to minimize the unexpected changes from the user's perspective. As I was already touching these lines, I also removed the "maximum" in the thickness parameter description, as I don't think it was adding any value and I even found it confusing. Reviewed-by: Andrey Utkin <andrey.krieger.utkin@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavfi/drawgrid: fix drawgrid options after 4c205f42c86Stefano Sabatini2013-05-19
| |
* | Merge commit '4c205f42c86ccefa093c59434669af34ad14a52b'Michael Niedermayer2013-05-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '4c205f42c86ccefa093c59434669af34ad14a52b': vf_drawbox: make config_props work properly when called multiple times. vf_drawtext: do not reset the frame number in config_input. vf_fps: move initializing pts from config_props to init. Conflicts: libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_drawbox: make config_props work properly when called multiple times.Anton Khirnov2013-05-17
| | | | | | | | Do not overwrite the variables set through AVOptions.
* | lavfi/drawbox: restore verbal form for drawbox options descriptionsStefano Sabatini2013-05-17
| |
* | lavfi: factorize drawgrid and drawbox codeStefano Sabatini2013-05-17
| |
* | Merge commit 'c0279956b3ca3e5fd0a6a25253893d6f07000e68'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c0279956b3ca3e5fd0a6a25253893d6f07000e68': vf_fade: use the name 's' for the pointer to the private context vf_drawtext: use the name 's' for the pointer to the private context vf_drawbox: use the name 's' for the pointer to the private context Conflicts: libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_drawbox: use the name 's' for the pointer to the private contextAnton Khirnov2013-05-16
| | | | | | | | This is shorter and consistent across filters.
| * lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-09
| |
* | lavfi: replace passthrough_filter_frame with a flag.Clément Bœsch2013-05-12
| | | | | | | | | | | | | | | | | | | | With the introduction of AVFilterContext->is_disabled, we can simplify the custom passthrough mode in filters. This commit is technically a small compat break, but the timeline was introduced very recently. Doxy by Stefano Sabatini.
* | lavfi: add timeline support.Clément Bœsch2013-04-23
| | | | | | | | | | Flag added in a few simple filters. A bunch of other filters can likely use the feature as well.
* | lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: libavfilter/avfilter.c libavfilter/vf_drawtext.c libavfilter/vf_lut.c libavfilter/vf_select.c libavfilter/vf_setpts.c libavfilter/vsrc_color.c libavfilter/vsrc_movie.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '335c31293baec6e6cf5907bd29840af3de8ff735'Michael Niedermayer2013-04-10
|\| | | | | | | | | | | | | | | | | | | | | * commit '335c31293baec6e6cf5907bd29840af3de8ff735': vf_drawbox: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/vf_drawbox.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_drawbox: switch to an AVOptions-based system.Anton Khirnov2013-04-09
| |
* | lavi/vf_drawbox: use standard options parsing.Nicolas George2013-03-20
| |
* | Merge commit '7e350379f87e7f74420b4813170fe808e2313911'Michael Niedermayer2013-03-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7e350379f87e7f74420b4813170fe808e2313911': lavfi: switch to AVFrame. Conflicts: doc/filters.texi libavfilter/af_ashowinfo.c libavfilter/audio.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersink.c libavfilter/buffersrc.c libavfilter/buffersrc.h libavfilter/f_select.c libavfilter/f_setpts.c libavfilter/fifo.c libavfilter/split.c libavfilter/src_movie.c libavfilter/version.h libavfilter/vf_aspect.c libavfilter/vf_bbox.c libavfilter/vf_blackframe.c libavfilter/vf_delogo.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_fieldorder.c libavfilter/vf_fps.c libavfilter/vf_frei0r.c libavfilter/vf_gradfun.c libavfilter/vf_hqdn3d.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_showinfo.c libavfilter/vf_transpose.c libavfilter/vf_vflip.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavfilter/yadif.h Following are notes about the merge authorship and various technical details. Michael Niedermayer: * Main merge operation, notably avfilter.c and video.c * Switch to AVFrame: - afade - anullsrc - apad - aresample - blackframe - deshake - idet - il - mandelbrot - mptestsrc - noise - setfield - smartblur - tinterlace * various merge changes and fixes in: - ashowinfo - blackdetect - field - fps - select - testsrc - yadif Nicolas George: * Switch to AVFrame: - make rawdec work with refcounted frames. Adapted from commit 759001c534287a96dc96d1e274665feb7059145d by Anton Khirnov. Also, fix the use of || instead of | in a flags check. - make buffer sink and src, audio and video work all together Clément Bœsch: * Switch to AVFrame: - aevalsrc - alphaextract - blend - cellauto - colormatrix - concat - earwax - ebur128 - edgedetect - geq - histeq - histogram - hue - kerndeint - life - movie - mp (with the help of Michael) - overlay - pad - pan - pp - pp - removelogo - sendcmd - showspectrum - showwaves - silencedetect - stereo3d - subtitles - super2xsai - swapuv - thumbnail - tile Hendrik Leppkes: * Switch to AVFrame: - aconvert - amerge - asetnsamples - atempo - biquads Matthieu Bouron: * Switch to AVFrame - alphamerge - decimate - volumedetect Stefano Sabatini: * Switch to AVFrame: - astreamsync - flite - framestep Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Clément Bœsch <ubitux@gmail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Stefano Sabatini <stefasab@gmail.com> Merged-by: Michael Niedermayer <michaelni@gmx.at>