On 25/05/2024 12:30, [email protected] wrote:
From: Tong Wu <[email protected]>

Related parameters such as device context, frame context are also moved
to base layer.

Signed-off-by: Tong Wu <[email protected]>
---
  libavcodec/hw_base_encode.c     | 49 ++++++++++++++++++
  libavcodec/hw_base_encode.h     | 17 +++++++
  libavcodec/vaapi_encode.c       | 90 +++++++++++----------------------
  libavcodec/vaapi_encode.h       | 10 ----
  libavcodec/vaapi_encode_av1.c   |  2 +-
  libavcodec/vaapi_encode_h264.c  |  2 +-
  libavcodec/vaapi_encode_h265.c  |  2 +-
  libavcodec/vaapi_encode_mjpeg.c |  6 ++-
  8 files changed, 102 insertions(+), 76 deletions(-)

diff --git a/libavcodec/hw_base_encode.c b/libavcodec/hw_base_encode.c
index 16afaa37be..c4789380b6 100644
--- a/libavcodec/hw_base_encode.c
+++ b/libavcodec/hw_base_encode.c
@@ -592,3 +592,52 @@ end:
return 0;
  }
+
+int ff_hw_base_encode_init(AVCodecContext *avctx)
+{
+    FFHWBaseEncodeContext *ctx = avctx->priv_data;

This is the issue I was talking about, this requires that FFHWBaseEncodeContext is always the main context.

Could you change it so everything takes FFHWBaseEncodeContext as an argument, rather than AVCodecContext (apart from where the function absolutely must read some data from it)?

Attachment: OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to