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

Function vaapi_transfer_data_from

libavutil/hwcontext_vaapi.c:971–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
972 AVFrame *dst, const AVFrame *src)
973{
974 AVFrame *map;
975 int err;
976
977 if (dst->width > hwfc->width || dst->height > hwfc->height)
978 return AVERROR(EINVAL);
979
980 map = av_frame_alloc();
981 if (!map)
982 return AVERROR(ENOMEM);
983 map->format = dst->format;
984
985 err = vaapi_map_frame(hwfc, map, src, AV_HWFRAME_MAP_READ);
986 if (err)
987 goto fail;
988
989 map->width = dst->width;
990 map->height = dst->height;
991
992 err = av_frame_copy(dst, map);
993 if (err)
994 goto fail;
995
996 err = 0;
997fail:
998 av_frame_free(&map);
999 return err;
1000}
1001
1002static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
1003 AVFrame *dst, const AVFrame *src)

Callers

nothing calls this directly

Calls 4

av_frame_allocFunction · 0.85
vaapi_map_frameFunction · 0.85
av_frame_copyFunction · 0.85
av_frame_freeFunction · 0.85

Tested by

no test coverage detected