[FFmpeg-devel] [PATCH 5/5] libavutil: add user specfic device type
Stefano Sabatini
stefasab at gmail.com
Sat Apr 6 01:14:19 CEST 2013
On date Friday 2013-04-05 10:34:13 +0800, Wei Gao encoded:
> 2013/4/5 Stefano Sabatini <stefasab at gmail.com>
>
> > On date Thursday 2013-04-04 20:34:52 +0800, Wei Gao encoded:
> > >
> >
> > > From b9d6433b9ad5f9dc2e8688f42227eca1a58e5fcb Mon Sep 17 00:00:00 2001
> > > From: highgod0401 <highgod0401 at gmail.com>
> > > Date: Thu, 4 Apr 2013 20:25:29 +0800
> > > Subject: [PATCH 5/5] add user specfic device type
> >
> > typo, also missing topic, e.g.:
> > lavu/opencl: add user specified device type
> >
> > >
> > > ---
> > > libavutil/opencl.c | 80
> > +++++++++++++++++++++++++++++++-----------------------
> > > libavutil/opencl.h | 4 +--
> > > 2 files changed, 48 insertions(+), 36 deletions(-)
> > >
> > > diff --git a/libavutil/opencl.c b/libavutil/opencl.c
> > > index 9876a42..4c0b56f 100644
> > > --- a/libavutil/opencl.c
> > > +++ b/libavutil/opencl.c
> > > @@ -45,6 +45,7 @@ static pthread_mutex_t atomic_opencl_lock =
> > PTHREAD_MUTEX_INITIALIZER;
> > > typedef struct {
> > > int dev_idx;
> > > int platform_idx;
> >
> > > + int dev_type_idx;
> >
> > device_type?
> >
> index of device type in _device_type device_type[]
I mean this sounds like a better name (also I don't like the
inconsistent use of dev_/device_, and I tend to dislike ambiguous
abbreviations).
[...]
> > We should use an option context and avoid manual parsing.
> >
> is there and code I can reference?
We could create a global context with some options. Note that we
already have a global context for this, OpenclUtils.
Check the opt.c example to see how to do it.
One possibility would be to make GPUEnv a context, then we could have
an interface like this:
int av_opencl_set_option(const char *key, const char *val);
which would be called by av_opencl_init().
--
FFmpeg = Fabulous and Fundamentalist MultiPurpose Elected Gadget
More information about the ffmpeg-devel
mailing list