aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/internal.h
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/mux: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-0/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/packet_internal: make avpriv_packet_list_* functions use an internal ↵James Almer2021-03-171-7/+7
| | | | | | | | | struct The next pointer is kept at the end for backwards compatability until the major bump, when it should ideally be moved at the front. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: return a pointer to the packet in ff_interleaved_peek()James Almer2021-02-131-6/+2
| | | | | | | And make it const, so the caller doesn't attempt to change it. ff_get_muxer_ts_offset() should be used to get the muxer timestamp offset. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: add ff_get_muxer_ts_offset()James Almer2021-02-131-0/+1
| | | | | | Will be useful in the next patch Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/cutils, dvenc: Move ff_brktimegm to its only userAndreas Rheinhardt2021-02-031-2/+0
| | | | | | This also allows to completely remove cutils.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: Change avpriv_new_chapter() from O(n) to (1) in the common caseMichael Niedermayer2021-01-281-0/+5
| | | | | | | | Fixes: timeout (slow -> 300ms) Fixes: 28876/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5664824587583488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: move AVStream.last_in_packet_buffer to AVStreamInternalAnton Khirnov2020-10-281-0/+5
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.probe_data to AVStreamInternalAnton Khirnov2020-10-281-0/+2
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.pts_buffer to AVStreamInternalAnton Khirnov2020-10-281-0/+4
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.*index_entries* to AVStreamInternalAnton Khirnov2020-10-281-0/+5
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Since there are some (semi-)public fields located after these, even though this section is supposed to be private, keep some dummy padding there until the next major bump to preserve ABI compatibility.
* lavf: move AVStream.interleaver_chunk_* to AVStreamInternalAnton Khirnov2020-10-281-0/+3
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.{request_probe,skip_to_keyframe} to AVStreamInternalAnton Khirnov2020-10-281-0/+13
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.{*skip_samples.*_discard_sample} to AVStreamInternalAnton Khirnov2020-10-281-0/+29
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.{nb_decoded_frames,mux_ts_offset} to AVStreamInternalAnton Khirnov2020-10-281-0/+11
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.{pts_wrap_*,update_initial_durations_done} to ↵Anton Khirnov2020-10-281-0/+22
| | | | | | | AVStreamInternal Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.pts_reorder_error[_count] to AVStreamInternalAnton Khirnov2020-10-281-0/+6
| | | | | Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.{last_dts_for_order_check,dts_[mis]ordered} to ↵Anton Khirnov2020-10-281-0/+7
| | | | | | | AVStreamInternal Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.{inject_global_side_data,display_aspect_ratio} to ↵Anton Khirnov2020-10-281-0/+12
| | | | | | | AVStreamInternal Those are private fields, no reason to have them exposed in a public header.
* lavf: move AVStream.info to AVStreamInternalAnton Khirnov2020-10-281-0/+33
| | | | | | | This struct is for internal use of avformat_find_stream_info(), so it should not be exposed in public headers. Keep a stub pointer in its place to avoid changing AVStream layout, since e.g. ffmpeg.c accesses some fields located after it (even though they are marked as private).
* avcodec/packet: move AVPacketList definition and function helpers over from ↵James Almer2020-09-151-42/+0
| | | | | | | | | libavformat And replace the flags parameter with a function callback that can be used to copy the contents of the packet (e.g, av_packet_ref and av_packet_copy_props). Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: Set AV_PKT_FLAG_KEY for is_intra_only packetLimin Wang2020-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch will make audio and subtitle packets be marked as AV_PKT_FLAG_KEY. For audio, it'll caused the audio sample to be sync sample. To verify ref/fate/movenc results: 1. Get the movenc test data [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_ After applied the patch: [lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key 2. Get l-smash and build boxdumper https://github.com/l-smash/l-smash.git 3. dump the box of crc change mp4 and diff -u [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4 > audio_key/non-empty-moov-no-elst.log [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4 > audio_old/non-empty-moov-no-elst.log [lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log - default_sample_flags = 0x02000000 - independent - sync sample + default_sample_flags = 0x01010000 + dependent + non-sync sample 4. have checked the change of crc are caused by default_sample_flags non-empty-moov.mp4, non-empty-moov-elst.mp4, non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4, empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4, delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4 etc 5 For subtitle, it'll effect for tests/ref/fate/binsub-movtextenc and tests/ref/fate/sub2video, that's expecting result for the subtitle is marked as keyframe. Below is the checking result of binsub-movtextenc: [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4 [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4 [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4 > audio_key/binsub-movtextenc.log [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4 > audio_old/binsub-movtextenc.log [lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log .... // the key difference is the flag for sync sample - flags = 0x000701 + flags = 0x000301 data-offset-present sample-duration-present sample-size-present - sample-flags-present sample_count = 6 - data_offset = 188 + data_offset = 164 sample[0] sample_duration = 1570000 sample_size = 21 - sample_flags = 0x02000000 - independent - sync sample - degradation_priority = 0 sample[1] sample_duration = 510000 sample_size = 2 - sample_flags = 0x01010000 - dependent - non-sync sample - degradation_priority = 0 sample[2] sample_duration = 1690000 sample_size = 9 - sample_flags = 0x02000000 - independent - sync sample - degradation_priority = 0 Suggested-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Suggested-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/utils: move is_intra_only() to header and rename to ff_is_intra_only()Limin Wang2020-05-061-0/+2
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/aviobuf, nutenc: Move ff_puv_v, ff_get_v_length to nutenc.cAndreas Rheinhardt2020-05-051-10/+0
| | | | | | | | | | | | | | and make it static again. These functions have been moved from nutenc to aviobuf and internal.h in f8280ff4c00eeaa245085fa9691035203abd168c in order to use them in a forthcoming patch in utils.c. Said patch never happened, so this commit moves them back and makes them static, effectively reverting said commit as well as f8280ff4c00eeaa245085fa9691035203abd168c (which added the ff-prefix to these functions). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: only allow a single bitstream filter when muxingMarton Balint2020-04-261-3/+2
| | | | | | | | | | | | Current muxers only use a single bitstream filter, so there is no need to maintain code which operates on a list of bitstream filters. When multiple bitstream filters are needed muxers can simply use a list bitstream filter. If there is a use case in the future when different bitstream filters should be added at subsequent packets then a new API possibly involving reconfiguring the list bitstream filter can be added knowing the exact requirements. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/mux, mxfenc: Don't initialize unnecessarilyAndreas Rheinhardt2020-04-181-2/+2
| | | | | | | | | | | When no packet could be output, the interleavement functions nevertheless initialized the packet destined for output (with the exception of the data and size fields, making the initialization pointless), although it will not be used at all. So remove the initializations. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mux: Remove redundant resettingAndreas Rheinhardt2020-04-181-7/+4
| | | | | | | | | | | | | | Now that ff_interleave_add_packet() always returns blank packets, the input packet to ff_interleave_packet_per_dts() will always be blank on return as well (if supplied) and the same goes for interleave_packet() in mux.c. Document these facts and remove the redundant resetting that happened in av_interleaved_write_frame(). The last reference to the (long removed) destruct field that AVPackets once had has been removed as well when updating the documentation of ff_interleave_packet_per_dts(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mux: Fix leak when adding packet to interleavement queue failsAndreas Rheinhardt2020-04-181-2/+2
| | | | | | | | | | | | | | When an error happened in ff_interleave_add_packet() when adding a packet to the packet queue, said packet would not be unreferenced in ff_interleave_add_packet(), but would be zeroed in av_interleaved_write_frame(), which results in a memleak. This has been fixed: ff_interleave_add_packet() now always unreferences the input packet on error; as a result, it always returns blank packets which has been documented. Relying on this a call to av_packet_unref() in ff_audio_rechunk_interleave() can be removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/avio: fix ff_rename to respect used protocolMarton Balint2020-01-191-4/+4
| | | | | | | | | | | Also simplify it and make it always log the error. This fixes for example the image2 muxer when used with an URL which also contains the protocol: ffmpeg -f lavfi -i testsrc -vframes 10 -atomic_writing 1 file:out%d.png Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/avio: move ff_rename implementation from internal.h to avio.cMarton Balint2020-01-191-13/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Revert "avformat/utils: make ff_ntp_time() accept a timestamp as input argument"James Almer2020-01-161-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: make ff_ntp_time() accept a timestamp as input argumentJames Almer2020-01-151-1/+1
| | | | | | Will be needed by the next patch. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Add max_probe_packets optionAndriy Gelman2019-11-031-2/+0
| | | | | | | Allows user to set maximum number of buffered packets when probing a codec. It was a hard-coded parameter before this commit. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: ensure that all packets in AVPacketList are reference countedAndreas Rheinhardt2019-09-251-1/+2
| | | | | | | This is done so that its data is really owned by the packet. This was already true for the current callers. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/internal: Improve documentation of ff_packet_list_getAndreas Rheinhardt2019-09-181-1/+4
| | | | | | | | | | | | | | | The documentation of ff_packet_list_get currently didn't match the actual usage: 1. It said that the destination packet is supposed to be initialized. But this makes no sense given that it will be overwritten completely and flacenc, mp3enc and ttaenc ignored this. 2. ff_packet_list_get returns an int, although it can't fail in case the packet list is not empty (for which there is an assert). Again, several callers didn't check for any return value. In both cases, the documentation has been adapted to match actual usage. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mux: Use const AVPacket * in compare functionsAndreas Rheinhardt2019-08-151-1/+1
| | | | | | | | | There is no reason for these functions to modify the given packets at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/avio: remove ffio_open2_wrapper functionJun Zhao2019-07-211-3/+0
| | | | | | Remove the function ffio_open2_wrapper, it's not being used anymore. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/utils: move mkdir_p to utilsSteven Liu2018-09-251-0/+8
| | | | | | | Because it will be used by avformat/segment.c or other module which need to automatically create sub-directories operation. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/utils: function to get the formatted ntp timeVishwanath Dixit2018-05-291-0/+8
| | | | | | | This utility function creates 64-bit NTP time format as per the RFC 5905. A simple explaination of 64-bit NTP time format is here http://www.beaglesoft.com/Manual/page53.htm
* lavf/aviobuf: add ff_get_chomp_lineJun Zhao2018-04-121-0/+10
| | | | | | | Same as ff_get_line but strip the white-space characters in the string tail. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* avformat/utils: make AVPacketList helper functions sharedJames Almer2018-04-041-0/+39
| | | | | | Based on a patch by Luca Barbato. Signed-off-by: James Almer <jamrial@gmail.com>
* lavf: move avpriv function definition to internal.hJosh de Kock2018-04-021-0/+1
| | | | Signed-off-by: Josh de Kock <josh@itanimul.li>
* Revert "lavd: add new API for iterating input and output devices"Josh de Kock2018-03-311-7/+0
| | | | | | | | | | This reverts commit 0fd475704e871ef3a535947596a012894bae3cbd. Revert "lavd: fix iterating of input and output devices" This reverts commit ce1d77a5e7cebce11074bf6f9e38ad6da37338ff. Signed-off-by: Josh de Kock <josh@itanimul.li>
* avformat/internal: Document the freeing behavior of ff_alloc_extradata()Michael Niedermayer2018-03-071-0/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aviobuf: add ff_read_line_to_bprint and ↵Marton Balint2018-02-241-0/+26
| | | | | | | | ff_read_line_to_bprint_overwrite functions To be able to read lines longer than a static buffer size. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavd: add new API for iterating input and output devicesJosh de Kock2018-02-061-0/+7
| | | | | This also adds an avpriv function to register devices in libavformat
* avformat: add url field to AVFormatContextMarton Balint2018-01-281-0/+7
| | | | | | | | | This will replace the 1024 character limited filename field. Compatiblity for output contexts are provided by copying filename field to URL if URL is unset and by providing an internal function for muxers to set both url and filename at once. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/hlsenc, utils: Moved is_http_proto from hlsenc to utils for re-useKarthick Jeyapal2017-12-291-0/+8
| | | | | Reviewed-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Steven Liu <lq@onvideo.cn>
* lavc, lavf: move avformat static mutex from avcodec to avformatwm42017-12-261-0/+4
| | | | | | | | It's completely absurd that libavcodec would care about libavformat locking, but it was there because the lock manager was in libavcodec. This is more stright forward. Changes ABI, but we don't require ABI compatibility currently.
* avformat/internal: fix compile error with some versions of g++Aman Gupta2017-12-231-2/+5
| | | | | | Fixes #6926 Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/internal: log underlying error with ff_rename failureAman Gupta2017-12-221-1/+1
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: wm4 <nfxjfg@googlemail.com>