aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_vulkan.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-02-11 22:16:32 +0100
committerJames Almer <jamrial@gmail.com>2024-03-07 08:53:31 -0300
commit3e669b24e282594ab92ef50c839bb1fdc01331b4 (patch)
tree2b11f6af5630dae3717866cbb7cf5c2be64c1e64 /libavutil/hwcontext_vulkan.c
parenta0b9b96269b48298eddb927059cb4dfea6725167 (diff)
downloadffmpeg-3e669b24e282594ab92ef50c839bb1fdc01331b4.tar.gz
avutil/hwcontext: Allocate AVHWFramesCtx jointly with its internals
This is possible because the lifetime of these structures coincide. It has the advantage of allowing to remove AVHWFramesInternal from the public header; given that AVHWFramesInternal.priv is no more, most accesses to AVHWFramesInternal are no more; indeed, the only field accessed of it outside of hwcontext.c is the internal frame pool, making this commit very simple. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r--libavutil/hwcontext_vulkan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 3c58904621..855f099e26 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2406,10 +2406,10 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
/* If user did not specify a pool, hwfc->pool will be set to the internal one
* in hwcontext.c just after this gets called */
if (!hwfc->pool) {
- hwfc->internal->pool_internal = av_buffer_pool_init2(sizeof(AVVkFrame),
- hwfc, vulkan_pool_alloc,
- NULL);
- if (!hwfc->internal->pool_internal)
+ ffhwframesctx(hwfc)->pool_internal = av_buffer_pool_init2(sizeof(AVVkFrame),
+ hwfc, vulkan_pool_alloc,
+ NULL);
+ if (!ffhwframesctx(hwfc)->pool_internal)
return AVERROR(ENOMEM);
}