[FFmpeg-devel] libavcodec/pthread.c:138: error: no previous prototype for 'avcodec_thread_execute2'
Benoit Fouet
benoit.fouet
Mon Mar 15 09:56:59 CET 2010
On Sun, 14 Mar 2010 13:46:19 +0000 M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
>
> > On Sun, Mar 14, 2010 at 02:00:12AM +0000, M?ns Rullg?rd wrote:
> >> Michael Niedermayer <michaelni at gmx.at> writes:
> >>
> >> > On Mon, Mar 08, 2010 at 04:57:24PM +0100, Benoit Fouet wrote:
> >> > [...]
> >> >> @@ -3255,9 +3255,11 @@ enum PixelFormat avcodec_default_get_for
> >> >>
> >> >> int avcodec_thread_init(AVCodecContext *s, int thread_count);
> >> >> void avcodec_thread_free(AVCodecContext *s);
> >> >> +#if LIBAVCODEC_VERSION_MAJOR < 53
> >> >> 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);
> >> >
> >> > these 2 are usefull to set AVCodecContext->execute* to a non threaded
> >> > variant which a user app might wish to do
> >>
> >> Those are the defaults if avcodec_thread_init() isn't called. There
> >> is no need to export them.
> >
> > I thought some implementations might want to use it as fallback or to
> > pass execution on after doing some processing.
>
> In that case they should be properly documented.
>
> > We allso have such a thing for get_buffer/release_buffer() and its used
>
> Those too.
>
OK, so here is an updated patch to remove avcodec_thread_execute:
Index: libavcodec/w32thread.c
===================================================================
--- libavcodec/w32thread.c (revision 22538)
+++ libavcodec/w32thread.c (working copy)
@@ -93,7 +93,7 @@ void avcodec_thread_free(AVCodecContext
av_freep(&s->thread_opaque);
}
-int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
+static int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
ThreadContext *c= s->thread_opaque;
int i;
int jobnr = 0;
Index: libavcodec/avcodec.h
===================================================================
--- libavcodec/avcodec.h (revision 22538)
+++ libavcodec/avcodec.h (working copy)
@@ -3256,7 +3256,6 @@ enum PixelFormat avcodec_default_get_for
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
Index: libavcodec/beosthread.c
===================================================================
--- libavcodec/beosthread.c (revision 22538)
+++ libavcodec/beosthread.c (working copy)
@@ -92,7 +92,7 @@ void avcodec_thread_free(AVCodecContext
av_freep(&s->thread_opaque);
}
-int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
+static int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
ThreadContext *c= s->thread_opaque;
int i;
Index: libavcodec/os2thread.c
===================================================================
--- libavcodec/os2thread.c (revision 22538)
+++ libavcodec/os2thread.c (working copy)
@@ -39,7 +39,7 @@ typedef struct ThreadContext{
}ThreadContext;
-void attribute_align_arg thread_func(void *v){
+static void attribute_align_arg thread_func(void *v){
ThreadContext *c= v;
for(;;){
@@ -81,7 +81,7 @@ void avcodec_thread_free(AVCodecContext
av_freep(&s->thread_opaque);
}
-int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
+static int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
ThreadContext *c= s->thread_opaque;
int i;
Index: libavcodec/pthread.c
===================================================================
--- libavcodec/pthread.c (revision 22538)
+++ libavcodec/pthread.c (working copy)
@@ -104,7 +104,7 @@ void avcodec_thread_free(AVCodecContext
av_freep(&avctx->thread_opaque);
}
-int avcodec_thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)
+static int avcodec_thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)
{
ThreadContext *c= avctx->thread_opaque;
int dummy_ret;
More information about the ffmpeg-devel
mailing list