diff --git a/ffmpeg/ffmpeg_version.txt b/ffmpeg/ffmpeg_version.txt index 98b39b4..71a620f 100644 --- a/ffmpeg/ffmpeg_version.txt +++ b/ffmpeg/ffmpeg_version.txt @@ -1,3 +1,3 @@ -FFmpeg 4.0 +FFmpeg 4.2.2 -../configure --disable-programs --disable-filters --disable-everything --disable-avdevice --disable-swscale --enable-avresample --enable-decoder=dvdsub --enable-decoder=pgssub --enable-decoder=aac --enable-decoder=mp3 --enable-decoder=mp2 --enable-decoder=mp1 --enable-decoder=ac3 --enable-decoder=eac3 --enable-decoder=truehd --enable-decoder=alac --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=flac --enable-decoder=mlp --enable-decoder=dca --enable-decoder=pcm --enable-encoder=ac3 --enable-filter=aresample --enable-parser=opus --enable-muxer=opus --prefix=/Users/damians/Desktop/iffmpeg --extra-cxxflags="-mmacosx-version-min=10.10" --extra-cflags="-mmacosx-version-min=10.10" --extra-ldflags="-mmacosx-version-min=10.10" --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_s16be --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s8 --enable-decoder=pcm_u8 --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --disable-iconv \ No newline at end of file +../configure --disable-programs --disable-filters --disable-everything --disable-avdevice --disable-swscale --enable-decoder=dvdsub --enable-decoder=pgssub --enable-decoder=aac --enable-decoder=mp3 --enable-decoder=mp2 --enable-decoder=mp1 --enable-decoder=ac3 --enable-decoder=eac3 --enable-decoder=truehd --enable-decoder=alac --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=flac --enable-decoder=mlp --enable-decoder=dca --enable-decoder=pcm --enable-encoder=ac3 --enable-filter=aresample --enable-parser=opus --enable-muxer=opus --prefix=/Users/damians/Desktop/iffmpeg --extra-cxxflags="-mmacosx-version-min=10.11" --extra-cflags="-mmacosx-version-min=10.10" --extra-ldflags="-mmacosx-version-min=10.11" --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_s16be --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s8 --enable-decoder=pcm_u8 --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --disable-iconv \ No newline at end of file diff --git a/ffmpeg/include/libavcodec/avcodec.h b/ffmpeg/include/libavcodec/avcodec.h index fb0c6fa..d234271 100644 --- a/ffmpeg/include/libavcodec/avcodec.h +++ b/ffmpeg/include/libavcodec/avcodec.h @@ -409,6 +409,7 @@ enum AVCodecID { AV_CODEC_ID_DXV, AV_CODEC_ID_SCREENPRESSO, AV_CODEC_ID_RSCC, + AV_CODEC_ID_AVS2, AV_CODEC_ID_Y41P = 0x8000, AV_CODEC_ID_AVRP, @@ -446,6 +447,16 @@ enum AVCodecID { AV_CODEC_ID_SVG, AV_CODEC_ID_GDV, AV_CODEC_ID_FITS, + AV_CODEC_ID_IMM4, + AV_CODEC_ID_PROSUMER, + AV_CODEC_ID_MWSC, + AV_CODEC_ID_WCMV, + AV_CODEC_ID_RASC, + AV_CODEC_ID_HYMT, + AV_CODEC_ID_ARBC, + AV_CODEC_ID_AGM, + AV_CODEC_ID_LSCR, + AV_CODEC_ID_VP4, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -485,6 +496,7 @@ enum AVCodecID { AV_CODEC_ID_PCM_S64BE, AV_CODEC_ID_PCM_F16LE, AV_CODEC_ID_PCM_F24LE, + AV_CODEC_ID_PCM_VIDC, /* various ADPCM codecs */ AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, @@ -529,6 +541,7 @@ enum AVCodecID { AV_CODEC_ID_ADPCM_AICA, AV_CODEC_ID_ADPCM_IMA_DAT4, AV_CODEC_ID_ADPCM_MTAF, + AV_CODEC_ID_ADPCM_AGM, /* AMR */ AV_CODEC_ID_AMR_NB = 0x12000, @@ -637,6 +650,8 @@ enum AVCodecID { AV_CODEC_ID_APTX, AV_CODEC_ID_APTX_HD, AV_CODEC_ID_SBC, + AV_CODEC_ID_ATRAC9, + AV_CODEC_ID_HCOM, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -665,6 +680,8 @@ enum AVCodecID { AV_CODEC_ID_PJS, AV_CODEC_ID_ASS, AV_CODEC_ID_HDMV_TEXT_SUBTITLE, + AV_CODEC_ID_TTML, + AV_CODEC_ID_ARIB_CAPTION, /* other specific kind of codecs (generally used for attachments) */ AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. @@ -843,6 +860,11 @@ typedef struct RcOverride{ * Use qpel MC. */ #define AV_CODEC_FLAG_QPEL (1 << 4) +/** + * Don't output frames whose parameters differ from first + * decoded frame in stream. + */ +#define AV_CODEC_FLAG_DROPCHANGED (1 << 5) /** * Use internal 2pass ratecontrol in first pass mode. */ @@ -1062,6 +1084,13 @@ typedef struct RcOverride{ */ #define AV_CODEC_CAP_HYBRID (1 << 19) +/** + * This codec takes the reordered_opaque field from input AVFrames + * and returns it in the corresponding field in AVCodecContext after + * encoding. + */ +#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20) + /** * Pan Scan area. * This specifies the area which should be displayed. @@ -1101,17 +1130,29 @@ typedef struct AVCPBProperties { * Maximum bitrate of the stream, in bits per second. * Zero if unknown or unspecified. */ +#if FF_API_UNSANITIZED_BITRATES int max_bitrate; +#else + int64_t max_bitrate; +#endif /** * Minimum bitrate of the stream, in bits per second. * Zero if unknown or unspecified. */ +#if FF_API_UNSANITIZED_BITRATES int min_bitrate; +#else + int64_t min_bitrate; +#endif /** * Average bitrate of the stream, in bits per second. * Zero if unknown or unspecified. */ +#if FF_API_UNSANITIZED_BITRATES int avg_bitrate; +#else + int64_t avg_bitrate; +#endif /** * The size of the buffer to which the ratecontrol is applied, in bits. @@ -1312,7 +1353,7 @@ enum AVPacketSideDataType { AV_PKT_DATA_METADATA_UPDATE, /** - * MPEGTS stream ID, this is required to pass the stream ID + * MPEGTS stream ID as uint8_t, this is required to pass the stream ID * information from the demuxer to the corresponding muxer. */ AV_PKT_DATA_MPEGTS_STREAM_ID, @@ -1357,6 +1398,12 @@ enum AVPacketSideDataType { */ AV_PKT_DATA_ENCRYPTION_INFO, + /** + * Active Format Description data consisting of a single byte as specified + * in ETSI TS 101 154 using AVActiveFormatDescription enum. + */ + AV_PKT_DATA_AFD, + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may @@ -1612,6 +1659,7 @@ typedef struct AVCodecContext { * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger * than extradata_size to avoid problems if it is read with the bitstream reader. * The bytewise contents of extradata must not depend on the architecture or CPU endianness. + * Must be allocated with the av_malloc() family of functions. * - encoding: Set/allocated/freed by libavcodec. * - decoding: Set/allocated/freed by user. */ @@ -2009,15 +2057,19 @@ typedef struct AVCodecContext { /** * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. + * Must be allocated with the av_malloc() family of functions, and will be freed in + * avcodec_free_context(). + * - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. + * - decoding: Set/allocated/freed by libavcodec. */ uint16_t *intra_matrix; /** * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. + * Must be allocated with the av_malloc() family of functions, and will be freed in + * avcodec_free_context(). + * - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. + * - decoding: Set/allocated/freed by libavcodec. */ uint16_t *inter_matrix; @@ -2661,7 +2713,10 @@ typedef struct AVCodecContext { /** * opaque 64-bit number (generally a PTS) that will be reordered and * output in AVFrame.reordered_opaque - * - encoding: unused + * - encoding: Set by libavcodec to the reordered_opaque of the input + * frame corresponding to the last returned packet. Only + * supported by encoders with the + * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability. * - decoding: Set by user. */ int64_t reordered_opaque; @@ -2945,6 +3000,16 @@ typedef struct AVCodecContext { #define FF_PROFILE_SBC_MSBC 1 +#define FF_PROFILE_PRORES_PROXY 0 +#define FF_PROFILE_PRORES_LT 1 +#define FF_PROFILE_PRORES_STANDARD 2 +#define FF_PROFILE_PRORES_HQ 3 +#define FF_PROFILE_PRORES_4444 4 +#define FF_PROFILE_PRORES_XQ 5 + +#define FF_PROFILE_ARIB_PROFILE_A 0 +#define FF_PROFILE_ARIB_PROFILE_C 1 + /** * level * - encoding: Set by user. @@ -3297,6 +3362,14 @@ typedef struct AVCodecContext { * used as reference pictures). */ int extra_hw_frames; + + /** + * The percentage of damaged samples to discard a frame. + * + * - decoding: set by user + * - encoding: unused + */ + int discard_damaged_percentage; } AVCodecContext; #if FF_API_CODEC_GET_SET @@ -4349,7 +4422,7 @@ int av_grow_packet(AVPacket *pkt, int grow_by); * Initialize a reference-counted packet from av_malloc()ed data. * * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. + * and buf fields, all others are left untouched. * @param data Data allocated by av_malloc() to be used as packet data. If this * function returns successfully, the data is owned by the underlying AVBuffer. * The caller may not access the data through other means. @@ -4855,6 +4928,9 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); * AVERROR_EOF: the decoder has been fully flushed, and there will be * no more output frames * AVERROR(EINVAL): codec not opened, or it is an encoder + * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters + * with respect to first decoded frame. Applicable + * when flag AV_CODEC_FLAG_DROPCHANGED is set. * other negative values: legitimate decoding errors */ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); @@ -5766,6 +5842,7 @@ typedef struct AVBitStreamFilter { int (*init)(AVBSFContext *ctx); int (*filter)(AVBSFContext *ctx, AVPacket *pkt); void (*close)(AVBSFContext *ctx); + void (*flush)(AVBSFContext *ctx); } AVBitStreamFilter; #if FF_API_OLD_BSF @@ -5892,6 +5969,11 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); */ int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt); +/** + * Reset the internal bitstream filter state / flush internal buffers. + */ +void av_bsf_flush(AVBSFContext *ctx); + /** * Free a bitstream filter context and everything associated with it; write NULL * into the supplied pointer. diff --git a/ffmpeg/include/libavcodec/mediacodec.h b/ffmpeg/include/libavcodec/mediacodec.h index 5606d24..4c8545d 100644 --- a/ffmpeg/include/libavcodec/mediacodec.h +++ b/ffmpeg/include/libavcodec/mediacodec.h @@ -85,4 +85,17 @@ typedef struct MediaCodecBuffer AVMediaCodecBuffer; */ 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. + * + * @param buffer the buffer to render + * @param time timestamp in nanoseconds of when to render the buffer + * @return 0 on success, < 0 otherwise + */ +int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time); + #endif /* AVCODEC_MEDIACODEC_H */ diff --git a/ffmpeg/include/libavcodec/version.h b/ffmpeg/include/libavcodec/version.h index 6895f1a..3331d47 100644 --- a/ffmpeg/include/libavcodec/version.h +++ b/ffmpeg/include/libavcodec/version.h @@ -28,7 +28,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 58 -#define LIBAVCODEC_VERSION_MINOR 18 +#define LIBAVCODEC_VERSION_MINOR 54 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ @@ -132,6 +132,9 @@ #ifndef FF_API_NEXT #define FF_API_NEXT (LIBAVCODEC_VERSION_MAJOR < 59) #endif +#ifndef FF_API_UNSANITIZED_BITRATES +#define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59) +#endif #endif /* AVCODEC_VERSION_H */ diff --git a/ffmpeg/include/libavfilter/buffersink.h b/ffmpeg/include/libavfilter/buffersink.h index 21d6bb5..3c846bb 100644 --- a/ffmpeg/include/libavfilter/buffersink.h +++ b/ffmpeg/include/libavfilter/buffersink.h @@ -151,7 +151,7 @@ int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame); * the end of stream, when it can contain less than nb_samples. * * @return The return codes have the same meaning as for - * av_buffersink_get_samples(). + * av_buffersink_get_frame(). * * @warning do not mix this function with av_buffersink_get_frame(). Use only one or * the other with a single sink, not both. diff --git a/ffmpeg/include/libavfilter/buffersrc.h b/ffmpeg/include/libavfilter/buffersrc.h index 0652113..08fbd18 100644 --- a/ffmpeg/include/libavfilter/buffersrc.h +++ b/ffmpeg/include/libavfilter/buffersrc.h @@ -106,7 +106,7 @@ typedef struct AVBufferSrcParameters { AVBufferRef *hw_frames_ctx; /** - * Audio only, the audio sampling rate in samples per secon. + * Audio only, the audio sampling rate in samples per second. */ int sample_rate; diff --git a/ffmpeg/include/libavfilter/version.h b/ffmpeg/include/libavfilter/version.h index 87468df..cc5b23b 100644 --- a/ffmpeg/include/libavfilter/version.h +++ b/ffmpeg/include/libavfilter/version.h @@ -30,9 +30,10 @@ #include "libavutil/version.h" #define LIBAVFILTER_VERSION_MAJOR 7 -#define LIBAVFILTER_VERSION_MINOR 16 +#define LIBAVFILTER_VERSION_MINOR 57 #define LIBAVFILTER_VERSION_MICRO 100 + #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ LIBAVFILTER_VERSION_MICRO) diff --git a/ffmpeg/include/libavformat/avformat.h b/ffmpeg/include/libavformat/avformat.h index a2fe7c6..6eb329f 100644 --- a/ffmpeg/include/libavformat/avformat.h +++ b/ffmpeg/include/libavformat/avformat.h @@ -36,17 +36,15 @@ * into component streams, and the reverse process of muxing - writing supplied * data in a specified container format. It also has an @ref lavf_io * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. + * file, tcp, http and others). * Unless you are absolutely sure you won't use libavformat's network * capabilities, you should also call avformat_network_init(). * * A supported input format is described by an AVInputFormat struct, conversely * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. + * input/output formats using the av_demuxer_iterate / av_muxer_iterate() functions. + * The protocols layer is not part of the public API, so you can only get the names + * of supported protocols with the avio_enum_protocols() function. * * Main lavf structure used for both muxing and demuxing is AVFormatContext, * which exports all information about the file being read or written. As with @@ -177,8 +175,8 @@ * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a * static storage somewhere inside the demuxer and the packet is only valid * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. + * requires a longer lifetime, av_packet_make_refcounted() will ensure that + * the data is reference counted, copying the data if necessary. * In both cases, the packet must be freed with av_packet_unref() when it is no * longer needed. * @@ -532,7 +530,16 @@ typedef struct AVOutputFormat { * New public fields should be added right above. ***************************************************************** */ - struct AVOutputFormat *next; + /** + * The ff_const59 define is not part of the public API and will + * be removed without further warning. + */ +#if FF_API_AVIOFORMAT +#define ff_const59 +#else +#define ff_const59 const +#endif + ff_const59 struct AVOutputFormat *next; /** * size of private data so that it can be allocated in the wrapper */ @@ -646,7 +653,7 @@ typedef struct AVInputFormat { /** * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, + * AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. */ int flags; @@ -676,7 +683,7 @@ typedef struct AVInputFormat { * New public fields should be added right above. ***************************************************************** */ - struct AVInputFormat *next; + ff_const59 struct AVInputFormat *next; /** * Raw demuxers store their codec ID here. @@ -693,7 +700,7 @@ typedef struct AVInputFormat { * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes * big so you do not have to check for that unless you need more. */ - int (*read_probe)(AVProbeData *); + int (*read_probe)(const AVProbeData *); /** * Read the format header and initialize the AVFormatContext @@ -846,6 +853,7 @@ typedef struct AVStreamInternal AVStreamInternal; #define AV_DISPOSITION_DESCRIPTIONS 0x20000 #define AV_DISPOSITION_METADATA 0x40000 #define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts) +#define AV_DISPOSITION_STILL_IMAGE 0x100000 ///< still images in video stream (still_picture_flag=1 in mpegts) /** * Options for behavior on timestamp wrap detection. @@ -1102,6 +1110,13 @@ typedef struct AVStream { */ int stream_identifier; + /** + * Details of the MPEG-TS program which created this stream. + */ + int program_num; + int pmt_version; + int pmt_stream_idx; + int64_t interleaver_chunk_size; int64_t interleaver_chunk_duration; @@ -1259,6 +1274,7 @@ typedef struct AVProgram { int program_num; int pmt_pid; int pcr_pid; + int pmt_version; /***************************************************************** * All fields below this line are not part of the public API. They @@ -1337,14 +1353,14 @@ typedef struct AVFormatContext { * * Demuxing only, set by avformat_open_input(). */ - struct AVInputFormat *iformat; + ff_const59 struct AVInputFormat *iformat; /** * The output container format. * * Muxing only, must be set by the caller before avformat_write_header(). */ - struct AVOutputFormat *oformat; + ff_const59 struct AVOutputFormat *oformat; /** * Format private data. This is an AVOptions-enabled struct @@ -1474,7 +1490,9 @@ typedef struct AVFormatContext { * This flag is mainly intended for testing. */ #define AVFMT_FLAG_BITEXACT 0x0400 -#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Enable RTP MP4A-LATM payload +#if FF_API_LAVF_MP4A_LATM +#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Deprecated, does nothing. +#endif #define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) #define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) #if FF_API_LAVF_KEEPSIDE_FLAG @@ -1926,6 +1944,13 @@ typedef struct AVFormatContext { * - decoding: set by user */ int max_streams; + + /** + * Skip duration calcuation in estimate_timings_from_pts. + * - encoding: unused + * - decoding: set by user + */ + int skip_estimate_duration_from_pts; } AVFormatContext; #if FF_API_FORMAT_GET_SET @@ -2193,7 +2218,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id); * @return >= 0 in case of success, a negative AVERROR code in case of * failure */ -int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat, +int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFormat *oformat, const char *format_name, const char *filename); /** @@ -2204,7 +2229,7 @@ int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oforma /** * Find AVInputFormat based on the short name of the input format. */ -AVInputFormat *av_find_input_format(const char *short_name); +ff_const59 AVInputFormat *av_find_input_format(const char *short_name); /** * Guess the file format. @@ -2213,7 +2238,7 @@ AVInputFormat *av_find_input_format(const char *short_name); * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. */ -AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); +ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int is_opened); /** * Guess the file format. @@ -2227,7 +2252,7 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended * to retry with a larger probe buffer. */ -AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); +ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max); /** * Guess the file format. @@ -2236,7 +2261,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score * demuxers with or without AVFMT_NOFILE are probed. * @param score_ret The score of the best detection. */ -AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret); +ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int is_opened, int *score_ret); /** * Probe a bytestream to determine the input format. Each time a probe returns @@ -2254,14 +2279,14 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score * the maximal score is AVPROBE_SCORE_MAX * AVERROR code otherwise */ -int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, +int av_probe_input_buffer2(AVIOContext *pb, ff_const59 AVInputFormat **fmt, const char *url, void *logctx, unsigned int offset, unsigned int max_probe_size); /** * Like av_probe_input_buffer2() but returns 0 on success */ -int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, +int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt, const char *url, void *logctx, unsigned int offset, unsigned int max_probe_size); @@ -2284,7 +2309,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, * * @note If you want to use custom IO, preallocate the format context and set its pb field. */ -int avformat_open_input(AVFormatContext **ps, const char *url, AVInputFormat *fmt, AVDictionary **options); +int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options); attribute_deprecated int av_demuxer_open(AVFormatContext *ic); @@ -2669,14 +2694,14 @@ int av_write_trailer(AVFormatContext *s); * @param mime_type if non-NULL checks if mime_type matches with the * MIME type of the registered formats */ -AVOutputFormat *av_guess_format(const char *short_name, +ff_const59 AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type); /** * Guess the codec ID based upon muxer and filename. */ -enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, +enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type); diff --git a/ffmpeg/include/libavformat/avio.h b/ffmpeg/include/libavformat/avio.h index 75912ce..dcb8dcd 100644 --- a/ffmpeg/include/libavformat/avio.h +++ b/ffmpeg/include/libavformat/avio.h @@ -236,7 +236,7 @@ typedef struct AVIOContext { int (*write_packet)(void *opaque, uint8_t *buf, int buf_size); int64_t (*seek)(void *opaque, int64_t offset, int whence); int64_t pos; /**< position in the file of the current buffer */ - int eof_reached; /**< true if eof reached */ + int eof_reached; /**< true if was unable to read due to error or eof */ int write_flag; /**< true if open for writing */ int max_packet_size; unsigned long checksum; @@ -566,8 +566,8 @@ static av_always_inline int64_t avio_tell(AVIOContext *s) int64_t avio_size(AVIOContext *s); /** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file + * Similar to feof() but also returns nonzero on read errors. + * @return non zero if and only if at end of file or a read error happened when reading. */ int avio_feof(AVIOContext *s); diff --git a/ffmpeg/include/libavformat/version.h b/ffmpeg/include/libavformat/version.h index a0a26d5..22ed534 100644 --- a/ffmpeg/include/libavformat/version.h +++ b/ffmpeg/include/libavformat/version.h @@ -32,7 +32,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 -#define LIBAVFORMAT_VERSION_MINOR 12 +#define LIBAVFORMAT_VERSION_MINOR 29 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ @@ -70,6 +70,9 @@ #ifndef FF_API_HLS_WRAP #define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 59) #endif +#ifndef FF_API_HLS_USE_LOCALTIME +#define FF_API_HLS_USE_LOCALTIME (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif #ifndef FF_API_LAVF_KEEPSIDE_FLAG #define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 59) #endif @@ -94,6 +97,15 @@ #ifndef FF_API_NEXT #define FF_API_NEXT (LIBAVFORMAT_VERSION_MAJOR < 59) #endif +#ifndef FF_API_DASH_MIN_SEG_DURATION +#define FF_API_DASH_MIN_SEG_DURATION (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_LAVF_MP4A_LATM +#define FF_API_LAVF_MP4A_LATM (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_AVIOFORMAT +#define FF_API_AVIOFORMAT (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif #ifndef FF_API_R_FRAME_RATE diff --git a/ffmpeg/include/libavresample/avresample.h b/ffmpeg/include/libavresample/avresample.h deleted file mode 100644 index 5ac9adb..0000000 --- a/ffmpeg/include/libavresample/avresample.h +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright (c) 2012 Justin Ruggles - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVRESAMPLE_AVRESAMPLE_H -#define AVRESAMPLE_AVRESAMPLE_H - -/** - * @file - * @ingroup lavr - * external API header - */ - -/** - * @defgroup lavr libavresample - * @{ - * - * Libavresample (lavr) is a library that handles audio resampling, sample - * format conversion and mixing. - * - * Interaction with lavr is done through AVAudioResampleContext, which is - * allocated with avresample_alloc_context(). It is opaque, so all parameters - * must be set with the @ref avoptions API. - * - * For example the following code will setup conversion from planar float sample - * format to interleaved signed 16-bit integer, downsampling from 48kHz to - * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing - * matrix): - * @code - * AVAudioResampleContext *avr = avresample_alloc_context(); - * av_opt_set_int(avr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0); - * av_opt_set_int(avr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0); - * av_opt_set_int(avr, "in_sample_rate", 48000, 0); - * av_opt_set_int(avr, "out_sample_rate", 44100, 0); - * av_opt_set_int(avr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); - * av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); - * @endcode - * - * Once the context is initialized, it must be opened with avresample_open(). If - * you need to change the conversion parameters, you must close the context with - * avresample_close(), change the parameters as described above, then reopen it - * again. - * - * The conversion itself is done by repeatedly calling avresample_convert(). - * Note that the samples may get buffered in two places in lavr. The first one - * is the output FIFO, where the samples end up if the output buffer is not - * large enough. The data stored in there may be retrieved at any time with - * avresample_read(). The second place is the resampling delay buffer, - * applicable only when resampling is done. The samples in it require more input - * before they can be processed. Their current amount is returned by - * avresample_get_delay(). At the end of conversion the resampling buffer can be - * flushed by calling avresample_convert() with NULL input. - * - * The following code demonstrates the conversion loop assuming the parameters - * from above and caller-defined functions get_input() and handle_output(): - * @code - * uint8_t **input; - * int in_linesize, in_samples; - * - * while (get_input(&input, &in_linesize, &in_samples)) { - * uint8_t *output - * int out_linesize; - * int out_samples = avresample_get_out_samples(avr, in_samples); - * - * av_samples_alloc(&output, &out_linesize, 2, out_samples, - * AV_SAMPLE_FMT_S16, 0); - * out_samples = avresample_convert(avr, &output, out_linesize, out_samples, - * input, in_linesize, in_samples); - * handle_output(output, out_linesize, out_samples); - * av_freep(&output); - * } - * @endcode - * - * When the conversion is finished and the FIFOs are flushed if required, the - * conversion context and everything associated with it must be freed with - * avresample_free(). - */ - -#include "libavutil/avutil.h" -#include "libavutil/channel_layout.h" -#include "libavutil/dict.h" -#include "libavutil/frame.h" -#include "libavutil/log.h" -#include "libavutil/mathematics.h" - -#include "libavresample/version.h" - -#define AVRESAMPLE_MAX_CHANNELS 32 - -typedef struct AVAudioResampleContext AVAudioResampleContext; - -/** - * @deprecated use libswresample - * - * Mixing Coefficient Types */ -enum attribute_deprecated AVMixCoeffType { - AV_MIX_COEFF_TYPE_Q8, /** 16-bit 8.8 fixed-point */ - AV_MIX_COEFF_TYPE_Q15, /** 32-bit 17.15 fixed-point */ - AV_MIX_COEFF_TYPE_FLT, /** floating-point */ - AV_MIX_COEFF_TYPE_NB, /** Number of coeff types. Not part of ABI */ -}; - -/** - * @deprecated use libswresample - * - * Resampling Filter Types */ -enum attribute_deprecated AVResampleFilterType { - AV_RESAMPLE_FILTER_TYPE_CUBIC, /**< Cubic */ - AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall Windowed Sinc */ - AV_RESAMPLE_FILTER_TYPE_KAISER, /**< Kaiser Windowed Sinc */ -}; - -/** - * @deprecated use libswresample - */ -enum attribute_deprecated AVResampleDitherMethod { - AV_RESAMPLE_DITHER_NONE, /**< Do not use dithering */ - AV_RESAMPLE_DITHER_RECTANGULAR, /**< Rectangular Dither */ - AV_RESAMPLE_DITHER_TRIANGULAR, /**< Triangular Dither*/ - AV_RESAMPLE_DITHER_TRIANGULAR_HP, /**< Triangular Dither with High Pass */ - AV_RESAMPLE_DITHER_TRIANGULAR_NS, /**< Triangular Dither with Noise Shaping */ - AV_RESAMPLE_DITHER_NB, /**< Number of dither types. Not part of ABI. */ -}; - -/** - * - * @deprecated use libswresample - * - * Return the LIBAVRESAMPLE_VERSION_INT constant. - */ -attribute_deprecated -unsigned avresample_version(void); - -/** - * - * @deprecated use libswresample - * - * Return the libavresample build-time configuration. - * @return configure string - */ -attribute_deprecated -const char *avresample_configuration(void); - -/** - * - * @deprecated use libswresample - * - * Return the libavresample license. - */ -attribute_deprecated -const char *avresample_license(void); - -/** - * - * @deprecated use libswresample - * - * Get the AVClass for AVAudioResampleContext. - * - * Can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options - * without allocating a context. - * - * @see av_opt_find(). - * - * @return AVClass for AVAudioResampleContext - */ -attribute_deprecated -const AVClass *avresample_get_class(void); - -/** - * - * @deprecated use libswresample - * - * Allocate AVAudioResampleContext and set options. - * - * @return allocated audio resample context, or NULL on failure - */ -attribute_deprecated -AVAudioResampleContext *avresample_alloc_context(void); - -/** - * - * @deprecated use libswresample - * - * Initialize AVAudioResampleContext. - * @note The context must be configured using the AVOption API. - * @note The fields "in_channel_layout", "out_channel_layout", - * "in_sample_rate", "out_sample_rate", "in_sample_fmt", - * "out_sample_fmt" must be set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * @see av_get_default_channel_layout() - * - * @param avr audio resample context - * @return 0 on success, negative AVERROR code on failure - */ -attribute_deprecated -int avresample_open(AVAudioResampleContext *avr); - -/** - * - * @deprecated use libswresample - * - * Check whether an AVAudioResampleContext is open or closed. - * - * @param avr AVAudioResampleContext to check - * @return 1 if avr is open, 0 if avr is closed. - */ -attribute_deprecated -int avresample_is_open(AVAudioResampleContext *avr); - -/** - * - * @deprecated use libswresample - * - * Close AVAudioResampleContext. - * - * This closes the context, but it does not change the parameters. The context - * can be reopened with avresample_open(). It does, however, clear the output - * FIFO and any remaining leftover samples in the resampling delay buffer. If - * there was a custom matrix being used, that is also cleared. - * - * @see avresample_convert() - * @see avresample_set_matrix() - * - * @param avr audio resample context - */ -attribute_deprecated -void avresample_close(AVAudioResampleContext *avr); - -/** - * - * @deprecated use libswresample - * - * Free AVAudioResampleContext and associated AVOption values. - * - * This also calls avresample_close() before freeing. - * - * @param avr audio resample context - */ -attribute_deprecated -void avresample_free(AVAudioResampleContext **avr); - -/** - * - * @deprecated use libswresample - * - * Generate a channel mixing matrix. - * - * This function is the one used internally by libavresample for building the - * default mixing matrix. It is made public just as a utility function for - * building custom matrices. - * - * @param in_layout input channel layout - * @param out_layout output channel layout - * @param center_mix_level mix level for the center channel - * @param surround_mix_level mix level for the surround channel(s) - * @param lfe_mix_level mix level for the low-frequency effects channel - * @param normalize if 1, coefficients will be normalized to prevent - * overflow. if 0, coefficients will not be - * normalized. - * @param[out] matrix mixing coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o. - * @param stride distance between adjacent input channels in the - * matrix array - * @param matrix_encoding matrixed stereo downmix mode (e.g. dplii) - * @return 0 on success, negative AVERROR code on failure - */ -attribute_deprecated -int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout, - double center_mix_level, double surround_mix_level, - double lfe_mix_level, int normalize, double *matrix, - int stride, enum AVMatrixEncoding matrix_encoding); - -/** - * - * @deprecated use libswresample - * - * Get the current channel mixing matrix. - * - * If no custom matrix has been previously set or the AVAudioResampleContext is - * not open, an error is returned. - * - * @param avr audio resample context - * @param matrix mixing coefficients; matrix[i + stride * o] is the weight of - * input channel i in output channel o. - * @param stride distance between adjacent input channels in the matrix array - * @return 0 on success, negative AVERROR code on failure - */ -attribute_deprecated -int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix, - int stride); - -/** - * - * @deprecated use libswresample - * - * Set channel mixing matrix. - * - * Allows for setting a custom mixing matrix, overriding the default matrix - * generated internally during avresample_open(). This function can be called - * anytime on an allocated context, either before or after calling - * avresample_open(), as long as the channel layouts have been set. - * avresample_convert() always uses the current matrix. - * Calling avresample_close() on the context will clear the current matrix. - * - * @see avresample_close() - * - * @param avr audio resample context - * @param matrix mixing coefficients; matrix[i + stride * o] is the weight of - * input channel i in output channel o. - * @param stride distance between adjacent input channels in the matrix array - * @return 0 on success, negative AVERROR code on failure - */ -attribute_deprecated -int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix, - int stride); - -/** - * - * @deprecated use libswresample - * - * Set a customized input channel mapping. - * - * This function can only be called when the allocated context is not open. - * Also, the input channel layout must have already been set. - * - * Calling avresample_close() on the context will clear the channel mapping. - * - * The map for each input channel specifies the channel index in the source to - * use for that particular channel, or -1 to mute the channel. Source channels - * can be duplicated by using the same index for multiple input channels. - * - * Examples: - * - * Reordering 5.1 AAC order (C,L,R,Ls,Rs,LFE) to FFmpeg order (L,R,C,LFE,Ls,Rs): - * { 1, 2, 0, 5, 3, 4 } - * - * Muting the 3rd channel in 4-channel input: - * { 0, 1, -1, 3 } - * - * Duplicating the left channel of stereo input: - * { 0, 0 } - * - * @param avr audio resample context - * @param channel_map customized input channel mapping - * @return 0 on success, negative AVERROR code on failure - */ -attribute_deprecated -int avresample_set_channel_mapping(AVAudioResampleContext *avr, - const int *channel_map); - -/** - * - * @deprecated use libswresample - * - * Set compensation for resampling. - * - * This can be called anytime after avresample_open(). If resampling is not - * automatically enabled because of a sample rate conversion, the - * "force_resampling" option must have been set to 1 when opening the context - * in order to use resampling compensation. - * - * @param avr audio resample context - * @param sample_delta compensation delta, in samples - * @param compensation_distance compensation distance, in samples - * @return 0 on success, negative AVERROR code on failure - */ -attribute_deprecated -int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta, - int compensation_distance); - -/** - * - * @deprecated use libswresample - * - * Provide the upper bound on the number of samples the configured - * conversion would output. - * - * @param avr audio resample context - * @param in_nb_samples number of input samples - * - * @return number of samples or AVERROR(EINVAL) if the value - * would exceed INT_MAX - */ -attribute_deprecated -int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples); - -/** - * - * @deprecated use libswresample - * - * Convert input samples and write them to the output FIFO. - * - * The upper bound on the number of output samples can be obtained through - * avresample_get_out_samples(). - * - * The output data can be NULL or have fewer allocated samples than required. - * In this case, any remaining samples not written to the output will be added - * to an internal FIFO buffer, to be returned at the next call to this function - * or to avresample_read(). - * - * If converting sample rate, there may be data remaining in the internal - * resampling delay buffer. avresample_get_delay() tells the number of remaining - * samples. To get this data as output, call avresample_convert() with NULL - * input. - * - * At the end of the conversion process, there may be data remaining in the - * internal FIFO buffer. avresample_available() tells the number of remaining - * samples. To get this data as output, either call avresample_convert() with - * NULL input or call avresample_read(). - * - * @see avresample_get_out_samples() - * @see avresample_read() - * @see avresample_get_delay() - * - * @param avr audio resample context - * @param output output data pointers - * @param out_plane_size output plane size, in bytes. - * This can be 0 if unknown, but that will lead to - * optimized functions not being used directly on the - * output, which could slow down some conversions. - * @param out_samples maximum number of samples that the output buffer can hold - * @param input input data pointers - * @param in_plane_size input plane size, in bytes - * This can be 0 if unknown, but that will lead to - * optimized functions not being used directly on the - * input, which could slow down some conversions. - * @param in_samples number of input samples to convert - * @return number of samples written to the output buffer, - * not including converted samples added to the internal - * output FIFO - */ -attribute_deprecated -int avresample_convert(AVAudioResampleContext *avr, uint8_t **output, - int out_plane_size, int out_samples, - uint8_t * const *input, int in_plane_size, - int in_samples); - -/** - * - * @deprecated use libswresample - * - * Return the number of samples currently in the resampling delay buffer. - * - * When resampling, there may be a delay between the input and output. Any - * unconverted samples in each call are stored internally in a delay buffer. - * This function allows the user to determine the current number of samples in - * the delay buffer, which can be useful for synchronization. - * - * @see avresample_convert() - * - * @param avr audio resample context - * @return number of samples currently in the resampling delay buffer - */ -attribute_deprecated -int avresample_get_delay(AVAudioResampleContext *avr); - -/** - * - * @deprecated use libswresample - * - * Return the number of available samples in the output FIFO. - * - * During conversion, if the user does not specify an output buffer or - * specifies an output buffer that is smaller than what is needed, remaining - * samples that are not written to the output are stored to an internal FIFO - * buffer. The samples in the FIFO can be read with avresample_read() or - * avresample_convert(). - * - * @see avresample_read() - * @see avresample_convert() - * - * @param avr audio resample context - * @return number of samples available for reading - */ -attribute_deprecated -int avresample_available(AVAudioResampleContext *avr); - -/** - * - * @deprecated use libswresample - * - * Read samples from the output FIFO. - * - * During conversion, if the user does not specify an output buffer or - * specifies an output buffer that is smaller than what is needed, remaining - * samples that are not written to the output are stored to an internal FIFO - * buffer. This function can be used to read samples from that internal FIFO. - * - * @see avresample_available() - * @see avresample_convert() - * - * @param avr audio resample context - * @param output output data pointers. May be NULL, in which case - * nb_samples of data is discarded from output FIFO. - * @param nb_samples number of samples to read from the FIFO - * @return the number of samples written to output - */ -attribute_deprecated -int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples); - -/** - * - * @deprecated use libswresample - * - * Convert the samples in the input AVFrame and write them to the output AVFrame. - * - * Input and output AVFrames must have channel_layout, sample_rate and format set. - * - * The upper bound on the number of output samples is obtained through - * avresample_get_out_samples(). - * - * If the output AVFrame does not have the data pointers allocated the nb_samples - * field will be set using avresample_get_out_samples() and av_frame_get_buffer() - * is called to allocate the frame. - * - * The output AVFrame can be NULL or have fewer allocated samples than required. - * In this case, any remaining samples not written to the output will be added - * to an internal FIFO buffer, to be returned at the next call to this function - * or to avresample_convert() or to avresample_read(). - * - * If converting sample rate, there may be data remaining in the internal - * resampling delay buffer. avresample_get_delay() tells the number of - * remaining samples. To get this data as output, call this function or - * avresample_convert() with NULL input. - * - * At the end of the conversion process, there may be data remaining in the - * internal FIFO buffer. avresample_available() tells the number of remaining - * samples. To get this data as output, either call this function or - * avresample_convert() with NULL input or call avresample_read(). - * - * If the AVAudioResampleContext configuration does not match the output and - * input AVFrame settings the conversion does not take place and depending on - * which AVFrame is not matching AVERROR_OUTPUT_CHANGED, AVERROR_INPUT_CHANGED - * or AVERROR_OUTPUT_CHANGED|AVERROR_INPUT_CHANGED is returned. - * - * @see avresample_get_out_samples() - * @see avresample_available() - * @see avresample_convert() - * @see avresample_read() - * @see avresample_get_delay() - * - * @param avr audio resample context - * @param output output AVFrame - * @param input input AVFrame - * @return 0 on success, AVERROR on failure or nonmatching - * configuration. - */ -attribute_deprecated -int avresample_convert_frame(AVAudioResampleContext *avr, - AVFrame *output, AVFrame *input); - -/** - * - * @deprecated use libswresample - * - * Configure or reconfigure the AVAudioResampleContext using the information - * provided by the AVFrames. - * - * The original resampling context is reset even on failure. - * The function calls avresample_close() internally if the context is open. - * - * @see avresample_open(); - * @see avresample_close(); - * - * @param avr audio resample context - * @param out output AVFrame - * @param in input AVFrame - * @return 0 on success, AVERROR on failure. - */ -attribute_deprecated -int avresample_config(AVAudioResampleContext *avr, AVFrame *out, AVFrame *in); - -/** - * @} - */ - -#endif /* AVRESAMPLE_AVRESAMPLE_H */ diff --git a/ffmpeg/include/libavresample/version.h b/ffmpeg/include/libavresample/version.h deleted file mode 100644 index d5d3ea8..0000000 --- a/ffmpeg/include/libavresample/version.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVRESAMPLE_VERSION_H -#define AVRESAMPLE_VERSION_H - -/** - * @file - * @ingroup lavr - * Libavresample version macros. - */ - -#include "libavutil/version.h" - -#define LIBAVRESAMPLE_VERSION_MAJOR 4 -#define LIBAVRESAMPLE_VERSION_MINOR 0 -#define LIBAVRESAMPLE_VERSION_MICRO 0 - -#define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \ - LIBAVRESAMPLE_VERSION_MINOR, \ - LIBAVRESAMPLE_VERSION_MICRO) -#define LIBAVRESAMPLE_VERSION AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \ - LIBAVRESAMPLE_VERSION_MINOR, \ - LIBAVRESAMPLE_VERSION_MICRO) -#define LIBAVRESAMPLE_BUILD LIBAVRESAMPLE_VERSION_INT - -#define LIBAVRESAMPLE_IDENT "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION) - -/** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - */ - -#endif /* AVRESAMPLE_VERSION_H */ diff --git a/ffmpeg/include/libavutil/avassert.h b/ffmpeg/include/libavutil/avassert.h index 46f3fea..9abeade 100644 --- a/ffmpeg/include/libavutil/avassert.h +++ b/ffmpeg/include/libavutil/avassert.h @@ -66,7 +66,7 @@ #endif /** - * Assert that floating point opperations can be executed. + * Assert that floating point operations can be executed. * * This will av_assert0() that the cpu is not in MMX state on X86 */ diff --git a/ffmpeg/include/libavutil/avstring.h b/ffmpeg/include/libavutil/avstring.h index 04d2695..37dd4e2 100644 --- a/ffmpeg/include/libavutil/avstring.h +++ b/ffmpeg/include/libavutil/avstring.h @@ -400,6 +400,12 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end, */ int av_match_list(const char *name, const char *list, char separator); +/** + * See libc sscanf manual for more information. + * Locale-independent sscanf implementation. + */ +int av_sscanf(const char *string, const char *format, ...); + /** * @} */ diff --git a/ffmpeg/include/libavutil/common.h b/ffmpeg/include/libavutil/common.h index 0fffa67..8db0291 100644 --- a/ffmpeg/include/libavutil/common.h +++ b/ffmpeg/include/libavutil/common.h @@ -228,7 +228,7 @@ static av_always_inline av_const int av_clip_intp2_c(int a, int p) */ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { - if (a & ~((1<> 31 & ((1<> 31 & ((1< + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HDR_DYNAMIC_METADATA_H +#define AVUTIL_HDR_DYNAMIC_METADATA_H + +#include "frame.h" +#include "rational.h" + +/** + * Option for overlapping elliptical pixel selectors in an image. + */ +enum AVHDRPlusOverlapProcessOption { + AV_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING = 0, + AV_HDR_PLUS_OVERLAP_PROCESS_LAYERING = 1, +}; + +/** + * Represents the percentile at a specific percentage in + * a distribution. + */ +typedef struct AVHDRPlusPercentile { + /** + * The percentage value corresponding to a specific percentile linearized + * RGB value in the processing window in the scene. The value shall be in + * the range of 0 to100, inclusive. + */ + uint8_t percentage; + + /** + * The linearized maxRGB value at a specific percentile in the processing + * window in the scene. The value shall be in the range of 0 to 1, inclusive + * and in multiples of 0.00001. + */ + AVRational percentile; +} AVHDRPlusPercentile; + +/** + * Color transform parameters at a processing window in a dynamic metadata for + * SMPTE 2094-40. + */ +typedef struct AVHDRPlusColorTransformParams { + /** + * The relative x coordinate of the top left pixel of the processing + * window. The value shall be in the range of 0 and 1, inclusive and + * in multiples of 1/(width of Picture - 1). The value 1 corresponds + * to the absolute coordinate of width of Picture - 1. The value for + * first processing window shall be 0. + */ + AVRational window_upper_left_corner_x; + + /** + * The relative y coordinate of the top left pixel of the processing + * window. The value shall be in the range of 0 and 1, inclusive and + * in multiples of 1/(height of Picture - 1). The value 1 corresponds + * to the absolute coordinate of height of Picture - 1. The value for + * first processing window shall be 0. + */ + AVRational window_upper_left_corner_y; + + /** + * The relative x coordinate of the bottom right pixel of the processing + * window. The value shall be in the range of 0 and 1, inclusive and + * in multiples of 1/(width of Picture - 1). The value 1 corresponds + * to the absolute coordinate of width of Picture - 1. The value for + * first processing window shall be 1. + */ + AVRational window_lower_right_corner_x; + + /** + * The relative y coordinate of the bottom right pixel of the processing + * window. The value shall be in the range of 0 and 1, inclusive and + * in multiples of 1/(height of Picture - 1). The value 1 corresponds + * to the absolute coordinate of height of Picture - 1. The value for + * first processing window shall be 1. + */ + AVRational window_lower_right_corner_y; + + /** + * The x coordinate of the center position of the concentric internal and + * external ellipses of the elliptical pixel selector in the processing + * window. The value shall be in the range of 0 to (width of Picture - 1), + * inclusive and in multiples of 1 pixel. + */ + uint16_t center_of_ellipse_x; + + /** + * The y coordinate of the center position of the concentric internal and + * external ellipses of the elliptical pixel selector in the processing + * window. The value shall be in the range of 0 to (height of Picture - 1), + * inclusive and in multiples of 1 pixel. + */ + uint16_t center_of_ellipse_y; + + /** + * The clockwise rotation angle in degree of arc with respect to the + * positive direction of the x-axis of the concentric internal and external + * ellipses of the elliptical pixel selector in the processing window. The + * value shall be in the range of 0 to 180, inclusive and in multiples of 1. + */ + uint8_t rotation_angle; + + /** + * The semi-major axis value of the internal ellipse of the elliptical pixel + * selector in amount of pixels in the processing window. The value shall be + * in the range of 1 to 65535, inclusive and in multiples of 1 pixel. + */ + uint16_t semimajor_axis_internal_ellipse; + + /** + * The semi-major axis value of the external ellipse of the elliptical pixel + * selector in amount of pixels in the processing window. The value + * shall not be less than semimajor_axis_internal_ellipse of the current + * processing window. The value shall be in the range of 1 to 65535, + * inclusive and in multiples of 1 pixel. + */ + uint16_t semimajor_axis_external_ellipse; + + /** + * The semi-minor axis value of the external ellipse of the elliptical pixel + * selector in amount of pixels in the processing window. The value shall be + * in the range of 1 to 65535, inclusive and in multiples of 1 pixel. + */ + uint16_t semiminor_axis_external_ellipse; + + /** + * Overlap process option indicates one of the two methods of combining + * rendered pixels in the processing window in an image with at least one + * elliptical pixel selector. For overlapping elliptical pixel selectors + * in an image, overlap_process_option shall have the same value. + */ + enum AVHDRPlusOverlapProcessOption overlap_process_option; + + /** + * The maximum of the color components of linearized RGB values in the + * processing window in the scene. The values should be in the range of 0 to + * 1, inclusive and in multiples of 0.00001. maxscl[ 0 ], maxscl[ 1 ], and + * maxscl[ 2 ] are corresponding to R, G, B color components respectively. + */ + AVRational maxscl[3]; + + /** + * The average of linearized maxRGB values in the processing window in the + * scene. The value should be in the range of 0 to 1, inclusive and in + * multiples of 0.00001. + */ + AVRational average_maxrgb; + + /** + * The number of linearized maxRGB values at given percentiles in the + * processing window in the scene. The maximum value shall be 15. + */ + uint8_t num_distribution_maxrgb_percentiles; + + /** + * The linearized maxRGB values at given percentiles in the + * processing window in the scene. + */ + AVHDRPlusPercentile distribution_maxrgb[15]; + + /** + * The fraction of selected pixels in the image that contains the brightest + * pixel in the scene. The value shall be in the range of 0 to 1, inclusive + * and in multiples of 0.001. + */ + AVRational fraction_bright_pixels; + + /** + * This flag indicates that the metadata for the tone mapping function in + * the processing window is present (for value of 1). + */ + uint8_t tone_mapping_flag; + + /** + * The x coordinate of the separation point between the linear part and the + * curved part of the tone mapping function. The value shall be in the range + * of 0 to 1, excluding 0 and in multiples of 1/4095. + */ + AVRational knee_point_x; + + /** + * The y coordinate of the separation point between the linear part and the + * curved part of the tone mapping function. The value shall be in the range + * of 0 to 1, excluding 0 and in multiples of 1/4095. + */ + AVRational knee_point_y; + + /** + * The number of the intermediate anchor parameters of the tone mapping + * function in the processing window. The maximum value shall be 15. + */ + uint8_t num_bezier_curve_anchors; + + /** + * The intermediate anchor parameters of the tone mapping function in the + * processing window in the scene. The values should be in the range of 0 + * to 1, inclusive and in multiples of 1/1023. + */ + AVRational bezier_curve_anchors[15]; + + /** + * This flag shall be equal to 0 in bitstreams conforming to this version of + * this Specification. Other values are reserved for future use. + */ + uint8_t color_saturation_mapping_flag; + + /** + * The color saturation gain in the processing window in the scene. The + * value shall be in the range of 0 to 63/8, inclusive and in multiples of + * 1/8. The default value shall be 1. + */ + AVRational color_saturation_weight; +} AVHDRPlusColorTransformParams; + +/** + * This struct represents dynamic metadata for color volume transform - + * application 4 of SMPTE 2094-40:2016 standard. + * + * To be used as payload of a AVFrameSideData or AVPacketSideData with the + * appropriate type. + * + * @note The struct should be allocated with + * av_dynamic_hdr_plus_alloc() and its size is not a part of + * the public ABI. + */ +typedef struct AVDynamicHDRPlus { + /** + * Country code by Rec. ITU-T T.35 Annex A. The value shall be 0xB5. + */ + uint8_t itu_t_t35_country_code; + + /** + * Application version in the application defining document in ST-2094 + * suite. The value shall be set to 0. + */ + uint8_t application_version; + + /** + * The number of processing windows. The value shall be in the range + * of 1 to 3, inclusive. + */ + uint8_t num_windows; + + /** + * The color transform parameters for every processing window. + */ + AVHDRPlusColorTransformParams params[3]; + + /** + * The nominal maximum display luminance of the targeted system display, + * in units of 0.0001 candelas per square metre. The value shall be in + * the range of 0 to 10000, inclusive. + */ + AVRational targeted_system_display_maximum_luminance; + + /** + * This flag shall be equal to 0 in bit streams conforming to this version + * of this Specification. The value 1 is reserved for future use. + */ + uint8_t targeted_system_display_actual_peak_luminance_flag; + + /** + * The number of rows in the targeted system_display_actual_peak_luminance + * array. The value shall be in the range of 2 to 25, inclusive. + */ + uint8_t num_rows_targeted_system_display_actual_peak_luminance; + + /** + * The number of columns in the + * targeted_system_display_actual_peak_luminance array. The value shall be + * in the range of 2 to 25, inclusive. + */ + uint8_t num_cols_targeted_system_display_actual_peak_luminance; + + /** + * The normalized actual peak luminance of the targeted system display. The + * values should be in the range of 0 to 1, inclusive and in multiples of + * 1/15. + */ + AVRational targeted_system_display_actual_peak_luminance[25][25]; + + /** + * This flag shall be equal to 0 in bitstreams conforming to this version of + * this Specification. The value 1 is reserved for future use. + */ + uint8_t mastering_display_actual_peak_luminance_flag; + + /** + * The number of rows in the mastering_display_actual_peak_luminance array. + * The value shall be in the range of 2 to 25, inclusive. + */ + uint8_t num_rows_mastering_display_actual_peak_luminance; + + /** + * The number of columns in the mastering_display_actual_peak_luminance + * array. The value shall be in the range of 2 to 25, inclusive. + */ + uint8_t num_cols_mastering_display_actual_peak_luminance; + + /** + * The normalized actual peak luminance of the mastering display used for + * mastering the image essence. The values should be in the range of 0 to 1, + * inclusive and in multiples of 1/15. + */ + AVRational mastering_display_actual_peak_luminance[25][25]; +} AVDynamicHDRPlus; + +/** + * Allocate an AVDynamicHDRPlus structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVDynamicHDRPlus filled with default values or NULL + * on failure. + */ +AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size); + +/** + * Allocate a complete AVDynamicHDRPlus and add it to the frame. + * @param frame The frame which side data is added to. + * + * @return The AVDynamicHDRPlus structure to be filled by caller or NULL + * on failure. + */ +AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame); + +#endif /* AVUTIL_HDR_DYNAMIC_METADATA_H */ diff --git a/ffmpeg/include/libavutil/hwcontext_cuda.h b/ffmpeg/include/libavutil/hwcontext_cuda.h index 12dae84..81a0552 100644 --- a/ffmpeg/include/libavutil/hwcontext_cuda.h +++ b/ffmpeg/include/libavutil/hwcontext_cuda.h @@ -41,6 +41,7 @@ typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal; */ typedef struct AVCUDADeviceContext { CUcontext cuda_ctx; + CUstream stream; AVCUDADeviceContextInternal *internal; } AVCUDADeviceContext; diff --git a/ffmpeg/include/libavutil/intreadwrite.h b/ffmpeg/include/libavutil/intreadwrite.h index 67c763b..4c8413a 100644 --- a/ffmpeg/include/libavutil/intreadwrite.h +++ b/ffmpeg/include/libavutil/intreadwrite.h @@ -542,6 +542,21 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; # define AV_WN64A(p, v) AV_WNA(64, p, v) #endif +#if AV_HAVE_BIGENDIAN +# define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p)) +# define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +#else +# define AV_RLA(s, p) AV_RN##s##A(p) +# define AV_WLA(s, p, v) AV_WN##s##A(p, v) +#endif + +#ifndef AV_RL64A +# define AV_RL64A(p) AV_RLA(64, p) +#endif +#ifndef AV_WL64A +# define AV_WL64A(p, v) AV_WLA(64, p, v) +#endif + /* * The AV_COPYxxU macros are suitable for copying data to/from unaligned * memory locations. diff --git a/ffmpeg/include/libavutil/lfg.h b/ffmpeg/include/libavutil/lfg.h index 03f779a..2b66920 100644 --- a/ffmpeg/include/libavutil/lfg.h +++ b/ffmpeg/include/libavutil/lfg.h @@ -24,6 +24,12 @@ #include +/** + * 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 + * to allow easy instanciation. + */ typedef struct AVLFG { unsigned int state[64]; int index; @@ -45,8 +51,9 @@ int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); * it may be good enough and faster for your specific use case. */ static inline unsigned int av_lfg_get(AVLFG *c){ - c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; - return c->state[c->index++ & 63]; + unsigned a = c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; + c->index += 1U; + return a; } /** @@ -57,7 +64,9 @@ static inline unsigned int av_lfg_get(AVLFG *c){ static inline unsigned int av_mlfg_get(AVLFG *c){ unsigned int a= c->state[(c->index-55) & 63]; unsigned int b= c->state[(c->index-24) & 63]; - return c->state[c->index++ & 63] = 2*a*b+a+b; + a = c->state[c->index & 63] = 2*a*b+a+b; + c->index += 1U; + return a; } /** diff --git a/ffmpeg/include/libavutil/mem.h b/ffmpeg/include/libavutil/mem.h index 7e0b12a..5fb1a02 100644 --- a/ffmpeg/include/libavutil/mem.h +++ b/ffmpeg/include/libavutil/mem.h @@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size) * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be * correctly aligned. */ -av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); +int av_reallocp_array(void *ptr, size_t nmemb, size_t size); /** * Reallocate the given buffer if it is not large enough, otherwise do nothing. @@ -363,10 +363,10 @@ av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); * @endcode * * @param[in,out] ptr Already allocated buffer, or `NULL` - * @param[in,out] size Pointer to current size of buffer `ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `ptr` + * @param[in,out] size Pointer to the size of buffer `ptr`. `*size` is + * updated to the new allocated size, in particular 0 + * in case of failure. + * @param[in] min_size Desired minimal size of buffer `ptr` * @return `ptr` if the buffer is large enough, a pointer to newly reallocated * buffer if the buffer was not large enough, or `NULL` in case of * error @@ -397,10 +397,10 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size); * @param[in,out] ptr Pointer to pointer to an already allocated buffer. * `*ptr` will be overwritten with pointer to new * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` + * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is + * updated to the new allocated size, in particular 0 + * in case of failure. + * @param[in] min_size Desired minimal size of buffer `*ptr` * @see av_realloc() * @see av_fast_mallocz() */ @@ -418,10 +418,10 @@ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size); * @param[in,out] ptr Pointer to pointer to an already allocated buffer. * `*ptr` will be overwritten with pointer to new * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` + * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is + * updated to the new allocated size, in particular 0 + * in case of failure. + * @param[in] min_size Desired minimal size of buffer `*ptr` * @see av_fast_malloc() */ void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size); diff --git a/ffmpeg/include/libavutil/opt.h b/ffmpeg/include/libavutil/opt.h index 07da68e..39f4a8d 100644 --- a/ffmpeg/include/libavutil/opt.h +++ b/ffmpeg/include/libavutil/opt.h @@ -289,6 +289,7 @@ typedef struct AVOption { #define AV_OPT_FLAG_READONLY 128 #define AV_OPT_FLAG_BSF_PARAM (1<<8) ///< a generic parameter which can be set by the user for bit stream filtering #define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering +#define AV_OPT_FLAG_DEPRECATED (1<<17) ///< set if option is deprecated, users should refer to AVOption.help text for more information //FIXME think about enc-audio, ... style flags /** diff --git a/ffmpeg/include/libavutil/pixdesc.h b/ffmpeg/include/libavutil/pixdesc.h index 1ab3727..c055810 100644 --- a/ffmpeg/include/libavutil/pixdesc.h +++ b/ffmpeg/include/libavutil/pixdesc.h @@ -167,12 +167,8 @@ typedef struct AVPixFmtDescriptor { /** * The pixel format has an alpha channel. This is set on all formats that - * support alpha in some way. The exception is AV_PIX_FMT_PAL8, which can - * carry alpha as part of the palette. Details are explained in the - * AVPixelFormat enum, and are also encoded in the corresponding - * AVPixFmtDescriptor. - * - * The alpha is always straight, never pre-multiplied. + * support alpha in some way, including AV_PIX_FMT_PAL8. The alpha is always + * straight, never pre-multiplied. * * If a codec or a filter does not support alpha, it should set all alpha to * opaque, or use the equivalent pixel formats without alpha component, e.g. @@ -347,7 +343,13 @@ char *av_get_pix_fmt_string(char *buf, int buf_size, * format writes the values corresponding to the palette * component c in data[1] to dst, rather than the palette indexes in * data[0]. The behavior is undefined if the format is not paletted. + * @param dst_element_size size of elements in dst array (2 or 4 byte) */ +void av_read_image_line2(void *dst, const uint8_t *data[4], + const int linesize[4], const AVPixFmtDescriptor *desc, + int x, int y, int c, int w, int read_pal_component, + int dst_element_size); + void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component); @@ -365,7 +367,12 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], * @param y the vertical coordinate of the first pixel to write * @param w the width of the line to write, that is the number of * values to write to the image line + * @param src_element_size size of elements in src array (2 or 4 byte) */ +void av_write_image_line2(const void *src, uint8_t *data[4], + const int linesize[4], const AVPixFmtDescriptor *desc, + int x, int y, int c, int w, int src_element_size); + void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w); diff --git a/ffmpeg/include/libavutil/pixfmt.h b/ffmpeg/include/libavutil/pixfmt.h index e184a56..8b54c94 100644 --- a/ffmpeg/include/libavutil/pixfmt.h +++ b/ffmpeg/include/libavutil/pixfmt.h @@ -42,6 +42,10 @@ * This is stored as BGRA on little-endian CPU architectures and ARGB on * big-endian CPUs. * + * @note + * If the resolution is not a multiple of the chroma subsampling factor + * then the chroma plane resolution must be rounded up. + * * @par * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized * image data is stored in AVFrame.data[0]. The palette is transported in @@ -330,6 +334,20 @@ enum AVPixelFormat { */ AV_PIX_FMT_OPENCL, + AV_PIX_FMT_GRAY14BE, ///< Y , 14bpp, big-endian + AV_PIX_FMT_GRAY14LE, ///< Y , 14bpp, little-endian + + AV_PIX_FMT_GRAYF32BE, ///< IEEE-754 single precision Y, 32bpp, big-endian + AV_PIX_FMT_GRAYF32LE, ///< IEEE-754 single precision Y, 32bpp, little-endian + + AV_PIX_FMT_YUVA422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian + AV_PIX_FMT_YUVA422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian + AV_PIX_FMT_YUVA444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian + AV_PIX_FMT_YUVA444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian + + AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) + AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped + 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 }; @@ -349,6 +367,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GRAY9 AV_PIX_FMT_NE(GRAY9BE, GRAY9LE) #define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE) #define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE) +#define AV_PIX_FMT_GRAY14 AV_PIX_FMT_NE(GRAY14BE, GRAY14LE) #define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE) #define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE) #define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE) @@ -397,12 +416,16 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRPF32 AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE) #define AV_PIX_FMT_GBRAPF32 AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE) +#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE) + #define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE) #define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE) #define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE) #define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE) #define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE) #define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE) +#define AV_PIX_FMT_YUVA422P12 AV_PIX_FMT_NE(YUVA422P12BE, YUVA422P12LE) +#define AV_PIX_FMT_YUVA444P12 AV_PIX_FMT_NE(YUVA444P12BE, YUVA444P12LE) #define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE) #define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE) #define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE) diff --git a/ffmpeg/include/libavutil/threadmessage.h b/ffmpeg/include/libavutil/threadmessage.h index 8480a0a..42ce655 100644 --- a/ffmpeg/include/libavutil/threadmessage.h +++ b/ffmpeg/include/libavutil/threadmessage.h @@ -95,6 +95,14 @@ void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq, void av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq, void (*free_func)(void *msg)); +/** + * Return the current number of messages in the queue. + * + * @return the current number of messages or AVERROR(ENOSYS) if lavu was built + * without thread support + */ +int av_thread_message_queue_nb_elems(AVThreadMessageQueue *mq); + /** * Flush the message queue * diff --git a/ffmpeg/include/libavutil/tx.h b/ffmpeg/include/libavutil/tx.h new file mode 100644 index 0000000..b1f2d96 --- /dev/null +++ b/ffmpeg/include/libavutil/tx.h @@ -0,0 +1,81 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_TX_H +#define AVUTIL_TX_H + +#include +#include + +typedef struct AVTXContext AVTXContext; + +typedef struct AVComplexFloat { + float re, im; +} AVComplexFloat; + +enum AVTXType { + /** + * Standard complex to complex FFT with sample data type AVComplexFloat. + * Scaling currently unsupported + */ + AV_TX_FLOAT_FFT = 0, + /** + * Standard MDCT with sample data type of float and a scale type of + * float. Length is the frame size, not the window size (which is 2x frame) + */ + AV_TX_FLOAT_MDCT = 1, +}; + +/** + * Function pointer to a function to perform the transform. + * + * @note Using a different context than the one allocated during av_tx_init() + * is not allowed. + * + * @param s the transform context + * @param out the output array + * @param in the input array + * @param stride the input or output stride (depending on transform direction) + * in bytes, currently implemented for all MDCT transforms + */ +typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride); + +/** + * Initialize a transform context with the given configuration + * Currently power of two lengths from 4 to 131072 are supported, along with + * any length decomposable to a power of two and either 3, 5 or 15. + * + * @param ctx the context to allocate, will be NULL on error + * @param tx pointer to the transform function pointer to set + * @param type type the type of transform + * @param inv whether to do an inverse or a forward transform + * @param len the size of the transform in samples + * @param scale pointer to the value to scale the output if supported by type + * @param flags currently unused + * + * @return 0 on success, negative error code on failure + */ +int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type, + int inv, int len, const void *scale, uint64_t flags); + +/** + * Frees a context and sets ctx to NULL, does nothing when ctx == NULL + */ +void av_tx_uninit(AVTXContext **ctx); + +#endif /* AVUTIL_TX_H */ diff --git a/ffmpeg/include/libavutil/version.h b/ffmpeg/include/libavutil/version.h index 3a63e63..24ca8ab 100644 --- a/ffmpeg/include/libavutil/version.h +++ b/ffmpeg/include/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 14 +#define LIBAVUTIL_VERSION_MINOR 31 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/ffmpeg/include/libswresample/version.h b/ffmpeg/include/libswresample/version.h index efc462f..a0b361b 100644 --- a/ffmpeg/include/libswresample/version.h +++ b/ffmpeg/include/libswresample/version.h @@ -29,7 +29,7 @@ #include "libavutil/avutil.h" #define LIBSWRESAMPLE_VERSION_MAJOR 3 -#define LIBSWRESAMPLE_VERSION_MINOR 1 +#define LIBSWRESAMPLE_VERSION_MINOR 5 #define LIBSWRESAMPLE_VERSION_MICRO 100 #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ diff --git a/ffmpeg/lib/libavcodec.a b/ffmpeg/lib/libavcodec.a index b5176c9..4f76078 100644 Binary files a/ffmpeg/lib/libavcodec.a and b/ffmpeg/lib/libavcodec.a differ diff --git a/ffmpeg/lib/libavfilter.a b/ffmpeg/lib/libavfilter.a index 113d8a2..6b157bf 100644 Binary files a/ffmpeg/lib/libavfilter.a and b/ffmpeg/lib/libavfilter.a differ diff --git a/ffmpeg/lib/libavformat.a b/ffmpeg/lib/libavformat.a index 5f12849..2397598 100644 Binary files a/ffmpeg/lib/libavformat.a and b/ffmpeg/lib/libavformat.a differ diff --git a/ffmpeg/lib/libavresample.a b/ffmpeg/lib/libavresample.a deleted file mode 100644 index 2e245fd..0000000 Binary files a/ffmpeg/lib/libavresample.a and /dev/null differ diff --git a/ffmpeg/lib/libavutil.a b/ffmpeg/lib/libavutil.a index e9f0639..f895785 100644 Binary files a/ffmpeg/lib/libavutil.a and b/ffmpeg/lib/libavutil.a differ diff --git a/ffmpeg/lib/libswresample.a b/ffmpeg/lib/libswresample.a index 66cae1d..601e872 100644 Binary files a/ffmpeg/lib/libswresample.a and b/ffmpeg/lib/libswresample.a differ diff --git a/ffmpeg/lib/pkgconfig/libavcodec.pc b/ffmpeg/lib/pkgconfig/libavcodec.pc index 68efb19..906ac1a 100644 --- a/ffmpeg/lib/pkgconfig/libavcodec.pc +++ b/ffmpeg/lib/pkgconfig/libavcodec.pc @@ -5,10 +5,10 @@ includedir=/Users/damians/Desktop/iffmpeg/include Name: libavcodec Description: FFmpeg codec library -Version: 58.18.100 -Requires: libswresample >= 3.1.100, libavutil >= 56.14.100 +Version: 58.54.100 +Requires: libswresample >= 3.5.100, libavutil >= 56.31.100 Requires.private: Conflicts: -Libs: -L${libdir} -lavcodec -pthread -liconv -lm +Libs: -L${libdir} -lavcodec -pthread -lm Libs.private: Cflags: -I${includedir} diff --git a/ffmpeg/lib/pkgconfig/libavfilter.pc b/ffmpeg/lib/pkgconfig/libavfilter.pc index 6830c72..48ce97f 100644 --- a/ffmpeg/lib/pkgconfig/libavfilter.pc +++ b/ffmpeg/lib/pkgconfig/libavfilter.pc @@ -5,8 +5,8 @@ includedir=/Users/damians/Desktop/iffmpeg/include Name: libavfilter Description: FFmpeg audio/video filtering library -Version: 7.16.100 -Requires: libswresample >= 3.1.100, libavutil >= 56.14.100 +Version: 7.57.100 +Requires: libswresample >= 3.5.100, libavutil >= 56.31.100 Requires.private: Conflicts: Libs: -L${libdir} -lavfilter -pthread -lm diff --git a/ffmpeg/lib/pkgconfig/libavformat.pc b/ffmpeg/lib/pkgconfig/libavformat.pc index 853a8f8..1dc7000 100644 --- a/ffmpeg/lib/pkgconfig/libavformat.pc +++ b/ffmpeg/lib/pkgconfig/libavformat.pc @@ -5,8 +5,8 @@ includedir=/Users/damians/Desktop/iffmpeg/include Name: libavformat Description: FFmpeg container format library -Version: 58.12.100 -Requires: libavcodec >= 58.18.100, libswresample >= 3.1.100, libavutil >= 56.14.100 +Version: 58.29.100 +Requires: libavcodec >= 58.54.100, libswresample >= 3.5.100, libavutil >= 56.31.100 Requires.private: Conflicts: Libs: -L${libdir} -lavformat -lm -lz diff --git a/ffmpeg/lib/pkgconfig/libavresample.pc b/ffmpeg/lib/pkgconfig/libavresample.pc deleted file mode 100644 index 561b84f..0000000 --- a/ffmpeg/lib/pkgconfig/libavresample.pc +++ /dev/null @@ -1,14 +0,0 @@ -prefix=/Users/damians/Desktop/iffmpeg -exec_prefix=${prefix} -libdir=/Users/damians/Desktop/iffmpeg/lib -includedir=/Users/damians/Desktop/iffmpeg/include - -Name: libavresample -Description: Libav audio resampling library -Version: 4.0.0 -Requires: libavutil >= 56.14.100 -Requires.private: -Conflicts: -Libs: -L${libdir} -lavresample -lm -Libs.private: -Cflags: -I${includedir} diff --git a/ffmpeg/lib/pkgconfig/libavutil.pc b/ffmpeg/lib/pkgconfig/libavutil.pc index 4b58c52..781ef9b 100644 --- a/ffmpeg/lib/pkgconfig/libavutil.pc +++ b/ffmpeg/lib/pkgconfig/libavutil.pc @@ -5,7 +5,7 @@ includedir=/Users/damians/Desktop/iffmpeg/include Name: libavutil Description: FFmpeg utility library -Version: 56.14.100 +Version: 56.31.100 Requires: Requires.private: Conflicts: diff --git a/ffmpeg/lib/pkgconfig/libswresample.pc b/ffmpeg/lib/pkgconfig/libswresample.pc index ce94620..81c7af3 100644 --- a/ffmpeg/lib/pkgconfig/libswresample.pc +++ b/ffmpeg/lib/pkgconfig/libswresample.pc @@ -5,8 +5,8 @@ includedir=/Users/damians/Desktop/iffmpeg/include Name: libswresample Description: FFmpeg audio resampling library -Version: 3.1.100 -Requires: libavutil >= 56.14.100 +Version: 3.5.100 +Requires: libavutil >= 56.31.100 Requires.private: Conflicts: Libs: -L${libdir} -lswresample -lm