STRUCT HANTRO_CTX(9)
β¨ struct hantro_ctx(9) β¨
okay so bestie, welcome to the Kernel API Manual for struct hantro_ctx β literally the private data for one context (aka one instance) of this whole VPU situation π
πΈ NAME πΈ
struct hantro_ctx β Context (instance) private data.
π SYNOPSIS π
here's the whole vibe, character for character:
struct hantro_ctx {
struct hantro_dev *dev;
struct v4l2_fh fh;
bool is_encoder;
u32 sequence_cap;
u32 sequence_out;
const struct hantro_fmt *vpu_src_fmt;
struct v4l2_pix_format_mplane src_fmt;
const struct hantro_fmt *vpu_dst_fmt;
struct v4l2_pix_format_mplane dst_fmt;
struct v4l2_pix_format_mplane ref_fmt;
struct v4l2_ctrl_handler ctrl_handler;
int jpeg_quality;
int bit_depth;
const struct hantro_codec_ops *codec_ops;
struct hantro_postproc_ctx postproc;
bool need_postproc;
union {
struct hantro_h264_dec_hw_ctx h264_dec;
struct hantro_mpeg2_dec_hw_ctx mpeg2_dec;
struct hantro_vp8_dec_hw_ctx vp8_dec;
struct hantro_hevc_dec_hw_ctx hevc_dec;
struct hantro_vp9_dec_hw_ctx vp9_dec;
struct hantro_av1_dec_hw_ctx av1_dec;
};
};
π Members π
devβ the VPU driver data that this context belongs to. like, whose child is this? π«Άfhβ the V4L2 file handler. the file-handle link-up, iykyk.is_encoderβ decoder or encoder context? the ultimate identity crisis question, answered with aboolπsequence_capβ sequence counter for the capture queue. keeping count, no cap πsequence_outβ sequence counter for the output queue. also keeping count β¨vpu_src_fmtβ descriptor of the active source format. the source's whole descriptor era.src_fmtβ V4L2 pixel format of the active source format. pixels, but make it V4L2 πvpu_dst_fmtβ descriptor of the active destination format. destination descriptor vibes.dst_fmtβ V4L2 pixel format of the active destination format. the destination's pixel format moment.ref_fmtβ V4L2 pixel format of the reference frames format. reference frames gotta have a format too πctrl_handlerβ control handler used to register controls. it handles the controls, literally its whole job.jpeg_qualityβ user-specified JPEG compression quality. you chose this, bestie πbit_depthβ bit depth of the current frame. how deep are the bits? this deep.codec_opsβ set of operations related to codec mode. the codec-mode to-do list π₯postprocβ post-processing context. the after-party context πneed_postprocβ set totrueif the bitstream features require to use the post-processor. like, the bitstream said "post-process me" and this flag said "bet" π
π¦ {unnamed_union} π¦
anonymous β yes bestie, it's an anonymous union, she has no name but she has range π
h264_decβ H.264-decoding context.mpeg2_decβ MPEG-2-decoding context.vp8_decβ VP8-decoding context.hevc_decβ HEVC-decoding context.vp9_decβ VP9-decoding context.av1_decβ AV1-decoding context.
π SEE ALSO π
Kernel file ./drivers/media/platform/verisilicon/hantro.h struct hantro_irq(9), struct hantro_variant(9), enum hantro_codec_mode(9), struct hantro_dev(9), struct hantro_fmt(9), hantro_debug: Module parameter to control level of debugging messages.(9)
fr fr, go read those other pages too, they're all connected and it's giving lore π§
and that's the whole page, bestie! this gem lives at ./drivers/media/platform/veris... β October 2026, struct hantro_ctx(9), slay π
β¨
π¦ 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