STRUCT HANTRO_CODEC_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 .init phase, if needed. also optional, also called from process context. balances out the vibes 🫢
  • run β€” starts a single {en,de)coding job πŸ”₯ 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 / exit energy: 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