X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcodec.h;h=de050b2815ffb2aa650cc9769d7d4835dc1ee024;hb=aa6c757d50ca060cab05c3a822a43563934823a1;hp=3d7a1f4c2606cae53cd5bdfc425191b87453219d;hpb=48e715c3fd4cd3d68f7ef43a04eb3f6beb12e30b;p=ffmpeg diff --git a/libavcodec/codec.h b/libavcodec/codec.h index 3d7a1f4c260..de050b2815f 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -43,9 +43,11 @@ */ #define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0) /** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. + * Codec uses get_buffer() or get_encode_buffer() for allocating buffers and + * supports custom allocators. + * If not set, it might not use get_buffer() or get_encode_buffer() at all, or + * use operations that assume the buffer was allocated by + * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. */ #define AV_CODEC_CAP_DR1 (1 << 1) #define AV_CODEC_CAP_TRUNCATED (1 << 3) @@ -113,9 +115,14 @@ */ #define AV_CODEC_CAP_PARAM_CHANGE (1 << 14) /** - * Codec supports avctx->thread_count == 0 (auto). + * Codec supports multithreading through a method other than slice- or + * frame-level multithreading. Typically this marks wrappers around + * multithreading-capable external libraries. */ -#define AV_CODEC_CAP_AUTO_THREADS (1 << 15) +#define AV_CODEC_CAP_OTHER_THREADS (1 << 15) +#if FF_API_AUTO_THREADS +#define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS +#endif /** * Audio encoder supports receiving a different number of samples in each call. */ @@ -251,6 +258,11 @@ typedef struct AVCodec { * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. */ int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src); + + /** + * Copy variables back to the user-facing context + */ + int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src); /** @} */ /** @@ -259,7 +271,7 @@ typedef struct AVCodec { const AVCodecDefault *defaults; /** - * Initialize codec static data, called from avcodec_register(). + * Initialize codec static data, called from av_codec_iterate(). * * This is not intended for time consuming operations as it is * run for every codec regardless of that codec being used. @@ -281,7 +293,20 @@ typedef struct AVCodec { */ int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, const struct AVFrame *frame, int *got_packet_ptr); - int (*decode)(struct AVCodecContext *, void *outdata, int *outdata_size, struct AVPacket *avpkt); + /** + * Decode picture or subtitle data. + * + * @param avctx codec context + * @param outdata codec type dependent output struct + * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a + * non-empty frame or subtitle was returned in + * outdata. + * @param[in] avpkt AVPacket containing the data to be decoded + * @return amount of bytes read from the packet on success, negative error + * code on failure + */ + int (*decode)(struct AVCodecContext *avctx, void *outdata, + int *got_frame_ptr, struct AVPacket *avpkt); int (*close)(struct AVCodecContext *); /** * Encode API with decoupled frame/packet dataflow. This function is called