MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / vulkan_map_from_vaapi

Function vulkan_map_from_vaapi

libavutil/hwcontext_vulkan.c:3713–3744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3711
3712#if CONFIG_VAAPI
3713static int vulkan_map_from_vaapi(AVHWFramesContext *dst_fc,
3714 AVFrame *dst, const AVFrame *src,
3715 int flags)
3716{
3717 int err;
3718 AVFrame *tmp = av_frame_alloc();
3719 AVHWFramesContext *vaapi_fc = (AVHWFramesContext*)src->hw_frames_ctx->data;
3720 AVVAAPIDeviceContext *vaapi_ctx = vaapi_fc->device_ctx->hwctx;
3721 VASurfaceID surface_id = (VASurfaceID)(uintptr_t)src->data[3];
3722
3723 if (!tmp)
3724 return AVERROR(ENOMEM);
3725
3726 /* We have to sync since like the previous comment said, no semaphores */
3727 vaSyncSurface(vaapi_ctx->display, surface_id);
3728
3729 tmp->format = AV_PIX_FMT_DRM_PRIME;
3730
3731 err = av_hwframe_map(tmp, src, flags);
3732 if (err < 0)
3733 goto fail;
3734
3735 err = vulkan_map_from_drm(dst_fc, dst, tmp, flags);
3736 if (err < 0)
3737 goto fail;
3738
3739 err = ff_hwframe_map_replace(dst, src);
3740
3741fail:
3742 av_frame_free(&tmp);
3743 return err;
3744}
3745#endif
3746#endif
3747

Callers 1

vulkan_map_toFunction · 0.85

Calls 5

av_frame_allocFunction · 0.85
av_hwframe_mapFunction · 0.85
vulkan_map_from_drmFunction · 0.85
ff_hwframe_map_replaceFunction · 0.85
av_frame_freeFunction · 0.85

Tested by

no test coverage detected