How freescale/libimxvpuapi works
Project type and purpose
• This is a C-language frontend library (“libimxvpuapi2”) that abstracts the hardware video codec (VPU) on various Freescale/NXP i.MX SoCs (i.MX6, i.MX8M series).
• It exposes a uniform decoder/encoder API, hides platform‐specific quirks, and relies on lower-level kernel drivers and helper libraries.
File structure
• Top‐level:
• debian/ – packaging metadata for Debian
• example/ – standalone C programs demonstrating decode/encode usage
• imxvpuapi2/ – core library source and headers
• waf & wscript – meta-build system scripts (configuration, compile, install)
• libimxvpuapi2.pc.in – pkg-config template
• imxvpuapi2/ directory:
• imxvpuapi2.c/.h – public API entry points, platform dispatch
• imxvpuapi2_priv.c/.h – shared internals (error handling, logging, common routines)
• imxvpuapi2_<platform>_*.c/.h – per-SoC implementations (e.g., imx6 CODA, imx8m Hantro decoder/encoder variants, JPEG)
• example/ directory: utility code (y4m_io.c/h, h264_utils.c/h) and example apps (decode, encode, JPEG)
• Build & packaging: waf scripts define configuration options (–imx-platform), generate the .pc file, install headers & libs. Debian folder contains rules for building cross-arch packages.
README for additional insights
• The README describes supported platforms, platform driver dependencies (imx-vpu, imx-vpu-hantro, imx-vpu-hantro-vc) and device nodes (/dev/mxc_hantro, etc.).
• It mentions dependency on libimxdmabuffer for DMA buffer allocation.
• It documents configuration via waf (CC, CFLAGS, LDFLAGS, PKG_CONFIG_PATH, IMX_PLATFORM, SYSROOT).
• Examples read/write raw frames (YUV4MPEG2) and encode/decode H.264 streams.