summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/movenc: add support for writing lhvC boxesmv-hevcJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: add a function to write a lhvC boxJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: store parameter set and layer IDs in HVCCNALUnitJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: use a single array for per-PS NALUsJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: don't write the same array values per nal additionJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: don't write NALUs with nuh_layer_id > 0 in hvcC boxesJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: Mark streams with a layered HEVC box as multilayerDerek Buitenhuis2024-06-25
| | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat: Add a new stream disposition for multilayer videoDerek Buitenhuis2024-06-25
| | | | | | | This lets us detect when a container has flagged a stream as multilayer. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/mov: add support for lhvC box parsingJames Almer2024-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mxfdec: don't use sizeof(AVMasteringDisplayMetadata)James Almer2024-06-20
| | | | | | It's not part of the libavutil ABI. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: don't use sizeof(AVMasteringDisplayMetadata)James Almer2024-06-20
| | | | | | It's not part of the libavutil ABI. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: don't use sizeof(AVMasteringDisplayMetadata)James Almer2024-06-20
| | | | | | It's not part of the libavutil ABI. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: split off generic NAL function helpers into their own fileJames Almer2024-06-20
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: add missing padding to AAC extradataJames Almer2024-06-19
| | | | | | | | Fixes: out of array access Fixes: 68863/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4833546039525376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: fix writing reserved bitsJames Almer2024-06-19
| | | | | | They are all zeroes, not ones. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/evc: remove useless struct fieldJames Almer2024-06-19
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mxfdec: Check container_ul->desc before useMichael Niedermayer2024-06-19
| | | | | | | | Fixes: CID1592939 Dereference after null check Sponsored-by: Sovereign Tech Fund Reviewed-by: Tomas Härdin <git@haerdin.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iamf_parse: 0 layers are not allowedMichael Niedermayer2024-06-19
| | | | | | | | | Fixes: out of array access Fixes: 68302/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4665793796177920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iamf_parse: consider nb_substreams when accessing substreams arrayMichael Niedermayer2024-06-19
| | | | | | | | | Fixes: out of array access Fixes: 68584/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6256656668229632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dump: Print all possible Stereo3D infoDerek Buitenhuis2024-06-18
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/mov: Add support for reading and exporting horizontal field of viewDerek Buitenhuis2024-06-18
| | | | | | | | | | These boxes are created by the Apple Vision Pro and the iPhone 15+ when capture for the Vision Pro is enabled. Based off of the swift API: * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/mov: Add support for exporting Video Extension Usage infoDerek Buitenhuis2024-06-18
| | | | | | | | | | | | | | | | | This box is provided by files created by the Apple Vision Pro, as well as the iPhone 15+ when capture for Vision Pro is enabled. The boxes are a mix of things documented by Apple in some PDFs, their API docs, and reverse engineering. Ideally we will have a real spec one day. Links: * https://developer.apple.com/av-foundation/Stereo-Video-ISOBMFF-Extensions.pdf * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* lavf/tls_mbedtls: add workaround for TLSv1.3 vs. verify=0sfan52024-06-18
| | | | | | | | | | As of mbedTLS 3.6.0 TLSv1.3 is enabled by default and certificate verification is now mandatory. Our default configuration does not do verification, so downgrade to 1.2 in these situations to avoid breaking it. ref: https://github.com/Mbed-TLS/mbedtls/issues/7075 Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/mxfdec: use the newly added channel ids for more exact mappingMarton Balint2024-06-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: make iso_channel_position table more compactMarton Balint2024-06-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: use the newly added channel ids for more exact mappingMarton Balint2024-06-12
| | | | | | | | | | Also make the iso_channel_position table consistent with what the AAC decoder uses in avcodec/aac/aacdec_usac.c. Fate changes are caused by the change of how 7.1 layout is mapped, previously it included Side Surround channels, now it includes the Surround channels. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/riff: Declare VCR2 to be MPEG-2Andreas Rheinhardt2024-06-12
| | | | | | | | This brings it in line with mpeg12dec.c. (This entry has been added before the MPEG2VIDEO codec id existed.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Use int64_t in intermediate for corrected_dtsMichael Niedermayer2024-06-12
| | | | | | | Fixes: CID1500312 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Use 64bit in intermediate for current_dtsMichael Niedermayer2024-06-12
| | | | | | | | Fixes: CID1500304 Unintentional integer overflow Fixes: CID1500318 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: Assert that num_levels is non negativeMichael Niedermayer2024-06-12
| | | | | | | Maybe Closes: CID1452496 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/libzmq: Check av_strstart()Michael Niedermayer2024-06-12
| | | | | | | Fixes: CID1453457 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/img2dec: Little JFIF / Exif cleanupMichael Niedermayer2024-06-12
| | | | | | | | | | This changes the behavior and makes it behave how it probably was intended. Either way this is unlikely to result in any user visible change Fixes: CID1494637 Missing break in switch Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/img2dec: Move DQT after unrelated if()Michael Niedermayer2024-06-12
| | | | | | | Fixes: CID1494636 Missing break in switch Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/imfdec: Simplify get_next_track_with_minimum_timestamp()Michael Niedermayer2024-06-12
| | | | | | | | | | This also makes the code more robust Fixes: CID1512414 Uninitialized pointer read Sponsored-by: Sovereign Tech Fund Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iamf_parse: Remove dead caseMichael Niedermayer2024-06-12
| | | | | | | Fixes: CID1559546 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* riscv: probe for Zbb extension at load timeRémi Denis-Courmont2024-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to hysterical raisins, most RISC-V Linux distributions target a RV64GC baseline excluding the Bit-manipulation ISA extensions, most notably: - Zba: address generation extension and - Zbb: basic bit manipulation extension. Most CPUs that would make sense to run FFmpeg on support Zba and Zbb (including the current FATE runner), so it makes sense to optimise for them. In fact a large chunk of existing assembler optimisations relies on Zba and/or Zbb. Since we cannot patch shared library code, the next best thing is to carry a flag initialised at load-time and check it on need basis. This results in 3 instructions overhead on isolated use, e.g.: 1: AUIPC rd, %pcrel_hi(ff_rv_zbb_supported) LBU rd, %pcrel_lo(1b)(rd) BEQZ rd, non_Zbb_fallback_code // Zbb code here The C compiler will typically load the flag ahead of time to reducing latency, and can also keep it around if Zbb is used multiple times in a single optimisation scope. For this to work, the flag symbol must be hidden; otherwise the optimisation degrades with a GOT look-up to support interposition: 1: AUIPC rd, GOT_OFFSET_HI LD rd, GOT_OFFSET_LO(rd) LBU rd, (rd) BEQZ rd, non_Zbb_fallback_code // Zbb code here This patch adds code to provision the flag in libraries using bit manipulation functions from libavutil: byte-swap, bit-weight and counting leading or trailing zeroes.
* lavf/tls_mbedtls: handle session ticket error code as no-opsfan52024-06-11
| | | | | | | | | | When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: https://github.com/Mbed-TLS/mbedtls/issues/8749 Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/tls_mbedtls: fix handling of certification validation failuressfan52024-06-11
| | | | | | | | | | We manually check the verification status after the handshake has completed using mbedtls_ssl_get_verify_result(). However with VERIFY_REQUIRED mbedtls_ssl_handshake() already returns an error, so this code is never reached. Fix that by using VERIFY_OPTIONAL, which performs the verification but does not abort the handshake. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/tls_mbedtls: hook up debug message callbacksfan52024-06-11
| | | | | | | Unfortunately this won't work out-of-the-box because mbedTLS only provides a global (not per-context) debug toggle. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/tls_mbedtls: add missing call to psa_crypto_initsfan52024-06-11
| | | | | | This is mandatory depending on configuration or at least with mbedTLS 3.6.0. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/tls_mbedtls: handle more error codes for human-readable messagessfan52024-06-11
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/evc: Fix format specifiersAndreas Rheinhardt2024-06-09
| | | | | | | Fixes -Wformat warnings; see e.g. https://fate.ffmpeg.org/log.cgi?slot=aarch64-osx-clang-1200.0.32.29&time=20240604151047&log=compile Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vvc: Don't use uint8_t iterators, fix shadowingAndreas Rheinhardt2024-06-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vvc: Fix commentAndreas Rheinhardt2024-06-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vvc: Reindent after the previous commitAndreas Rheinhardt2024-06-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vvc: Fix crash on allocation failure, avoid allocationsAndreas Rheinhardt2024-06-09
| | | | | | | | | | This is the VVC version of 8b5d15530127fea54e934043a64653859de07353. (Hint: This ensures that the order of NALU arrays is OPI-VPS-SPS-PPS- Prefix-SEI-Suffix-SEI, regardless of the order in the original extradata. I hope this is right.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vvc: Don't use ff_copy_bits()Andreas Rheinhardt2024-06-09
| | | | | | | | | | | There is no benefit in using it: The fast path of copying is not taken because of misalignment; furthermore we are only dealing with a few byte here anyway, so simply copy the bytes manually, avoiding the dependency on bitstream.c in lavf (which also contains a function that is completely unused in lavf). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vvc: Use put_bytes_output()Andreas Rheinhardt2024-06-09
| | | | | | The PutBitContext has just been flushed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sdp: Check before appending ","Michael Niedermayer2024-06-07
| | | | | | | Found by reviewing code related to CID1500301 String not null terminated Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rpl: reject invalid sample rateKacper Michajłow2024-06-07
| | | | | | | | | Fixes overflow check for bit_rate multiplication few lines below. Found by OSS-Fuzz. Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>