STRUCT HANTRO_CODEC_OPS(9)
πΈ struct hantro_codec_ops(9) πΈ
okay bestie, welcome to the Kernel API Manual β¨ this one's a little struct called struct hantro_codec_ops, and it's basically the codec mode specific operations headquarters β like, every codec mode gets to plug in its own lil' set of function pointers here and honestly? iconic. π
π¦ SYNOPSIS π¦
struct hantro_codec_ops {
int (*init)(struct hantro_ctx *ctx);
void (*exit)(struct hantro_ctx *ctx);
int (*run)(struct hantro_ctx *ctx);
void (*done)(struct hantro_ctx *ctx);
void (*reset)(struct hantro_ctx *ctx);
};
like, five whole function pointers, all taking a struct hantro_ctx *ctx, no cap π
β¨ Members β¨
initβ if you need it, this is your initialization moment π it's optional, and it gets called from process context. cute and safe.exitβ the undo button for the.initphase, if needed. also optional, also called from process context. balances out the vibes π«Άrunβ starts a single{en,de)codingjob π₯ this one's called from atomic context to signal that a pair of buffers is ready and the hardware should be programmed and started. Returns zero if OK, and a negative value in error cases. so like, don't be weird about it.doneβ reads back processing results and any additional data from the hardware πβ¨resetβ resets the hardware in case of a timeout π yeah. timeout. it happens.init/exitenergy: both process context, both optional, both doing the most emotionally mature thing possible.
okay but fr fr, note that run runs in atomic context β that is not the place to be doing sleepy things. the original says it plain, so I'm saying it plain too. π
π SEE ALSO π
Kernel file ./drivers/media/platform/verisilicon/hantro_hw.h β and the whole friend group:
struct hantro_aux_buf(9)struct hantro_h264_dec_ctrls(9)struct hantro_h264_dec_reflists(9)struct hantro_h264_dec_hw_ctx(9)struct hantro_hevc_dec_ctrls(9)struct hantro_hevc_dec_hw_ctx(9)struct hantro_mpeg2_dec_hw_ctx(9)struct hantro_vp8_dec_hw_ctx(9)struct hantro_vp9_frame_info(9)struct hantro_vp9_dec_hw_ctx(9)struct hantro_av1_dec_ctrls(9)struct hantro_av1_dec_hw_ctx(9)struct hantro_postproc_ctx(9)struct hantro_postproc_ops(9)enum hantro_enc_fmt(9)
like, the entire hantro cinematic universe, honestly π
and that's the whole page, bestie! π sign-off time: this lil' gem lives in ./drivers/media/platform/veris... and it's dated October 2026 β go forth and codec, you've got this πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms