Commit Graph

65 Commits

Author SHA1 Message Date
Andreas Rheinhardt
790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
b800327f4c avformat/avformat: Add FFInputFormat, hide internals of AVInputFormat
This commit does for AVInputFormat what commit
59c9dc82f4 did for AVOutputFormat:
It adds a new type FFInputFormat, moves all the internals
of AVInputFormat to it and adds a now reduced AVInputFormat
as first member.

This does not affect/improve extensibility of both public
or private fields for demuxers (it is still a mess due to lavd).

This is possible since 50f34172e0
(which removed the last usage of an internal field of AVInputFormat
in fftools).

(Hint: tools/probetest.c accesses the internals of FFInputFormat
as well, but given that it is a testing tool this is not considered
a problem.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-07 08:53:31 -03:00
Michael Niedermayer
80f6e0378b
avformat/format: Stop reading data at EOF during probing
Issue found by: Сергей Колесников
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-09-16 20:47:32 +02:00
Andreas Rheinhardt
4f98bf9dbd avformat/avio_internal: Don't include url.h
It is only included because two very rarely used functions
use pointers to URLContexts; use struct URLContext instead.
Also move ffio_geturlcontext() so that one can avoid
a forward declaration of struct URLContext (which would be
necessary as soon as FF_API_AVIODIRCONTEXT is no more).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-10 21:19:29 +02:00
Michael Niedermayer
19a74bc794
avformat/format: Remove redundant FFMIN() in ff_match_url_ext()
Found-by: Leo Izen

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-22 02:49:48 +02:00
Michael Niedermayer
a7b06bfc5d
avformat: add ff_match_url_ext()
Match url against a list of extensions similar to av_match_ext()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-15 03:02:28 +02:00
Andreas Rheinhardt
145f6b2223 avformat/avformat: Remove AVOutputFormat.data_codec
No AVOutputFormat has this set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-02-09 15:24:15 +01:00
Andreas Rheinhardt
33d1c71931 avformat/format: Also search for image2-codecs for image2pipe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-28 02:40:49 +02:00
Martin Storsjö
a78f136f3f configure: Use a separate config_components.h header for $ALL_COMPONENTS
This avoids unnecessary rebuilds of most source files if only the
list of enabled components has changed, but not the other properties
of the build, set in config.h.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:12:49 +02:00
Anton Khirnov
be97d2a825 lavf: add a flag for experimental (de)muxers 2022-01-03 20:38:35 +01:00
Andreas Rheinhardt
baf89ab9a7 avformat/format: Improve const-correctness
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-07 14:06:58 +02:00
Andreas Rheinhardt
56450a0ee4 avformat: Constify the API wrt AV(In|Out)putFormat
Also constify AVProbeData.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00
Carl Eugen Hoyos
6a3520bf98 lavf: Constify AVProbeData* in av_probe_input_format(). 2019-03-20 19:04:49 +01:00
Carl Eugen Hoyos
3aa6208db9 lavf: Constify AVInputFormat pointer. 2019-03-20 18:52:38 +01:00
Carl Eugen Hoyos
9461e4bc69 lavf: Constify AVOutputFormat pointer. 2019-03-20 18:38:48 +01:00
Jun Zhao
053ee996a0 lavf/format: Remove the dead code in av_probe_input_buffer2.
Remove the dead code in av_probe_input_buffer2

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-05-06 15:07:28 +08:00
Josh de Kock
d1221f3351 lavf/format: use const AVInputFormat for iteration
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
Josh de Kock
85bf89885a Revert "avformat/format: temporarily use old next api"
This reverts commit 909e00ae81.

There is no need to use the old API anymore as the new API now
behaves in the same way (treating devices as formats when loaded).

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
Josh de Kock
d8ae40611b Revert "lavd: add new API for iterating input and output devices"
This reverts commit 0fd475704e.

Revert "lavd: fix iterating of input and output devices"

This reverts commit ce1d77a5e7.

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-03-31 23:26:31 +01:00
Muhammad Faiz
909e00ae81 avformat/format: temporarily use old next api
Should fix https://ffmpeg.org/pipermail/ffmpeg-devel/2018-February/225066.html

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2018-02-10 07:23:41 +07:00
Josh de Kock
0fd475704e lavd: add new API for iterating input and output devices
This also adds an avpriv function to register devices in
libavformat
2018-02-06 18:57:42 +00:00
Josh de Kock
0694d87024 lavf: add new API for iterating muxers and demuxers 2018-02-06 18:57:42 +00:00
James Almer
57960b1f28 avformat: use mutexes instead of atomics in av_register_{input,output}_format()
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 13:18:34 -03:00
Michael Niedermayer
4cc896ea5f avformat/format: Fix registering a format more than once and related races
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-25 20:09:10 +02:00
Michael Niedermayer
2ccf9ae6cc avformat/format: Print debug info when probe score is increased due to mime type
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-05 16:35:40 +02:00
Michael Niedermayer
77864be44a avformat/format: Weight the filename extension higher if there is nearly no data after an ID3 available
Fixes Ticket5205

Based-on-patch-by: Carl Eugen Hoyos
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-30 22:25:31 +01:00
Michael Niedermayer
8619582bdf avformat/format: Replace nodat by enum
This makes the code much more readable

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-30 22:25:31 +01:00
Ganesh Ajjanagadde
6ea457f76d avformat/format: silence -Wdiscarded-qualifiers
lpd.buf is non-const and discards the const qualifier of zerobuffer.
This fixes -Wdiscarded-qualifiers observed with a variety of compilers, including GCC 5.2.
Note that this does not change the type of zerobuffer, and merely makes the intent explicit.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-20 02:14:18 +02:00
Timothy Gu
d36eac698f Revert "avformat/format: silence -Wdiscarded-qualifiers"
This reverts commit 27cbe4588a.

See
https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179002.html

Requested-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2015-09-16 19:53:13 -07:00
Ganesh Ajjanagadde
27cbe4588a avformat/format: silence -Wdiscarded-qualifiers
lpd.buf is non-const and discards the const qualifier of zerobuffer.
This fixes -Wdiscarded-qualifiers observed with GCC 5.2.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-09-16 16:24:56 -07:00
Clément Bœsch
c8370a17f5 avformat: fix style after recent commits 2015-09-14 17:42:56 +02:00
Alex Agranovsky
9b10ae5727 avformat/format: Remove parameters from mime type before comparission for probing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-12 00:42:18 +02:00
Michael Niedermayer
75a730a22b avformat/format: Add generic trace av_log in av_probe_input_format3()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 03:43:59 +02:00
Anshul Maheshwari
a47c9331ef avformat: Improve data streams/codec support
This adds data codec/stream handling where previously there was only
audio/video/subtitles

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-16 02:24:08 +01:00
Michael Niedermayer
cebe8c8095 avformat/format: Use av_match_name() instead of list in av_match_ext()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-23 04:33:09 +02:00
Michael Niedermayer
e96fb980dc avformat/format: move mime_type_opt declaration to where its used
also remove a related dead store

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-10 03:08:11 +02:00
Michael Niedermayer
911ba8fb19 Merge commit 'b15b06ebf582ae81e47d236524c9ad6e10c8a0a7'
* commit 'b15b06ebf582ae81e47d236524c9ad6e10c8a0a7':
  avformat: use const char* instead of uint8_t* for AVProbeData.mime_type

Conflicts:
	libavformat/format.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-08 21:35:40 +02:00
Andreas Cadhalpun
b15b06ebf5 avformat: use const char* instead of uint8_t* for AVProbeData.mime_type
This makes the field consistent with AVInputFormat.mime_type and the
argument type of av_match_name.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-10-08 15:13:15 +01:00
Michael Niedermayer
0d92b0d5f4 avutil/avstring: Factor av_match_list() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-02 18:51:05 +02:00
Andreas Cadhalpun
883e98bc25 probe: Bump the score for mime type matching
It should be more trustworthy than extension matching.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-26 20:56:16 +02:00
Andreas Cadhalpun
bcac0f4010 lavf/format.c: use AVPROBE_SCORE_MIME instead of AVPROBE_SCORE_EXTENSION for matching mime types
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-13 00:37:35 +02:00
Michael Niedermayer
917d14e6a2 avformat/format: Run image2 probe again when file content data is available
Reviewed-by: Benoit Fouet <benoit.fouet@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-12 18:20:38 +02:00
Gabriel Dume
4b1f5e5090 cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 05:34:13 -07:00
Michael Niedermayer
fce8817a01 avformat/format: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 20:40:11 +02:00
Michael Niedermayer
c218d8218d Merge commit '24e87f7f425a52b1e69661dcb2fbe0555a76f30b'
* commit '24e87f7f425a52b1e69661dcb2fbe0555a76f30b':
  Remove obsolete FF_API_PROBE_MIME cruft.

Conflicts:
	libavformat/avformat.h
	libavformat/format.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 01:36:21 +02:00
Anton Khirnov
24e87f7f42 Remove obsolete FF_API_PROBE_MIME cruft. 2014-08-09 16:59:21 +00:00
Michael Niedermayer
98e42a249e avformat/format: Check for av_guess_format() failure
Fixes null pointer dereference
Fixes Ticket3812

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-02 04:16:02 +02:00
Michael Niedermayer
26ffa8eaee avformat/format: use av_match_name() in av_guess_codec()
Fixes part of Ticket2236

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-02 03:39:38 +02:00
Michael Niedermayer
d38edeee9b avformat/format: fix memleak and error code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-29 21:38:15 +02:00
Michael Niedermayer
4182728c78 avformat/format.c: remove duplicate include, put libavutil includes together
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-29 21:35:07 +02:00