aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_d3d11va.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-07 00:09:10 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-12 09:42:27 +0200
commit423b6a7e493828dd91d5e590e0905236f1f46557 (patch)
tree2bdbe0020ba7ecab45e3f0909a7f3d862520a6c7 /libavutil/hwcontext_d3d11va.c
parent5094d1f429e58a67c542f1c5940a3de5184c35ca (diff)
downloadffmpeg-423b6a7e493828dd91d5e590e0905236f1f46557.tar.gz
avutil/imgutils: Add wrapper for av_image_copy() to avoid casts
av_image_copy() accepts const uint8_t* const * as source; lots of user have uint8_t* const * and therefore either cast (the majority) or copy the array of pointers. This commit changes this by adding a static inline wrapper for av_image_copy() that casts between the two types so that we do not need to add casts everywhere else. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavutil/hwcontext_d3d11va.c')
-rw-r--r--libavutil/hwcontext_d3d11va.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index aa50538d64..cc8c97d2b6 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -452,8 +452,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map);
- av_image_copy(dst->data, dst->linesize, (const uint8_t **)map_data, map_linesize,
- ctx->sw_format, w, h);
+ av_image_copy2(dst->data, dst->linesize, map_data, map_linesize,
+ ctx->sw_format, w, h);
ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0);
} else {
@@ -464,8 +464,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map);
- av_image_copy(map_data, map_linesize, (const uint8_t **)src->data, src->linesize,
- ctx->sw_format, w, h);
+ av_image_copy2(map_data, map_linesize, src->data, src->linesize,
+ ctx->sw_format, w, h);
ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0);