X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favcodec.h;h=f4fe7d676a88d3d11205db8654434a7a9e01c712;hb=e262365d7c84203028b5da5265ffc6b27ac33be8;hp=900e3b5301b787a7b1708769c0c89d52a5d692b7;hpb=ae8d21fb4512d95eb7829b713b1223bcf350c9c7;p=ffmpeg diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 900e3b5301b..f4fe7d676a8 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -30,8 +30,8 @@ #include "libavutil/avutil.h" #define LIBAVCODEC_VERSION_MAJOR 52 -#define LIBAVCODEC_VERSION_MINOR 30 -#define LIBAVCODEC_VERSION_MICRO 2 +#define LIBAVCODEC_VERSION_MINOR 42 +#define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ @@ -196,6 +196,10 @@ enum CodecID { CODEC_ID_V210X, CODEC_ID_TMV, CODEC_ID_V210, + CODEC_ID_DPX, + CODEC_ID_MAD, + CODEC_ID_FRWU, + CODEC_ID_FLASHSV2, /* various PCM "codecs" */ CODEC_ID_PCM_S16LE= 0x10000, @@ -222,6 +226,7 @@ enum CodecID { CODEC_ID_PCM_F32LE, CODEC_ID_PCM_F64BE, CODEC_ID_PCM_F64LE, + CODEC_ID_PCM_BLURAY, /* various ADPCM codecs */ CODEC_ID_ADPCM_IMA_QT= 0x11000, @@ -317,6 +322,7 @@ enum CodecID { CODEC_ID_TWINVQ, CODEC_ID_TRUEHD, CODEC_ID_MP4ALS, + CODEC_ID_ATRAC1, /* subtitle codecs */ CODEC_ID_DVD_SUBTITLE= 0x17000, @@ -325,6 +331,8 @@ enum CodecID { CODEC_ID_XSUB, CODEC_ID_SSA, CODEC_ID_MOV_TEXT, + CODEC_ID_HDMV_PGS_SUBTITLE, + CODEC_ID_DVB_TELETEXT, /* other specific kind of codecs (generally used for attachments) */ CODEC_ID_TTF= 0x18000, @@ -380,6 +388,11 @@ enum SampleFormat { #define CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. #define CH_STEREO_RIGHT 0x40000000 ///< See CH_STEREO_LEFT. +/** Channel mask value used for AVCodecContext.request_channel_layout + to indicate that the user requests the channel order of the decoder output + to be the native codec channel order. */ +#define CH_LAYOUT_NATIVE 0x8000000000000000LL + /* Audio channel convenience macros */ #define CH_LAYOUT_MONO (CH_FRONT_CENTER) #define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT) @@ -392,6 +405,7 @@ enum SampleFormat { #define CH_LAYOUT_5POINT1 (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY) #define CH_LAYOUT_5POINT0_BACK (CH_LAYOUT_SURROUND|CH_BACK_LEFT|CH_BACK_RIGHT) #define CH_LAYOUT_5POINT1_BACK (CH_LAYOUT_5POINT0_BACK|CH_LOW_FREQUENCY) +#define CH_LAYOUT_7POINT0 (CH_LAYOUT_5POINT0|CH_BACK_LEFT|CH_BACK_RIGHT) #define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT) #define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_5POINT1_BACK|\ CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER) @@ -599,6 +613,10 @@ typedef struct RcOverride{ * Codec can export data for HW decoding (VDPAU). */ #define CODEC_CAP_HWACCEL_VDPAU 0x0080 +/** + * Codec can output multiple frames per AVPacket + */ +#define CODEC_CAP_SUBFRAMES 0x0100 //The following defines may change, don't expect compatibility if you use them. #define MB_TYPE_INTRA4x4 0x0001 @@ -1112,7 +1130,7 @@ typedef struct AVCodecContext { * - encoding: Set by user. * - decoding: Set by libavcodec. */ - enum SampleFormat sample_fmt; ///< sample format, currently unused + enum SampleFormat sample_fmt; ///< sample format /* The following data should not be initialized. */ /** @@ -1331,6 +1349,9 @@ typedef struct AVCodecContext { * If pic.reference is set then the frame will be read later by libavcodec. * avcodec_align_dimensions() should be used to find the required width and * height, as they normally need to be rounded up to the next multiple of 16. + * if CODEC_CAP_DR1 is not set then get_buffer() must call + * avcodec_default_get_buffer() instead of providing buffers allocated by + * some other means. * - encoding: unused * - decoding: Set by libavcodec., user can override. */ @@ -1959,6 +1980,9 @@ typedef struct AVCodecContext { * libavcodec will pass previous buffer in pic, function should return * same buffer or new buffer with old frame "painted" into it. * If pic.data[0] == NULL must behave like get_buffer(). + * if CODEC_CAP_DR1 is not set then reget_buffer() must call + * avcodec_default_reget_buffer() instead of providing buffers allocated by + * some other means. * - encoding: unused * - decoding: Set by libavcodec., user can override */ @@ -2509,7 +2533,37 @@ typedef struct AVCodecContext { * - encoding: Set by user * - decoding: Set by libavcodec */ - enum AVChromaLocation chroma_sample_location; + enum AVChromaLocation chroma_sample_location; + + /** + * The codec may call this to execute several independent things. + * It will return only after finishing all tasks. + * The user may replace this with some multithreaded implementation, + * the default implementation will execute the parts serially. + * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. + * @param c context passed also to func + * @param count the number of things to execute + * @param arg2 argument passed unchanged to func + * @param ret return values of executed functions, must have space for "count" values. May be NULL. + * @param func function that will be called count times, with jobnr from 0 to count-1. + * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no + * two instances of func executing at the same time will have the same threadnr. + * @return always 0 currently, but code should handle a future improvement where when any call to func + * returns < 0 no further calls to func may be done and < 0 is returned. + * - encoding: Set by libavcodec, user can override. + * - decoding: Set by libavcodec, user can override. + */ + int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); + + /** + * explicit P-frame weighted prediction analysis method + * 0: off + * 1: fast blind weighting (one reference duplicate with -1 offset) + * 2: smart weighting (full fade detection analysis) + * - encoding: Set by user. + * - decoding: unused + */ + int weighted_p_pred; } AVCodecContext; /** @@ -2726,6 +2780,7 @@ typedef struct AVSubtitle { uint32_t end_display_time; /* relative to packet pts, in ms */ unsigned num_rects; AVSubtitleRect **rects; + int64_t pts; ///< Same as packet pts, in AV_TIME_BASE } AVSubtitle; /* packet functions */ @@ -2893,7 +2948,7 @@ void avpicture_free(AVPicture *picture); * @return size of the image data in bytes */ int avpicture_fill(AVPicture *picture, uint8_t *ptr, - int pix_fmt, int width, int height); + enum PixelFormat pix_fmt, int width, int height); int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size); @@ -3022,6 +3077,16 @@ AVCodec *av_codec_next(AVCodec *c); */ unsigned avcodec_version(void); +/** + * Returns the libavcodec build-time configuration. + */ +const char * avcodec_configuration(void); + +/** + * Returns the libavcodec license. + */ +const char * avcodec_license(void); + /** * Initializes libavcodec. * @@ -3137,6 +3202,7 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count); void avcodec_thread_free(AVCodecContext *s); int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); +int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); //FIXME func typedef /** @@ -3190,9 +3256,11 @@ attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *s /** * Decodes the audio frame of size avpkt->size from avpkt->data into samples. * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. + * decoders would then just decode the first frame. In this case, + * avcodec_decode_audio3 has to be called again with an AVPacket that contains + * the remaining data in order to decode the second frame etc. * If no frame - * could be decompressed, frame_size_ptr is zero. Otherwise, it is the + * could be outputted, frame_size_ptr is zero. Otherwise, it is the * decompressed frame size in bytes. * * @warning You must set frame_size_ptr to the allocated size of the @@ -3215,14 +3283,14 @@ attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *s * (AltiVec and SSE do). * * @param avctx the codec context - * @param[out] samples the output buffer + * @param[out] samples the output buffer, sample type in avctx->sample_fmt * @param[in,out] frame_size_ptr the output buffer size in bytes * @param[in] avpkt The input AVPacket containing the input buffer. * You can create such packet with av_init_packet() and by then setting * data and size, some decoders might in addition need other fields. * All decoders are designed to use the least fields possible though. * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. + * used or zero if no frame data was decompressed (used) from the input AVPacket. */ int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, @@ -3707,6 +3775,30 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *str); #define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */ #define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */ +/** + * Logs a generic warning message about a missing feature. This function is + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) + * only, and would normally not be used by applications. + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] feature string containing the name of the missing feature + * @param[in] want_sample indicates if samples are wanted which exhibit this feature. + * If want_sample is non-zero, additional verbage will be added to the log + * message which tells the user how to report samples to the development + * mailing list. + */ +void av_log_missing_feature(void *avc, const char *feature, int want_sample); + +/** + * Logs a generic warning message asking for a sample. This function is + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) + * only, and would normally not be used by applications. + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] msg string containing an optional message, or NULL if no message + */ +void av_log_ask_for_sample(void *avc, const char *msg); + /** * Registers the hardware accelerator hwaccel. */