[FFmpeg-devel] [PATCH v2 01/69] avcodec/avcodec: Avoid MpegEncContext in AVHWAccel.decode_mb

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Feb 1 14:47:33 EET 2022


Use an opaque pointer to void instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/avcodec.h        | 6 +-----
 libavcodec/mpegvideo_xvmc.c | 3 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ec1a0566a4..918753fd0e 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2026,8 +2026,6 @@ typedef struct AVCodecContext {
     int (*get_encode_buffer)(struct AVCodecContext *s, AVPacket *pkt, int flags);
 } AVCodecContext;
 
-struct MpegEncContext;
-
 /**
  * @defgroup lavc_hwaccel AVHWAccel
  *
@@ -2154,10 +2152,8 @@ typedef struct AVHWAccel {
      * XvMC uses it to replace the ff_mpv_reconstruct_mb().
      * Instead of decoding to raw picture, MB parameters are
      * stored in an array provided by the video driver.
-     *
-     * @param s the mpeg context
      */
-    void (*decode_mb)(struct MpegEncContext *s);
+    void (*decode_mb)(void *opaque);
 
     /**
      * Initialize the hwaccel private data.
diff --git a/libavcodec/mpegvideo_xvmc.c b/libavcodec/mpegvideo_xvmc.c
index f06583768c..bfeb453834 100644
--- a/libavcodec/mpegvideo_xvmc.c
+++ b/libavcodec/mpegvideo_xvmc.c
@@ -168,8 +168,9 @@ static int ff_xvmc_field_end(AVCodecContext *avctx)
  * Synthesize the data needed by XvMC to render one macroblock of data.
  * Fill all relevant fields, if necessary do IDCT.
  */
-static void ff_xvmc_decode_mb(struct MpegEncContext *s)
+static void ff_xvmc_decode_mb(void *opaque)
 {
+    MpegEncContext *const s = opaque;
     XvMCMacroBlock *mv_block;
     struct xvmc_pix_fmt *render;
     int i, cbp, blocks_per_mb;
-- 
2.32.0



More information about the ffmpeg-devel mailing list