aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vulkan_av1.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-04 16:21:03 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-07 22:35:22 +0200
commitf8252d6ce3ff7f306f7f7689c8c1c0c02126c70d (patch)
treee37bed3b2eea908606c9950c631bb988708b4a73 /libavcodec/vulkan_av1.c
parent3ba4f9c21e8bd78386738324d8767d74d75eec53 (diff)
downloadffmpeg-f8252d6ce3ff7f306f7f7689c8c1c0c02126c70d.tar.gz
avcodec/decode: Use RefStruct API for hwaccel_picture_private
Avoids allocations and therefore error checks: Syncing hwaccel_picture_private across threads can't fail any more. Also gets rid of an unnecessary pointer in structures and in the parameter list of ff_hwaccel_frame_priv_alloc(). Reviewed-by: Anton Khirnov <anton@khirnov.net> Reviewed-by: Lynne <dev@lynne.ee> Tested-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vulkan_av1.c')
-rw-r--r--libavcodec/vulkan_av1.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c
index b1373722ef..7c8dda7798 100644
--- a/libavcodec/vulkan_av1.c
+++ b/libavcodec/vulkan_av1.c
@@ -536,10 +536,10 @@ static int vk_av1_end_frame(AVCodecContext *avctx)
return ff_vk_decode_frame(avctx, pic->f, vp, rav, rvp);
}
-static void vk_av1_free_frame_priv(void *_hwctx, uint8_t *data)
+static void vk_av1_free_frame_priv(FFRefStructOpaque _hwctx, void *data)
{
- AVHWDeviceContext *hwctx = _hwctx;
- AV1VulkanDecodePicture *ap = (AV1VulkanDecodePicture *)data;
+ AVHWDeviceContext *hwctx = _hwctx.nc;
+ AV1VulkanDecodePicture *ap = data;
/* Workaround for a spec issue. */
if (ap->frame_id_set)
@@ -547,9 +547,6 @@ static void vk_av1_free_frame_priv(void *_hwctx, uint8_t *data)
/* Free frame resources, this also destroys the session parameters. */
ff_vk_decode_free_frame(hwctx, &ap->vp);
-
- /* Free frame context */
- av_free(ap);
}
const FFHWAccel ff_av1_vulkan_hwaccel = {