History

cmdutils: add opencl command line options to ffmpeg

highgod0401 committed 13 years ago

Commit d757f751 parent 567feaa3 files · +31 −0Browse files

Unified · Split

3 files
  1. cmdutils.c +24 −0
  2. cmdutils.h +4 −0
  3. cmdutils_common_opts.h +3 −0
cmdutils.c+24−0
@@ -56,6 +56,10 @@ · 55 unmodified lines
56#include <sys/time.h>56#include <sys/time.h>
57#include <sys/resource.h>57#include <sys/resource.h>
58#endif58#endif
59#if CONFIG_OPENCL
60#include "libavutil/opencl.h"
61#endif
62
59 63
60static int init_report(const char *env);64static int init_report(const char *env);
61 65
@@ -955,6 +959,26 @@ int opt_timelimit(void *optctx, const char *opt, const char *arg) · 893 unmodified lines
955 return 0;959 return 0;
956}960}
957 961
962#if CONFIG_OPENCL
963int opt_opencl(void *optctx, const char *opt, const char *arg)
964{
965 char *key, *value;
966 const char *opts = arg;
967 int ret = 0;
968 while (*opts) {
969 ret = av_opt_get_key_value(&opts, "=", ":", 0, &key, &value);
970 if (ret < 0)
971 return ret;
972 ret = av_opencl_set_option(key, value);
973 if (ret < 0)
974 return ret;
975 if (*opts)
976 opts++;
977 }
978 return ret;
979}
980#endif
981
958void print_error(const char *filename, int err)982void print_error(const char *filename, int err)
959{983{
960 char errbuf[128];984 char errbuf[128];
cmdutils.h+4−0
@@ -90,6 +90,10 @@ int opt_cpuflags(void *optctx, const char *opt, const char *arg); · 89 unmodified lines
90 90
91int opt_codec_debug(void *optctx, const char *opt, const char *arg);91int opt_codec_debug(void *optctx, const char *opt, const char *arg);
92 92
93#if CONFIG_OPENCL
94int opt_opencl(void *optctx, const char *opt, const char *arg);
95#endif
96
93/**97/**
94 * Limit the execution time.98 * Limit the execution time.
95 */99 */
cmdutils_common_opts.h+3−0
@@ -19,3 +19,6 @@ · 18 unmodified lines
19 { "report" , 0, {(void*)opt_report}, "generate a report" },19 { "report" , 0, {(void*)opt_report}, "generate a report" },
20 { "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },20 { "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
21 { "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },21 { "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },
22 #if CONFIG_OPENCL
23 { "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
24 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t