Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-03-05 02:57:30 +0300
committerMark Thompson <sw@jkqxz.net>2017-06-15 00:26:32 +0300
commit06043cc0bc72b530db352a67776392cf61a54104 (patch)
treea231ad41bad12b7ab393981b59a0eee1accb5b44 /ffmpeg_opt.c
parent0b1794a43e1083644aa3db2a09323681cfe080ec (diff)
ffmpeg: Generic device setup
Not yet enabled for any hwaccels. (cherry picked from commit d2e6dd32a445b5744a51d090c0822dbd7e434592) (cherry picked from commit 9203aac22874c7259e155b7d00f1f33bb1355129)
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index c997ea8faf..6755e09e47 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -67,25 +67,32 @@
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", videotoolbox_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
+ { "vda", videotoolbox_init, HWACCEL_VDA, AV_PIX_FMT_VDA,
+ AV_HWDEVICE_TYPE_NONE },
#endif
#if CONFIG_VIDEOTOOLBOX
- { "videotoolbox", videotoolbox_init, HWACCEL_VIDEOTOOLBOX, AV_PIX_FMT_VIDEOTOOLBOX },
+ { "videotoolbox", videotoolbox_init, HWACCEL_VIDEOTOOLBOX, AV_PIX_FMT_VIDEOTOOLBOX,
+ 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
#if CONFIG_CUVID
- { "cuvid", cuvid_init, HWACCEL_CUVID, AV_PIX_FMT_CUDA },
+ { "cuvid", cuvid_init, HWACCEL_CUVID, AV_PIX_FMT_CUDA,
+ AV_HWDEVICE_TYPE_NONE },
#endif
{ 0 },
};
@@ -463,6 +470,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
@@ -3674,5 +3696,8 @@ const OptionDef options[] = {
"set QSV hardware device (DirectX adapter index, 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, },
};