[FFmpeg-devel] [PATCH v4 2/5] ffmpeg: VAAPI hwaccel helper and related initialisation
Timothy Gu
timothygu99 at gmail.com
Sun Jan 24 01:43:25 CET 2016
On Sat, Jan 23, 2016 at 07:14:29PM +0000, Mark Thompson wrote:
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index 9b341cf..fd41600 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -82,6 +82,9 @@ const HWAccel hwaccels[] = {
> #if CONFIG_LIBMFX
> { "qsv", qsv_init, HWACCEL_QSV, AV_PIX_FMT_QSV },
> #endif
> +#if CONFIG_VAAPI_RECENT
> + { "vaapi", vaapi_decode_init, HWACCEL_VAAPI, AV_PIX_FMT_VAAPI },
> +#endif
> { 0 },
> };
>
> @@ -442,6 +445,15 @@ static int opt_sdp_file(void *optctx, const char *opt, const char *arg)
> return 0;
> }
>
> +#if CONFIG_VAAPI_RECENT
> +static int opt_vaapi(void *optctx, const char *opt, const char *arg)
> +{
> + if(vaapi_hardware_init(arg))
> + exit_program(1);
> + return 0;
> +}
> +#endif
> +
> /**
> * Parse a metadata specifier passed as 'arg' parameter.
> * @param arg metadata string to parse
> @@ -3438,5 +3450,9 @@ const OptionDef options[] = {
> { "dn", OPT_BOOL | OPT_VIDEO | OPT_OFFSET | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(data_disable) },
> "disable data" },
>
> +#if CONFIG_VAAPI_RECENT
> + { "vaapi", HAS_ARG, { .func_arg = opt_vaapi }, "set VAAPI hardware context" },
What is "hardware context"? The address of an AVVAAPIHardwareContext? That
makes no sense.
> +#endif
> +
> { NULL, },
> };
Timothy
More information about the ffmpeg-devel
mailing list