diff options
author | highgod0401 <highgod0401@gmail.com> | 2013-04-11 20:16:29 +0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-11 16:05:19 +0200 |
commit | d757f7510bc2abe805627d4dc6cf5ebba2ee1fcf (patch) | |
tree | ccc7cd4bcda53bf748525e18f94a319928d7c93b /cmdutils.c | |
parent | 567feaafa807279927f9e85915482b6b27ef1968 (diff) | |
download | ffmpeg-d757f7510bc2abe805627d4dc6cf5ebba2ee1fcf.tar.gz |
cmdutils: add opencl command line options to ffmpeg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index ee42fea371..4634ae20ff 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -56,6 +56,10 @@ #include <sys/time.h> #include <sys/resource.h> #endif +#if CONFIG_OPENCL +#include "libavutil/opencl.h" +#endif + static int init_report(const char *env); @@ -955,6 +959,26 @@ int opt_timelimit(void *optctx, const char *opt, const char *arg) return 0; } +#if CONFIG_OPENCL +int opt_opencl(void *optctx, const char *opt, const char *arg) +{ + char *key, *value; + const char *opts = arg; + int ret = 0; + while (*opts) { + ret = av_opt_get_key_value(&opts, "=", ":", 0, &key, &value); + if (ret < 0) + return ret; + ret = av_opencl_set_option(key, value); + if (ret < 0) + return ret; + if (*opts) + opts++; + } + return ret; +} +#endif + void print_error(const char *filename, int err) { char errbuf[128]; |