Allow all struct fields to be accessed directly, as long as they're public. Before this change, many fields were "public", but could be accessed via AVOption only. This meant they were effectively not public, but were present for documentation purposes, which was incredibly confusing at best.
Showing the changes to libavformat (2 of 7 files). Show all
Unified · Split
| @@ -1649,7 +1649,7 @@ typedef struct AVFormatContext { · 1648 unmodified lines | ||
| 1649 | 1649 | /** |
| 1650 | 1650 | * Audio preload in microseconds. |
| 1651 | 1651 | * Note, not all formats support this and unpredictable things may happen if it is used when not supported. |
| 1652 | − * - encoding: Set by user via AVOptions (NO direct access) | |
| 1652 | + * - encoding: Set by user | |
| 1653 | 1653 | * - decoding: unused |
| 1654 | 1654 | */ |
| 1655 | 1655 | int audio_preload; |
| @@ -1657,7 +1657,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1657 | 1657 | /** |
| 1658 | 1658 | * Max chunk time in microseconds. |
| 1659 | 1659 | * Note, not all formats support this and unpredictable things may happen if it is used when not supported. |
| 1660 | − * - encoding: Set by user via AVOptions (NO direct access) | |
| 1660 | + * - encoding: Set by user | |
| 1661 | 1661 | * - decoding: unused |
| 1662 | 1662 | */ |
| 1663 | 1663 | int max_chunk_duration; |
| @@ -1665,7 +1665,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1665 | 1665 | /** |
| 1666 | 1666 | * Max chunk size in bytes |
| 1667 | 1667 | * Note, not all formats support this and unpredictable things may happen if it is used when not supported. |
| 1668 | − * - encoding: Set by user via AVOptions (NO direct access) | |
| 1668 | + * - encoding: Set by user | |
| 1669 | 1669 | * - decoding: unused |
| 1670 | 1670 | */ |
| 1671 | 1671 | int max_chunk_size; |
| @@ -1674,14 +1674,14 @@ typedef struct AVFormatContext { · 2 unmodified lines | ||
| 1674 | 1674 | * forces the use of wallclock timestamps as pts/dts of packets |
| 1675 | 1675 | * This has undefined results in the presence of B frames. |
| 1676 | 1676 | * - encoding: unused |
| 1677 | − * - decoding: Set by user via AVOptions (NO direct access) | |
| 1677 | + * - decoding: Set by user | |
| 1678 | 1678 | */ |
| 1679 | 1679 | int use_wallclock_as_timestamps; |
| 1680 | 1680 | |
| 1681 | 1681 | /** |
| 1682 | 1682 | * avio flags, used to force AVIO_FLAG_DIRECT. |
| 1683 | 1683 | * - encoding: unused |
| 1684 | − * - decoding: Set by user via AVOptions (NO direct access) | |
| 1684 | + * - decoding: Set by user | |
| 1685 | 1685 | */ |
| 1686 | 1686 | int avio_flags; |
| 1687 | 1687 | |
| @@ -1689,34 +1689,34 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1689 | 1689 | * The duration field can be estimated through various ways, and this field can be used |
| 1690 | 1690 | * to know how the duration was estimated. |
| 1691 | 1691 | * - encoding: unused |
| 1692 | − * - decoding: Read by user via AVOptions (NO direct access) | |
| 1692 | + * - decoding: Read by user | |
| 1693 | 1693 | */ |
| 1694 | 1694 | enum AVDurationEstimationMethod duration_estimation_method; |
| 1695 | 1695 | |
| 1696 | 1696 | /** |
| 1697 | 1697 | * Skip initial bytes when opening stream |
| 1698 | 1698 | * - encoding: unused |
| 1699 | − * - decoding: Set by user via AVOptions (NO direct access) | |
| 1699 | + * - decoding: Set by user | |
| 1700 | 1700 | */ |
| 1701 | 1701 | int64_t skip_initial_bytes; |
| 1702 | 1702 | |
| 1703 | 1703 | /** |
| 1704 | 1704 | * Correct single timestamp overflows |
| 1705 | 1705 | * - encoding: unused |
| 1706 | − * - decoding: Set by user via AVOptions (NO direct access) | |
| 1706 | + * - decoding: Set by user | |
| 1707 | 1707 | */ |
| 1708 | 1708 | unsigned int correct_ts_overflow; |
| 1709 | 1709 | |
| 1710 | 1710 | /** |
| 1711 | 1711 | * Force seeking to any (also non key) frames. |
| 1712 | 1712 | * - encoding: unused |
| 1713 | − * - decoding: Set by user via AVOptions (NO direct access) | |
| 1713 | + * - decoding: Set by user | |
| 1714 | 1714 | */ |
| 1715 | 1715 | int seek2any; |
| 1716 | 1716 | |
| 1717 | 1717 | /** |
| 1718 | 1718 | * Flush the I/O context after each packet. |
| 1719 | − * - encoding: Set by user via AVOptions (NO direct access) | |
| 1719 | + * - encoding: Set by user | |
| 1720 | 1720 | * - decoding: unused |
| 1721 | 1721 | */ |
| 1722 | 1722 | int flush_packets; |
| @@ -1726,14 +1726,14 @@ typedef struct AVFormatContext { · 3 unmodified lines | ||
| 1726 | 1726 | * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes |
| 1727 | 1727 | * the format. |
| 1728 | 1728 | * - encoding: unused |
| 1729 | − * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) | |
| 1729 | + * - decoding: set by avformat, read by user | |
| 1730 | 1730 | */ |
| 1731 | 1731 | int probe_score; |
| 1732 | 1732 | |
| 1733 | 1733 | /** |
| 1734 | 1734 | * number of bytes to read maximally to identify format. |
| 1735 | 1735 | * - encoding: unused |
| 1736 | − * - decoding: set by user through AVOPtions (NO direct access) | |
| 1736 | + * - decoding: set by user | |
| 1737 | 1737 | */ |
| 1738 | 1738 | int format_probesize; |
| 1739 | 1739 | |
| @@ -1741,7 +1741,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1741 | 1741 | * ',' separated list of allowed decoders. |
| 1742 | 1742 | * If NULL then all are allowed |
| 1743 | 1743 | * - encoding: unused |
| 1744 | − * - decoding: set by user through AVOptions (NO direct access) | |
| 1744 | + * - decoding: set by user | |
| 1745 | 1745 | */ |
| 1746 | 1746 | char *codec_whitelist; |
| 1747 | 1747 | |
| @@ -1749,7 +1749,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1749 | 1749 | * ',' separated list of allowed demuxers. |
| 1750 | 1750 | * If NULL then all are allowed |
| 1751 | 1751 | * - encoding: unused |
| 1752 | − * - decoding: set by user through AVOptions (NO direct access) | |
| 1752 | + * - decoding: set by user | |
| 1753 | 1753 | */ |
| 1754 | 1754 | char *format_whitelist; |
| 1755 | 1755 | |
| @@ -1771,7 +1771,7 @@ typedef struct AVFormatContext { · 15 unmodified lines | ||
| 1771 | 1771 | * Forced video codec. |
| 1772 | 1772 | * This allows forcing a specific decoder, even when there are multiple with |
| 1773 | 1773 | * the same codec_id. |
| 1774 | − * Demuxing: Set by user via av_format_set_video_codec (NO direct access). | |
| 1774 | + * Demuxing: Set by user | |
| 1775 | 1775 | */ |
| 1776 | 1776 | AVCodec *video_codec; |
| 1777 | 1777 | |
| @@ -1779,7 +1779,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1779 | 1779 | * Forced audio codec. |
| 1780 | 1780 | * This allows forcing a specific decoder, even when there are multiple with |
| 1781 | 1781 | * the same codec_id. |
| 1782 | − * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). | |
| 1782 | + * Demuxing: Set by user | |
| 1783 | 1783 | */ |
| 1784 | 1784 | AVCodec *audio_codec; |
| 1785 | 1785 | |
| @@ -1787,7 +1787,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1787 | 1787 | * Forced subtitle codec. |
| 1788 | 1788 | * This allows forcing a specific decoder, even when there are multiple with |
| 1789 | 1789 | * the same codec_id. |
| 1790 | − * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). | |
| 1790 | + * Demuxing: Set by user | |
| 1791 | 1791 | */ |
| 1792 | 1792 | AVCodec *subtitle_codec; |
| 1793 | 1793 | |
| @@ -1795,7 +1795,7 @@ typedef struct AVFormatContext { · 1 unmodified line | ||
| 1795 | 1795 | * Forced data codec. |
| 1796 | 1796 | * This allows forcing a specific decoder, even when there are multiple with |
| 1797 | 1797 | * the same codec_id. |
| 1798 | − * Demuxing: Set by user via av_format_set_data_codec (NO direct access). | |
| 1798 | + * Demuxing: Set by user | |
| 1799 | 1799 | */ |
| 1800 | 1800 | AVCodec *data_codec; |
| 1801 | 1801 | |
| @@ -1819,15 +1819,13 @@ typedef struct AVFormatContext { · 17 unmodified lines | ||
| 1819 | 1819 | |
| 1820 | 1820 | /** |
| 1821 | 1821 | * Output timestamp offset, in microseconds. |
| 1822 | − * Muxing: set by user via AVOptions (NO direct access) | |
| 1822 | + * Muxing: set by user | |
| 1823 | 1823 | */ |
| 1824 | 1824 | int64_t output_ts_offset; |
| 1825 | 1825 | |
| 1826 | 1826 | /** |
| 1827 | 1827 | * dump format separator. |
| 1828 | 1828 | * can be ", " or "\n " or anything else |
| 1829 | − * Code outside libavformat should access this field using AVOptions | |
| 1830 | − * (NO direct access). | |
| 1831 | 1829 | * - muxing: Set by user. |
| 1832 | 1830 | * - demuxing: Set by user. |
| 1833 | 1831 | */ |
| @@ -1864,7 +1862,7 @@ typedef struct AVFormatContext { · 30 unmodified lines | ||
| 1864 | 1862 | /** |
| 1865 | 1863 | * ',' separated list of allowed protocols. |
| 1866 | 1864 | * - encoding: unused |
| 1867 | − * - decoding: set by user through AVOptions (NO direct access) | |
| 1865 | + * - decoding: set by user | |
| 1868 | 1866 | */ |
| 1869 | 1867 | char *protocol_whitelist; |
| 1870 | 1868 | |
| @@ -1899,18 +1897,22 @@ typedef struct AVFormatContext { · 28 unmodified lines | ||
| 1899 | 1897 | /** |
| 1900 | 1898 | * ',' separated list of disallowed protocols. |
| 1901 | 1899 | * - encoding: unused |
| 1902 | − * - decoding: set by user through AVOptions (NO direct access) | |
| 1900 | + * - decoding: set by user | |
| 1903 | 1901 | */ |
| 1904 | 1902 | char *protocol_blacklist; |
| 1905 | 1903 | |
| 1906 | 1904 | /** |
| 1907 | 1905 | * The maximum number of streams. |
| 1908 | 1906 | * - encoding: unused |
| 1909 | − * - decoding: set by user through AVOptions (NO direct access) | |
| 1907 | + * - decoding: set by user | |
| 1910 | 1908 | */ |
| 1911 | 1909 | int max_streams; |
| 1912 | 1910 | } AVFormatContext; |
| 1913 | 1911 | |
| 1912 | +/** | |
| 1913 | + * Accessors for some AVFormatContext fields. These used to be provided for ABI | |
| 1914 | + * compatibility, and do not need to be used anymore. | |
| 1915 | + */ | |
| 1914 | 1916 | int av_format_get_probe_score(const AVFormatContext *s); |
| 1915 | 1917 | AVCodec * av_format_get_video_codec(const AVFormatContext *s); |
| 1916 | 1918 | void av_format_set_video_codec(AVFormatContext *s, AVCodec *c); |
| @@ -33,7 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | // Also please add any ticket numbers that you believe might be affected here |
| 34 | 34 | #define LIBAVFORMAT_VERSION_MAJOR 57 |
| 35 | 35 | #define LIBAVFORMAT_VERSION_MINOR 66 |
| 36 | −#define LIBAVFORMAT_VERSION_MICRO 102 | |
| 36 | +#define LIBAVFORMAT_VERSION_MICRO 103 | |
| 37 | 37 | |
| 38 | 38 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |
| 39 | 39 | LIBAVFORMAT_VERSION_MINOR, \ |