aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tests
Commit message (Collapse)AuthorAgeFilesLines
* avformat: remove deprecated FF_API_ALLOW_FLUSHJames Almer2025-03-281-4/+0
| | | | | | Deprecated since 2023-10-02. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/test/movenc: set audio packets as key framesJames Almer2024-11-241-0/+1
| | | | | | | Don't depend on the generic code setting this. This is in preparation for a following change. Signed-off-by: James Almer <jamrial@gmail.com>
* tests/movenc: Validate that normal muxer usage doesn't print warningsMartin Storsjö2024-04-111-2/+8
| | | | | | | | | | | | | | | | | | | | We have test to make sure that certain configurations do print warnings. However, the normal operation of the muxer within this test always printed a warning, so those tests to check for extra warnings didn't essentially guard anything. The warning that always was printed, "track 1: codec frame size is not set" was not present in the libav fork where this testcase originated, it was removed in f234e8a32e6c69d7b63f8627f278be7c2c987f43. Set the frame size for the audio stream to silence the warning, and use this frame size in a couple later calculations, and check that one test configuration doesn't print warnings. Setting the frame size apparently changes the rounding of a timestamp in the ismv muxing testcase. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Allow writing timed ID3 metadataMartin Storsjö2024-04-101-7/+48
| | | | | | | | | | | | | This is based on a spec at https://aomediacodec.github.io/id3-emsg/, further based on ISO/IEC 23009-1:2019. Within libavformat, timed ID3 metadata (already supported by the mpegts demuxer and muxer) is handled as a separate data AVStream with codec type AV_CODEC_ID_TIMED_ID3. However, it doesn't have a corresponding track in the mov file - instead, these events are written as separate toplevel 'emsg' boxes. Signed-off-by: Martin Storsjö <martin@martin.st>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSHAndreas Rheinhardt2024-03-221-1/+1
| | | | | | | It better reflects that this is a muxer-only flag. Also document the flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/fifo_test: Move into tests/fifo_muxer.cAndreas Rheinhardt2024-03-121-1/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This muxer solely exists to test the fifo muxer via a dedicated test tool in libavformat/tests/fifo_muxer.c. It fulfills no other role and it is only designed with this role in mind. The latter can be seen in two facts: The muxer uses printf for logging and it simply presumes the packets' data to contain a FailingMuxerPacketData (a struct duplicated in fifo_test.c and tests/fifo_muxer.c.); in particular, it presumes packets to have data at all, but this need not be true with side-data only packets and a segfault can easily be triggered by e.g. encoding flac (our native encoder sends a side-data only packet with updated extradata at the end of encoding). This patch fixes this by moving the test muxer into the fifo test tool, making it inaccessible via the API (and actually removing it from libavformat.so and libavformat.a). While this muxer was accessible via e.g. av_guess_format(), it was not really usable for an API user as FailingMuxerPacketData was not public. Therefore this is not considered a breaking change. In order to continue to use the test muxer in the test tool, the ordinary fifo muxer had to be overridden: fifo_muxer.c includes lavf/fifo.c but with FIFO_TEST defined which makes it support the fifo_test muxer. This is possible because test tools are always linked statically to their respective library. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tests/movenc: Constify write functionsAndreas Rheinhardt2024-03-081-2/+2
| | | | | | Forgotten in 2a68d945cd74265bb71c3d38b7a2e7f7d7e87be5. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/imf: clean-up loggingPierre-Anthony Lemieux2023-05-311-2/+2
| | | | | * remove logging to NULL * remove extraneous logging
* fate/imf: remove redundant codePierre-Anthony Lemieux2023-05-181-40/+12
|
* fate/imf: fix memory leakPierre-Anthony Lemieux2023-05-181-1/+10
|
* avformat/tests/imf: add invalid resource testPierre-Anthony Lemieux2023-05-111-0/+65
|
* tests: do not override movflags defaultsMarton Balint2023-04-241-27/+27
| | | | | | It does not matter if the default is 0, but still it is cleaner that way. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tests/imf: add CPL timecode testPierre-Anthony Lemieux2022-11-031-0/+7
|
* avformat/tests/imf: Test ff_imf_parse_cpl_from_xml_dom cleanup on errorAndreas Rheinhardt2022-08-271-4/+8
| | | | | | | Improves the test; also should fix Coverity issue #1512408. Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/imf: refactor to use avutil/uuidPierre-Anthony Lemieux2022-06-121-9/+9
|
* avformat/demux: Add new demux.h headerAndreas Rheinhardt2022-05-101-1/+1
| | | | | | And move those stuff already in demuxer-only files to it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/test/seek: set ch_layout instead of channelsJames Almer2022-03-221-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/tests: add test for ff_rescale_interval()Pierre-Anthony Lemieux2022-03-192-0/+58
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* movenc-test: convert to new channel layout APIVittorio Giovara2022-03-151-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/tests: add /imf to .gitignorePierre-Anthony Lemieux2022-02-051-0/+1
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/avformat: Add AVFMT_AVOID_NEG_TS_DISABLEDAndreas Rheinhardt2022-01-211-2/+2
| | | | | | And also don't use explicit constants in the movenc test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tests/imf: Don't use uninitialized valueAndreas Rheinhardt2022-01-041-1/+1
| | | | | Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/imf: TestsPierre-Anthony Lemieux2021-12-311-0/+526
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: do not use AVIO_FLAG_* with avio_alloc_contextMarvin Scholz2021-12-041-1/+1
| | | | | | | | | | | | | The documentation states that here 0 should be used for read-only and 1 for a writable buffer. AVIO_FLAG_WRITE however is 2, while it works due to the way the flag is handled internally, it is still wrong according to the documentation. Additionally it makes it seem as if the AVIO_FLAG_* values could be used here, which is actually not true, as when AVIO_FLAG_READ would be used here it would create a writable buffer as AVIO_FLAG_READ is defined as 1. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/url: add ff_make_absolulte_url2 to be able to test windows path casesMarton Balint2021-04-071-3/+30
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tests/fifo_muxer: Fix memleak on error, fix API violationAndreas Rheinhardt2021-03-191-8/+5
| | | | | | | | | | The test program for the FIFO muxer allocates a buffer without padding and wraps it into a packet via av_packet_from_data(). This is an API violation. Furthermore, said buffer leaks in case av_packet_from_data() fails. Fix both of these issues by using av_new_packet() instead. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/tests/fifo_muxer: Fix leak of AVPacket on errorAndreas Rheinhardt2021-03-191-22/+15
| | | | | | | | | Also factor allocating and freeing the packet out. Fixes Coverity issues #1473722 and #1473723; it is a regression since 4b386b2059806ca7ee7f991d2c8b735410693e8c. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/tests/movenc: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-39/+42
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/tests/fifo_muxer: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-10/+18
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/url: fix relative url parsing when the query string or fragment has a colonruiquan.crq2020-10-281-0/+2
| | | | | | | | | This disallows the usage of ? and # in libavformat specific scheme options (e.g. subfile,,start,32815239,end,0,,:video.ts) but this change was considered acceptable. Signed-off-by: ruiquan.crq <caihaoning83@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/url: rewrite ff_make_absolute_url() using ff_url_decompose().Nicolas George2020-08-121-1/+59
| | | | | | | | | | Also add and update some tests. Change the semantic a little, because for filesytem paths symlinks complicate things. See the comments in the code for detail. Fix trac tickets #8813 and 8814.
* lavf/url: add ff_url_decompose().Nicolas George2020-08-121-0/+34
|
* avformat/url: check url root node when rel include double dot and trim ↵Steven Liu2020-05-061-0/+5
| | | | | | | | | double dot fix ticket: 8625 and add testcase into url for double dot corner case Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/utils: make av_url_split search for hashmark as well to separate ↵Marton Balint2020-02-151-0/+1
| | | | | | | | | | | hostname RFC 3986 states that the generic syntax uses the slash ("/"), question mark ("?"), and number sign ("#") characters to delimit components that are significant to the generic parser's hierarchical interpretation of an identifier. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tests/url: add av_url_split testsMarton Balint2020-02-151-0/+24
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tests/url: make format more readableMarton Balint2020-02-151-1/+2
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lav*,tests: remove several register_all callsJosh de Kock2018-04-022-5/+0
| | | | | | | avdevice_register_all() is still required to register devices into lavf (this is required due to lavd being somewhat of a hack). Signed-off-by: Josh de Kock <josh@itanimul.li>
* lavf: move fifo test muxer into separate fileJosh de Kock2018-02-061-113/+2
| | | | | This fixes the fate-fifo-muxer test with the clarified removal of registering external formats.
* avformat/mux: stop delaying writing the headerJames Almer2017-12-061-52/+0
| | | | | | | Every bitstream filter behaves as intended now, so there's no need to wait for the first packet of every stream. Signed-off-by: James Almer <jamrial@gmail.com>
* movenc-test: fix potential uninitialized readTimo Rothenpieler2017-11-131-0/+1
| | | | Fixes CID #1413023
* avformat: remove use of deprecated AVFMT_FLAG_KEEP_SIDE_DATA flagJames Almer2017-10-291-2/+0
| | | | | | | It has no effect whatsoever since the major bump. Replace the flag's documentation to reflect this as well. Signed-off-by: James Almer <jamrial@gmail.com>
* movenc-test: Add tests for negative cts offsetsMartin Storsjö2017-09-281-0/+19
| | | | | Signed-off-by: Martin Storsjö <martin@martin.st> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Use the new AVIOContext destructor.Anton Khirnov2017-09-011-1/+1
| | | | | (cherry picked from commit 6f554521afdf7ab4edbfaa9536660a1dca946b19) Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit '537b5b773b317af79d3a5b576ee9683e15ed84f6'James Almer2017-04-041-0/+2
|\ | | | | | | | | | | | | * commit '537b5b773b317af79d3a5b576ee9683e15ed84f6': rtmpdh: Do global initialization before running the test Merged-by: James Almer <jamrial@gmail.com>
| * rtmpdh: Do global initialization before running the testMartin Storsjö2016-11-241-0/+2
| | | | | | | | | | | | | | | | | | The rtmpdh code can use crypto libraries which may require a process global init. (gcrypt is one of the libraries where the rtmpdh test code can fail if global init hasn't been done, depending on gcrypt version.) Signed-off-by: Martin Storsjö <martin@martin.st>
* | ffmpeg, ffprobe: don't "merge" side data into packet data by defaultwm42017-03-141-0/+2
| | | | | | | | | | | | | | | | Preparation for potentially disabling merged side data by default in the libs. Do this in particular because it affects fate tests. The changed tests either reflect added packet side data, or the changed packet size due to merged side data removal reducing the packet size.
* | avformat/test/fifo_muxer: add check for FailingMuxerPacketData allocSteven Liu2017-01-061-0/+3
| | | | | | | | | | | | | | CID: 1396257 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | avformat/tests/fifo_muxer: includes libavformat/network.h to define ↵Gregory J. Wolfe2016-12-011-0/+1
| | | | | | | | | | | | ETIMEDOUT for fate build. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>