History

avformat/avformat: Reorder AVFormatContext fields

Move related fields closer together.

James Almer committed 2 years ago

Commit c8db1001 parent 53cdf941 file · +111 −111Browse files

Unified · Split

libavformat/avformat.h+111−111
@@ -1324,6 +1324,39 @@ typedef struct AVFormatContext { · 1323 unmodified lines
13241324 */
13251325 AVStream **streams;
13261326
1327+ /**
1328+ * Number of elements in AVFormatContext.stream_groups.
1329+ *
1330+ * Set by avformat_stream_group_create(), must not be modified by any other code.
1331+ */
1332+ unsigned int nb_stream_groups;
1333+ /**
1334+ * A list of all stream groups in the file. New groups are created with
1335+ * avformat_stream_group_create(), and filled with avformat_stream_group_add_stream().
1336+ *
1337+ * - demuxing: groups may be created by libavformat in avformat_open_input().
1338+ * If AVFMTCTX_NOHEADER is set in ctx_flags, then new groups may also
1339+ * appear in av_read_frame().
1340+ * - muxing: groups may be created by the user before avformat_write_header().
1341+ *
1342+ * Freed by libavformat in avformat_free_context().
1343+ */
1344+ AVStreamGroup **stream_groups;
1345+
1346+ /**
1347+ * Number of chapters in AVChapter array.
1348+ * When muxing, chapters are normally written in the file header,
1349+ * so nb_chapters should normally be initialized before write_header
1350+ * is called. Some muxers (e.g. mov and mkv) can also write chapters
1351+ * in the trailer. To write chapters in the trailer, nb_chapters
1352+ * must be zero when write_header is called and non-zero when
1353+ * write_trailer is called.
1354+ * - muxing: set by user
1355+ * - demuxing: set by libavformat
1356+ */
1357+ unsigned int nb_chapters;
1358+ AVChapter **chapters;
1359+
13271360 /**
13281361 * input or output URL. Unlike the old filename field, this field has no
13291362 * length restriction.
@@ -1443,36 +1476,10 @@ typedef struct AVFormatContext { · 113 unmodified lines
14431476 enum AVCodecID subtitle_codec_id;
14441477
14451478 /**
1446− * Maximum amount of memory in bytes to use for the index of each stream.
1447− * If the index exceeds this size, entries will be discarded as
1448− * needed to maintain a smaller size. This can lead to slower or less
1449− * accurate seeking (depends on demuxer).
1450− * Demuxers for which a full in-memory index is mandatory will ignore
1451− * this.
1452− * - muxing: unused
1453− * - demuxing: set by user
1454− */
1455− unsigned int max_index_size;
1456−
1457− /**
1458− * Maximum amount of memory in bytes to use for buffering frames
1459− * obtained from realtime capture devices.
1460− */
1461− unsigned int max_picture_buffer;
1462−
1463− /**
1464− * Number of chapters in AVChapter array.
1465− * When muxing, chapters are normally written in the file header,
1466− * so nb_chapters should normally be initialized before write_header
1467− * is called. Some muxers (e.g. mov and mkv) can also write chapters
1468− * in the trailer. To write chapters in the trailer, nb_chapters
1469− * must be zero when write_header is called and non-zero when
1470− * write_trailer is called.
1471− * - muxing: set by user
1472− * - demuxing: set by libavformat
1479+ * Forced Data codec_id.
1480+ * Demuxing: Set by user.
14731481 */
1474− unsigned int nb_chapters;
1475− AVChapter **chapters;
1482+ enum AVCodecID data_codec_id;
14761483
14771484 /**
14781485 * Metadata that applies to the whole file.
@@ -1528,6 +1535,31 @@ typedef struct AVFormatContext { · 49 unmodified lines
15281535 int debug;
15291536 #define FF_FDEBUG_TS 0x0001
15301537
1538+ /**
1539+ * The maximum number of streams.
1540+ * - encoding: unused
1541+ * - decoding: set by user
1542+ */
1543+ int max_streams;
1544+
1545+ /**
1546+ * Maximum amount of memory in bytes to use for the index of each stream.
1547+ * If the index exceeds this size, entries will be discarded as
1548+ * needed to maintain a smaller size. This can lead to slower or less
1549+ * accurate seeking (depends on demuxer).
1550+ * Demuxers for which a full in-memory index is mandatory will ignore
1551+ * this.
1552+ * - muxing: unused
1553+ * - demuxing: set by user
1554+ */
1555+ unsigned int max_index_size;
1556+
1557+ /**
1558+ * Maximum amount of memory in bytes to use for buffering frames
1559+ * obtained from realtime capture devices.
1560+ */
1561+ unsigned int max_picture_buffer;
1562+
15311563 /**
15321564 * Maximum buffering duration for interleaving.
15331565 *
@@ -1546,6 +1578,35 @@ typedef struct AVFormatContext { · 12 unmodified lines
15461578 */
15471579 int64_t max_interleave_delta;
15481580
1581+ /**
1582+ * Maximum number of packets to read while waiting for the first timestamp.
1583+ * Decoding only.
1584+ */
1585+ int max_ts_probe;
1586+
1587+ /**
1588+ * Max chunk time in microseconds.
1589+ * Note, not all formats support this and unpredictable things may happen if it is used when not supported.
1590+ * - encoding: Set by user
1591+ * - decoding: unused
1592+ */
1593+ int max_chunk_duration;
1594+
1595+ /**
1596+ * Max chunk size in bytes
1597+ * Note, not all formats support this and unpredictable things may happen if it is used when not supported.
1598+ * - encoding: Set by user
1599+ * - decoding: unused
1600+ */
1601+ int max_chunk_size;
1602+
1603+ /**
1604+ * Maximum number of packets that can be probed
1605+ * - encoding: unused
1606+ * - decoding: set by user
1607+ */
1608+ int max_probe_packets;
1609+
15491610 /**
15501611 * Allow non-standard and experimental extension
15511612 * @see AVCodecContext.strict_std_compliance
@@ -1572,11 +1633,6 @@ typedef struct AVFormatContext { · 20 unmodified lines
15721633 */
15731634 #define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001
15741635
1575− /**
1576− * Maximum number of packets to read while waiting for the first timestamp.
1577− * Decoding only.
1578− */
1579− int max_ts_probe;
15801636
15811637 /**
15821638 * Avoid negative timestamps during muxing.
@@ -1599,22 +1655,6 @@ typedef struct AVFormatContext { · 16 unmodified lines
15991655 */
16001656 int audio_preload;
16011657
1602− /**
1603− * Max chunk time in microseconds.
1604− * Note, not all formats support this and unpredictable things may happen if it is used when not supported.
1605− * - encoding: Set by user
1606− * - decoding: unused
1607− */
1608− int max_chunk_duration;
1609−
1610− /**
1611− * Max chunk size in bytes
1612− * Note, not all formats support this and unpredictable things may happen if it is used when not supported.
1613− * - encoding: Set by user
1614− * - decoding: unused
1615− */
1616− int max_chunk_size;
1617−
16181658 /**
16191659 * forces the use of wallclock timestamps as pts/dts of packets
16201660 * This has undefined results in the presence of B frames.
@@ -1623,6 +1663,13 @@ typedef struct AVFormatContext { · 2 unmodified lines
16231663 */
16241664 int use_wallclock_as_timestamps;
16251665
1666+ /**
1667+ * Skip duration calcuation in estimate_timings_from_pts.
1668+ * - encoding: unused
1669+ * - decoding: set by user
1670+ */
1671+ int skip_estimate_duration_from_pts;
1672+
16261673 /**
16271674 * avio flags, used to force AVIO_FLAG_DIRECT.
16281675 * - encoding: unused
@@ -1702,6 +1749,20 @@ typedef struct AVFormatContext { · 73 unmodified lines
17021749 */
17031750 char *format_whitelist;
17041751
1752+ /**
1753+ * ',' separated list of allowed protocols.
1754+ * - encoding: unused
1755+ * - decoding: set by user
1756+ */
1757+ char *protocol_whitelist;
1758+
1759+ /**
1760+ * ',' separated list of disallowed protocols.
1761+ * - encoding: unused
1762+ * - decoding: set by user
1763+ */
1764+ char *protocol_blacklist;
1765+
17051766 /**
17061767 * IO repositioned flag.
17071768 * This is set by avformat when the underlaying IO context read pointer
@@ -1774,19 +1835,6 @@ typedef struct AVFormatContext { · 66 unmodified lines
17741835 */
17751836 uint8_t *dump_separator;
17761837
1777− /**
1778− * Forced Data codec_id.
1779− * Demuxing: Set by user.
1780− */
1781− enum AVCodecID data_codec_id;
1782−
1783− /**
1784− * ',' separated list of allowed protocols.
1785− * - encoding: unused
1786− * - decoding: set by user
1787− */
1788− char *protocol_whitelist;
1789−
17901838 /**
17911839 * A callback for opening new IO streams.
17921840 *
@@ -1810,34 +1858,6 @@ typedef struct AVFormatContext { · 17 unmodified lines
18101858 int (*io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url,
18111859 int flags, AVDictionary **options);
18121860
1813− /**
1814− * ',' separated list of disallowed protocols.
1815− * - encoding: unused
1816− * - decoding: set by user
1817− */
1818− char *protocol_blacklist;
1819−
1820− /**
1821− * The maximum number of streams.
1822− * - encoding: unused
1823− * - decoding: set by user
1824− */
1825− int max_streams;
1826−
1827− /**
1828− * Skip duration calcuation in estimate_timings_from_pts.
1829− * - encoding: unused
1830− * - decoding: set by user
1831− */
1832− int skip_estimate_duration_from_pts;
1833−
1834− /**
1835− * Maximum number of packets that can be probed
1836− * - encoding: unused
1837− * - decoding: set by user
1838− */
1839− int max_probe_packets;
1840−
18411861 /**
18421862 * A callback for closing the streams opened with AVFormatContext.io_open().
18431863 *
@@ -1850,26 +1870,6 @@ typedef struct AVFormatContext { · 6 unmodified lines
18501870 * @return 0 on success, a negative AVERROR code on failure
18511871 */
18521872 int (*io_close2)(struct AVFormatContext *s, AVIOContext *pb);
1853−
1854− /**
1855− * Number of elements in AVFormatContext.stream_groups.
1856− *
1857− * Set by avformat_stream_group_create(), must not be modified by any other code.
1858− */
1859− unsigned int nb_stream_groups;
1860−
1861− /**
1862− * A list of all stream groups in the file. New groups are created with
1863− * avformat_stream_group_create(), and filled with avformat_stream_group_add_stream().
1864− *
1865− * - demuxing: groups may be created by libavformat in avformat_open_input().
1866− * If AVFMTCTX_NOHEADER is set in ctx_flags, then new groups may also
1867− * appear in av_read_frame().
1868− * - muxing: groups may be created by the user before avformat_write_header().
1869− *
1870− * Freed by libavformat in avformat_free_context().
1871− */
1872− AVStreamGroup **stream_groups;
18731873 } AVFormatContext;
18741874
18751875 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t