From 35694706938ebf6e1641c2743da7b8151c2b82cd Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 16 Feb 2014 23:36:31 +0100 Subject: [PATCH 1/5] doxygen: Add a number of missing function parameter descriptions (cherry picked from commit 4d7ab5cfebef91820af2933ef2f622ea598e6b53) --- libavcodec/avcodec.h | 2 ++ libavcodec/avfft.h | 2 ++ libavformat/avformat.h | 16 ++++++++++++++++ libavformat/avio.h | 6 ++++++ 4 files changed, 26 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 54c60a91aa..244f47ba10 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4108,7 +4108,9 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height); /** * Put a string representing the codec tag codec_tag in buf. * + * @param buf buffer to place codec tag in * @param buf_size size in bytes of buf + * @param codec_tag codec tag to assign * @return the length of the string that would have been generated if * enough space had been available, excluding the trailing null */ diff --git a/libavcodec/avfft.h b/libavcodec/avfft.h index b89618258e..e2e727da9e 100644 --- a/libavcodec/avfft.h +++ b/libavcodec/avfft.h @@ -99,9 +99,11 @@ enum DCTTransformType { /** * Set up DCT. + * * @param nbits size of the input array: * (1 << nbits) for DCT-II, DCT-III and DST-I * (1 << nbits) + 1 for DCT-I + * @param type the type of transform * * @note the first element of the input of DST-I is ignored */ diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 0b8fca21a7..ec1f9c77b0 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -342,6 +342,7 @@ struct AVFormatContext; * Allocate and read the payload of a packet and initialize its * fields with default values. * + * @param s associated IO context * @param pkt packet * @param size desired payload size * @return >0 (read size) if OK, AVERROR_xxx otherwise @@ -357,6 +358,7 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size); * when there is no reasonable way to know (an upper bound of) * the final size. * + * @param s associated IO context * @param pkt packet * @param size amount of data to read * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data @@ -1269,6 +1271,7 @@ const AVClass *avformat_get_class(void); * * When muxing, should be called by the user before avformat_write_header(). * + * @param s media file handle * @param c If non-NULL, the AVCodecContext corresponding to the new stream * will be initialized to use this codec. This is needed for e.g. codec-specific * defaults to be set, so codec should be provided if it is known. @@ -1297,6 +1300,7 @@ AVInputFormat *av_find_input_format(const char *short_name); /** * Guess the file format. * + * @param pd data to be probed * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. */ @@ -1305,6 +1309,7 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); /** * Guess the file format. * + * @param pd data to be probed * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. * @param score_max A probe score larger that this is required to accept a @@ -1438,6 +1443,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt); /** * Seek to the keyframe at timestamp. * 'timestamp' in 'stream_index'. + * + * @param s media file handle * @param stream_index If stream_index is (-1), a default * stream is selected, and timestamp is automatically converted * from AV_TIME_BASE units to the stream specific time_base. @@ -1464,6 +1471,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as * keyframes (this may not be supported by all demuxers). * + * @param s media file handle * @param stream_index index of the stream which is used as time base reference * @param min_ts smallest acceptable timestamp * @param ts target timestamp @@ -1700,6 +1708,7 @@ void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, * * @param tags list of supported codec_id-codec_tag pairs, as stored * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + * @param tag codec tag to match to a codec ID */ enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag); @@ -1709,6 +1718,7 @@ enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned i * * @param tags list of supported codec_id-codec_tag pairs, as stored * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + * @param id codec ID to match to a codec tag */ unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id); @@ -1716,6 +1726,9 @@ int av_find_default_stream_index(AVFormatContext *s); /** * Get the index for a specific timestamp. + * + * @param st stream that the timestamp belongs to + * @param timestamp timestamp to retrieve the index for * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond * to the timestamp which is <= the requested one, if backward * is 0, then it will be >= @@ -1812,6 +1825,7 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size); * Return a positive value if the given filename has one of the given * extensions, 0 otherwise. * + * @param filename file name to check against the given extensions * @param extensions a comma-separated list of filename extensions */ int av_match_ext(const char *filename, const char *extensions); @@ -1819,6 +1833,8 @@ int av_match_ext(const char *filename, const char *extensions); /** * Test if the given container can store a codec. * + * @param ofmt container to check for compatibility + * @param codec_id codec to potentially store in container * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* * * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. diff --git a/libavformat/avio.h b/libavformat/avio.h index b6d3cb33b2..3360e8296e 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -318,6 +318,7 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); * * @param s Used to return the pointer to the created AVIOContext. * In case of failure the pointed to value is set to NULL. + * @param url resource to access * @param flags flags which control how the resource indicated by url * is to be opened * @return 0 in case of success, a negative value corresponding to an @@ -333,6 +334,7 @@ int avio_open(AVIOContext **s, const char *url, int flags); * * @param s Used to return the pointer to the created AVIOContext. * In case of failure the pointed to value is set to NULL. + * @param url resource to access * @param flags flags which control how the resource indicated by url * is to be opened * @param int_cb an interrupt callback to be used at the protocols level @@ -406,6 +408,8 @@ const char *avio_enum_protocols(void **opaque, int output); /** * Pause and resume playing - only meaningful if using a network streaming * protocol (e.g. MMS). + * + * @param h IO context from which to call the read_pause function pointer * @param pause 1 for pause, 0 for resume */ int avio_pause(AVIOContext *h, int pause); @@ -413,6 +417,8 @@ int avio_pause(AVIOContext *h, int pause); /** * Seek to a given timestamp relative to some component stream. * Only meaningful if using a network streaming protocol (e.g. MMS.). + * + * @param h IO context from which to call the seek function pointers * @param stream_index The stream index that the timestamp is relative to. * If stream_index is (-1) the timestamp should be in AV_TIME_BASE * units from the beginning of the presentation. From 1779cd7695ab26a5f708df6f743d4d8fe806ce7b Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 16 Feb 2014 22:09:30 +0100 Subject: [PATCH 2/5] doxygen: Replace @parblock syntax with manual linebreaks @parblock is only supported in very recent Doxygen versions. (cherry picked from commit 2f2b2efd31f6af997812a70de22b6d717fb41d4e) --- libavformat/avformat.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ec1f9c77b0..ec9c2627cb 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1543,24 +1543,22 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options); * function. * * @param s media file handle - * @param pkt @parblock - * The packet containing the data to be written. Note that unlike + * @param pkt The packet containing the data to be written. Note that unlike * av_interleaved_write_frame(), this function does not take * ownership of the packet passed to it (though some muxers may make * an internal reference to the input packet). - * + *
* This parameter can be NULL (at any time, not just at the end), in * order to immediately flush data buffered within the muxer, for * muxers that buffer up data internally before writing it to the * output. - * + *
* Packet's @ref AVPacket.stream_index "stream_index" field must be * set to the index of the corresponding stream in @ref * AVFormatContext.streams "s->streams". It is very strongly * recommended that timing information (@ref AVPacket.pts "pts", @ref * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to * correct values. - * @endparblock * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush * * @see av_interleaved_write_frame() @@ -1576,26 +1574,24 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt); * av_write_frame() instead of this function. * * @param s media file handle - * @param pkt @parblock - * The packet containing the data to be written. - * + * @param pkt The packet containing the data to be written. + *
* If the packet is reference-counted, this function will take * ownership of this reference and unreference it later when it sees * fit. * The caller must not access the data through this reference after * this function returns. If the packet is not reference-counted, * libavformat will make a copy. - * + *
* This parameter can be NULL (at any time, not just at the end), to * flush the interleaving queues. - * + *
* Packet's @ref AVPacket.stream_index "stream_index" field must be * set to the index of the corresponding stream in @ref * AVFormatContext.streams "s->streams". It is very strongly * recommended that timing information (@ref AVPacket.pts "pts", @ref * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to * correct values. - * @endparblock * * @return 0 on success, a negative AVERROR on error. Libavformat will always * take care of freeing the packet, even if this function fails. From cd6281abef6e707bfd34b2f479af400a854ab149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 7 Feb 2014 16:22:54 +0200 Subject: [PATCH 3/5] arm: Mark the stack as non-executable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If linking in an object file without this attribute set, the linker will assume that an executable stack might be needed. Signed-off-by: Martin Storsjö (cherry picked from commit 543156d7518f5e5d731123da066d86278f9fa492) --- libavutil/arm/asm.S | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S index f4523ea310..45fdf55522 100644 --- a/libavutil/arm/asm.S +++ b/libavutil/arm/asm.S @@ -53,6 +53,7 @@ .syntax unified T .thumb ELF .eabi_attribute 25, 1 @ Tag_ABI_align_preserved +ELF .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable .macro function name, export=0, align=2 .set .Lpic_idx, 0 From 33e1bca6517d60a3113e60ed40b9bd50dbf90f4b Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 18 Feb 2014 18:37:48 +0100 Subject: [PATCH 4/5] gitignore: Add all examples below doc/examples (cherry picked from commit 294a51e18ab7df4d658249361a03f0d716a4e9f0) --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 01d93b9f1f..23339508e2 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ /doc/avoptions_codec.texi /doc/avoptions_format.texi /doc/doxy/html/ +/doc/examples/avcodec +/doc/examples/metadata /doc/examples/output /doc/examples/transcode_aac /doc/print_options From 39dc4a6bb34baf833ce1e5eabad7d0dbf933237d Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 18 Feb 2014 14:30:04 +0100 Subject: [PATCH 5/5] x86: dca: Add missing multiple inclusion guards (cherry picked from commit b23bc95920e2f10b9621857e829c45b064f356c0) --- libavcodec/x86/dca.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/x86/dca.h b/libavcodec/x86/dca.h index ab175b3afa..11d45ae61c 100644 --- a/libavcodec/x86/dca.h +++ b/libavcodec/x86/dca.h @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef AVCODEC_X86_DCA_H +#define AVCODEC_X86_DCA_H + #include "config.h" #if ARCH_X86_64 && HAVE_SSE2_INLINE @@ -53,3 +56,5 @@ static inline void int8x8_fmul_int32(av_unused DCADSPContext *dsp, } #endif /* ARCH_X86_64 && HAVE_SSE2_INLINE */ + +#endif /* AVCODEC_X86_DCA_H */