You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'
* commit 'f62bb216ac4cfbbff16108c6bac35a0282532972': hwcontext_vaapi: allow transfers to/from any size of sw frame Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
@@ -817,6 +817,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
|
|||||||
AVFrame *map;
|
AVFrame *map;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (dst->width > hwfc->width || dst->height > hwfc->height)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
map = av_frame_alloc();
|
map = av_frame_alloc();
|
||||||
if (!map)
|
if (!map)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -826,6 +829,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
|
|||||||
if (err)
|
if (err)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
map->width = dst->width;
|
||||||
|
map->height = dst->height;
|
||||||
|
|
||||||
err = av_frame_copy(dst, map);
|
err = av_frame_copy(dst, map);
|
||||||
if (err)
|
if (err)
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -842,6 +848,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
|
|||||||
AVFrame *map;
|
AVFrame *map;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (src->width > hwfc->width || src->height > hwfc->height)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
map = av_frame_alloc();
|
map = av_frame_alloc();
|
||||||
if (!map)
|
if (!map)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -851,6 +860,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
|
|||||||
if (err)
|
if (err)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
map->width = src->width;
|
||||||
|
map->height = src->height;
|
||||||
|
|
||||||
err = av_frame_copy(map, src);
|
err = av_frame_copy(map, src);
|
||||||
if (err)
|
if (err)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Reference in New Issue
Block a user