Commit 3aa7b0a2 authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit 'f62bb216'

* commit 'f62bb216':
  hwcontext_vaapi: allow transfers to/from any size of sw frame
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents 1f8e1c20 f62bb216
...@@ -817,6 +817,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment