Commit Graph

1161 Commits

Author SHA1 Message Date
Andreas Rheinhardt 52c1e9e530 avformat/matroskaenc: Disable MKV-only code if MKV muxer is disabled
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>
2022-01-08 18:16:29 +01:00
Andreas Rheinhardt 99f3fb8ea1 avformat/Makefile: Add entries for CRI, GEM and PGX image pipe demuxers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-08 18:12:17 +01:00
Andreas Rheinhardt 1beeeaf23d avformat/Makefile: Add missing alp-muxer->rawenc.o dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-08 18:11:36 +01:00
Andreas Rheinhardt 78a840e7a3 avformat/Makefile, amr: Add missing amr-demuxers->rawdec.o dependency
Forgotten in 1f447fd954.
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>
2022-01-08 18:04:31 +01:00
Andreas Rheinhardt 5bdd8e67e6 avformat/Makefile: Add missing libamqp->urldecode dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-08 18:03:02 +01:00
Andreas Rheinhardt 6e163619e3 avformat/Makefile: Fix name of PhotoCD demuxer
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-07 12:59:24 +01:00
Limin Wang 41f213c3bf avformat: reuse the common code for v210/v210x
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>
2022-01-05 09:38:14 +08:00
Andreas Rheinhardt b74e47c4ff avcodec/utils: Unavpriv avpriv_toupper4()
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>
2022-01-04 13:16:50 +01:00
Andreas Rheinhardt 33e6d57f01 avcodec/mpegaudiodata: Unavpriv mpa_bitrate and mpa_frequency tabs
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>
2022-01-04 13:16:50 +01:00
Andreas Rheinhardt 49bf94536f avcodec/mpeg4audio: Unavpriv and deduplicate mpeg4audio_sample_rates
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>
2022-01-04 13:16:50 +01:00
Andreas Rheinhardt 1d333c1547 avcodec/jpegtables: Unavpriv MJPEG-tables
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>
2022-01-04 13:16:50 +01:00
Andreas Rheinhardt 3afb41655e avcodec/dca: Unavpriv dca_sample_rates
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>
2022-01-04 13:16:49 +01:00
Andreas Rheinhardt d7a75d2163 avcodec/ac3tab: Unavpriv ac3_channel_layout_tab
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>
2022-01-04 13:16:49 +01:00
Andreas Rheinhardt 20b0d24c2f Makefile: Redo duplicating object files in shared builds
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>
2022-01-04 05:01:04 +01:00
quietvoid f0fb005f59 avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc
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>
2022-01-04 04:29:36 +01:00
quietvoid 9906f9ae3b avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvc
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>
2022-01-04 04:29:36 +01:00
quietvoid 05c07943b0 avformat/matroska{dec, enc}: Parse BlockAdditionMapping elements
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>
2022-01-04 04:29:36 +01:00
James Almer 0154f142f3 avformat/Makefile: add imf.h to SKIPHEADERS
Should fix "make checkheaders".

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-31 19:22:47 -03:00
Pierre-Anthony Lemieux 6b7e4de0db
avformat/imf: Tests
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-12-31 17:26:01 +10:00
Pierre-Anthony Lemieux 73f6cce936
avformat/imf: Demuxer
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-12-31 17:26:01 +10:00
Limin Wang d590e211a2 avformat: add bitpacked demuxer
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>
2021-12-31 07:08:43 +08:00
Zane van Iperen 12f8293c02
avformat/scd: add demuxer
Adds demuxer for Square Enux SCD files.

Based off [1] and personal investigation.

This has only been tested against Drakengard 3 (PS3) *_SCD.XXX files
(big-endian). As it is highly likely that FFXIV (PC) files are little-endian,
this demuxer is marked as experimental until this can be confirmed.

[1]: http://ffxivexplorer.fragmenterworks.com/research/scd%20files.txt

Reviewed-by: Peter Ross <pross@xvid.org>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-12-02 01:41:55 +10:00
Limin Wang 4f5352d5fe avformat/rtpenc: adds partial support for the RFC 4175
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-25 15:04:35 +08:00
Limin Wang 38052757f5 avformat: add raw avs3 muxer
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-19 20:15:47 +08:00
Nachiket Tarate ff958b3846 libavformat/hls: add support for decryption of HLS media segments encrypted using SAMPLE-AES encryption method
Apple HTTP Live Streaming Sample Encryption:

https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2021-10-13 11:23:53 +08:00
Andreas Rheinhardt bde2cdfe9b avformat/utils: Move demuxing code out into a new file
libavformat/utils.c has over 4800 lines and is supposed to contain
"various utility functions for use within FFmpeg". In reality it
contains all that and the whole demuxing core of libavformat.
This is especially bad, because said file includes the FFMPEG_VERSION
(the git commit sha) so that it is rebuilt whenever the commit HEAD
points to changes. Therefore this commit makes it smaller by moving
the demuxing code out to a new file, demux.c (in analogy to mux.c
for the muxing code).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17 14:42:17 +02:00
Andreas Rheinhardt cf7c51f24b avformat/utils: Move seeking code out into a new file
libavformat/utils.c has over 5500 lines and is supposed to contain
"various utility functions for use within FFmpeg". In reality it
contains all that and the whole demuxing+seeking core of libavformat.
This is especially bad, because said file includes the FFMPEG_VERSION
(the git commit sha) so that it is rebuilt whenever the commit HEAD
points to changes. Therefore this commit starts making it smaller
by factoring the seeking code out.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17 13:53:30 +02:00
James Almer 8a6beccf0d avformat: add an AV1 Low overhead bitstream format muxer
Suggested-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-01 19:55:30 -03:00
Jan Ekström e41bd075dd avformat/movenc: add support for TTML muxing
Includes basic support for both the ISMV ('dfxp') and MP4 ('stpp')
methods. This initial version also foregoes fragmentation support
in case the built-in sample squashing is to be utilized, as this
eases the initial review.

Additionally, add basic tests for both muxing modes in MP4.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-08-25 09:26:46 +03:00
Andreas Rheinhardt 41ab409332 avformat/Makefile: Remove rawdec dependency from aptx, codec2 demuxers
These demuxers don't need anything from rawdec; they furthermore only
used rawdec.h to include opt.h. Both of this has been fixed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt 2c984ecbdd avformat/Makefile: Add missing rawdec dependency for IPU demuxer
Needed for ff_raw_read_partial_packet and ff_raw_options.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
James Almer 8c2c0135e5 avformat: add a concat protocol that takes a line break delimited list of resources
Suggested-by: ffmpeg@fb.com
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-02 10:21:06 -03:00
Zane van Iperen dcb285d2b7
avformat: add Argonaut Games CVG muxer
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-12 20:27:02 +10:00
Zane van Iperen 9789ea59d0
avformat: add Argonaut Games CVG demuxer
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-12 20:25:50 +10:00
Aidan Richmond 4236e87f50
avformat/westwoodaudenc: Adds muxer for Westwood AUD format.
Format is still used by modders of these old games.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Aidan Richmond <aidan.is@hotmail.co.uk>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-26 19:56:33 +10:00
Gyan Doshi 240aa70b79 avformat/rawenc: remove singlejpeg muxer
It was added in 51ac1f616f due to ticket #4218, in order to show a single
image via ffserver. With ffserver long gone, it serves no purpose.
2021-04-16 11:14:36 +05:30
Paul B Mahol 4098f809d6 libavformat: add librist protocol
This work is sponsored by Open Broadcast Systems.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2021-03-13 17:36:48 +01:00
parazyd 51367267c8 avformat/gopher: Add support for Gopher over TLS
This commit adds a "gophers" handler to the gopher protocol. gophers
is a community-adopted protocol that acts the same way like normal
gopher with the added TLS encapsulation.

The gophers protocol is supported by gopher servers like geomydae(8),
and clients like curl(1), clic(1), and hurl(1).

This commit also adds compilation guards to both gopher and gophers,
since now there are two protocols in the file it makes sense to
have this addition.

Signed-off-by: parazyd <parazyd@dyne.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-11 23:47:19 +01:00
Jan Ekström 64af14555b avformat: add TTML muxer
Enables writing TTML documents or encoded TTML paragraphs as such
documents.

Additionally, a test for the combined TTML encoder and muxer has
been added to validate that the components still work.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-03-05 19:45:00 +02:00
Paul B Mahol c6c82428af avformat: add Digital Pictures SGA game demuxer 2021-03-01 17:41:05 +01:00
Andreas Rheinhardt 78d5e1c653 avformat/Makefile: Remove unnecessary dependencies on vocdec
Commit 0d1229f1d2 factored the main part
of the voc demuxer's read_packet function out; yet when this Libav
commit was merged in f99195d56f, the
dependency of the other users of this function on vocdec.o was
unnecessarily kept. This commit fixes this.

While just at it, also disable the data only used by the voc demuxer
and muxer in voc.c if both of them are disabled.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 21:12:26 +01:00
Andreas Rheinhardt 08b4a25ff9 avformat/aiff: Deduplicate codec tags and codec tags list
Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 11:30:57 +01:00
Andreas Rheinhardt bb9167dbde avformat/isom: Split movaudio/movvideo tags off into a separate file
The NUT and avi demuxers only need ff_codec_movvideo_tags and so this
removes a dependency on the rest of isom.c as well as on mpeg4audio.c
(which isom depends on); it is similar for the Matroska demuxer and
muxers, except that the mpeg4audio.c dependency can't be avoided.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 10:14:26 +01:00
Andreas Rheinhardt 215536ad0c avformat/Makefile: Remove outdated AIFF demuxer dependency on iso_media
This is a result of the mov channel parsing stuff being factored out
of mov.c twice: Once in 91b782720f
to isom.c and later in 3bab7cd128.

Also remove the isom.h header; and while just at it, remove an unused
mathematics.h inclusion.

(isom.c actually depends upon mpeg4audio from libavcodec for
avpriv_mpeg4audio_get_config2 and avpriv_mpa_freq_tab; yet there is
no configure dependency for iso_media which leads to failure of shared
builds.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 10:14:26 +01:00
Paul B Mahol 51a9f487ae avformat: add Simbiosis IMX demuxer 2021-02-20 17:43:17 +01:00
Paul B Mahol 84d5df5446 avformat: add xbm_pipe demuxer 2021-02-05 15:36:19 +01:00
Paul B Mahol e955f5ac01 avformat: add binka demuxer 2021-02-04 17:52:45 +01:00
Andreas Rheinhardt 7936cfc157 avformat/Makefile: Only compile qtpalette.c when needed
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 21:35:43 +01:00
Andreas Rheinhardt a703410d25 avformat/cutils, dvenc: Move ff_brktimegm to its only user
This also allows to completely remove cutils.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 21:35:43 +01:00
Derek Buitenhuis a7f9b3b954 avformat/hlsenc: Add dependency on avc.o
a2b1dd0ce3 added a dependency
on ff_nal_unit_extract_rbsp.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-12-22 18:03:18 -05:00