History

avcodec, avutil, avformat: remove AVOption requirement for some fields

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.

wm4 committed 9 years ago

Commit 554bc4e1 parent 37330397 files · +42 −76Browse files

Showing the changes to libavformat (2 of 7 files). Show all

Unified · Split

2 files
  1. libavformat/avformat.h +26 −24
  2. libavformat/version.h +1 −1
libavformat/avformat.h+26−24
@@ -1649,7 +1649,7 @@ typedef struct AVFormatContext { · 1648 unmodified lines
16491649 /**
16501650 * Audio preload in microseconds.
16511651 * 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
16531653 * - decoding: unused
16541654 */
16551655 int audio_preload;
@@ -1657,7 +1657,7 @@ typedef struct AVFormatContext { · 1 unmodified line
16571657 /**
16581658 * Max chunk time in microseconds.
16591659 * 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
16611661 * - decoding: unused
16621662 */
16631663 int max_chunk_duration;
@@ -1665,7 +1665,7 @@ typedef struct AVFormatContext { · 1 unmodified line
16651665 /**
16661666 * Max chunk size in bytes
16671667 * 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
16691669 * - decoding: unused
16701670 */
16711671 int max_chunk_size;
@@ -1674,14 +1674,14 @@ typedef struct AVFormatContext { · 2 unmodified lines
16741674 * forces the use of wallclock timestamps as pts/dts of packets
16751675 * This has undefined results in the presence of B frames.
16761676 * - encoding: unused
1677− * - decoding: Set by user via AVOptions (NO direct access)
1677+ * - decoding: Set by user
16781678 */
16791679 int use_wallclock_as_timestamps;
16801680
16811681 /**
16821682 * avio flags, used to force AVIO_FLAG_DIRECT.
16831683 * - encoding: unused
1684− * - decoding: Set by user via AVOptions (NO direct access)
1684+ * - decoding: Set by user
16851685 */
16861686 int avio_flags;
16871687
@@ -1689,34 +1689,34 @@ typedef struct AVFormatContext { · 1 unmodified line
16891689 * The duration field can be estimated through various ways, and this field can be used
16901690 * to know how the duration was estimated.
16911691 * - encoding: unused
1692− * - decoding: Read by user via AVOptions (NO direct access)
1692+ * - decoding: Read by user
16931693 */
16941694 enum AVDurationEstimationMethod duration_estimation_method;
16951695
16961696 /**
16971697 * Skip initial bytes when opening stream
16981698 * - encoding: unused
1699− * - decoding: Set by user via AVOptions (NO direct access)
1699+ * - decoding: Set by user
17001700 */
17011701 int64_t skip_initial_bytes;
17021702
17031703 /**
17041704 * Correct single timestamp overflows
17051705 * - encoding: unused
1706− * - decoding: Set by user via AVOptions (NO direct access)
1706+ * - decoding: Set by user
17071707 */
17081708 unsigned int correct_ts_overflow;
17091709
17101710 /**
17111711 * Force seeking to any (also non key) frames.
17121712 * - encoding: unused
1713− * - decoding: Set by user via AVOptions (NO direct access)
1713+ * - decoding: Set by user
17141714 */
17151715 int seek2any;
17161716
17171717 /**
17181718 * Flush the I/O context after each packet.
1719− * - encoding: Set by user via AVOptions (NO direct access)
1719+ * - encoding: Set by user
17201720 * - decoding: unused
17211721 */
17221722 int flush_packets;
@@ -1726,14 +1726,14 @@ typedef struct AVFormatContext { · 3 unmodified lines
17261726 * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes
17271727 * the format.
17281728 * - 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
17301730 */
17311731 int probe_score;
17321732
17331733 /**
17341734 * number of bytes to read maximally to identify format.
17351735 * - encoding: unused
1736− * - decoding: set by user through AVOPtions (NO direct access)
1736+ * - decoding: set by user
17371737 */
17381738 int format_probesize;
17391739
@@ -1741,7 +1741,7 @@ typedef struct AVFormatContext { · 1 unmodified line
17411741 * ',' separated list of allowed decoders.
17421742 * If NULL then all are allowed
17431743 * - encoding: unused
1744− * - decoding: set by user through AVOptions (NO direct access)
1744+ * - decoding: set by user
17451745 */
17461746 char *codec_whitelist;
17471747
@@ -1749,7 +1749,7 @@ typedef struct AVFormatContext { · 1 unmodified line
17491749 * ',' separated list of allowed demuxers.
17501750 * If NULL then all are allowed
17511751 * - encoding: unused
1752− * - decoding: set by user through AVOptions (NO direct access)
1752+ * - decoding: set by user
17531753 */
17541754 char *format_whitelist;
17551755
@@ -1771,7 +1771,7 @@ typedef struct AVFormatContext { · 15 unmodified lines
17711771 * Forced video codec.
17721772 * This allows forcing a specific decoder, even when there are multiple with
17731773 * the same codec_id.
1774− * Demuxing: Set by user via av_format_set_video_codec (NO direct access).
1774+ * Demuxing: Set by user
17751775 */
17761776 AVCodec *video_codec;
17771777
@@ -1779,7 +1779,7 @@ typedef struct AVFormatContext { · 1 unmodified line
17791779 * Forced audio codec.
17801780 * This allows forcing a specific decoder, even when there are multiple with
17811781 * the same codec_id.
1782− * Demuxing: Set by user via av_format_set_audio_codec (NO direct access).
1782+ * Demuxing: Set by user
17831783 */
17841784 AVCodec *audio_codec;
17851785
@@ -1787,7 +1787,7 @@ typedef struct AVFormatContext { · 1 unmodified line
17871787 * Forced subtitle codec.
17881788 * This allows forcing a specific decoder, even when there are multiple with
17891789 * the same codec_id.
1790− * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).
1790+ * Demuxing: Set by user
17911791 */
17921792 AVCodec *subtitle_codec;
17931793
@@ -1795,7 +1795,7 @@ typedef struct AVFormatContext { · 1 unmodified line
17951795 * Forced data codec.
17961796 * This allows forcing a specific decoder, even when there are multiple with
17971797 * the same codec_id.
1798− * Demuxing: Set by user via av_format_set_data_codec (NO direct access).
1798+ * Demuxing: Set by user
17991799 */
18001800 AVCodec *data_codec;
18011801
@@ -1819,15 +1819,13 @@ typedef struct AVFormatContext { · 17 unmodified lines
18191819
18201820 /**
18211821 * Output timestamp offset, in microseconds.
1822− * Muxing: set by user via AVOptions (NO direct access)
1822+ * Muxing: set by user
18231823 */
18241824 int64_t output_ts_offset;
18251825
18261826 /**
18271827 * dump format separator.
18281828 * can be ", " or "\n " or anything else
1829− * Code outside libavformat should access this field using AVOptions
1830− * (NO direct access).
18311829 * - muxing: Set by user.
18321830 * - demuxing: Set by user.
18331831 */
@@ -1864,7 +1862,7 @@ typedef struct AVFormatContext { · 30 unmodified lines
18641862 /**
18651863 * ',' separated list of allowed protocols.
18661864 * - encoding: unused
1867− * - decoding: set by user through AVOptions (NO direct access)
1865+ * - decoding: set by user
18681866 */
18691867 char *protocol_whitelist;
18701868
@@ -1899,18 +1897,22 @@ typedef struct AVFormatContext { · 28 unmodified lines
18991897 /**
19001898 * ',' separated list of disallowed protocols.
19011899 * - encoding: unused
1902− * - decoding: set by user through AVOptions (NO direct access)
1900+ * - decoding: set by user
19031901 */
19041902 char *protocol_blacklist;
19051903
19061904 /**
19071905 * The maximum number of streams.
19081906 * - encoding: unused
1909− * - decoding: set by user through AVOptions (NO direct access)
1907+ * - decoding: set by user
19101908 */
19111909 int max_streams;
19121910 } AVFormatContext;
19131911
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+ */
19141916 int av_format_get_probe_score(const AVFormatContext *s);
19151917 AVCodec * av_format_get_video_codec(const AVFormatContext *s);
19161918 void av_format_set_video_codec(AVFormatContext *s, AVCodec *c);
libavformat/version.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 // Also please add any ticket numbers that you believe might be affected here
3434 #define LIBAVFORMAT_VERSION_MAJOR 57
3535 #define LIBAVFORMAT_VERSION_MINOR 66
36−#define LIBAVFORMAT_VERSION_MICRO 102
36+#define LIBAVFORMAT_VERSION_MICRO 103
3737
3838 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3939 LIBAVFORMAT_VERSION_MINOR, \

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