[FFmpeg-devel] [PATCH 2/6] Deprecate avcodec_thread_init()

Michael Niedermayer michaelni
Wed Dec 1 17:51:08 CET 2010


On Mon, Nov 15, 2010 at 08:37:02AM -0500, Alexander Strange wrote:
> As a side effect of the last commit, avcodec_open() now calls it automatically,
> so there is no longer any need for clients to call it.
> Instead they should set AVCodecContext.thread_count.
> 
> avcodec_thread_free() will be removed from avcodec.h at the same time; there
> is no need to mark it deprecated as clients already had no reason to call it.
[...]
> @@ -3544,8 +3544,14 @@ int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
>  
>  enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
>  
> +#if LIBAVCODEC_VERSION_MAJOR < 53
> +/**
> + * @deprecated Set s->thread_count before calling avcodec_open() instead of calling this.
> + */
> +attribute_deprecated
>  int avcodec_thread_init(AVCodecContext *s, int thread_count);
>  void avcodec_thread_free(AVCodecContext *s);
> +#endif

missing a 2nd attribute_deprecated


>  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
> diff --git a/libavcodec/thread.h b/libavcodec/thread.h
> index ac370bd..0267c6f 100644
> --- a/libavcodec/thread.h
> +++ b/libavcodec/thread.h
> @@ -95,4 +95,9 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f);
>   */
>  void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f);
>  
> +#if LIBAVCODEC_VERSION_MAJOR >= 53
> +int avcodec_thread_init(AVCodecContext *s, int thread_count);
> +void avcodec_thread_free(AVCodecContext *s);
> +#endif

they should be renamed to ff_ and wrapers removed once the major ver is bumped

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101201/c7285b40/attachment.pgp>



More information about the ffmpeg-devel mailing list