[FFmpeg-devel] [PATCH 1/2] libavutil/libavfilter: opencl wrapper based on comments on 20130401

Wei Gao highgod0401 at gmail.com
Thu Apr 4 14:40:10 CEST 2013


2013/4/4 James Almer <jamrial at gmail.com>

> On 04/04/13 12:36 AM, Wei Gao wrote:
> > 2013/4/4 James Almer <jamrial at gmail.com>
> >
> >> On 02/04/13 6:46 AM, Michael Niedermayer wrote:
> >>>> Since unlike in atomic.c we have init() and uninit() functions here,
> >> there's no need
> >>>> to have a statically allocated mutex. We could call
> >> pthread_mutex_init() and
> >>>
> >>> the init and uninit themselfs must be thread safe, also register is
> >>> called before init and must be thread safe
> >>
> >> As things are right now the code wont compile unless you use pthreads or
> >> no threading
> >> at all (See ticket #2422).
> >>
> >> So the code either needs to be changed to allocate the mutexes
> dynamically
> >> (Which will
> >> let us use the wrappers), or we make configure abort when trying to
> build
> >> with OpenCL
> >> support and w32threads or os2threads enabled.
> >>
> >> Ideally, the latter if implemented should be a temporary solution until
> >> the former is
> >> implemented instead.
> >>
> >> Regards.
> >>
> > Hi, I want to ask a question, does it mean that the OpenCL code can't be
> > used  in w32threads or os2threads? Is there any solutions to solve that?
> > Thanks
> > Best regards
>
> Right now, it fails to compile with anything except pthreads or no
> threading at
> all: http://ffmpeg.org/trac/ffmpeg/ticket/2422
>
> And as for a solution, making the mutex dynamic instead of static should
> allow
> us to enable this with all threading types using the wrappers, but I'm not
> sure how to properly implement that.
>
> thanks, can I add a function to init the mutex and note that it should be
called in the main thread to init the mutex? I think codecs also has this
problem. I saw that the init function is in pthreads.c, should I add a init
thread function for opencl in it?

Thanks
Best regards


> Regards.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list