summaryrefslogtreecommitdiff
path: root/libavfilter/f_metadata.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/f_metadata: use av_dict_iterateMarvin Scholz2022-12-011-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+2
| | | | | | | | 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: add AVFILTER_FLAG_METADATA_ONLYAnton Khirnov2021-12-041-2/+4
| | | | | | This flag allows distinguishing between filters that actually modify the data and those that only modify metadata or gather some stream information.
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-201-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/f_metadata: do not return the frame early if there is no metadataMarton Balint2021-07-061-3/+0
| | | | | | | | | The early return caused isses for the "add" mode (got fixed in c95dfe5cce98cde3e7fb14fbd04b3897f3927cec) and the "select" mode needs a similar fix. It is probably better to fully remove the check, since all modes work correctly with NULL metadata. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/metadata: add intuitive labels for metadata valuesGyan Doshi2021-05-161-2/+6
|
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-271-2/+2
| | | | | | | 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/f_metadata: correct check for existing metadataGyan Doshi2020-01-171-1/+1
| | | | When adding metadata, existing dictionary need not be present.
* avfilter/f_metadata: allow direct flushing when printing to fileGyan Doshi2020-01-101-0/+6
| | | | Useful for monitoring sparse data in realtime
* avfilter/f_metadata: remove unneeded codeLimin Wang2019-11-081-4/+0
| | | | | Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/f_metadata: do not memleak exprPaul B Mahol2019-09-301-0/+2
|
* avfilter/f_metadata: add ends_with() function for comparing ends of stringsPaul B Mahol2019-09-301-0/+13
|
* avfilter/f_metadata: avoid trailing whitespace in filter outputTobias Rapp2017-09-271-2/+2
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-231-1/+1
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* avfilter/formats: allow unknown channel layouts by defaultMarton Balint2016-12-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the default in the libav fork is to only allow known layouts, making unknown layouts allowed by default here can be a security risk for filters directly merged from libav. However, usually it is simple to detect such cases, use of av_get_channel_layout_nb_channels is a good indicator, so I suggest we change this regardless. See http://ffmpeg.org/pipermail/ffmpeg-devel/2016-November/203204.html. This patch indirectly adds unknown channel layout support for filters where query_formats is not specified: abench afifo ainterleave anullsink apad aperms arealtime aselect asendcmd asetnsamples asetpts asettb ashowinfo azmq It introduces a query_formats callback for the asyncts filter, which only supports known channel layouts since it is using libavresample. And it removes .query_formats callback from filters where it was only there to support unknown layouts, as this is now the default: aloop ametadata anull asidedata asplit atrim Acked-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavfi: split frame_count between input and output.Nicolas George2016-11-131-2/+2
| | | | | | | | | | | | AVFilterLink.frame_count is supposed to count the number of frames that were passed on the link, but with min_samples, that number is not always the same for the source and destination filters. With the addition of a FIFO on the link, the difference will become more significant. Split the variable in two: frame_count_in counts the number of frames that entered the link, frame_count_out counts the number of frames that were sent to the destination filter.
* lavfi/metadata: fix metadata deletion if comparison returns falseMarton Balint2016-10-111-3/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavfi/metadata: allow deleting all metadataMarton Balint2016-10-011-2/+4
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavfi/metadata: fix setting metadata valuesMarton Balint2016-10-011-8/+8
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* Changed metadata print option to accept general urlsSami Hult2016-07-101-20/+28
| | | | | | | | | | | | | | | | | | This is an - once again - updated patch, that uses avio_write instead of avio_puts to stream clean text output without null characters. Works now for me as intended. Changes metadata filter to accept general urls as file argument without breaking former behaviour. As a byproduct, it also allows for writing to file "-" if specified as "file:-". Example: ffmpeg -i test.wav -filter_complex "silencedetect=n=-40dB:d=0.1,ametadata=mode=print:file='pipe\:4'" -f null Signed-off-by: Sami Hult <sami.hult@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/f_metadata: update print output header line formatTobias Rapp2016-05-101-4/+4
| | | | | | | | | | Update print mode output header line format to be more consistent with other log output of FFmpeg. The printf-modifiers have been inspired by the showinfo filter. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/f_metadata: add pts_time to print outputTobias Rapp2016-05-091-2/+5
| | | | | | | | | This allows e.g. to correlate signalstats metadata to time position without having to find out the filter chain timebase first. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/f_metadata: remove unused headersPaul B Mahol2016-02-141-2/+0
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/f_metadata: rename "string" into "same_str"Tobias Rapp2016-02-111-17/+15
| | | | | | | Rename function option value "string" into "same_str". Remove obsolete "length" option. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avfilter/f_metadata: whitespace clean-upTobias Rapp2016-02-111-8/+8
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avfilter/f_metadata: add starts_with string functionTobias Rapp2016-02-111-0/+10
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avfilter/f_metadata: add support for file outputTobias Rapp2016-02-111-5/+61
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avfilter/f_metadata: avoid float rounding problemsTobias Rapp2016-02-111-3/+5
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* avfilter/f_metadata: fix few logic errorsPaul B Mahol2016-02-101-6/+6
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: add metadata filtersPaul B Mahol2016-02-101-0/+341
Signed-off-by: Paul B Mahol <onemda@gmail.com>