X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favcodec.h;h=1cfb986e7de1251cd3f4d5e230af7fdf17df440a;hb=a420ccd4f2a011887451a7d5e1bebba4fd7c40e2;hp=79c6efc3a2856f74dad67878ff33478198d04ea1;hpb=cce3e0a49f0dd030262c28d9c53de0bd2fd909c4;p=ffmpeg diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 79c6efc3a28..1cfb986e7de 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -36,15 +36,16 @@ #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" -#if FF_API_FAST_MALLOC -// to provide fast_*alloc -#include "libavutil/mem.h" -#endif #include "libavutil/pixfmt.h" #include "libavutil/rational.h" #include "version.h" +#if FF_API_FAST_MALLOC +// to provide fast_*alloc +#include "libavutil/mem.h" +#endif + /** * @defgroup libavc Encoding/Decoding Library * @{ @@ -282,6 +283,13 @@ enum AVCodecID { AV_CODEC_ID_WEBP, AV_CODEC_ID_HNM4_VIDEO, AV_CODEC_ID_HEVC, + AV_CODEC_ID_FIC, + AV_CODEC_ID_ALIAS_PIX, + AV_CODEC_ID_BRENDER_PIX, + AV_CODEC_ID_PAF_VIDEO, + AV_CODEC_ID_EXR, + AV_CODEC_ID_VP7, + AV_CODEC_ID_SANM, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -430,6 +438,7 @@ enum AVCodecID { AV_CODEC_ID_COMFORT_NOISE, AV_CODEC_ID_TAK, AV_CODEC_ID_METASOUND, + AV_CODEC_ID_PAF_AUDIO, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -666,7 +675,13 @@ typedef struct RcOverride{ #define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode. #define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode. #define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale. -#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges. +#if FF_API_EMU_EDGE +/** + * @deprecated edges are not used/required anymore. I.e. this flag is now always + * set. + */ +#define CODEC_FLAG_EMU_EDGE 0x4000 +#endif #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding. #define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random location instead of only at frame boundaries. */ @@ -762,10 +777,12 @@ typedef struct RcOverride{ * Codec should fill in channel configuration and samplerate instead of container */ #define CODEC_CAP_CHANNEL_CONF 0x0400 +#if FF_API_NEG_LINESIZES /** - * Codec is able to deal with negative linesizes + * @deprecated no codecs use this capability */ #define CODEC_CAP_NEG_LINESIZES 0x0800 +#endif /** * Codec supports frame-level multithreading. */ @@ -913,8 +930,20 @@ enum AVPacketSideDataType { * @endcode */ AV_PKT_DATA_H263_MB_INFO, + + /** + * This side data should be associated with an audio stream and contains + * ReplayGain information in form of the AVReplayGain struct. + */ + AV_PKT_DATA_REPLAYGAIN, }; +typedef struct AVPacketSideData { + uint8_t *data; + int size; + enum AVPacketSideDataType type; +} AVPacketSideData; + /** * This structure stores compressed data. It is typically exported by demuxers * and then passed as input to decoders, or received as output from encoders and @@ -971,11 +1000,7 @@ typedef struct AVPacket { * Additional packet data that can be provided by the container. * Packet can contain several types of side information. */ - struct { - uint8_t *data; - int size; - enum AVPacketSideDataType type; - } *side_data; + AVPacketSideData *side_data; int side_data_elems; /** @@ -1997,9 +2022,6 @@ typedef struct AVCodecContext { * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused * (read and/or written to if it is writable) later by libavcodec. * - * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an - * edge of the size returned by avcodec_get_edge_width() on all sides. - * * avcodec_align_dimensions2() should be used to find the required width and * height, as they normally need to be rounded up to the next multiple of 16. * @@ -2453,13 +2475,17 @@ typedef struct AVCodecContext { #define FF_IDCT_SIMPLEMMX 3 #define FF_IDCT_ARM 7 #define FF_IDCT_ALTIVEC 8 +#if FF_API_ARCH_SH4 #define FF_IDCT_SH4 9 +#endif #define FF_IDCT_SIMPLEARM 10 #define FF_IDCT_IPP 13 #define FF_IDCT_XVIDMMX 14 #define FF_IDCT_SIMPLEARMV5TE 16 #define FF_IDCT_SIMPLEARMV6 17 +#if FF_API_ARCH_SPARC #define FF_IDCT_SIMPLEVIS 18 +#endif #define FF_IDCT_FAAN 20 #define FF_IDCT_SIMPLENEON 22 #if FF_API_ARCH_ALPHA @@ -2494,7 +2520,7 @@ typedef struct AVCodecContext { /** * the picture in the bitstream * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. + * - decoding: unused */ AVFrame *coded_frame; @@ -2659,6 +2685,11 @@ typedef struct AVCodecContext { #define FF_PROFILE_JPEG2000_DCINEMA_2K 3 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define FF_PROFILE_HEVC_MAIN 1 +#define FF_PROFILE_HEVC_MAIN_10 2 +#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 + /** * level * - encoding: Set by user. @@ -3094,20 +3125,21 @@ const AVClass *avcodec_get_class(void); */ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); +#if FF_API_AVFRAME_LAVC /** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using avcodec_free_frame(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults + * @deprecated use av_frame_alloc() */ +attribute_deprecated AVFrame *avcodec_alloc_frame(void); /** * Set the fields of the given AVFrame to default values. * * @param frame The AVFrame of which the fields should be set to default values. + * + * @deprecated use av_frame_unref() */ +attribute_deprecated void avcodec_get_frame_defaults(AVFrame *frame); /** @@ -3119,8 +3151,12 @@ void avcodec_get_frame_defaults(AVFrame *frame); * @warning this function does NOT free the data buffers themselves * (it does not know how, since they might have been allocated with * a custom get_buffer()). + * + * @deprecated use av_frame_free() */ +attribute_deprecated void avcodec_free_frame(AVFrame **frame); +#endif /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this @@ -3391,14 +3427,20 @@ attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame */ int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags); +#if FF_API_EMU_EDGE /** * Return the amount of padding in pixels which the get_buffer callback must * provide around the edge of the image for codecs which do not have the * CODEC_FLAG_EMU_EDGE flag. * * @return Required padding in pixels. + * + * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer + * needed */ +attribute_deprecated unsigned avcodec_get_edge_width(void); +#endif /** * Modify width and height values so that they will result in a memory @@ -3406,8 +3448,6 @@ unsigned avcodec_get_edge_width(void); * padding. * * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. */ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); @@ -3417,8 +3457,6 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); * line sizes are a multiple of the respective linesize_align[i]. * * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. */ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]); @@ -4089,7 +4127,9 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height); /** * Put a string representing the codec tag codec_tag in buf. * + * @param buf buffer to place codec tag in * @param buf_size size in bytes of buf + * @param codec_tag codec tag to assign * @return the length of the string that would have been generated if * enough space had been available, excluding the trailing null */