summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/rtpenc_rfc4175: support for interlace formatLimin Wang2022-01-12
| | | | | | | | | | | | | | | | | Below are steps how to test on your local host: wget --no-check-certificate https://samples.ffmpeg.org/MPEG2/interlaced/burosch1.mpg 1. interlace format: ffmpeg -re -i ./burosch1.mpg -c:v bitpacked -pix_fmt yuv422p10 -f rtp rtp://239.255.0.1:6000 copy and create sdp file test.sdp ffplay -buffer_size 671088640 -protocol_whitelist "file,rtp,udp" test.sdp 2. progressive format: ffmpeg -re -i ./burosch1.mpg -vf yadif -c:v bitpacked -pix_fmt yuv422p10 -f rtp rtp://239.255.0.1:6000 copy and create sdp file test.sdp ffplay -buffer_size 671088640 -protocol_whitelist "file,rtp,udp" test.sdp Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpdec_rfc4175: reindent after last commitLimin Wang2022-01-12
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpdec_rfc4175: support for interlace formatLimin Wang2022-01-12
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavf/udp: do not return an uninitialized value from udp_open()Anton Khirnov2022-01-11
|
* lavf/dvenc: replace av_fifo_peek2() with av_fifo_generic_peek_at()Anton Khirnov2022-01-10
| | | | | This is the only remaining caller of av_fifo_peek2(), which will be deprecated.
* avformat/movenc: fix duration in mdhd boxZhao Zhili2022-01-10
| | | | | | | mvhd and tkhd present the post-editlist duration, while mdhd should have the pre-editlist duration. Regression since c2424b1f3. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/amr: Return error upon errorAndreas Rheinhardt2022-01-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dashdec: do not use filesize when reading XML fileMarton Balint2022-01-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/imfdec: do not use filesize when reading XML fileMarton Balint2022-01-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: support MCA audio informationMarc-Antoine Arnaud2022-01-09
| | | | | | | Channel reordering is removed from this patch because the new channel layout API will support it properly. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/rawvideodec: Disable option accidentally added for v210(x)Andreas Rheinhardt2022-01-09
| | | | | | | | | 41f213c3bf629d549400e935e7f123e6cfa959ab accidentally added an unused pixel_format option to the v210(x) demuxers. Remove it before it really becomes part of the API. Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hlsenc: convey stream id to segment streamsGyan Doshi2022-01-09
|
* avformat/matroskaenc: Disable MKV-only code if MKV muxer is disabledAndreas Rheinhardt2022-01-08
| | | | | | | | The Matroska muxer has quite a lot of dependencies and lots of them are unnecessary for WebM. By disabling the Matroska-only code at compile time one can get rid of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Move AAC extradata check to other audio checksAndreas Rheinhardt2022-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rtsp: #if unused functions away, fix -O0 compilationAndreas Rheinhardt2022-01-08
| | | | | | | | | | | parse_rtsp_message() is only called if the rtsp demuxer is enabled and so it is normally compiled away if said demuxer is disabled. Yet this does not happen when compiling with -O0 and this leads to a linking failure because parse_rtsp_message() calls functions that may not be available if the rtsp demuxer is disabled. Fix this by properly #if'ing the unused functions away. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/img2dec: Don't include disabled demuxersAndreas Rheinhardt2022-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/Makefile: Add entries for CRI, GEM and PGX image pipe demuxersAndreas Rheinhardt2022-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/Makefile: Add missing alp-muxer->rawenc.o dependencyAndreas Rheinhardt2022-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/amr: Fix writing AMR headerAndreas Rheinhardt2022-01-08
| | | | | | Regression since f282c34c009e3653ec160c3880e64fc1a9300d0e. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/amr: Don't reset AVFormatContext.priv_dataAndreas Rheinhardt2022-01-08
| | | | | | | | The AMR muxer doesn't have a private context, so it's priv_data will be NULL. If it weren't, simply setting it to NULL would lead to a memleak. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/Makefile, amr: Add missing amr-demuxers->rawdec.o dependencyAndreas Rheinhardt2022-01-08
| | | | | | | | | Forgotten in 1f447fd95463bbf39a78d886359a3006d82f6a94. Also only enable amr_probe() and amr_read_header() in case the AMR demuxer is enabled; this avoids having to add a rawdec.o dependency to the muxer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/Makefile: Add missing libamqp->urldecode dependencyAndreas Rheinhardt2022-01-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mvdec: re-indent after last commitJohn-Paul Stewart2022-01-08
| | | | | | Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Reviewed-by: Peter Ross <pross@xvid.org>
* avformat/mvdec: make audio stream conditionalJohn-Paul Stewart2022-01-08
| | | | | | | | | | | | | | | Only allocate an audio stream if there is one in the data. Silicon Graphics movie format will contain default values (16 bit samples, 2 audio channels, 22050 Hz sample rate) even when no audio is present in the file. This confuses FFmpeg into thinking such an audio stream is present with 0 samples in it. There is a flag value in the format to indicate whether or not audio is present. This patch checks that and behaves accordingly. Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Reviewed-by: Peter Ross <pross@xvid.org>
* avformat/matroskaenc: Fix build with only WebM muxer enabledAndreas Rheinhardt2022-01-07
| | | | | | | | | In this case ff_isom_put_dvcc_dvvc() might not be available, leading to linking failures. Given that WebM currently doesn't support DOVI, this is fixed by #if'ing the offending code away if the Matroska muxer is not enabled. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/Makefile: Fix name of PhotoCD demuxerAndreas Rheinhardt2022-01-07
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/takdec: Don't initialize get_bits context to read one valueAndreas Rheinhardt2022-01-07
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/imf: Fix indentationPierre-Anthony Lemieux2022-01-05
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/imf: fix CPL parsing error handlingPierre-Anthony Lemieux2022-01-05
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/imf: fix bad free() when directory name of the input url is emptyPierre-Anthony Lemieux2022-01-05
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/imf: fix error CPL root element is absentPierre-Anthony Lemieux2022-01-05
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: remove unused v210.cLimin Wang2022-01-05
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat: reuse the common code for v210/v210xLimin Wang2022-01-05
| | | | | | | | As suggested by Andreas Rheinhardt, most code of v210 demuxer is common code which is duplicated from rawvideodec, so it's better to move v210/v210x demuxer code to rawvideodec.c and reuse the common code. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lib*/version.h: Bump Versions after release/5.0 branchAndreas Rheinhardt2022-01-04
| | | | | | | This is done a second time for 5.0 because master was merged into 5.0 so that it contains the recent DOVI additions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lib*/version.h: Bump Versions before release/5.0 branchAndreas Rheinhardt2022-01-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/packet_internal: Add proper PacketList structAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | Up until now, we had a PacketList structure which is actually a PacketListEntry; a proper PacketList did not exist and all the related functions just passed pointers to pointers to the head and tail elements around. All these pointers were actually consecutive elements of their containing structs, i.e. the users already treated them as if they were a struct. So add a proper PacketList struct and rename the current PacketList to PacketListEntry; also make the functions use this structure instead of the pair of pointers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/utils: Unavpriv avpriv_toupper4()Andreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | This function is quite small (96B with GCC 11.2 on x64 Ubuntu 21.10 at -O3), making it more economical to duplicate it into libavformat instead of exporting it as avpriv: Doing so saves 2x24B in .dynsim, 2x16B in .dynstr, 2x2B .gnu.version, 24B in .rela.plt, 16B in .plt, 16B in .plt.sec (if enabled), 4B .gnu.hash; besides the actual duplicated code this also adds 2x8B .eh_frame_hdr and 24B .eh_frame. In other words: Duplicating is neutral size-wise (it is also presumed neutral for other systems). Given that it avoids the runtime overhead of dynamic symbols, it is advantageouos to duplicate the function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegaudiodata: Unavpriv mpa_bitrate and mpa_frequency tabsAndreas Rheinhardt2022-01-04
| | | | | | | | | | | These arrays have a size of 180 resp. six bytes. This does not make it worthwhile to export them due to the overhead this occurs; for x64 Elf/Linux/GNU: 2x2B version, 2x24B .dynsym, 24B .rela.dyn, 8B .got, 4B hash + twice the size of the name (here 20+23B). Therefore these symbols are unavprived and duplicated for shared builds. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4audio: Unavpriv and deduplicate mpeg4audio_sample_ratesAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | | | | | | avpriv_mpeg4audio_sample_rates has a size of 64B and it is currently avpriv; a clone of it exists in aacenctab.h and from there it is inlined in aacenc.c (which also uses the avpriv version) and in the FLV muxer. This means that despite it being avpriv both libavformat as well as libavcodec have copies already. This situation is clearly suboptimal. Given the overhead of exporting symbols (for x64 Elf/Linux/GNU: 2x2B version, 2x24B .dynsym, 24B .rela.dyn, 8B .got, 4B hash + twice the size of the name (here 31B)) the object is unavprived, i.e. duplicated into libavformat when creating a shared build; but the duplicates in the AAC encoder and FLV muxer are removed. This involves splitting of the sample rate table into a file of its own; this allowed to break some spurious dependencies (e.g. both the AAC encoder as well as the Matroska demuxer actually don't need the mpeg4audio_get_config stuff). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/jpegtables: Unavpriv MJPEG-tablesAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | There are seven MJPEG-tables, five small (1x12, 4x17) and two not small (2x162). These are all avpriv, despite this not being worthwhile due to the overhead of exporting a symbol: The total overhead for each symbol consists of two entries in .dynsym (24B each), one entry in the importing library's .rela.dyn (24B) and one in .got (8B) as well as 2x2B for symbol versions and 4B for symbol hashes in the exporting library; in addition to that, the name of the symbol is included in both exporting and importing libraries, using 2x210 bytes in this case. (The above numbers are for a x64 Elf/Linux/GNU system. Other platforms will give different numbers.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dca: Unavpriv dca_sample_ratesAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | Said table is 64 bytes long and exported so that it can be used both in libavcodec and libavformat. This commit stops doing so and instead duplicates it for shared builds, because the overhead of exporting the symbol is bigger than 64 bytes. It consists of the length of the name of the symbol (2x24 bytes), two entries in .dynsym (2x24 bytes), two entries for symbol version (2x2 bytes), one hash value in the exporting library (4 bytes) in addition to one entry in the importing library's .got and .rela.dyn (8 + 24 bytes). (The above numbers are for a Linux/GNU/Elf system; the numbers for other platforms may be different.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3tab: Unavpriv ac3_channel_layout_tabAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | | It is small (16 B) and therefore the overhead of exporting it more than outweighs the size savings from not having duplicated symbols: When the symbol is no longer avpriv, one saves twice the size of the string containing the symbols name (2x30 byte), two entries in .dynsym (24 bytes each on x64), one entry in the importing libraries .got and .rela.dyn (8 + 24 bytes on x64) and two entries for the symbol version (2 bytes each) and one hash value in the exporting library (4 bytes). (The exact numbers are of course different for other platforms (e.g. when using dlls), but given that the strings saved alone more than outweigh the array size it can be presumed that this is beneficial for all platforms.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/raw: Reduce number of avpriv symbolsAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libavcodec currently exports four avpriv symbols that deal with PixelFormatTags: avpriv_get_raw_pix_fmt_tags, avpriv_find_pix_fmt, avpriv_pix_fmt_bps_avi and avpriv_pix_fmt_bps_mov. The latter two are lists of PixelFormatTags, the former returns such a list and the second searches a list for a pixel format that matches a given fourcc; only one of the aforementioned three lists is ever searched. Yet for avpriv_pix_fmt_bps_avi, avpriv_pix_fmt_bps_mov and avpriv_find_pix_fmt the overhead of exporting these functions actually exceeds the size of said objects (at least for ELF; the following numbers are for x64 Ubuntu 20.10): The code size of avpriv_find_pix_fmt is small (GCC 10.2 37B, Clang 11 41B), yet exporting it adds a 20B string for the name alone to the exporting as well as to each importing library; there is more: Four bytes in the exporting libraries .gnu.hash; two bytes each for the exporting as well as each importing libraries .gnu.version; 24B in the exporting as well as each importing libraries .dynsym; 16B+24B for an entry in .plt as well as the accompanying relocation entry in .rela.plt for each importing library. The overhead for the lists is similar: The strings are 23B and the .plt+.rela.plt pair is replaced by 8B+24B for an entry in .got and a relocation entry in .rela.dyn. These lists have a size of 80 resp. 72 bytes. Yet for ff_raw_pix_fmt_tags, exporting it is advantageous compared to duplicating it into libavformat and potentially libavdevice. Therefore this commit replaces all library uses of the four symbols with a single function that is exported for shared builds. It has an enum parameter to choose the desired list besides the parameter for the fourcc. New lists can be supported with new enum values. Unfortunately, avpriv_get_raw_pix_fmt_tags could not be removed, as the fourcc2pixfmt tool uses the table of raw pix fmts. No other user of this function remains. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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>