diff --git a/ThirdParty/ffmpeg/include/libavcodec/avcodec.h b/ThirdParty/ffmpeg/include/libavcodec/avcodec.h index 35df4f6ce..00f9c82af 100644 --- a/ThirdParty/ffmpeg/include/libavcodec/avcodec.h +++ b/ThirdParty/ffmpeg/include/libavcodec/avcodec.h @@ -445,6 +445,7 @@ enum AVCodecID { AV_CODEC_ID_BITPACKED, AV_CODEC_ID_MSCC, AV_CODEC_ID_SRGC, + AV_CODEC_ID_SVG, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -1593,6 +1594,16 @@ enum AVPacketSideDataType { * AVContentLightMetadata struct. */ AV_PKT_DATA_CONTENT_LIGHT_LEVEL, + + /** + * The number of side data elements (in fact a bit more than it). + * This is not part of the public API/ABI in the sense that it may + * change when new side data types are added. + * This must stay the last enum value. + * If its value becomes huge, some code using it + * needs to be updated as it assumes it to be smaller than other limits. + */ + AV_PKT_DATA_NB }; #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED @@ -3644,6 +3655,33 @@ typedef struct AVCodecContext { * AVCodecContext.get_format callback) */ int hwaccel_flags; + + /** + * Video decoding only. Certain video codecs support cropping, meaning that + * only a sub-rectangle of the decoded frame is intended for display. This + * option controls how cropping is handled by libavcodec. + * + * When set to 1 (the default), libavcodec will apply cropping internally. + * I.e. it will modify the output frame width/height fields and offset the + * data pointers (only by as much as possible while preserving alignment, or + * by the full amount if the AV_CODEC_FLAG_UNALIGNED flag is set) so that + * the frames output by the decoder refer only to the cropped area. The + * crop_* fields of the output frames will be zero. + * + * When set to 0, the width/height fields of the output frames will be set + * to the coded dimensions and the crop_* fields will describe the cropping + * rectangle. Applying the cropping is left to the caller. + * + * @warning When hardware acceleration with opaque output frames is used, + * libavcodec is unable to apply cropping from the top/left border. + * + * @note when this option is set to zero, the width/height fields of the + * AVCodecContext and output AVFrames have different meanings. The codec + * context fields store display dimensions (with the coded dimensions in + * coded_width/height), while the frame fields store the coded dimensions + * (with the display dimensions being determined by the crop_* fields). + */ + int apply_cropping; } AVCodecContext; AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); diff --git a/ThirdParty/ffmpeg/include/libavcodec/version.h b/ThirdParty/ffmpeg/include/libavcodec/version.h index 46872b056..5f2321cf5 100644 --- a/ThirdParty/ffmpeg/include/libavcodec/version.h +++ b/ThirdParty/ffmpeg/include/libavcodec/version.h @@ -28,8 +28,8 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 57 -#define LIBAVCODEC_VERSION_MINOR 93 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MINOR 96 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/ThirdParty/ffmpeg/include/libavutil/ffversion.h b/ThirdParty/ffmpeg/include/libavutil/ffversion.h index bbf558d1f..c1f0340e4 100644 --- a/ThirdParty/ffmpeg/include/libavutil/ffversion.h +++ b/ThirdParty/ffmpeg/include/libavutil/ffversion.h @@ -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-85620-gfdeab95a82" +#define FFMPEG_VERSION "N-86203-gfc3a03fcf9" #endif /* AVUTIL_FFVERSION_H */ diff --git a/ThirdParty/ffmpeg/include/libavutil/frame.h b/ThirdParty/ffmpeg/include/libavutil/frame.h index 4d8c1bed4..26261d7e4 100644 --- a/ThirdParty/ffmpeg/include/libavutil/frame.h +++ b/ThirdParty/ffmpeg/include/libavutil/frame.h @@ -25,6 +25,7 @@ #ifndef AVUTIL_FRAME_H #define AVUTIL_FRAME_H +#include #include #include "avutil.h" @@ -240,9 +241,18 @@ typedef struct AVFrame { uint8_t **extended_data; /** - * width and height of the video frame + * @name Video dimensions + * Video frames only. The coded dimensions (in pixels) of the video frame, + * i.e. the size of the rectangle that contains some well-defined values. + * + * @note The part of the frame intended for display/presentation is further + * restricted by the @ref cropping "Cropping rectangle". + * @{ */ int width, height; + /** + * @} + */ /** * number of audio samples (per channel) described by this frame @@ -530,6 +540,22 @@ typedef struct AVFrame { * purpose. */ AVBufferRef *opaque_ref; + + /** + * @anchor cropping + * @name Cropping + * Video frames only. The number of pixels to discard from the the + * top/bottom/left/right border of the frame to obtain the sub-rectangle of + * the frame intended for presentation. + * @{ + */ + size_t crop_top; + size_t crop_bottom; + size_t crop_left; + size_t crop_right; + /** + * @} + */ } AVFrame; /** diff --git a/ThirdParty/ffmpeg/include/libavutil/hwcontext.h b/ThirdParty/ffmpeg/include/libavutil/hwcontext.h index 284b09120..cfc6ad0e2 100644 --- a/ThirdParty/ffmpeg/include/libavutil/hwcontext.h +++ b/ThirdParty/ffmpeg/include/libavutil/hwcontext.h @@ -30,6 +30,7 @@ enum AVHWDeviceType { AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_DXVA2, AV_HWDEVICE_TYPE_QSV, + AV_HWDEVICE_TYPE_VIDEOTOOLBOX, }; typedef struct AVHWDeviceInternal AVHWDeviceInternal; diff --git a/ThirdParty/ffmpeg/include/libavutil/hwcontext_videotoolbox.h b/ThirdParty/ffmpeg/include/libavutil/hwcontext_videotoolbox.h new file mode 100644 index 000000000..380918d92 --- /dev/null +++ b/ThirdParty/ffmpeg/include/libavutil/hwcontext_videotoolbox.h @@ -0,0 +1,54 @@ +/* + * 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_HWCONTEXT_VIDEOTOOLBOX_H +#define AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H + +#include + +#include + +#include "pixfmt.h" + +/** + * @file + * An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX. + * + * This API currently does not support frame allocation, as the raw VideoToolbox + * API does allocation, and FFmpeg itself never has the need to allocate frames. + * + * If the API user sets a custom pool, AVHWFramesContext.pool must return + * AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef. + * + * Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always + * NULL. + */ + +/** + * Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat. + * Returns AV_PIX_FMT_NONE if no known equivalent was found. + */ +enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt(uint32_t cv_fmt); + +/** + * Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format. + * Returns 0 if no known equivalent was found. + */ +uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt); + +#endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */ diff --git a/ThirdParty/ffmpeg/include/libavutil/md5.h b/ThirdParty/ffmpeg/include/libavutil/md5.h index 9571c1fa4..ca72ccbf8 100644 --- a/ThirdParty/ffmpeg/include/libavutil/md5.h +++ b/ThirdParty/ffmpeg/include/libavutil/md5.h @@ -27,6 +27,7 @@ #ifndef AVUTIL_MD5_H #define AVUTIL_MD5_H +#include #include #include "attributes.h" @@ -63,7 +64,11 @@ void av_md5_init(struct AVMD5 *ctx); * @param src input data to update hash with * @param len input data length */ +#if FF_API_CRYPTO_SIZE_T void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); +#else +void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len); +#endif /** * Finish hashing and output digest value. @@ -80,7 +85,11 @@ void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); * @param src The data to hash * @param len The length of the data, in bytes */ +#if FF_API_CRYPTO_SIZE_T void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); +#else +void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len); +#endif /** * @} diff --git a/ThirdParty/ffmpeg/include/libavutil/sha.h b/ThirdParty/ffmpeg/include/libavutil/sha.h index c7558a896..c0180e572 100644 --- a/ThirdParty/ffmpeg/include/libavutil/sha.h +++ b/ThirdParty/ffmpeg/include/libavutil/sha.h @@ -27,6 +27,7 @@ #ifndef AVUTIL_SHA_H #define AVUTIL_SHA_H +#include #include #include "attributes.h" @@ -69,11 +70,15 @@ int av_sha_init(struct AVSHA* context, int bits); /** * Update hash value. * - * @param context hash function context + * @param ctx hash function context * @param data input data to update hash with * @param len input data length */ -void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); +#if FF_API_CRYPTO_SIZE_T +void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len); +#else +void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len); +#endif /** * Finish hashing and output digest value. diff --git a/ThirdParty/ffmpeg/include/libavutil/sha512.h b/ThirdParty/ffmpeg/include/libavutil/sha512.h index 5bac184cf..bef714b41 100644 --- a/ThirdParty/ffmpeg/include/libavutil/sha512.h +++ b/ThirdParty/ffmpeg/include/libavutil/sha512.h @@ -28,6 +28,7 @@ #ifndef AVUTIL_SHA512_H #define AVUTIL_SHA512_H +#include #include #include "attributes.h" @@ -75,7 +76,11 @@ int av_sha512_init(struct AVSHA512* context, int bits); * @param data input data to update hash with * @param len input data length */ +#if FF_API_CRYPTO_SIZE_T void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); +#else +void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len); +#endif /** * Finish hashing and output digest value. diff --git a/ThirdParty/ffmpeg/include/libavutil/timecode.h b/ThirdParty/ffmpeg/include/libavutil/timecode.h index 56e3975fd..37c1361bc 100644 --- a/ThirdParty/ffmpeg/include/libavutil/timecode.h +++ b/ThirdParty/ffmpeg/include/libavutil/timecode.h @@ -30,7 +30,7 @@ #include #include "rational.h" -#define AV_TIMECODE_STR_SIZE 16 +#define AV_TIMECODE_STR_SIZE 23 enum AVTimecodeFlag { AV_TIMECODE_FLAG_DROPFRAME = 1<<0, ///< timecode is drop frame diff --git a/ThirdParty/ffmpeg/include/libavutil/version.h b/ThirdParty/ffmpeg/include/libavutil/version.h index bba39e018..fb61dcc66 100644 --- a/ThirdParty/ffmpeg/include/libavutil/version.h +++ b/ThirdParty/ffmpeg/include/libavutil/version.h @@ -78,8 +78,9 @@ * @{ */ + #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 61 +#define LIBAVUTIL_VERSION_MINOR 63 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -135,6 +136,9 @@ #ifndef FF_API_PKT_PTS #define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 56) #endif +#ifndef FF_API_CRYPTO_SIZE_T +#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 56) +#endif /** diff --git a/ThirdParty/ffmpeg/lib/libavcodec.a b/ThirdParty/ffmpeg/lib/libavcodec.a index b70657b2d..e53377c70 100644 Binary files a/ThirdParty/ffmpeg/lib/libavcodec.a and b/ThirdParty/ffmpeg/lib/libavcodec.a differ diff --git a/ThirdParty/ffmpeg/lib/libavformat.a b/ThirdParty/ffmpeg/lib/libavformat.a index 52a0a5271..5f0fa4f72 100644 Binary files a/ThirdParty/ffmpeg/lib/libavformat.a and b/ThirdParty/ffmpeg/lib/libavformat.a differ diff --git a/ThirdParty/ffmpeg/lib/libavutil.a b/ThirdParty/ffmpeg/lib/libavutil.a index 6938e375f..d1bc96194 100644 Binary files a/ThirdParty/ffmpeg/lib/libavutil.a and b/ThirdParty/ffmpeg/lib/libavutil.a differ diff --git a/ThirdParty/ffmpeg/lib/pkgconfig/libavcodec.pc b/ThirdParty/ffmpeg/lib/pkgconfig/libavcodec.pc index 5cbb3570c..dbcb709e9 100644 --- a/ThirdParty/ffmpeg/lib/pkgconfig/libavcodec.pc +++ b/ThirdParty/ffmpeg/lib/pkgconfig/libavcodec.pc @@ -1,14 +1,14 @@ prefix=/Users/chris/Source/Repos/cog/ThirdParty/ffmpeg exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include +libdir=/Users/chris/Source/Repos/cog/ThirdParty/ffmpeg/lib +includedir=/Users/chris/Source/Repos/cog/ThirdParty/ffmpeg/include Name: libavcodec Description: FFmpeg codec library -Version: 57.93.100 -Requires: libavutil >= 55.61.100 +Version: 57.96.101 +Requires: libavutil >= 55.63.100 Requires.private: Conflicts: -Libs: -L${libdir} -lavcodec -framework QuartzCore -framework VideoDecodeAcceleration -framework CoreFoundation -framework QuartzCore -framework CoreFoundation -framework AudioToolbox -framework CoreMedia -framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework CoreVideo -liconv -Wl,-framework,CoreFoundation -Wl,-framework,Security -lm -lbz2 -lz -pthread -framework CoreServices +Libs: -L${libdir} -lavcodec -framework QuartzCore -framework VideoDecodeAcceleration -framework CoreFoundation -framework QuartzCore -framework CoreFoundation -framework AudioToolbox -framework CoreMedia -framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework CoreVideo -liconv -Wl,-framework,CoreFoundation -Wl,-framework,Security -lm -lbz2 -lz -pthread -pthread -framework CoreServices Libs.private: Cflags: -I${includedir} diff --git a/ThirdParty/ffmpeg/lib/pkgconfig/libavutil.pc b/ThirdParty/ffmpeg/lib/pkgconfig/libavutil.pc index 1b59724c0..c571c105c 100644 --- a/ThirdParty/ffmpeg/lib/pkgconfig/libavutil.pc +++ b/ThirdParty/ffmpeg/lib/pkgconfig/libavutil.pc @@ -1,11 +1,11 @@ prefix=/Users/chris/Source/Repos/cog/ThirdParty/ffmpeg exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include +libdir=/Users/chris/Source/Repos/cog/ThirdParty/ffmpeg/lib +includedir=/Users/chris/Source/Repos/cog/ThirdParty/ffmpeg/include Name: libavutil Description: FFmpeg utility library -Version: 55.61.100 +Version: 55.63.100 Requires: Requires.private: Conflicts: