[FFmpeg-devel] [PATCH 1/2] libavutil/opencl: add user spec device interface
Michael Niedermayer
michaelni at gmx.at
Mon Apr 8 02:57:19 CEST 2013
On Sun, Apr 07, 2013 at 08:10:36PM +0800, Wei Gao wrote:
>
> ffmpeg_opt.c | 25 +++
> libavutil/opencl.c | 379 +++++++++++++++++++++++++++++------------------------
> libavutil/opencl.h | 67 ++++++++-
> 3 files changed, 297 insertions(+), 174 deletions(-)
> 9ab5dc6cf2c3eda3e6a450830d6692021c3abf29 0001-add-user-spec-device-interface.patch
> From d8b8bd67f62d65965684b9a9d8f3b99bbb257233 Mon Sep 17 00:00:00 2001
> From: highgod0401 <highgod0401 at gmail.com>
> Date: Sun, 7 Apr 2013 20:05:31 +0800
> Subject: [PATCH 1/2] add user spec device interface
>
> ---
> ffmpeg_opt.c | 25 ++++
> libavutil/opencl.c | 379 ++++++++++++++++++++++++++++++-----------------------
> libavutil/opencl.h | 67 +++++++++-
> 3 files changed, 297 insertions(+), 174 deletions(-)
>
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index 63a238d..256319f 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -41,6 +41,9 @@
> #include "libavutil/parseutils.h"
> #include "libavutil/pixdesc.h"
> #include "libavutil/pixfmt.h"
> +#if CONFIG_OPENCL
> +#include "libavutil/opencl.h"
> +#endif
>
> #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
> {\
> @@ -316,6 +319,24 @@ static int opt_attach(void *optctx, const char *opt, const char *arg)
> o->attachments[o->nb_attachments - 1] = arg;
> return 0;
> }
> +#if CONFIG_OPENCL
> +static int opt_opencl(void *optctx, const char *opt, const char *arg)
> +{
> + char *key, *value;
> + const char *temp = arg;
> + int ret = 0;
> + while (strlen(temp)) {
> + key = av_get_token(&temp, "=,:[\n");
> + temp++;
i think temp can point to the 0 termination of the string so with
++
the pointer would then be invalid and its used below
> + value = av_get_token(&temp, "=,:[\n");
> + temp++;
> + ret = av_opencl_set_option(key, value);
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130408/bc568876/attachment.asc>
More information about the ffmpeg-devel
mailing list