[FFmpeg-devel] [PATCH 6/6] hwcontext_vaapi: Add support for mapping to DRM objects
sw at jkqxz.net
Sun Oct 8 19:11:01 EEST 2017
On 08/10/17 17:03, Derek Buitenhuis wrote:
> On 10/8/2017 4:11 PM, Mark Thompson wrote:
>> Uses vaExportSurfaceHandle() from libva2.
>> libavutil/hwcontext_vaapi.c | 106 +++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 104 insertions(+), 2 deletions(-)
>> + for (i = 0; i < drm_desc->nb_objects; i++)
>> + close(drm_desc->objects[i].fd);
> Delightful API...
>> + surface_id = (VASurfaceID)(uintptr_t)src->data;
> Can you elaborate a bit on this part? Casting pointers to uintptr_t and storing
> them is always a red flag to me... C standard issues, etc.
>> + dst->data = (uint8_t*)drm_desc;
> This is also a bit wtf-looking... is it cast back at some point? That could be
This is just how hardware surfaces are stored in AVFrames - they have their own API-specific handles in the data pointers because that's the only place to put them.
More information about the ffmpeg-devel