| 969 | } |
| 970 | |
| 971 | static 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; |
| 997 | fail: |
| 998 | av_frame_free(&map); |
| 999 | return err; |
| 1000 | } |
| 1001 | |
| 1002 | static int vaapi_transfer_data_to(AVHWFramesContext *hwfc, |
| 1003 | AVFrame *dst, const AVFrame *src) |
nothing calls this directly
no test coverage detected