Commit Graph

30 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 4a4dcde339 avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.h
and rename it to FF_INFMT_INIT_CLEANUP. This flag is demuxer-only,
so this is the more appropriate place for it.
This does not preclude adding internal flags common to both
demuxer and muxer in the future.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-26 06:36: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
James Almer d6799ee0e4 avformat: remove deprecated FF_API_AVFORMAT_IO_CLOSE
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-07 08:53:30 -03:00
Anton Khirnov 08bebeb1be Revert "all: Don't set AVClass.item_name to its default value"
Some callers assume that item_name is always set, so this may be
considered an API break.

This reverts commit 0c6203c97a.
2024-01-20 10:34:48 +01:00
Andreas Rheinhardt 0c6203c97a all: Don't set AVClass.item_name to its default value
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-22 15:12:33 +01:00
Pierre-Anthony Lemieux 0f2f0dd5b4
avformat/imf: clean-up logging
* remove logging to NULL
 * remove extraneous logging
2023-05-31 09:03:58 -07:00
Pierre-Anthony Lemieux 15de355e62
avformat/imfdec: remove the experimental flag
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-02-21 19:38:53 -08:00
Marton Balint 927042b409 avformat: deprecate AVFormatContext io_close callback
io_close2 should be used instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-02-16 01:18:45 +01:00
Pierre-Anthony Lemieux 94922f6cab
avformat/imfdec: use CPL start timecode if available
The IMF CPL contains an optional timecode start address. This patch reads the
latter, if present, into the context's timecode metadata parameter.
This addresses https://trac.ffmpeg.org/ticket/9842.
2022-11-03 21:16:03 +10:00
Pierre-Anthony Lemieux 0e402ebf48
format/imfdec: improve error handling when selecting tracks for playback
Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
2022-09-28 11:54:52 +10:00
Pierre-Anthony Lemieux 6e91d405be avformat/imfdec: check if Asset/Id exists before trying to read it
Fixes Coverity issue #1512406

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-07 17:16:02 +02:00
Pierre-Anthony Lemieux d5b46fa07d avformat/imfdec: preserve stream information
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-12 18:55:00 +02:00
Pierre-Anthony Lemieux 751549af9b
avformat/imf: refactor to use avutil/uuid 2022-06-12 18:34:37 +10:00
Andreas Rheinhardt 35ec5c819b avformat/demux: Add new demux.h header
And move those stuff already in demuxer-only files to it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 07:37:38 +02:00
Pierre-Anthony Lemieux f409c78517
avformat/imf: refactor to use ff_rescale_interval()
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-03-19 21:34:06 +10:00
Pierre-Anthony Lemieux 22e1175e39
avformat/imf: clean-up and reduce logging
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-03-19 21:33:58 +10:00
Pierre-Anthony Lemieux 32b9f5ac2f
avformat/imf: add support for input seeking
The IMF demuxer did not implement AVInputFormat::read_seek2(), resulting in
inefficient input seeking.

Addresses https://trac.ffmpeg.org/ticket/9648

Byte- and frame-seeking are not supported.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-03-19 21:33:55 +10:00
Pierre-Anthony Lemieux 9ca4d80d6b
avformat/imf: relocate static function imf_time_to_ts()
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-03-19 21:33:48 +10:00
Andreas Rheinhardt 814f806e06 avformat/imfdec: Convert to the new channel layout API
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-17 15:05:20 +01:00
Pierre-Anthony Lemieux 12139d1103
avformat/imf: document IMFVirtualTrackResourcePlaybackCtx 2022-02-20 18:32:09 +10:00
Pierre-Anthony Lemieux b0193e26ca
avformat/imf: fix packet pts, dts and muxing
The IMF demuxer does not set the DTS and PTS of packets accurately in all
scenarios. Moreover, audio packets are not trimmed when they exceed the
duration of the underlying resource.

imf-cpl-with-repeat FATE ref file is regenerated.

Addresses https://trac.ffmpeg.org/ticket/9611
2022-02-20 18:32:09 +10:00
Pierre-Anthony Lemieux ef0d5245d6
avformat/imf: open resources only when first needed
IMF CPLs can reference thousands of files, which can result in system limits
for the number of open files to be exceeded. The following patch opens and
closes files as needed.

Addresses https://trac.ffmpeg.org/ticket/9623
2022-02-20 18:25:42 +10:00
Zane van Iperen 40766ae1da
avformat/imf: cosmetics
s/++i/i++/g

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-02-05 22:52:46 +10:00
Andreas Rheinhardt b7a543707f avformat/imfdec: Use proper logcontext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-19 16:50:46 +01:00
Marton Balint ae690d5cf5 avformat/imfdec: do not use filesize when reading XML file
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-01-09 18:44:26 +01:00
Pierre-Anthony Lemieux 59f1a46048
avformat/imf: fix bad free() when directory name of the input url is empty
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-01-05 21:19:34 +10:00
Pierre-Anthony Lemieux 4c03928f4d
avformat/imf: Fix error handling in set_context_streams_from_tracks()
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-01-04 19:07:32 +10:00
Anton Khirnov 70f318e6b6 lavf/imfdec: mark as experimental
People have expressed concerns about its safety, so prevent it from
being auto-selected without explicit user indication.
2022-01-03 20:38:35 +01: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