[FFmpeg-devel] [PATCH v2 3/3] hwcontext_vaapi: #if guard VAAPI_DRM specifics
Anton Khirnov
anton at khirnov.net
Thu Jul 28 17:04:24 EEST 2022
Quoting Emil Velikov (2022-07-22 15:27:26)
>
> Assuming I'm reading the code correctly, currently when both are
> undefined vaapi_device_create() will be basically a dummy, doing some
> basic malloc + opts parsing and erroring out.
>
> So as-is functions like av_hwdevice_ctx_alloc() will return success,
> although as av_hwdevice_ctx_create() is called later on it will always
> fail.
> My aim was to effectively omit the HWContextType vaapi instance in the
> final libavutil, since it cannot work. Perhaps there's a better way to
> achieve that?
You seem to have missed that av_hwdevice_ctx_create() is entirely
optional. The users _can_ call it to avoid some boilerplate, but they
can just as well use av_hwdevice_ctx_alloc()+av_hwdevice_ctx_init(),
while opening the device themselves using whatever other means.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list