summaryrefslogtreecommitdiff
path: root/avtools/avconv_opt.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-03-04 23:57:30 +0000
committerMark Thompson <sw@jkqxz.net>2017-03-20 23:15:43 +0000
commitd2e6dd32a445b5744a51d090c0822dbd7e434592 (patch)
treebd542e6c11e81b1852f91b0bbd52f41422388ffa /avtools/avconv_opt.c
parentb7487f4f3c39b4b202e1ea7bb2de13902f2dee45 (diff)
avconv: Generic device setup
Not yet enabled for any hwaccels.
Diffstat (limited to 'avtools/avconv_opt.c')
-rw-r--r--avtools/avconv_opt.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/avtools/avconv_opt.c b/avtools/avconv_opt.c
index e078a0b89d..c17bc15895 100644
--- a/avtools/avconv_opt.c
+++ b/avtools/avconv_opt.c
@@ -57,19 +57,24 @@
const HWAccel hwaccels[] = {
#if HAVE_VDPAU_X11
- { "vdpau", vdpau_init, HWACCEL_VDPAU, AV_PIX_FMT_VDPAU },
+ { "vdpau", vdpau_init, HWACCEL_VDPAU, AV_PIX_FMT_VDPAU,
+ AV_HWDEVICE_TYPE_NONE },
#endif
#if HAVE_DXVA2_LIB
- { "dxva2", dxva2_init, HWACCEL_DXVA2, AV_PIX_FMT_DXVA2_VLD },
+ { "dxva2", dxva2_init, HWACCEL_DXVA2, AV_PIX_FMT_DXVA2_VLD,
+ AV_HWDEVICE_TYPE_NONE },
#endif
#if CONFIG_VDA
- { "vda", vda_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
+ { "vda", vda_init, HWACCEL_VDA, AV_PIX_FMT_VDA,
+ AV_HWDEVICE_TYPE_NONE },
#endif
#if CONFIG_LIBMFX
- { "qsv", qsv_init, HWACCEL_QSV, AV_PIX_FMT_QSV },
+ { "qsv", qsv_init, HWACCEL_QSV, AV_PIX_FMT_QSV,
+ AV_HWDEVICE_TYPE_NONE },
#endif
#if CONFIG_VAAPI
- { "vaapi", vaapi_decode_init, HWACCEL_VAAPI, AV_PIX_FMT_VAAPI },
+ { "vaapi", vaapi_decode_init, HWACCEL_VAAPI, AV_PIX_FMT_VAAPI,
+ AV_HWDEVICE_TYPE_NONE },
#endif
{ 0 },
};
@@ -337,6 +342,21 @@ static int opt_vaapi_device(void *optctx, const char *opt, const char *arg)
}
#endif
+static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
+{
+ if (!strcmp(arg, "list")) {
+ enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
+ printf("Supported hardware device types:\n");
+ while ((type = av_hwdevice_iterate_types(type)) !=
+ AV_HWDEVICE_TYPE_NONE)
+ printf("%s\n", av_hwdevice_get_type_name(type));
+ printf("\n");
+ exit_program(0);
+ } else {
+ return hw_device_init_from_string(arg, NULL);
+ }
+}
+
/**
* Parse a metadata specifier passed as 'arg' parameter.
* @param arg metadata string to parse
@@ -2741,5 +2761,8 @@ const OptionDef options[] = {
"set VAAPI hardware device (DRM path or X11 display name)", "device" },
#endif
+ { "init_hw_device", HAS_ARG | OPT_EXPERT, { .func_arg = opt_init_hw_device },
+ "initialise hardware device", "args" },
+
{ NULL, },
};