summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/tests/imf: Don't use uninitialized valueAndreas Rheinhardt2022-01-04
| | | | | Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/imf: Fix error handling in set_context_streams_from_tracks()Pierre-Anthony Lemieux2022-01-04
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/movenc: Use dedicated pointer for access to MOVTrackAndreas Rheinhardt2022-01-04
| | | | | | | | | Improves readability and slightly decreases codesize. While just at it, also remove a check whether the packet list is nonempty before freeing it, as freeing an empty list is fine and basically a no-op. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux, mxfenc: Don't use sizeof(AVPacket)Andreas Rheinhardt2022-01-04
| | | | | | | | This removes one of the last usages of sizeof(AVPacket) in the generic muxing code. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Makefile: Redo duplicating object files in shared buildsAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of shared builds, some object files containing tables are currently duplicated into other libraries: log2_tab.c, golomb.c, reverse.c. The check for whether this is duplicated is simply whether CONFIG_SHARED is true. Yet this is crude: E.g. libavdevice includes reverse.c for shared builds, but only needs it for the decklink input device, which given that decklink is not enabled by default will be unused in most libavdevice.so. This commit changes this by making it more explicit about what to duplicate from other libraries. To do this, two new Makefile variables were added: SHLIBOBJS and STLIBOBJS. SHLIBOBJS contains the objects that are duplicated from other libraries in case of shared builds; STLIBOBJS contains stuff that a library has to provide for other libraries in case of static builds. These new variables provide a way to enable/disable with a finer granularity than just whether shared builds are enabled or not. E.g. lavd's Makefile now contains: SHLIBOBJS-$(CONFIG_DECKLINK_INDEV) += reverse.o Another example is provided by the golomb tables. These are provided by lavc for static builds, even if one uses a build configuration that makes only lavf use them. Therefore lavc's Makefile contains STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o, whereas lavf's Makefile has a corresponding SHLIBOBJS-$(CONFIG_MXF_MUXER) += golomb_tab.o. E.g. in case the MXF muxer is the only component needing these tables only libavformat.so will contain them for shared builds; currently libavcodec.so does so, too. (There is currently a CONFIG_EXTRA group for golomb. But actually one would need two groups (golomb_avcodec and golomb_avformat) in order to know when and where to include these tables. Therefore this commit uses a Makefile-based approach for this and stops using these groups for the users in libavformat.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/(aiff|flac|mov|mp3|tta)enc: Don't create unnecessary referencesAndreas Rheinhardt2022-01-04
| | | | | | | | | The packet given to muxers is not used afterwards; it is always unreferenced by libavformat. Ergo muxers are allowed to keep the references in the packets and e.g. move the ownership to a packet list. This is what this commit does. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvcquietvoid2022-01-04
| | | | | | | | Improves code legibility by not using bit shifts. Also avoids duplicating the dvcC/dvvC ISOM box writing code. Signed-off-by: quietvoid <tcChlisop0@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvcquietvoid2022-01-04
| | | | | | | To avoid duplicating code. The implementation in dovi_isom is identical. Signed-off-by: quietvoid <tcChlisop0@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroska{dec, enc}: Parse BlockAdditionMapping elementsquietvoid2022-01-04
| | | | | | | | | | | | | Adds handling of dvcC/dvvC block addition mappings. The parsing creates AVDOVIDecoderConfigurationRecord side data. The configuration block is written when muxing into Matroska, if DOVI side data is present for the track. Most of the Matroska element parsing is based on Plex's FFmpeg source code. Signed-off-by: quietvoid <tcChlisop0@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dovi_isom: Implement Dolby Vision configuration parsing/writingquietvoid2022-01-04
| | | | | | | | | | | | | | Both parse/write implementations are based on mov/movenc. This only adds support for the "Dolby Vision configuration box". Other configuration boxes, such as "Dolby Vision enhancement layer configuration box" are not supported. The new functions will be used to implement parsing/writing the DOVI config for Matroska, as well as to refactor both mov/movenc to use dovi_isom functions. Signed-off-by: quietvoid <tcChlisop0@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: propagate return value of ff_format_io_close in ↵Marton Balint2022-01-03
| | | | | | ff_format_shift_data Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/segafilmenc: use ff_format_shift_data for shiftingMarton Balint2022-01-03
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/flvenc: use ff_format_shift_data for data shiftingMarton Balint2022-01-03
| | | | | | add_keyframe_index seems to generate a corrupted index even before this change. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/movenc: factorize data shiftingMarton Balint2022-01-03
| | | | | | And move data shift function from movenc to utils. Signed-off-by: Marton Balint <cus@passwd.hu>
* lib*/version.h: Bump Versions after release/5.0 branchMichael Niedermayer2022-01-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lib*/version.h: Bump Versions before release/5.0 branchMichael Niedermayer2022-01-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/imfdec: mark as experimentalAnton Khirnov2022-01-03
| | | | | People have expressed concerns about its safety, so prevent it from being auto-selected without explicit user indication.
* lavf: add a flag for experimental (de)muxersAnton Khirnov2022-01-03
|
* avformat/Makefile: add imf.h to SKIPHEADERSJames Almer2021-12-31
| | | | | | Should fix "make checkheaders". Signed-off-by: James Almer <jamrial@gmail.com>
* http: make caching of redirect url optionalerankor2021-12-31
| | | | | | | | | | | added "cache_redirect" option to http. when enabled, requests issued after seek will use the latest redirected url. when disabled, each call to seek will revert to the original url that was sent to http_open. currently, the default remains 'enabled', until the next major libavformat bump, where it will change to 'disabled'.
* avformat/mov: add option max_stts_deltaGyan Doshi2021-12-31
| | | | | | | | | | | | | | | | Very high stts sample deltas may occasionally be intended but usually they are written in error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when cast to int32 are used to adjust onward dts. Unit is the track time scale. Default is UINT_MAX - 48000*10 which allows upto a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of uint32 range. Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/imf: TestsPierre-Anthony Lemieux2021-12-31
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/imf: DemuxerPierre-Anthony Lemieux2021-12-31
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: add bitpacked demuxerLimin Wang2021-12-31
| | | | | | | | Allows user can playback bitpacked pixel format directly: ffplay -video_size 1280x720 -pixel_format yuv422p10 test.bitpacked ffplay -f bitpacked -video_size 1280x720 -pixel_format uyvy422 test.yuv Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/flvdec: timestamps cannot use the full int64 rangeMichael Niedermayer2021-12-30
| | | | | | | | | We do not support this as we multiply by 1000 Fixes: signed integer overflow: -45318575073853696 * 1000 cannot be represented in type 'long' Fixes: 42804/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-4630325425209344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/tls_mbedtls: fix handling of tls_verify=0sfan52021-12-30
| | | | | If ca_file was set, setting tls_verify=0 would not actually disable verification.
* avformat/mxfenc: fix DNxHD GC element_typeNicolas Gaullier2021-12-27
| | | | | | | | | | | | | | | | The values for the essence element type were updated in the spec from 0x05/0x06 (ST2019-4 2008) to 0x0C/0x0D (ST2019-4 2009). Fixes ticket #6380. Thanks-to: Philip de Nier <philip.denier@bbc.co.uk> Thanks-to: Matthieu Bouron <matthieu.bouron@gmail.com> Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: fix DNxHD GC container_ulNicolas Gaullier2021-12-27
| | | | | | | Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mvdec: Check bytes_per_sampleMichael Niedermayer2021-12-25
| | | | | | | | | | Fixes: division by zero Fixes: 42814/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4787014237552640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Reviewed-by: John-Paul Stewart <jpstewart@personalprojects.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat: add side_data copy in concat demuxerGerard Sole2021-12-22
| | | | | | | | | | | | Adds support for concat demuxer to copy the side data information from the input file to the resulting file. It will behave like the metadata copy, where the metadata of the first file is kept in the the output file. Extract the current code that already performs the stream side_data copy into a separate method and reuse the method in the concat demuxer. Signed-off-by: Gerard Sole <g.sole.ca@gmail.com>
* avformat/mvdec: explicitly set durationJohn-Paul Stewart2021-12-21
| | | | | | | | Resolves a warning that duration is being innaccurately estimated based on bitrate. Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net> Reviewed-by: Peter Ross <pross@xvid.org>
* avformat/mvdec: read frame rate from data streamJohn-Paul Stewart2021-12-21
| | | | | | | | | | Prior to this patch, for version 2 of the file format the frame rate was hard-coded at 15 fps. This uses the 64-bit floating-point value from the data stream, similar to what is already done for version 3 of the file format (around line 206). Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net> Reviewed-by: Peter Ross <pross@xvid.org>
* avformat/wvenc: Make init function out of write_headerAndreas Rheinhardt2021-12-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/crcenc: Make init function out of write_headerAndreas Rheinhardt2021-12-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sdp: Fix use of uninitialised valueAndreas Rheinhardt2021-12-20
| | | | | | | Fixes Coverity ticket #1495831. Regression since fe31708eaa10af42507b8db773d5af5a56e1aff4. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfenc: Avoid allocation for timecode trackAndreas Rheinhardt2021-12-19
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfenc: Use smaller types to make struct smallerAndreas Rheinhardt2021-12-19
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/Makefile: Remove superfluous avformat->DNXHD dependenciesAndreas Rheinhardt2021-12-19
| | | | | | | | | There is no mxfenc dependency any more since commit b9a26b9d55f77ebbff3596e46be54bb5fed469d3. Also remove a dnxhddata.h inclusion in mxfenc that was forgotten in the very same commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aviobuf: ffio_copy_url_optionsPierre-Anthony Lemieux2021-12-19
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* lavf/sdp: add more thorough error handlingAnton Khirnov2021-12-17
| | | | | | Return error codes when constructing a stream config fails, rather than just disregarding the failure and continuing. Propagate the error codes from av_sdp_create().
* lavf/sdp: reindent switch() according to our conventionsAnton Khirnov2021-12-17
|
* lavf/sdp: add const qualifiers where appropriateAnton Khirnov2021-12-17
| | | | Declares that these structs are read-only for this code.
* avformat/4xm: Check for duplicate track idsMichael Niedermayer2021-12-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/4xm: Consider max_streams on reallocating tracks arrayMichael Niedermayer2021-12-16
| | | | | | | | Fixes: OOM Fixes: 41595/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-6355979363549184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cinedec: Avoid repeatedly allocating packets beyond the inputMichael Niedermayer2021-12-16
| | | | | | | | Fixes: Timeout Fixes: 41025/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5540848285122560 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Check next offset in mov_read_dref()Michael Niedermayer2021-12-16
| | | | | | | | Fixes: signed integer overflow: 9223372036200463215 + 1109914409 cannot be represented in type 'long' Fixes: 41480/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6553086177443840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vivo: Favor setting fps from explicit fractionsMichael Niedermayer2021-12-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vivo: Do not use the general expression evaluator for parsing a ↵Michael Niedermayer2021-12-16
| | | | | | | | | | floating point value Fixes: Timeout Fixes: 41564/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-6309014024093696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mvdec: Use 64 bit in timestamp computationMichael Niedermayer2021-12-16
| | | | | | | | | | Fixes: division by zero Fixes: 42198/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5054366405492736.fuzz Fixes: 42222/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4561249331970048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aviobuf: fix double free by return early on errorSteven Liu2021-12-16
| | | | | | | | | | Because the s->buffer has been freed by av_freep in avio_closep. It should not av_freep the buffer in label fail after avio_closep. Then just move the av_freep before avio_closep and remove the label fail. Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Reviewed-by: Zhao Zhili <zhilizhao@tencent.com> Signed-off-by: Steven Liu <liuqi05@kuaishou.com>