diff mbox series

[FFmpeg-devel,09/23] avutil/hwcontext: Remove unused AVHWDeviceInternal.priv

Message ID DU0P250MB0747CC6E462DBFC41C7A13C68F482@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,01/23] avutil/hwcontext_opencl: Use proper OpenCLFramesContext | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Andreas Rheinhardt Feb. 12, 2024, 12:03 a.m. UTC
It is no longer used by any hwcontext, as they all allocate
their private data together with their public data and access
it via AVHWDeviceContext.hwctx.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavutil/hwcontext.c          | 9 ---------
 libavutil/hwcontext_internal.h | 6 ------
 2 files changed, 15 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 63fc1a6a22..02e9668c31 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -139,7 +139,6 @@  static void hwdevice_ctx_free(void *opaque, uint8_t *data)
     av_buffer_unref(&ctx->internal->source_device);
 
     av_freep(&ctx->hwctx);
-    av_freep(&ctx->internal->priv);
     av_freep(&ctx->internal);
     av_freep(&ctx);
 }
@@ -168,12 +167,6 @@  AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type)
     if (!ctx->internal)
         goto fail;
 
-    if (hw_type->device_priv_size) {
-        ctx->internal->priv = av_mallocz(hw_type->device_priv_size);
-        if (!ctx->internal->priv)
-            goto fail;
-    }
-
     if (hw_type->device_hwctx_size) {
         ctx->hwctx = av_mallocz(hw_type->device_hwctx_size);
         if (!ctx->hwctx)
@@ -194,8 +187,6 @@  AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type)
     return buf;
 
 fail:
-    if (ctx->internal)
-        av_freep(&ctx->internal->priv);
     av_freep(&ctx->internal);
     av_freep(&ctx->hwctx);
     av_freep(&ctx);
diff --git a/libavutil/hwcontext_internal.h b/libavutil/hwcontext_internal.h
index 4df516ee6a..374c6dde2f 100644
--- a/libavutil/hwcontext_internal.h
+++ b/libavutil/hwcontext_internal.h
@@ -41,11 +41,6 @@  typedef struct HWContextType {
      * i.e. AVHWDeviceContext.hwctx
      */
     size_t             device_hwctx_size;
-    /**
-     * size of the private data, i.e.
-     * AVHWDeviceInternal.priv
-     */
-    size_t             device_priv_size;
 
     /**
      * Size of the hardware-specific device configuration.
@@ -102,7 +97,6 @@  typedef struct HWContextType {
 
 struct AVHWDeviceInternal {
     const HWContextType *hw_type;
-    void                *priv;
 
     /**
      * For a derived device, a reference to the original device