avcodec/hw_base_encode: avoid getting FFHWBaseEncodeContext from avctx

This patch is to make FFHWBaseEncodeContext a standalone component
and avoid getting FFHWBaseEncodeContext from avctx->priv_data.
This patch also removes some unnecessary AVCodecContext arguments.

For receive_packet call, a small wrapper is introduced.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
This commit is contained in:
Tong Wu 2024-05-28 09:34:17 +09:00 committed by Lynne
parent 0ba10f2d75
commit e783e45e29
14 changed files with 76 additions and 65 deletions

View file

@ -1499,7 +1499,7 @@ const FFCodec ff_hevc_vaapi_encoder = {
.p.id = AV_CODEC_ID_HEVC,
.priv_data_size = sizeof(VAAPIEncodeH265Context),
.init = &vaapi_encode_h265_init,
FF_CODEC_RECEIVE_PACKET_CB(&ff_hw_base_encode_receive_packet),
FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet),
.close = &vaapi_encode_h265_close,
.p.priv_class = &vaapi_encode_h265_class,
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |