Commit Graph

1013 Commits

Author SHA1 Message Date
Marton Balint
64834bb86a avformat: introduce AVFormatContext io_close2 which returns an int
Otherwise there is no way to detect an error returned by avio_close() because
ff_format_io_close cannot get the return value.

Checking the return value of the close function is important in order to check
if all data was successfully written and the underlying close() operation was
successful.

It can also be useful even for read mode because it can return any pending
AVIOContext error, so the user don't have to manually check AVIOContext->error.

In order to still support if the user overrides io_close, the generic code only
uses io_close2 if io_close is either NULL or the default io_close callback.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-12-12 00:32:20 +01: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
Derek Buitenhuis
a35101aae3 avformat/http: Add short_seek_size option
In 45bfe8b838, short_seek_threshold was removed
from the public AVIO struct. Although this option was private and not intended
to be used by public API users, it was nonetheless, because it provided functionality
that could otherwise not be gained via public API.

This was especially important for networked I/O like HTTP, where the internal
size for lavf could be way to small depending on the specifics of a user's
usecase, such as reading interlavd media files from cloud storage.

Add an AVOption to make this functionality accessible to the HTTP client.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-11-17 14:32:17 +00:00
Anton Khirnov
ed75a08d36 lavf: add an AVClass to AVStream on next major bump
Also add a function to retrieve that class, analogously to
avformat_get_class().

This will be useful for adding an AVOption for dispositions.
2021-11-16 10:51:32 +01:00
Anton Khirnov
db932241ee */version.h: define FF_API macros unconditionally
There is no reason to wrap them in #ifndef guards, they should only be
defined here and nowhere else. The define guards just add the
possibility to accidentally use the same FF_API name in different
libraries.
2021-11-15 16:24:58 +01:00
Jan Ekström
682bafdb12 avformat/avio{,buf}: introduce public AVIOContext::bytes_{read,written}
Such fields can be seen as generally useful in cases where the
API user is not implementing custom AVIO callbacks, but still would
like to know if data is being read or written out, such as in case
data is being read from input but no AVPacket has been received yet.
2021-10-24 13:04:39 +03:00
Jan Ekström
a5622ed16f avformat/avio{,buf}: deprecate AVIOContext::written
Originally added as a private entry in commit
3f75e5116b, but its grouping with
the comment noting its private state was missed during merging of
the field from Libav (most likely due to an already existing field
in between).
2021-10-24 13:04:39 +03:00
Peter Ross
4ff8840697 avformat/img2dec: add GEM Raster image demuxer
Signed-off-by: Peter Ross <pross@xvid.org>
2021-10-08 20:37:36 +11:00
Jan Ekström
7a446b1179 avformat/{isom,mov,movenc}: add support for CMAF DASH roles
This information is coded in a standard MP4 KindBox and utilizes the
scheme and values as per the DASH role scheme defined in MPEG-DASH.
Other schemes are technically allowed, but where multiple schemes
define the same concepts, the DASH scheme should be utilized.

Such flagging is additionally utilized by the DASH-IF CMAF ingest
specification, enabling an encoder to inform the following component
of the roles of the incoming media streams.

A test is added for this functionality in a similar manner to the
matroska test.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-10-04 17:55:27 +03: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
Andreas Rheinhardt
750631b098 avformat/matroskaenc: Pass dispositions through unchanged by default
Up until now, the Matroska muxer did not use the dispositions it is
given as-is; instead it by default overrode the disposition of the first
track of a kind (audio, video, subtitles) if no track of this kind has
the default disposition set. And up until recently, it also enforced
by default that no more than one track of each kind be marked as
default.

The rationale for the former is that there are lots of containers which
lack the concept of default streams, so that it is not uncommon for no
stream to be marked as default at all; the rationale for the latter was
that up until recently, it was dubious whether the Matroska specification
allowed more than one default stream for track type (e.g. mkvmerge
disallowed it). It was this point which led to the implementation of
the above mentioned behaviour inspired by mkvmerge.

Yet the Matroska specifications have changed and now explicitly allow
to set more than one track of each type as default, so that the main
reason of not using the dispositions as-is was rendered moot. Therefore
this commit changes the default to pass the disposition through.

The matroska-mpegts-remux FATE-test has been updated to still use the
old "infer" mode so that it is still covered by FATE; the
matroska-zero-length-block test has also been updated to cover
the infer_no_subs mode. The references for lots of other FATE tests
needed to be updated because of a newly added FlagDefault element with
value zero (whereas a FlagDefault with value 1 needn't be coded at all,
as it coincided with the default value of said element).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-24 04:23:29 +02:00
Zane van Iperen
981d49e373
avformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 14:14:39 +10: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
Matthieu Patou
52795d7f09 lavf/webmdashenc.c: Allow AV1 video in WebM
Suggested-By: ffmpeg@fb.com
2021-06-20 22:30:38 +02:00
James Almer
2cccab96f6 avformat: make AVStream.pts_wrap_bits public
It can be useful to library users, and is currently being used by ffmpeg.c

Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-10 18:37:26 -03:00
Zhao Zhili
58614f7bee avformat/libsrt: workaround conflict with ffmpeg cmdline option
Add 'srt_streamid' option as an alias for 'streamid'.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:09:33 +02:00
Ubaldo Porcheddu
36b16a30db avformat/mpegtsenc: add NIT support
With some minor changes by Marton Balint:
 - removed trailing whitespace
 - fixed network_descriptors_length
 - fixed reserved_future_use flag in the start of the section
 - removed unused program variable
 - emit first NIT after PAT
 - some other cosmetics

Signed-off-by: Ubaldo Porcheddu <ubaldo@eja.it>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-05-20 23:07:46 +02: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
Justin Ruggles
c75dfa0435 movenc: add movie_timescale option instead of hardcoding 1000
There are cases where using 1000 as the MP4 timescale is not
accurate enough, for example when one needs sample-accurate audio
handling.

This adds a new AVOption to the MOV/MP4 muxer to override the
movie timescale, but it still defaults to 1000 to maintain current
default behavior.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2021-05-04 15:32:26 +02:00
Anton Khirnov
85ba17f36d Bump major versions of all libraries.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27 11:48:05 -03:00
James Almer
3749eede66 avformat: remove deprecated AVStream.codec
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:47:24 -03:00
Andreas Rheinhardt
e83717e63e avformat: Switch AVChapter.id to 64bits
Announced in e318438f2f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:10 -03:00
Andreas Rheinhardt
0a071f7124 avformat: Remove deprecated av_demuxer_open()
Deprecate in e37f161e66.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:10 -03:00
Andreas Rheinhardt
e8876bdcf3 avformat: Remove deprecated AVFMT_FLAG_MP4A_LATM flag, latm option
Deprecated in 67747c89ad.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
e5bcda6473 avformat/dashenc: Remove deprecated min_seg_duration option
Deprecated in 01ba52852d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
6f34f03190 avformat/rtsp: Remove deprecated old options, rename stimeout->timeout
Deprecated in ff46124b0d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
252500a78f avformat/aviobuf: End grace period of allowing 0 from read_packet
See a606f27f4c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
7b6012efaa avformat/mov, movenc: Stop exporting rotation via metadata
Deprecated in ddef3d902f.

(The reference file of the mov-zombie test needed to be updated, because
a rotate metadata tag is no longer exported; the side-data is of course
still present.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
a3439de874 avformat: Remove remnants of side data merging
Deprecated in d682ae70b4,
ineffective since ca4df37f06.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
2086d635c3 avformat/hlsenc: Remove deprecated localtime options
Deprecated in fbd8746efa.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
41181bc4a0 avformat/hlsenc: Remove deprecated wrap option
Deprecated in d96ebc5ef8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
dc8e15ef15 avformat/http: Remove deprecated "user-agent" option
Deprecated in 27714b462d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
30f7021aa0 avformat: Remove deprecated filename field from AVFormatContext
Deprecated in fa8308d3d4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
704017d91e avformat: Remove getters and setters
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
119ebd642a avformat: Remove deprecated old open callbacks
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
Andreas Rheinhardt
131f2c2712 avformat: Remove FFserver leftovers
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
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
Andreas Rheinhardt
1137ddf330 avformat: Remove next API for AV(In|Out)putFormat
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:42:59 -03: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
Anton Khirnov
270ddc2baf lavf: postpone removal of FF_API_COMPUTE_PKT_FIELDS2
The infrastructure to fully handle generating timestamps e.g. for raw
video streamcopy is still not present.
2021-04-08 11:03:15 +02:00
James Almer
557953a397 avformat/utils: add helper functions to retrieve index entries from an AVStream
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-07 09:51:44 -03:00
Michael Niedermayer
c361fa9e21 Bump minor versions after release branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-03-20 01:02:11 +01:00
Michael Niedermayer
c67d2a2875 Bump Versions before release/4.4 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-03-20 01:01:12 +01:00
Andreas Rheinhardt
e318438f2f avformat: Make AVChapter.id an int64_t on next major bump
64 bits are needed in order to retain the uid values of Matroska
chapters; the type is kept signed because the semantics of NUT chapters
depend upon whether the id is > 0 or < 0.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-19 02:36:58 +01:00
Marton Balint
c281d84b20 avformat: add Changelog entry for librist and bump minor
Signed-off-by: Marton Balint <cus@passwd.hu>
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
James Almer
42e68fe015 avformat/utils: change AVStream side data related public function and struct size types to size_t
av_stream_add_side_data() already defines size as a size_t, so this makes it
consistent across all side data functions.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03: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
Andreas Rheinhardt
2ff40b98ec avformat: Deprecate AVFMT_FLAG_PRIV_OPT, remove av_demuxer_open on bump
This flag was added in 492026209b
in conjunction with av_demuxer_open() to allow to pass private
options to demuxers. It worked as follows: av_open_input_stream()
(the predecessor of avformat_open_input()) would not call the
read_header function if this flag is set. Instead the user could set
private options of the demuxer via the format's private class after
avformat_open_input() and then call av_demuxer_open() which called
the format's read_header function.

This approach was abandoned in e37f161e66
and av_demuxer_open() deprecated; instead the AVDictionary based way of
passing private options to the demuxer was choosen. Yet
AVFMT_FLAG_PRIV_OPT has never been deprecated and av_demuxer_open()
never removed. This commit implements the deprecation of the flag and
schedules av_demuxer_open for removal on the next major bump.
Given that av_demuxer_open() has been deprecated in 2012 and that this
flag is useless without it, the flag will be ignored after the next
major version bump.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-03 14:41:08 +01:00