Updated FFmpeg to n5.2-dev-1305-g3bd0bf76fb

Among other things, fixes CVE-2022-2566.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
main
Christopher Snowhill 2022-10-17 03:55:39 -07:00
parent 54f46d6380
commit b5e096180a
57 changed files with 602 additions and 244 deletions

View File

@ -231,6 +231,16 @@ typedef struct RcOverride{
* decoded frame in stream.
*/
#define AV_CODEC_FLAG_DROPCHANGED (1 << 5)
/**
* Request the encoder to output reconstructed frames, i.e. frames that would be
* produced by decoding the encoded bistream. These frames may be retrieved by
* calling avcodec_receive_frame() immediately after a successful call to
* avcodec_receive_packet().
*
* Should only be used with encoders flagged with the
* AV_CODEC_CAP_ENCODER_RECON_FRAME capability.
*/
#define AV_CODEC_FLAG_RECON_FRAME (1 << 6)
/**
* Use internal 2pass ratecontrol in first pass mode.
*/
@ -331,13 +341,12 @@ typedef struct RcOverride{
* Do not reset ASS ReadOrder field on flush (subtitles decoding)
*/
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30)
/* Unsupported options :
* Syntax Arithmetic coding (SAC)
* Reference Picture Selection
* Independent Segment Decoding */
/* /Fx */
/* codec capabilities */
/**
* Generate/parse ICC profiles on encode/decode, as appropriate for the type of
* file. No effect on codecs which cannot contain embedded ICC profiles, or
* when compiled without support for lcms2.
*/
#define AV_CODEC_FLAG2_ICC_PROFILES (1U << 31)
/* Exported side data.
These flags can be passed in AVCodecContext.export_side_data before initialization.
@ -1296,13 +1305,9 @@ typedef struct AVCodecContext {
* unofficial and experimental (that is, they always try to decode things
* when they can) unless they are explicitly asked to behave stupidly
* (=strictly conform to the specs)
* This may only be set to one of the FF_COMPLIANCE_* values in defs.h.
*/
int strict_std_compliance;
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
#define FF_COMPLIANCE_NORMAL 0
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
/**
* error concealment flags
@ -1338,28 +1343,13 @@ typedef struct AVCodecContext {
/**
* Error recognition; may misdetect some more or less valid parts as errors.
* This is a bitfield of the AV_EF_* values defined in defs.h.
*
* - encoding: Set by user.
* - decoding: Set by user.
*/
int err_recognition;
/**
* Verify checksums embedded in the bitstream (could be of either encoded or
* decoded data, depending on the codec) and print an error message on mismatch.
* If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
* decoder returning an error.
*/
#define AV_EF_CRCCHECK (1<<0)
#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder should not do as an error
/**
* opaque 64-bit number (generally a PTS) that will be reordered and
* output in AVFrame.reordered_opaque
@ -1379,13 +1369,26 @@ typedef struct AVCodecContext {
const struct AVHWAccel *hwaccel;
/**
* Hardware accelerator context.
* For some hardware accelerators, a global context needs to be
* provided by the user. In that case, this holds display-dependent
* data FFmpeg cannot instantiate itself. Please refer to the
* FFmpeg HW accelerator documentation to know how to fill this.
* - encoding: unused
* - decoding: Set by user
* Legacy hardware accelerator context.
*
* For some hardware acceleration methods, the caller may use this field to
* signal hwaccel-specific data to the codec. The struct pointed to by this
* pointer is hwaccel-dependent and defined in the respective header. Please
* refer to the FFmpeg HW accelerator documentation to know how to fill
* this.
*
* In most cases this field is optional - the necessary information may also
* be provided to libavcodec through @ref hw_frames_ctx or @ref
* hw_device_ctx (see avcodec_get_hw_config()). However, in some cases it
* may be the only method of signalling some (optional) information.
*
* The struct and its contents are owned by the caller.
*
* - encoding: May be set by the caller before avcodec_open2(). Must remain
* valid until avcodec_free_context().
* - decoding: May be set by the caller in the get_format() callback.
* Must remain valid until the next get_format() call,
* or avcodec_free_context() (whichever comes first).
*/
void *hwaccel_context;
@ -1496,7 +1499,7 @@ typedef struct AVCodecContext {
* libavcodec will behave as if this field was always set to 1.
* Callers that want to be forward compatible with future libavcodec
* versions should wrap access to this field in
* #if LIBAVCODEC_VERSION_MAJOR < 60
* `#if LIBAVCODEC_VERSION_MAJOR < 60`
*/
attribute_deprecated
int thread_safe_callbacks;
@ -1518,7 +1521,6 @@ typedef struct AVCodecContext {
* It will return only after finishing all tasks.
* The user may replace this with some multithreaded implementation,
* the default implementation will execute the parts serially.
* Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
* @param c context passed also to func
* @param count the number of things to execute
* @param arg2 argument passed unchanged to func
@ -2494,6 +2496,7 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[AV_NUM_DATA_POINTERS]);
#ifdef FF_API_AVCODEC_CHROMA_POS
/**
* Converts AVChromaLocation to swscale x/y chroma position.
*
@ -2502,7 +2505,9 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*
* @param xpos horizontal chroma sample position
* @param ypos vertical chroma sample position
* @deprecated Use av_chroma_location_enum_to_pos() instead.
*/
attribute_deprecated
int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
/**
@ -2513,8 +2518,11 @@ int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
*
* @param xpos horizontal chroma sample position
* @param ypos vertical chroma sample position
* @deprecated Use av_chroma_location_pos_to_enum() instead.
*/
attribute_deprecated
enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
#endif
/**
* Decode a subtitle message.
@ -2596,21 +2604,23 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);
/**
* Return decoded output data from a decoder.
* Return decoded output data from a decoder or encoder (when the
* AV_CODEC_FLAG_RECON_FRAME flag is used).
*
* @param avctx codec context
* @param frame This will be set to a reference-counted video or audio
* frame (depending on the decoder type) allocated by the
* decoder. Note that the function will always call
* codec. Note that the function will always call
* av_frame_unref(frame) before doing anything else.
*
* @return
* 0: success, a frame was returned
* AVERROR(EAGAIN): output is not available in this state - user must try
* to send new input
* AVERROR_EOF: the decoder has been fully flushed, and there will be
* AVERROR_EOF: the codec has been fully flushed, and there will be
* no more output frames
* AVERROR(EINVAL): codec not opened, or it is an encoder
* AVERROR(EINVAL): codec not opened, or it is an encoder without
* the AV_CODEC_FLAG_RECON_FRAME flag enabled
* AVERROR_INPUT_CHANGED: current decoded frame has changed parameters
* with respect to first decoded frame. Applicable
* when flag AV_CODEC_FLAG_DROPCHANGED is set.
@ -2781,10 +2791,10 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx,
*/
enum AVPictureStructure {
AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown
AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field
AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
AV_PICTURE_STRUCTURE_FRAME, //< coded as frame
AV_PICTURE_STRUCTURE_UNKNOWN, ///< unknown
AV_PICTURE_STRUCTURE_TOP_FIELD, ///< coded as top field
AV_PICTURE_STRUCTURE_BOTTOM_FIELD, ///< coded as bottom field
AV_PICTURE_STRUCTURE_FRAME, ///< coded as frame
};
typedef struct AVCodecParserContext {

View File

@ -164,6 +164,8 @@ int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx);
/**
* Prepare the filter for use, after all the parameters and options have been
* set.
*
* @param ctx a AVBSFContext previously allocated with av_bsf_alloc()
*/
int av_bsf_init(AVBSFContext *ctx);
@ -174,6 +176,7 @@ int av_bsf_init(AVBSFContext *ctx);
* av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or
* AVERROR_EOF.
*
* @param ctx an initialized AVBSFContext
* @param pkt the packet to filter. The bitstream filter will take ownership of
* the packet and reset the contents of pkt. pkt is not touched if an error occurs.
* If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero),
@ -192,6 +195,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);
/**
* Retrieve a filtered packet.
*
* @param ctx an initialized AVBSFContext
* @param[out] pkt this struct will be filled with the contents of the filtered
* packet. It is owned by the caller and must be freed using
* av_packet_unref() when it is no longer needed.

View File

@ -182,6 +182,14 @@
*/
#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
/**
* The encoder is able to output reconstructed frame data, i.e. raw frames that
* would be produced by decoding the encoded bitstream.
*
* Reconstructed frame output is enabled by the AV_CODEC_FLAG_RECON_FRAME flag.
*/
#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22)
/**
* AVProfile.
*/

View File

@ -24,6 +24,8 @@
#include "libavutil/avutil.h"
#include "libavutil/samplefmt.h"
#include "version_major.h"
/**
* @addtogroup lavc_core
* @{
@ -251,7 +253,9 @@ enum AVCodecID {
AV_CODEC_ID_AVRP,
AV_CODEC_ID_012V,
AV_CODEC_ID_AVUI,
#if FF_API_AYUV_CODECID
AV_CODEC_ID_AYUV,
#endif
AV_CODEC_ID_TARGA_Y216,
AV_CODEC_ID_V308,
AV_CODEC_ID_V408,
@ -311,6 +315,10 @@ enum AVCodecID {
AV_CODEC_ID_VBN,
AV_CODEC_ID_JPEGXL,
AV_CODEC_ID_QOI,
AV_CODEC_ID_PHM,
AV_CODEC_ID_RADIANCE_HDR,
AV_CODEC_ID_WBMP,
AV_CODEC_ID_MEDIA100,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
@ -520,6 +528,10 @@ enum AVCodecID {
AV_CODEC_ID_FASTAUDIO,
AV_CODEC_ID_MSNSIREN,
AV_CODEC_ID_DFPWM,
AV_CODEC_ID_BONK,
AV_CODEC_ID_MISC4,
AV_CODEC_ID_APAC,
AV_CODEC_ID_FTR,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.

View File

@ -32,15 +32,16 @@
/**
* @addtogroup lavc_core
* @{
*/
enum AVFieldOrder {
AV_FIELD_UNKNOWN,
AV_FIELD_PROGRESSIVE,
AV_FIELD_TT, //< Top coded_first, top displayed first
AV_FIELD_BB, //< Bottom coded first, bottom displayed first
AV_FIELD_TB, //< Top coded first, bottom displayed first
AV_FIELD_BT, //< Bottom coded first, top displayed first
AV_FIELD_TT, ///< Top coded_first, top displayed first
AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
AV_FIELD_TB, ///< Top coded first, bottom displayed first
AV_FIELD_BT, ///< Bottom coded first, top displayed first
};
/**

View File

@ -39,6 +39,28 @@
*/
#define AV_INPUT_BUFFER_PADDING_SIZE 64
/**
* Verify checksums embedded in the bitstream (could be of either encoded or
* decoded data, depending on the format) and print an error message on mismatch.
* If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
* decoder/demuxer returning an error.
*/
#define AV_EF_CRCCHECK (1<<0)
#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
#define FF_COMPLIANCE_NORMAL 0
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
/**
* @ingroup lavc_decoding
*/

View File

@ -88,13 +88,15 @@ int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render);
/**
* Release a MediaCodec buffer and render it at the given time to the surface
* that is associated with the decoder. The timestamp must be within one second
* of the current java/lang/System#nanoTime() (which is implemented using
* CLOCK_MONOTONIC on Android). See the Android MediaCodec documentation
* of android/media/MediaCodec#releaseOutputBuffer(int,long) for more details.
* of the current `java/lang/System#nanoTime()` (which is implemented using
* `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation
* of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details.
*
* @param buffer the buffer to render
* @param time timestamp in nanoseconds of when to render the buffer
* @return 0 on success, < 0 otherwise
*
* [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long)
*/
int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time);

View File

@ -21,7 +21,7 @@
#ifndef AVCODEC_QSV_H
#define AVCODEC_QSV_H
#include <mfx/mfxvideo.h>
#include <mfxvideo.h>
#include "libavutil/buffer.h"
@ -61,6 +61,8 @@ typedef struct AVQSVContext {
* required by the encoder and the user-provided value nb_opaque_surfaces.
* The array of the opaque surfaces will be exported to the caller through
* the opaque_surfaces field.
*
* The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0)
*/
int opaque_alloc;

View File

@ -152,6 +152,6 @@ int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
*/
AVVDPAUContext *av_vdpau_alloc_context(void);
/* @}*/
/** @} */
#endif /* AVCODEC_VDPAU_H */

View File

@ -29,8 +29,8 @@
#include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 34
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_MINOR 50
#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

View File

@ -50,5 +50,8 @@
#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 60)
#endif /* AVCODEC_VERSION_MAJOR_H */

View File

@ -29,6 +29,15 @@
* Public libavcodec Videotoolbox header.
*/
/**
* @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder
* @ingroup lavc_codec_hwaccel
*
* Hardware accelerated decoding using VideoToolbox on Apple Platforms
*
* @{
*/
#include <stdint.h>
#define Picture QuickdrawPicture
@ -37,6 +46,8 @@
#include "libavcodec/avcodec.h"
#include "libavutil/attributes.h"
/**
* This struct holds all the information that needs to be passed
* between the caller and libavcodec for initializing Videotoolbox decoding.
@ -50,11 +61,14 @@ typedef struct AVVideotoolboxContext {
*/
VTDecompressionSessionRef session;
#if FF_API_VT_OUTPUT_CALLBACK
/**
* The output callback that must be passed to the session.
* Set by av_videottoolbox_default_init()
*/
attribute_deprecated
VTDecompressionOutputCallback output_callback;
#endif
/**
* CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.

View File

@ -1121,12 +1121,15 @@ typedef struct AVStream {
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
#if FF_API_GET_END_PTS
/**
* Returns the pts of the last muxed packet + its duration
*
* the retuned value is undefined when used with a demuxer.
*/
attribute_deprecated
int64_t av_stream_get_end_pts(const AVStream *st);
#endif
#define AV_PROGRAM_RUNNING 1
@ -1895,8 +1898,8 @@ const AVOutputFormat *av_muxer_iterate(void **opaque);
/**
* Iterate over all registered demuxers.
*
* @param opaque a pointer where libavformat will store the iteration state. Must
* point to NULL to start the iteration.
* @param opaque a pointer where libavformat will store the iteration state.
* Must point to NULL to start the iteration.
*
* @return the next registered demuxer or NULL when the iteration is
* finished
@ -1954,12 +1957,13 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
/**
* Wrap an existing array as stream side data.
*
* @param st stream
* @param st stream
* @param type side information type
* @param data the side data array. It must be allocated with the av_malloc()
* family of functions. The ownership of the data is transferred to
* st.
* @param size side information size
*
* @return zero on success, a negative AVERROR code on failure. On failure,
* the stream is unchanged and the data remains owned by the caller.
*/
@ -1970,8 +1974,9 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
* Allocate new information from stream.
*
* @param stream stream
* @param type desired side information type
* @param size side information size
* @param type desired side information type
* @param size side information size
*
* @return pointer to fresh allocated data or NULL otherwise
*/
uint8_t *av_stream_new_side_data(AVStream *stream,
@ -1980,9 +1985,10 @@ uint8_t *av_stream_new_side_data(AVStream *stream,
* Get side information from stream.
*
* @param stream stream
* @param type desired side information type
* @param size If supplied, *size will be set to the size of the side data
* or to zero if the desired side data is not present.
* @param type desired side information type
* @param size If supplied, *size will be set to the size of the side data
* or to zero if the desired side data is not present.
*
* @return pointer to data if present or NULL otherwise
*/
uint8_t *av_stream_get_side_data(const AVStream *stream,
@ -2000,16 +2006,17 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
* avformat_free_context() can be used to free the context and
* everything allocated by the framework within it.
*
* @param *ctx is set to the created format context, or to NULL in
* case of failure
* @param oformat format to use for allocating the context, if NULL
* format_name and filename are used instead
* @param format_name the name of output format to use for allocating the
* context, if NULL filename is used instead
* @param filename the name of the filename to use for allocating the
* context, may be NULL
* @return >= 0 in case of success, a negative AVERROR code in case of
* failure
* @param ctx pointee is set to the created format context,
* or to NULL in case of failure
* @param oformat format to use for allocating the context, if NULL
* format_name and filename are used instead
* @param format_name the name of output format to use for allocating the
* context, if NULL filename is used instead
* @param filename the name of the filename to use for allocating the
* context, may be NULL
*
* @return >= 0 in case of success, a negative AVERROR code in case of
* failure
*/
int avformat_alloc_output_context2(AVFormatContext **ctx, const AVOutputFormat *oformat,
const char *format_name, const char *filename);
@ -2064,15 +2071,16 @@ const AVInputFormat *av_probe_input_format3(const AVProbeData *pd,
* attempt is made. When the maximum probe size is reached, the input format
* with the highest score is returned.
*
* @param pb the bytestream to probe
* @param fmt the input format is put here
* @param url the url of the stream
* @param logctx the log context
* @param offset the offset within the bytestream to probe from
* @param pb the bytestream to probe
* @param fmt the input format is put here
* @param url the url of the stream
* @param logctx the log context
* @param offset the offset within the bytestream to probe from
* @param max_probe_size the maximum probe buffer size (zero for default)
*
* @return the score in case of success, a negative value corresponding to an
* the maximal score is AVPROBE_SCORE_MAX
* AVERROR code otherwise
* AVERROR code otherwise
*/
int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt,
const char *url, void *logctx,
@ -2089,16 +2097,19 @@ int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt,
* Open an input stream and read the header. The codecs are not opened.
* The stream must be closed with avformat_close_input().
*
* @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
* May be a pointer to NULL, in which case an AVFormatContext is allocated by this
* function and written into ps.
* Note that a user-supplied AVFormatContext will be freed on failure.
* @param url URL of the stream to open.
* @param fmt If non-NULL, this parameter forces a specific input format.
* Otherwise the format is autodetected.
* @param options A dictionary filled with AVFormatContext and demuxer-private options.
* On return this parameter will be destroyed and replaced with a dict containing
* options that were not found. May be NULL.
* @param ps Pointer to user-supplied AVFormatContext (allocated by
* avformat_alloc_context). May be a pointer to NULL, in
* which case an AVFormatContext is allocated by this
* function and written into ps.
* Note that a user-supplied AVFormatContext will be freed
* on failure.
* @param url URL of the stream to open.
* @param fmt If non-NULL, this parameter forces a specific input format.
* Otherwise the format is autodetected.
* @param options A dictionary filled with AVFormatContext and demuxer-private
* options.
* On return this parameter will be destroyed and replaced with
* a dict containing options that were not found. May be NULL.
*
* @return 0 on success, a negative AVERROR on failure.
*
@ -2137,6 +2148,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
* @param last the last found program, the search will start after this
* program, or from the beginning if it is NULL
* @param s stream index
*
* @return the next program which belongs to s, NULL if no program is found or
* the last program is not among the programs of ic.
*/
@ -2161,10 +2173,12 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i
* @param decoder_ret if non-NULL, returns the decoder for the
* selected stream
* @param flags flags; none are currently defined
*
* @return the non-negative stream number in case of success,
* AVERROR_STREAM_NOT_FOUND if no stream with the requested type
* could be found,
* AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
*
* @note If av_find_best_stream returns successfully and decoder_ret is not
* NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
*/
@ -2208,13 +2222,14 @@ 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.
* @param timestamp Timestamp in AVStream.time_base units
* or, if no stream is specified, in AV_TIME_BASE units.
* @param flags flags which select direction and seeking mode
* @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.
* @param timestamp Timestamp in AVStream.time_base units or, if no stream
* is specified, in AV_TIME_BASE units.
* @param flags flags which select direction and seeking mode
*
* @return >= 0 on success
*/
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
@ -2236,12 +2251,12 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
* keyframes (this may not be supported by all demuxers).
* If flags contain AVSEEK_FLAG_BACKWARD, it is ignored.
*
* @param s media file handle
* @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
* @param max_ts largest acceptable timestamp
* @param flags flags
* @param min_ts smallest acceptable timestamp
* @param ts target timestamp
* @param max_ts largest acceptable timestamp
* @param flags flags
* @return >=0 on success, error code otherwise
*
* @note This is part of the new seek API which is still under construction.
@ -2305,16 +2320,22 @@ void avformat_close_input(AVFormatContext **s);
* Allocate the stream private data and write the stream header to
* an output media file.
*
* @param s Media file handle, must be allocated with avformat_alloc_context().
* Its oformat field must be set to the desired output format;
* Its pb field must be set to an already opened AVIOContext.
* @param options An AVDictionary filled with AVFormatContext and muxer-private options.
* On return this parameter will be destroyed and replaced with a dict containing
* options that were not found. May be NULL.
* @param s Media file handle, must be allocated with
* avformat_alloc_context().
* Its \ref AVFormatContext.oformat "oformat" field must be set
* to the desired output format;
* Its \ref AVFormatContext.pb "pb" field must be set to an
* already opened ::AVIOContext.
* @param options An ::AVDictionary filled with AVFormatContext and
* muxer-private options.
* On return this parameter will be destroyed and replaced with
* a dict containing options that were not found. May be NULL.
*
* @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not already been fully initialized in avformat_init,
* AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec had already been fully initialized in avformat_init,
* negative AVERROR on failure.
* @retval AVSTREAM_INIT_IN_WRITE_HEADER On success, if the codec had not already been
* fully initialized in avformat_init_output().
* @retval AVSTREAM_INIT_IN_INIT_OUTPUT On success, if the codec had already been fully
* initialized in avformat_init_output().
* @retval AVERROR A negative AVERROR on failure.
*
* @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_init_output.
*/
@ -2323,20 +2344,26 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options);
/**
* Allocate the stream private data and initialize the codec, but do not write the header.
* May optionally be used before avformat_write_header to initialize stream parameters
* May optionally be used before avformat_write_header() to initialize stream parameters
* before actually writing the header.
* If using this function, do not pass the same options to avformat_write_header.
* If using this function, do not pass the same options to avformat_write_header().
*
* @param s Media file handle, must be allocated with avformat_alloc_context().
* Its oformat field must be set to the desired output format;
* Its pb field must be set to an already opened AVIOContext.
* @param options An AVDictionary filled with AVFormatContext and muxer-private options.
* On return this parameter will be destroyed and replaced with a dict containing
* options that were not found. May be NULL.
* @param s Media file handle, must be allocated with
* avformat_alloc_context().
* Its \ref AVFormatContext.oformat "oformat" field must be set
* to the desired output format;
* Its \ref AVFormatContext.pb "pb" field must be set to an
* already opened ::AVIOContext.
* @param options An ::AVDictionary filled with AVFormatContext and
* muxer-private options.
* On return this parameter will be destroyed and replaced with
* a dict containing options that were not found. May be NULL.
*
* @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires avformat_write_header to fully initialize,
* AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec has been fully initialized,
* negative AVERROR on failure.
* @retval AVSTREAM_INIT_IN_WRITE_HEADER On success, if the codec requires
* avformat_write_header to fully initialize.
* @retval AVSTREAM_INIT_IN_INIT_OUTPUT On success, if the codec has been fully
* initialized.
* @retval AVERROR Anegative AVERROR on failure.
*
* @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_write_header.
*/
@ -2481,11 +2508,11 @@ int av_write_trailer(AVFormatContext *s);
* there is no match.
*
* @param short_name if non-NULL checks if short_name matches with the
* names of the registered formats
* @param filename if non-NULL checks if filename terminates with the
* extensions of the registered formats
* @param mime_type if non-NULL checks if mime_type matches with the
* MIME type of the registered formats
* names of the registered formats
* @param filename if non-NULL checks if filename terminates with the
* extensions of the registered formats
* @param mime_type if non-NULL checks if mime_type matches with the
* MIME type of the registered formats
*/
const AVOutputFormat *av_guess_format(const char *short_name,
const char *filename,
@ -2509,9 +2536,11 @@ enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
* time_base units
* @param[out] wall absolute time when that packet whas output,
* in microsecond
* @return 0 if OK, AVERROR(ENOSYS) if the format does not support it
* Note: some formats or devices may not allow to measure dts and wall
* atomically.
* @retval 0 Success
* @retval AVERROR(ENOSYS) The format does not support it
*
* @note Some formats or devices may not allow to measure dts and wall
* atomically.
*/
int av_get_output_timestamp(struct AVFormatContext *s, int stream,
int64_t *dts, int64_t *wall);
@ -2653,7 +2682,7 @@ const AVIndexEntry *avformat_index_get_entry(AVStream *st, int idx);
* Get the AVIndexEntry corresponding to the given timestamp.
*
* @param st Stream containing the requested AVIndexEntry.
* @param timestamp Timestamp to retrieve the index entry for.
* @param wanted_timestamp Timestamp to retrieve the index entry for.
* @param flags If AVSEEK_FLAG_BACKWARD then the returned entry will correspond
* to the timestamp which is <= the requested one, if backward
* is 0, then it will be >=

View File

@ -101,9 +101,13 @@ typedef struct AVIODirEntry {
int64_t filemode; /**< Unix file mode, -1 if unknown. */
} AVIODirEntry;
#if FF_API_AVIODIRCONTEXT
typedef struct AVIODirContext {
struct URLContext *url_context;
} AVIODirContext;
#else
typedef struct AVIODirContext AVIODirContext;
#endif
/**
* Different data types that can be returned via the AVIO
@ -464,6 +468,7 @@ int avio_put_str16be(AVIOContext *s, const char *str);
*
* Zero-length ranges are omitted from the output.
*
* @param s the AVIOContext
* @param time the stream time the current bytestream pos corresponds to
* (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not
* applicable

View File

@ -31,8 +31,8 @@
#include "version_major.h"
#define LIBAVFORMAT_VERSION_MINOR 25
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_MINOR 34
#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

View File

@ -46,6 +46,8 @@
#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_R_FRAME_RATE 1

View File

@ -42,6 +42,9 @@ struct AVAES *av_aes_alloc(void);
/**
* Initialize an AVAES context.
*
* @param a The AVAES context
* @param key Pointer to the key
* @param key_bits 128, 192 or 256
* @param decrypt 0 for encryption, 1 for decryption
*/
@ -49,9 +52,11 @@ int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
/**
* Encrypt or decrypt a buffer using a previously initialized context.
* @param count number of 16 byte blocks
*
* @param a The AVAES context
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param count number of 16 byte blocks
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
* @param decrypt 0 for encryption, 1 for decryption
*/

View File

@ -22,6 +22,12 @@
#ifndef AVUTIL_AES_CTR_H
#define AVUTIL_AES_CTR_H
/**
* @defgroup lavu_aes_ctr AES-CTR
* @ingroup lavu_crypto
* @{
*/
#include <stdint.h>
#include "attributes.h"
@ -38,17 +44,23 @@ struct AVAESCTR *av_aes_ctr_alloc(void);
/**
* Initialize an AVAESCTR context.
*
* @param a The AVAESCTR context to initialize
* @param key encryption key, must have a length of AES_CTR_KEY_SIZE
*/
int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
/**
* Release an AVAESCTR context.
*
* @param a The AVAESCTR context
*/
void av_aes_ctr_free(struct AVAESCTR *a);
/**
* Process a buffer using a previously initialized context.
*
* @param a The AVAESCTR context
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param size the size of src and dst

View File

@ -135,6 +135,7 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_forma
/**
* Get the count of continuous non zero chars starting from the beginning.
*
* @param s the string whose length to count
* @param len maximum number of characters to check in the string, that
* is the maximum value which is returned by the function
*/

View File

@ -18,6 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* @ingroup lavu_avbprint
* AVBPrint public header
*/
#ifndef AVUTIL_BPRINT_H
#define AVUTIL_BPRINT_H
@ -26,6 +32,14 @@
#include "attributes.h"
#include "avstring.h"
/**
* @defgroup lavu_avbprint AVBPrint
* @ingroup lavu_data
*
* A buffer to print data progressively
* @{
*/
/**
* Define a structure with extra padding to a fixed size
* This helps ensuring binary compatibility with future versions.
@ -48,14 +62,14 @@ typedef struct name { \
* Small buffers are kept in the structure itself, and thus require no
* memory allocation at all (unless the contents of the buffer is needed
* after the structure goes out of scope). This is almost as lightweight as
* declaring a local "char buf[512]".
* declaring a local `char buf[512]`.
*
* The length of the string can go beyond the allocated size: the buffer is
* then truncated, but the functions still keep account of the actual total
* length.
*
* In other words, buf->len can be greater than buf->size and records the
* total length of what would have been to the buffer if there had been
* In other words, AVBPrint.len can be greater than AVBPrint.size and records
* the total length of what would have been to the buffer if there had been
* enough memory.
*
* Append operations do not need to be tested for failure: if a memory
@ -63,20 +77,17 @@ typedef struct name { \
* is still updated. This situation can be tested with
* av_bprint_is_complete().
*
* The size_max field determines several possible behaviours:
*
* size_max = -1 (= UINT_MAX) or any large value will let the buffer be
* reallocated as necessary, with an amortized linear cost.
*
* size_max = 0 prevents writing anything to the buffer: only the total
* length is computed. The write operations can then possibly be repeated in
* a buffer with exactly the necessary size
* (using size_init = size_max = len + 1).
*
* size_max = 1 is automatically replaced by the exact size available in the
* structure itself, thus ensuring no dynamic memory allocation. The
* internal buffer is large enough to hold a reasonable paragraph of text,
* such as the current paragraph.
* The AVBPrint.size_max field determines several possible behaviours:
* - `size_max = -1` (= `UINT_MAX`) or any large value will let the buffer be
* reallocated as necessary, with an amortized linear cost.
* - `size_max = 0` prevents writing anything to the buffer: only the total
* length is computed. The write operations can then possibly be repeated in
* a buffer with exactly the necessary size
* (using `size_init = size_max = len + 1`).
* - `size_max = 1` is automatically replaced by the exact size available in the
* structure itself, thus ensuring no dynamic memory allocation. The
* internal buffer is large enough to hold a reasonable paragraph of text,
* such as the current paragraph.
*/
FF_PAD_STRUCTURE(AVBPrint, 1024,
@ -88,12 +99,31 @@ FF_PAD_STRUCTURE(AVBPrint, 1024,
)
/**
* @name Max size special values
* Convenience macros for special values for av_bprint_init() size_max
* parameter.
* @{
*/
/**
* Buffer will be reallocated as necessary, with an amortized linear cost.
*/
#define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1)
/**
* Use the exact size available in the AVBPrint structure itself.
*
* Thus ensuring no dynamic memory allocation. The internal buffer is large
* enough to hold a reasonable paragraph of text, such as the current paragraph.
*/
#define AV_BPRINT_SIZE_AUTOMATIC 1
/**
* Do not write anything to the buffer, only calculate the total length.
*
* The write operations can then possibly be repeated in a buffer with
* exactly the necessary size (using `size_init = size_max = AVBPrint.len + 1`).
*/
#define AV_BPRINT_SIZE_COUNT_ONLY 0
/** @} */
/**
* Init a print buffer.
@ -101,12 +131,12 @@ FF_PAD_STRUCTURE(AVBPrint, 1024,
* @param buf buffer to init
* @param size_init initial size (including the final 0)
* @param size_max maximum size;
* 0 means do not write anything, just count the length;
* 1 is replaced by the maximum value for automatic storage;
* any large value means that the internal buffer will be
* reallocated as needed up to that limit; -1 is converted to
* UINT_MAX, the largest limit possible.
* Check also AV_BPRINT_SIZE_* macros.
* - `0` means do not write anything, just count the length
* - `1` is replaced by the maximum value for automatic storage
* any large value means that the internal buffer will be
* reallocated as needed up to that limit
* - `-1` is converted to `UINT_MAX`, the largest limit possible.
* Check also `AV_BPRINT_SIZE_*` macros.
*/
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max);
@ -216,4 +246,6 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str);
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars,
enum AVEscapeMode mode, int flags);
/** @} */
#endif /* AVUTIL_BPRINT_H */

View File

@ -40,6 +40,8 @@
# include "arm/bswap.h"
#elif ARCH_AVR32
# include "avr32/bswap.h"
#elif ARCH_RISCV
# include "riscv/bswap.h"
#elif ARCH_SH4
# include "sh4/bswap.h"
#elif ARCH_X86

View File

@ -59,7 +59,7 @@ int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param count number of 16 byte blocks
* @paran iv initialization vector for CBC mode, NULL for ECB mode
* @param iv initialization vector for CBC mode, NULL for ECB mode
* @param decrypt 0 for encryption, 1 for decryption
*/
void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);

View File

@ -30,11 +30,17 @@
/**
* @file
* audio channel layout utility functions
* @ingroup lavu_audio_channels
* Public libavutil channel layout APIs header.
*/
/**
* @addtogroup lavu_audio
* @defgroup lavu_audio_channels Audio channels
* @ingroup lavu_audio
*
* Audio channel layout utility functions
*
* @{
*/
@ -84,9 +90,9 @@ enum AVChannel {
* Range of channels between AV_CHAN_AMBISONIC_BASE and
* AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system.
*
* Given a channel id <i> between AV_CHAN_AMBISONIC_BASE and
* AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel <n> is
* <n> = <i> - AV_CHAN_AMBISONIC_BASE.
* Given a channel id `<i>` between AV_CHAN_AMBISONIC_BASE and
* AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `<n>` is
* `<n> = <i> - AV_CHAN_AMBISONIC_BASE`.
*
* @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel
* orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels
@ -266,8 +272,11 @@ typedef struct AVChannelCustom {
* A channel layout here is defined as a set of channels ordered in a specific
* way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an
* AVChannelLayout carries only the channel count).
* All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by
* ignoring everything but the channel count, as long as av_channel_layout_check()
* considers they are valid.
*
* Unlike most structures in Libav, sizeof(AVChannelLayout) is a part of the
* Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the
* public ABI and may be used by the caller. E.g. it may be allocated on stack
* or embedded in caller-defined structs.
*
@ -350,6 +359,10 @@ typedef struct AVChannelLayout {
#define AV_CHANNEL_LAYOUT_MASK(nb, m) \
{ .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }}
/**
* @name Common pre-defined channel layouts
* @{
*/
#define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO)
#define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO)
#define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1)
@ -381,10 +394,16 @@ typedef struct AVChannelLayout {
#define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
#define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
{ .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }}
/** @} */
struct AVBPrint;
#if FF_API_OLD_CHANNEL_LAYOUT
/**
* @name Deprecated Functions
* @{
*/
/**
* Return a channel layout id that matches name, or 0 if no match is found.
*
@ -429,6 +448,8 @@ int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, i
*
* @param buf put here the string containing the channel layout
* @param buf_size size in bytes of the buffer
* @param nb_channels number of channels
* @param channel_layout channel layout bitset
* @deprecated use av_channel_layout_describe()
*/
attribute_deprecated
@ -459,6 +480,7 @@ int64_t av_get_default_channel_layout(int nb_channels);
/**
* Get the index of a channel in channel_layout.
*
* @param channel_layout channel layout bitset
* @param channel a channel layout describing exactly one channel which must be
* present in channel_layout.
*
@ -511,6 +533,9 @@ const char *av_get_channel_description(uint64_t channel);
attribute_deprecated
int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
const char **name);
/**
* @}
*/
#endif
/**
@ -519,6 +544,7 @@ int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
*
* @param buf pre-allocated buffer where to put the generated string
* @param buf_size size in bytes of the buffer.
* @param channel the AVChannel whose name to get
* @return amount of bytes needed to hold the output string, or a negative AVERROR
* on failure. If the returned value is bigger than buf_size, then the
* string was truncated.
@ -537,6 +563,7 @@ void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
*
* @param buf pre-allocated buffer where to put the generated string
* @param buf_size size in bytes of the buffer.
* @param channel the AVChannel whose description to get
* @return amount of bytes needed to hold the output string, or a negative AVERROR
* on failure. If the returned value is bigger than buf_size, then the
* string was truncated.
@ -593,7 +620,7 @@ int av_channel_layout_from_string(AVChannelLayout *channel_layout,
/**
* Get the default channel layout for a given number of channels.
*
* @param channel_layout the layout structure to be initialized
* @param ch_layout the layout structure to be initialized
* @param nb_channels number of channels
*/
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels);
@ -658,6 +685,7 @@ int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout,
* Get the channel with the given index in a channel layout.
*
* @param channel_layout input channel layout
* @param idx index of the channel
* @return channel with the index idx in channel_layout on success or
* AV_CHAN_NONE on failure (if idx is not valid or the channel order is
* unspecified)
@ -670,6 +698,7 @@ av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsi
* channels are found, only the first match will be returned.
*
* @param channel_layout input channel layout
* @param channel the channel whose index to obtain
* @return index of channel in channel_layout on success or a negative number if
* channel is not present in channel_layout.
*/
@ -684,6 +713,7 @@ int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout,
* @ref av_channel_from_string().
*
* @param channel_layout input channel layout
* @param name string describing the channel whose index to obtain
* @return a channel index described by the given string, or a negative AVERROR
* value.
*/
@ -697,6 +727,7 @@ int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout,
* @ref av_channel_from_string().
*
* @param channel_layout input channel layout
* @param name string describing the channel to obtain
* @return a channel described by the given string in channel_layout on success
* or AV_CHAN_NONE on failure (if the string is not valid or the channel
* order is unspecified)
@ -742,7 +773,6 @@ int av_channel_layout_check(const AVChannelLayout *channel_layout);
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1);
/**
* @}
* @}
*/

View File

@ -78,6 +78,16 @@
#define AV_CPU_FLAG_LSX (1 << 0)
#define AV_CPU_FLAG_LASX (1 << 1)
// RISC-V extensions
#define AV_CPU_FLAG_RVI (1 << 0) ///< I (full GPR bank)
#define AV_CPU_FLAG_RVF (1 << 1) ///< F (single precision FP)
#define AV_CPU_FLAG_RVD (1 << 2) ///< D (double precision FP)
#define AV_CPU_FLAG_RVV_I32 (1 << 3) ///< Vectors of 8/16/32-bit int's */
#define AV_CPU_FLAG_RVV_F32 (1 << 4) ///< Vectors of float's */
#define AV_CPU_FLAG_RVV_I64 (1 << 5) ///< Vectors of 64-bit int's */
#define AV_CPU_FLAG_RVV_F64 (1 << 6) ///< Vectors of double's
#define AV_CPU_FLAG_RVB_BASIC (1 << 7) ///< Basic bit-manipulations
/**
* Return the flags which specify extensions supported by the CPU.
* The returned value is affected by av_force_cpu_flags() if that was used

View File

@ -84,7 +84,10 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id);
/**
* Calculate the CRC of a block.
* @param ctx initialized AVCRC array (see av_crc_init())
* @param crc CRC of previous blocks if any or initial value for CRC
* @param buffer buffer whose CRC to calculate
* @param length length of the buffer
* @return CRC updated with the data from the given block
*
* @see av_crc_init() "le" parameter

View File

@ -24,9 +24,14 @@
#include "rational.h"
/**
* @file Colorspace value utility functions for libavutil.
* @file
* Colorspace value utility functions for libavutil.
* @ingroup lavu_math_csp
* @author Ronald S. Bultje <rsbultje@gmail.com>
* @author Leo Izen <leo.izen@gmail.com>
*/
/**
* @defgroup lavu_math_csp Colorspace Utility
* @ingroup lavu_math
* @{

View File

@ -43,6 +43,8 @@ AVDES *av_des_alloc(void);
/**
* @brief Initializes an AVDES context.
*
* @param d pointer to a AVDES structure to initialize
* @param key pointer to the key to use
* @param key_bits must be 64 or 192
* @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
* @return zero on success, negative value otherwise
@ -52,9 +54,10 @@ int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
/**
* @brief Encrypts / decrypts using the DES algorithm.
*
* @param count number of 8 byte blocks
* @param d pointer to the AVDES structure
* @param dst destination array, can be equal to src, must be 8-byte aligned
* @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
* @param count number of 8 byte blocks
* @param iv initialization vector for CBC mode, if NULL then ECB will be used,
* must be 8-byte aligned
* @param decrypt 0 for encryption, 1 for decryption
@ -64,9 +67,10 @@ void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count,
/**
* @brief Calculates CBC-MAC using the DES algorithm.
*
* @param count number of 8 byte blocks
* @param d pointer to the AVDES structure
* @param dst destination array, can be equal to src, must be 8-byte aligned
* @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
* @param count number of 8 byte blocks
*/
void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);

View File

@ -93,6 +93,7 @@ av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx)
* AVDetectionBBox, and initializes the variables.
* Can be freed with a normal av_free() call.
*
* @param nb_bboxes number of AVDetectionBBox structures to allocate
* @param out_size if non-NULL, the size in bytes of the resulting data array is
* written here.
*/

View File

@ -20,6 +20,7 @@
/**
* @file
* @ingroup lavu_video_display
* Display matrix
*/
@ -29,15 +30,9 @@
#include <stdint.h>
/**
* @addtogroup lavu_video
* @{
*
* @defgroup lavu_video_display Display transformation matrix functions
* @{
*/
/**
* @addtogroup lavu_video_display
* @ingroup lavu_video
*
* The display transformation matrix specifies an affine transformation that
* should be applied to video frames for correct presentation. It is compatible
* with the matrices stored in the ISO/IEC 14496-12 container format.
@ -71,6 +66,8 @@
* q' = (b * p + d * q + y) / z;
* z = u * p + v * q + w
* @endcode
*
* @{
*/
/**
@ -90,8 +87,8 @@ double av_display_rotation_get(const int32_t matrix[9]);
* Initialize a transformation matrix describing a pure clockwise
* rotation by the specified angle (in degrees).
*
* @param matrix an allocated transformation matrix (will be fully overwritten
* by this function)
* @param[out] matrix a transformation matrix (will be fully overwritten
* by this function)
* @param angle rotation angle in degrees.
*/
void av_display_rotation_set(int32_t matrix[9], double angle);
@ -99,14 +96,13 @@ void av_display_rotation_set(int32_t matrix[9], double angle);
/**
* Flip the input matrix horizontally and/or vertically.
*
* @param matrix an allocated transformation matrix
* @param[in,out] matrix a transformation matrix
* @param hflip whether the matrix should be flipped horizontally
* @param vflip whether the matrix should be flipped vertically
*/
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
/**
* @}
* @}
*/

View File

@ -42,6 +42,7 @@ typedef struct AVExpr AVExpr;
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
* @param log_offset log level offset, can be used to silence error messages
* @param log_ctx parent logging context
* @return >= 0 in case of success, a negative value corresponding to an
* AVERROR code otherwise
@ -65,6 +66,7 @@ int av_expr_parse_and_eval(double *res, const char *s,
* @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
* @param log_offset log level offset, can be used to silence error messages
* @param log_ctx parent logging context
* @return >= 0 in case of success, a negative value corresponding to an
* AVERROR code otherwise
@ -78,6 +80,7 @@ int av_expr_parse(AVExpr **expr, const char *s,
/**
* Evaluate a previously parsed expression.
*
* @param e the AVExpr to evaluate
* @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
* @return the value of the expression
@ -87,6 +90,7 @@ double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
/**
* Track the presence of variables and their number of occurrences in a parsed expression
*
* @param e the AVExpr to track variables in
* @param counter a zero-initialized array where the count of each variable will be stored
* @param size size of array
* @return 0 on success, a negative value indicates that no expression or array was passed
@ -98,6 +102,7 @@ int av_expr_count_vars(AVExpr *e, unsigned *counter, int size);
* Track the presence of user provided functions and their number of occurrences
* in a parsed expression.
*
* @param e the AVExpr to track user provided functions in
* @param counter a zero-initialized array where the count of each function will be stored
* if you passed 5 functions with 2 arguments to av_expr_parse()
* then for arg=2 this will use upto 5 entries.

View File

@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
#define FFMPEG_VERSION "N-107242-gc7ce03d826"
#define FFMPEG_VERSION "N-108709-g3bd0bf76fb"
#endif /* AVUTIL_FFVERSION_H */

View File

@ -18,7 +18,8 @@
/**
* @file
* a very simple circular buffer FIFO implementation
* @ingroup lavu_fifo
* A generic FIFO API
*/
#ifndef AVUTIL_FIFO_H
@ -30,6 +31,14 @@
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_fifo AVFifo
* @ingroup lavu_data
*
* @{
* A generic FIFO API
*/
typedef struct AVFifo AVFifo;
/**
@ -88,7 +97,13 @@ void av_fifo_auto_grow_limit(AVFifo *f, size_t max_elems);
size_t av_fifo_can_read(const AVFifo *f);
/**
* @return number of elements that can be written into the given FIFO.
* @return Number of elements that can be written into the given FIFO without
* growing it.
*
* In other words, this number of elements or less is guaranteed to fit
* into the FIFO. More data may be written when the
* AV_FIFO_FLAG_AUTO_GROW flag was specified at FIFO creation, but this
* may involve memory allocation, which can fail.
*/
size_t av_fifo_can_write(const AVFifo *f);
@ -109,9 +124,12 @@ int av_fifo_grow2(AVFifo *f, size_t inc);
/**
* Write data into a FIFO.
*
* In case nb_elems > av_fifo_can_write(f), nothing is written and an error
* In case nb_elems > av_fifo_can_write(f) and the AV_FIFO_FLAG_AUTO_GROW flag
* was not specified at FIFO creation, nothing is written and an error
* is returned.
*
* Calling function is guaranteed to succeed if nb_elems <= av_fifo_can_write(f).
*
* @param f the FIFO buffer
* @param buf Data to be written. nb_elems * av_fifo_elem_size(f) bytes will be
* read from buf on success.
@ -423,4 +441,8 @@ static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
#endif
#endif
/**
* @}
*/
#endif /* AVUTIL_FIFO_H */

View File

@ -22,6 +22,7 @@
#include <stddef.h>
#include <stdint.h>
#include "version.h"
#include "attributes.h"
/**
@ -38,6 +39,9 @@
* case *bufptr will be set to NULL and *size will be set to 0.
* The returned buffer must be released with av_file_unmap().
*
* @param filename path to the file
* @param[out] bufptr pointee is set to the mapped or allocated buffer
* @param[out] size pointee is set to the size in bytes of the buffer
* @param log_offset loglevel offset used for logging
* @param log_ctx context used for logging
* @return a non negative number in case of success, a negative value
@ -50,11 +54,13 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
/**
* Unmap or free the buffer bufptr created by av_file_map().
*
* @param bufptr the buffer previously created with av_file_map()
* @param size size in bytes of bufptr, must be the same as returned
* by av_file_map()
*/
void av_file_unmap(uint8_t *bufptr, size_t size);
#if FF_API_AV_FOPEN_UTF8
/**
* Wrapper to work around the lack of mkstemp() on mingw.
* Also, tries to create file in /tmp first, if possible.
@ -67,6 +73,8 @@ void av_file_unmap(uint8_t *bufptr, size_t size);
* libraries and could interfere with the calling application.
* @deprecated as fd numbers cannot be passed saftely between libs on some platforms
*/
attribute_deprecated
int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
#endif
#endif /* AVUTIL_FILE_H */

View File

@ -604,13 +604,18 @@ typedef struct AVFrame {
*/
int64_t pkt_pos;
#if FF_API_PKT_DURATION
/**
* duration of the corresponding packet, expressed in
* AVStream->time_base units, 0 if unknown.
* - encoding: unused
* - decoding: Read by user.
*
* @deprecated use duration instead
*/
attribute_deprecated
int64_t pkt_duration;
#endif
/**
* metadata.
@ -702,6 +707,11 @@ typedef struct AVFrame {
* Channel layout of the audio data.
*/
AVChannelLayout ch_layout;
/**
* Duration of the frame, in the same units as pts. 0 if unknown.
*/
int64_t duration;
} AVFrame;
@ -818,7 +828,8 @@ int av_frame_is_writable(AVFrame *frame);
* Ensure that the frame data is writable, avoiding data copy if possible.
*
* Do nothing if the frame is writable, allocate new buffers and copy the data
* if it is not.
* if it is not. Non-refcounted frames behave as non-writable, i.e. a copy
* is always made.
*
* @return 0 on success, a negative AVERROR on error.
*
@ -853,6 +864,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
/**
* Get the buffer reference a given data plane is stored in.
*
* @param frame the frame to get the plane's buffer from
* @param plane index of the data plane of interest in frame->extended_data.
*
* @return the buffer reference that contains the plane or NULL if the input

View File

@ -249,7 +249,7 @@ const char *av_hwdevice_get_type_name(enum AVHWDeviceType type);
/**
* Iterate over supported device types.
*
* @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type
* @param prev AV_HWDEVICE_TYPE_NONE initially, then the previous type
* returned by this function in subsequent iterations.
* @return The next usable device type from enum AVHWDeviceType, or
* AV_HWDEVICE_TYPE_NONE if there are no more.
@ -591,6 +591,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
*
* @param derived_frame_ctx On success, a reference to the newly created
* AVHWFramesContext.
* @param format The AVPixelFormat for the derived context.
* @param derived_device_ctx A reference to the device to create the new
* AVHWFramesContext on.
* @param source_frame_ctx A reference to an existing AVHWFramesContext

View File

@ -19,7 +19,7 @@
#ifndef AVUTIL_HWCONTEXT_QSV_H
#define AVUTIL_HWCONTEXT_QSV_H
#include <mfx/mfxvideo.h>
#include <mfxvideo.h>
/**
* @file
@ -34,6 +34,17 @@
*/
typedef struct AVQSVDeviceContext {
mfxSession session;
/**
* The mfxLoader handle used for mfxSession creation
*
* This field is only available for oneVPL user. For non-oneVPL user, this
* field must be set to NULL.
*
* Filled by the user before calling av_hwdevice_ctx_init() and should be
* cast to mfxLoader handle. Deallocating the AVHWDeviceContext will always
* release this interface.
*/
void *loader;
} AVQSVDeviceContext;
/**

View File

@ -23,6 +23,7 @@
#include <VideoToolbox/VideoToolbox.h>
#include "frame.h"
#include "pixfmt.h"
/**

View File

@ -48,6 +48,7 @@
* component in the plane with the max pixel step.
* @param max_pixstep_comps an array which is filled with the component
* for each plane which has the max pixel step. May be NULL.
* @param pixdesc the AVPixFmtDescriptor for the image, describing its format
*/
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
const AVPixFmtDescriptor *pixdesc);
@ -65,6 +66,8 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
* width width.
*
* @param linesizes array to be filled with the linesize for each plane
* @param pix_fmt the AVPixelFormat of the image
* @param width width of the image in pixels
* @return >= 0 in case of success, a negative error code otherwise
*/
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
@ -73,6 +76,8 @@ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int wi
* Fill plane sizes for an image with pixel format pix_fmt and height height.
*
* @param size the array to be filled with the size of each image plane
* @param pix_fmt the AVPixelFormat of the image
* @param height height of the image in pixels
* @param linesizes the array containing the linesize for each
* plane, should be filled by av_image_fill_linesizes()
* @return >= 0 in case of success, a negative error code otherwise
@ -88,6 +93,8 @@ int av_image_fill_plane_sizes(size_t size[4], enum AVPixelFormat pix_fmt,
* height height.
*
* @param data pointers array to be filled with the pointer for each image plane
* @param pix_fmt the AVPixelFormat of the image
* @param height height of the image in pixels
* @param ptr the pointer to a buffer which will contain the image
* @param linesizes the array containing the linesize for each
* plane, should be filled by av_image_fill_linesizes()
@ -103,6 +110,11 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
* The allocated image buffer has to be freed by using
* av_freep(&pointers[0]).
*
* @param pointers array to be filled with the pointer for each image plane
* @param linesizes the array filled with the linesize for each plane
* @param w width of the image in pixels
* @param h height of the image in pixels
* @param pix_fmt the AVPixelFormat of the image
* @param align the value to use for buffer size alignment
* @return the size in bytes required for the image buffer, a negative
* error code in case of failure
@ -119,8 +131,11 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
* bytewidth must be contained by both absolute values of dst_linesize
* and src_linesize, otherwise the function behavior is undefined.
*
* @param dst destination plane to copy to
* @param dst_linesize linesize for the image plane in dst
* @param src source plane to copy from
* @param src_linesize linesize for the image plane in src
* @param height height (number of lines) of the plane
*/
void av_image_copy_plane(uint8_t *dst, int dst_linesize,
const uint8_t *src, int src_linesize,
@ -147,8 +162,13 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize,
/**
* Copy image in src_data to dst_data.
*
* @param dst_data destination image data buffer to copy to
* @param dst_linesizes linesizes for the image in dst_data
* @param src_data source image data buffer to copy from
* @param src_linesizes linesizes for the image in src_data
* @param pix_fmt the AVPixelFormat of the image
* @param width width of the image in pixels
* @param height height of the image in pixels
*/
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
const uint8_t *src_data[4], const int src_linesizes[4],

View File

@ -27,7 +27,7 @@
/**
* Context structure for the Lagged Fibonacci PRNG.
* The exact layout, types and content of this struct may change and should
* not be accessed directly. Only its sizeof() is guranteed to stay the same
* not be accessed directly. Only its `sizeof()` is guaranteed to stay the same
* to allow easy instanciation.
*/
typedef struct AVLFG {
@ -40,7 +40,7 @@ void av_lfg_init(AVLFG *c, unsigned int seed);
/**
* Seed the state of the ALFG using binary data.
*
* Return value: 0 on success, negative value (AVERROR) on failure.
* @return 0 on success, negative value (AVERROR) on failure.
*/
int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length);
@ -73,6 +73,7 @@ static inline unsigned int av_mlfg_get(AVLFG *c){
* Get the next two numbers generated by a Box-Muller Gaussian
* generator using the random numbers issued by lfg.
*
* @param lfg pointer to the contex structure
* @param out array where the two generated numbers are placed
*/
void av_bmg_get(AVLFG *lfg, double out[2]);

View File

@ -111,7 +111,8 @@ enum AVRounding {
/**
* Compute the greatest common divisor of two integer operands.
*
* @param a,b Operands
* @param a Operand
* @param b Operand
* @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0;
* if a == 0 and b == 0, returns 0.
*/
@ -186,7 +187,8 @@ int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
* av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) > 0x02 % 0x20 (0x02)
* @endcode
*
* @param a,b Operands
* @param a Operand
* @param b Operand
* @param mod Divisor; must be a power of 2
* @return
* - a negative value if `a % mod < b % mod`

View File

@ -667,7 +667,8 @@ void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
/**
* Multiply two `size_t` values checking for overflow.
*
* @param[in] a,b Operands of multiplication
* @param[in] a Operand of multiplication
* @param[in] b Operand of multiplication
* @param[out] r Pointer to the result of the operation
* @return 0 on success, AVERROR(EINVAL) on overflow
*/

View File

@ -79,6 +79,8 @@ int av_parse_video_rate(AVRational *rate, const char *str);
/**
* Put the RGBA values that correspond to color_string in rgba_color.
*
* @param rgba_color 4-elements array of uint8_t values, where the respective
* red, green, blue and alpha component values are written.
* @param color_string a string specifying a color. It can be the name of
* a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
* possibly followed by "@" and a string representing the alpha
@ -92,6 +94,8 @@ int av_parse_video_rate(AVRational *rate, const char *str);
* @param slen length of the initial part of color_string containing the
* color. It can be set to -1 if color_string is a null terminated string
* containing nothing else than the color.
* @param log_ctx a pointer to an arbitrary struct of which the first field
* is a pointer to an AVClass struct (used for av_log()). Can be NULL.
* @return >= 0 in case of success, a negative value in case of
* failure (for example if color_string cannot be parsed).
*/
@ -106,7 +110,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
* av_parse_color().
*
* @param color_idx index of the requested color, starting from 0
* @param rgbp if not NULL, will point to a 3-elements array with the color value in RGB
* @param rgb if not NULL, will point to a 3-elements array with the color value in RGB
* @return the color name string or NULL if color_idx is not in the array
*/
const char *av_get_known_color_name(int color_idx, const uint8_t **rgb);
@ -162,19 +166,19 @@ int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info
* by the standard strptime().
*
* The supported input field descriptors are listed below.
* - %H: the hour as a decimal number, using a 24-hour clock, in the
* - `%%H`: the hour as a decimal number, using a 24-hour clock, in the
* range '00' through '23'
* - %J: hours as a decimal number, in the range '0' through INT_MAX
* - %M: the minute as a decimal number, using a 24-hour clock, in the
* - `%%J`: hours as a decimal number, in the range '0' through INT_MAX
* - `%%M`: the minute as a decimal number, using a 24-hour clock, in the
* range '00' through '59'
* - %S: the second as a decimal number, using a 24-hour clock, in the
* - `%%S`: the second as a decimal number, using a 24-hour clock, in the
* range '00' through '59'
* - %Y: the year as a decimal number, using the Gregorian calendar
* - %m: the month as a decimal number, in the range '1' through '12'
* - %d: the day of the month as a decimal number, in the range '1'
* - `%%Y`: the year as a decimal number, using the Gregorian calendar
* - `%%m`: the month as a decimal number, in the range '1' through '12'
* - `%%d`: the day of the month as a decimal number, in the range '1'
* through '31'
* - %T: alias for '%H:%M:%S'
* - %%: a literal '%'
* - `%%T`: alias for `%%H:%%M:%%S`
* - `%%`: a literal `%`
*
* @return a pointer to the first character not processed in this function
* call. In case the input string contains more characters than

View File

@ -264,6 +264,28 @@ const char *av_chroma_location_name(enum AVChromaLocation location);
*/
int av_chroma_location_from_name(const char *name);
/**
* Converts AVChromaLocation to swscale x/y chroma position.
*
* The positions represent the chroma (0,0) position in a coordinates system
* with luma (0,0) representing the origin and luma(1,1) representing 256,256
*
* @param xpos horizontal chroma sample position
* @param ypos vertical chroma sample position
*/
int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
/**
* Converts swscale x/y chroma position to AVChromaLocation.
*
* The positions represent the chroma (0,0) position in a coordinates system
* with luma (0,0) representing the origin and luma(1,1) representing 256,256
*
* @param xpos horizontal chroma sample position
* @param ypos vertical chroma sample position
*/
enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos);
/**
* Return the pixel format corresponding to name.
*
@ -357,12 +379,15 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4],
*/
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
#define FF_LOSS_EXCESS_RESOLUTION 0x0040 /**< loss due to unneeded extra resolution */
#define FF_LOSS_EXCESS_DEPTH 0x0080 /**< loss due to unneeded extra color depth */
/**
* Compute what kind of losses will occur when converting from one specific

View File

@ -367,6 +367,31 @@ enum AVPixelFormat {
AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian
AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian
AV_PIX_FMT_VUYA, ///< packed VUYA 4:4:4, 32bpp, VUYAVUYA...
AV_PIX_FMT_RGBAF16BE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian
AV_PIX_FMT_RGBAF16LE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian
AV_PIX_FMT_VUYX, ///< packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined
AV_PIX_FMT_P012LE, ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, little-endian
AV_PIX_FMT_P012BE, ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, big-endian
AV_PIX_FMT_Y212BE, ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, big-endian
AV_PIX_FMT_Y212LE, ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, little-endian
AV_PIX_FMT_XV30BE, ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), big-endian, variant of Y410 where alpha channel is left undefined
AV_PIX_FMT_XV30LE, ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channel is left undefined
AV_PIX_FMT_XV36BE, ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian, variant of Y412 where alpha channel is left undefined
AV_PIX_FMT_XV36LE, ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian, variant of Y412 where alpha channel is left undefined
AV_PIX_FMT_RGBF32BE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian
AV_PIX_FMT_RGBF32LE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian
AV_PIX_FMT_RGBAF32BE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
AV_PIX_FMT_RGBAF32LE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian
AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
};
@ -453,9 +478,13 @@ enum AVPixelFormat {
#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE)
#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE)
#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE)
#define AV_PIX_FMT_P012 AV_PIX_FMT_NE(P012BE, P012LE)
#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE)
#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
#define AV_PIX_FMT_Y212 AV_PIX_FMT_NE(Y212BE, Y212LE)
#define AV_PIX_FMT_XV30 AV_PIX_FMT_NE(XV30BE, XV30LE)
#define AV_PIX_FMT_XV36 AV_PIX_FMT_NE(XV36BE, XV36LE)
#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
@ -464,6 +493,11 @@ enum AVPixelFormat {
#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE)
#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE)
#define AV_PIX_FMT_RGBAF16 AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE)
#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)
#define AV_PIX_FMT_RGBAF32 AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE)
/**
* Chromaticity coordinates of the source primaries.
* These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.

View File

@ -179,7 +179,8 @@ AVRational av_d2q(double d, int max) av_const;
* Find which of the two rationals is closer to another rational.
*
* @param q Rational to be compared against
* @param q1,q2 Rationals to be tested
* @param q1 Rational to be tested
* @param q2 Rational to be tested
* @return One of the following values:
* - 1 if `q1` is nearer to `q` than `q2`
* - -1 if `q2` is nearer to `q` than `q1`

View File

@ -42,6 +42,8 @@ AVRC4 *av_rc4_alloc(void);
/**
* @brief Initializes an AVRC4 context.
*
* @param d pointer to the AVRC4 context
* @param key buffer containig the key
* @param key_bits must be a multiple of 8
* @param decrypt 0 for encryption, 1 for decryption, currently has no effect
* @return zero on success, negative value otherwise
@ -51,6 +53,7 @@ int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
/**
* @brief Encrypts / decrypts using the RC4 algorithm.
*
* @param d pointer to the AVRC4 context
* @param count number of bytes
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst, may be NULL

View File

@ -213,6 +213,7 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
* @param[out] linesize aligned size for audio buffer(s), may be NULL
* @param nb_channels number of audio channels
* @param nb_samples number of samples per channel
* @param sample_fmt the sample format
* @param align buffer size alignment (0 = default, 1 = no alignment)
* @return >=0 on success or a negative error code on failure
* @todo return the size of the allocated buffer in case of success at the next bump

View File

@ -20,6 +20,7 @@
/**
* @file
* @ingroup lavu_video_spherical
* Spherical video
*/
@ -30,19 +31,14 @@
#include <stdint.h>
/**
* @addtogroup lavu_video
* @{
*
* @defgroup lavu_video_spherical Spherical video mapping
* @{
*/
/**
* @addtogroup lavu_video_spherical
* @ingroup lavu_video
*
* A spherical video file contains surfaces that need to be mapped onto a
* sphere. Depending on how the frame was converted, a different distortion
* transformation or surface recomposition function needs to be applied before
* the video should be mapped and displayed.
* @{
*/
/**
@ -225,7 +221,6 @@ const char *av_spherical_projection_name(enum AVSphericalProjection projection);
*/
int av_spherical_from_name(const char *name);
/**
* @}
* @}
*/

View File

@ -20,6 +20,7 @@
/**
* @file
* @ingroup lavu_video_stereo3d
* Stereoscopic video
*/
@ -31,19 +32,15 @@
#include "frame.h"
/**
* @addtogroup lavu_video
* @{
*
* @defgroup lavu_video_stereo3d Stereo3D types and functions
* @{
*/
/**
* @addtogroup lavu_video_stereo3d
* @ingroup lavu_video
*
* A stereoscopic video file consists in multiple views embedded in a single
* frame, usually describing two views of a scene. This file describes all
* possible codec-independent view arrangements.
* */
*
* @{
*/
/**
* List of possible 3D Types
@ -226,7 +223,6 @@ const char *av_stereo3d_type_name(unsigned int type);
int av_stereo3d_from_name(const char *name);
/**
* @}
* @}
*/

View File

@ -59,7 +59,7 @@ int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits);
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param count number of 16 byte blocks
* @paran iv initialization vector for CBC mode, NULL for ECB mode
* @param iv initialization vector for CBC mode, NULL for ECB mode
* @param decrypt 0 for encryption, 1 for decryption
*/
void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);

View File

@ -106,7 +106,6 @@ int av_uuid_parse_range(const char *in_start, const char *in_end, AVUUID uu);
*
* @param[in] uu AVUUID
* @param[out] out Pointer to an array of no less than 37 characters.
* @return A non-zero value in case of an error.
*/
void av_uuid_unparse(const AVUUID uu, char *out);

View File

@ -79,8 +79,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 57
#define LIBAVUTIL_VERSION_MINOR 27
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_MINOR 39
#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
@ -114,6 +114,7 @@
#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 58)
/**
* @}

View File

@ -73,7 +73,7 @@
*
* Once all values have been set, it must be initialized with swr_init(). If
* you need to change the conversion parameters, you can change the parameters
* using @ref AVOptions, as described above in the first example; or by using
* using @ref avoptions, as described above in the first example; or by using
* swr_alloc_set_opts2(), but with the first argument the allocated context.
* You must then call swr_init() again.
*
@ -286,8 +286,8 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
* On error, the Swr context is freed and *ps set to NULL.
*/
int swr_alloc_set_opts2(struct SwrContext **ps,
AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
int log_offset, void *log_ctx);
/**
* @}
@ -354,8 +354,8 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
* in this case the output timestamps will match output sample numbers.
* See ffmpeg-resampler(1) for the two modes of compensation.
*
* @param s[in] initialized Swr context
* @param pts[in] timestamp for the next input sample, INT64_MIN if unknown
* @param[in] s initialized Swr context
* @param[in] pts timestamp for the next input sample, INT64_MIN if unknown
* @see swr_set_compensation(), swr_drop_output(), and swr_inject_silence() are
* function used internally for timestamp compensation.
* @return the output timestamp for the next output sample
@ -636,8 +636,8 @@ int swr_convert_frame(SwrContext *swr,
* @see swr_close();
*
* @param swr audio resample context
* @param output output AVFrame
* @param input input AVFrame
* @param out output AVFrame
* @param in input AVFrame
* @return 0 on success, AVERROR on failure.
*/
int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in);

View File

@ -30,7 +30,7 @@
#include "version_major.h"
#define LIBSWRESAMPLE_VERSION_MINOR 6
#define LIBSWRESAMPLE_VERSION_MINOR 9
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \

View File

@ -18,7 +18,7 @@ index 11eee51a98..9e199eb56f 100644
@@ -25,6 +25,7 @@
#include "avcodec.h"
#include "codec_internal.h"
#include "internal.h"
#include "decode.h"
+#include "fmtconvert.h"
#ifdef AACDECODER_LIB_VL0
@ -43,7 +43,7 @@ index 11eee51a98..9e199eb56f 100644
if (!s->decoder_buffer)
return AVERROR(ENOMEM);
+ ff_fmt_convert_init(&s->fmt_conv, avctx);
+ ff_fmt_convert_init(&s->fmt_conv);
+
return 0;
}

Binary file not shown.

Binary file not shown.