Commit Graph

99 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
James Almer 65ddc74988 avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-07 08:53:30 -03:00
James Almer 25a10677d1 avformat: add a Tile Grid stream group type
This will be used to support tiled image formats like HEIF.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-26 12:21:12 -03:00
Andreas Rheinhardt 568645f087 avformat/dump: Fix use of undeclared variables
Broken in ec2036454b.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-13 14:17:38 +01:00
James Almer ec2036454b avformat: add a disposition field to AVStreamGroup
The existing (and upcoming) available group types are meant to combine several
streams for presentation, with the result being treated as if it was a stream
itself.
For example, a file could export two stream groups of the same type with one of
them as the "default".

Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-13 09:51:28 -03:00
Andreas Rheinhardt 569ad285a5 avformat/options: Only allocate AVCodecContext for demuxers
The muxer's AVCodecContext is currently used for exactly one thing:
To store a time base in it that has been derived via heuristics
in avformat_transfer_internal_stream_timing_info(); said time base
can then be read back via av_stream_get_codec_timebase().
But one does not need a whole AVCodecContext for that, a simple
AVRational is enough.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-07 10:22:18 +01:00
Damiano Galassi 112d3618ca avformat/mov: add support for 'amve' ambient viewing environment box
As defined in ISOBMFF (ISO/IEC 14496-12) document.

Co-Authored-By: Cosmin Stejerean <cosmin@cosmin.at>
2024-02-04 13:36:25 -03:00
James Almer 6c4388b468 avformat/dump: be less verbose when printing streams within a group
Signed-off-by: James Almer <jamrial@gmail.com>
2024-01-20 09:21:46 -03:00
James Almer 556b596d1d avformat: introduce AVStreamGroup
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-18 15:18:05 -03:00
James Almer 5432d2aaca avformat/avformat: use the side data from AVStream.codecpar
Deprecate AVStream.side_data and its helpers in favor of the AVStream's
codecpar.coded_side_data.

This will considerably simplify the propagation of global side data to decoders
and from encoders. Instead of having to do it inside packets, it will be
available during init().
Global and frame specific side data will therefore be distinct.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:03:57 -03:00
Marvin Scholz 2b5391b88f avformat/dump: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Andreas Rheinhardt 2b41463b87 avformat/internal: Don't include avcodec.h
The general demuxing API uses parsers and decoders. Therefore
FFStream contains pointers to AVCodecContexts and
AVCodecParserContext and lavf/internal.h includes lavc/avcodec.h.

Yet actually only a few files files really use these; and it is best
when this number stays small. Therefore this commit uses opaque
structs in lavf/internal.h for these contexts and stops including
avcodec.h.
This also avoids including lavc/codec_desc.h implicitly. All other
headers are implicitly included as now (mostly through codec.h).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-26 03:02:50 +02:00
Andreas Rheinhardt 62af385b91 avformat/dump: Avoid unnecessary implicit calculation of strlen
av_strlcpy() returns the length of the src string to enable
the caller to check for truncation. It is currently used in
the following way in dump_metadata(): Every metadata value
is searched for \b, \n, \v, \f, \r and then the data up to
the first of these characters found is copied to a small
temporary buffer via av_strlcpy() (but of course not more
than fits into said buffer) and then printed; all characters up
to the character found earlier are then treated as consumed.

But this is bad performance-wise if the while string is big
and contains many of these characters, because av_strlcpy()
will unnecessarily calculate the length of the whole remaining string.
(dump_metadata() actually ignored the return value of av_strlcpy().)

Fix this by not copying the data to a temporary buffer at all.
Instead just use %.*s to bound the number of characters output.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-14 15:03:59 +02:00
Vittorio Giovara b2d6e7a289 lavf: Add non diegetic stream disposition flag
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:46 -03:00
Anton Khirnov 09b5d3fb44 lavc: deprecate channel count/layout changing side data
They are incompatible with the new channel layout scheme and no decoder
uses them.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Andreas Rheinhardt 40bdd8cc05 avformat: Avoid allocation for AVStreamInternal
Do this by allocating AVStream together with the data that is
currently in AVStreamInternal; or rather: Put AVStream at the
beginning of a new structure called FFStream (which encompasses
more than just the internal fields and is a proper context in its own
right, hence the name) and remove AVStreamInternal altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17 13:22:25 +02:00
James Almer 7489f63281 avformat: move AVStream.codec_info_nb_frames to AVStreamInternal
It's a private field, no reason to have it exposed in a public header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 09:27:21 -03:00
Andreas Rheinhardt 4796ec5d4e avformat/dump: Remove remnants of codec timebase
Fixes Coverity issue #1477414.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-30 10:21:29 +02: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 ef6a9e5e31 avutil/buffer: Switch AVBuffer API to size_t
Announced in 14040a1d91.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt f0c7fa2c48 avcodec: Switch AVCPBProperties to 64bits
Announced in 2e8b0446c6.
Two FATE-tests needed to be updated because the checksums of
side data containing an AVCPBProperties struct changed.

buffer_size has also been switched to 64bits because it is a bitsize.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:07 -03:00
Anton Khirnov b7251aed46 av_dump_format(): reduce indentation for streams
Makes it easier to identify where metadata/chapters end and streams
begin.
2021-02-03 10:41:33 +01:00
Anton Khirnov 3696c3b161 av_dump_format(): increase indentation for chapter metadata
It should be at a deeper level than the chapter it belongs to.
2021-02-03 10:41:29 +01:00
Anton Khirnov 80aad8886a av_dump_format: add a heading for chapters
Otherwise the chapters look like a part of the metadata section.
2021-02-03 10:41:20 +01:00
Marton Balint 9b434bea75 avformat: use av_timecode_make_smpte_tc_string2
WSD format has no frames stored for playback time.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Limin Wang 448a9aaa78 API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-07-15 05:47:14 +08:00
Limin Wang af5751940e avformat/dump: add a \n for end of ERROR log
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-07-02 21:12:37 +08:00
Andreas Rheinhardt e365076c10 avformat/dump: Use intermediate pointer for access to programs array
Improves readability.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-30 17:11:12 +02:00
Andreas Rheinhardt 0179ef7eac avformat/dump: Use const where appropriate
Also switch to using a pointer to access stream side data instead of
copying the stream's AVPacketSideData.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-30 16:45:35 +02:00
Anton Khirnov 202e06870e lavf/dump: schedule use of deprecated API for removal 2020-06-10 11:35:17 +02:00
Derek Buitenhuis 5d9ce445ef avformat/dump: Use int64_t for intermediate time values
Prevents wrap-around to negative values while calculating the duration string.

Before:

    Duration: -411422:-59:-42.17, start: 0.000000, bitrate: 0 kb/s

After:

    Duration: 781623:28:34.17, start: 0.000000, bitrate: 0 kb/s

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-05-17 13:03:30 +01:00
Jun Zhao 446dac9ccf lavf/dump: dump DOVI side data
dump DOVI side data.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-04-23 08:05:56 +08:00
vectronic 05d27f342b API: add AV_PKT_DATA_ICC_PROFILE to AVPacketSideDataType
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2020-03-10 15:10:06 +00:00
Limin Wang ffd65c8862 lavf/dump: dump the vbv_delay with N/A instead of 18446744073709551615
How to check it:
./ffmpeg -f lavfi -i testsrc  -c:v mpeg2video  -f null  -
master:
  Side data:
        cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay:
        18446744073709551615
patch applied:
Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-28 18:18:41 +02:00
Limin Wang df6e341b04 lavf/dump: use error log level for invalid size
Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-08-18 08:17:57 +08:00
Carl Eugen Hoyos 098ed8a73e lavf/dump: Fix cpb bitrate type after next major bump. 2019-08-10 23:46:53 +02:00
Carl Eugen Hoyos 6711419569 lavf/dump: Fix vbv_delay type specifier.
Spotted-by: James Almer
2019-08-10 23:33:10 +02:00
Jun Zhao be1643be31 lavf/dump: More disposition flag dump
More disposition flag dump

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-03 10:35:16 +08:00
Carl Eugen Hoyos feb05ffa99 lavf/dump: Fix a typo: comentary -> commentary.
Fixes ticket #7499.
2018-10-19 20:19:25 +02:00
Aman Gupta 5dfeb7f081 avformat/mpegts: tag video streams with still images
Parses the video_stream_descriptor (H.222 2.6.2) to look
for the still_picture_flag. This is exposed to the user
via a new AV_DISPOSITION_STILL_IMAGE.

See for example https://tmm1.s3.amazonaws.com/music-choice.ts,
whose video stream only updates every ~6 seconds.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-17 12:03:22 -07:00
Aman Gupta 4f40d64e00 avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audio
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-02-23 13:47:29 -08:00
Aman Gupta 61ecfbc32a avformat/dump: tag AV_DISPOSITION_DESCRIPTIONS streams
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-02-23 13:47:29 -08:00
Carl Eugen Hoyos 9b79c65ec0 lavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT. 2017-12-17 18:05:42 +01:00
Carl Eugen Hoyos d4fbe99dab lavf/dump: Remove superfluous cast. 2017-08-29 01:33:47 +02:00
Steve Lhomme f4cee500e9 avformat/dump : Display Content Light Level metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-06 11:40:31 -03:00
James Almer 2efb70c379 avformat/dump: use av_spherical_projection_name() to print spherical projection names
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-31 13:27:04 -03:00
Clément Bœsch 549045254c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
Vittorio Giovara f20bcec4c2 spherical: Change types of bounding and pad to uint32_t
These values are defined to be 32bit in the specification,
so it makes more sense to store them as fixed width.

Based on a patch by Micahel Niedermayer <michael@niedermayer.cc>.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-17 13:12:25 -04:00
Vittorio Giovara 1b7ffddb3a spherical: Add tiled equirectangular type and projection-specific properties
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-07 11:19:37 -05:00
Vittorio Giovara e7a6f8c972 lavc: Add spherical packet side data API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:40:06 -05:00