bind-tv-lib-abi

Verify symbols and struct offsets against device FFmpeg and libcurl binaries before binding them.

39|7|Updated Jul 3, 2026
One-click install
npx skills add https://github.com/GLinnik21/plx-native --skill bind-tv-lib-abi-glinnik21
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bind-tv-lib-abi
Source: https://github.com/GLinnik21/plx-native/tree/main/.agents/skills/bind-tv-lib-abi
Command: npx skills add https://github.com/GLinnik21/plx-native --skill bind-tv-lib-abi-glinnik21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Stub .so files make every link succeed even when a symbol does not exist on the TV, so wrong symbols and wrong struct offsets only surface at runtime as garbage values or SIGSEGVs on a device with no debugger. This Skill enforces a prove-it-first workflow that validates every symbol and offset against the device's own binaries before any binding code is written. ## Core Features & Use Cases - Symbol presence probing: Run tools/abi-probe.sh has <lib> <sym> to confirm a function exists on the device, with demangling for the C++ StarfishMediaAPIs/ACB seam. - Struct offset extraction: Read real field offsets from FFmpeg's embedded AVOption tables via tools/abi-probe.sh opts, with manual derivation rules for FF_API_* blocks and 32-bit ARM int64 alignment padding. - Stub and runtime safety: Add empty-body stub symbols with the correct SONAME, plus a runtime ABI self-check that disables the feature on offset mismatch instead of corrupting memory. - Use Case: When adding an HEVC encoder call and the link fails with "undefined reference to av_*", probe libavcodec.so.57 on the TV, derive AVCodecContext offsets from its AVOption table, add the stub, and verify on-device via the event log. ## Quick Start Ask the agent to bind a new FFmpeg function for the TV and have it prove the symbol and struct offsets against the device binaries before writing any code.

Frequently Asked Questions about bind-tv-lib-abi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix undefined reference to av_* when linking FFmpeg for webOS?▼

Add an empty function body with the matching name to the appropriate stub/*_stub.c file, since only the symbol name is resolved at link time. First run tools/abi-probe.sh has to confirm the symbol exists on the device, or the stub only moves the failure to runtime.

How do I find FFmpeg AVCodecContext struct offsets for a specific build?▼

Run tools/abi-probe.sh opts on the device library to read real offsets from its embedded AVOption tables. For fields without AVOptions, derive from the matching-version header while accounting for FF_API_* blocks and 32-bit ARM int64 alignment padding.

Why does my code compile but crash with SIGSEGV inside a TV library?▼

The stub .so trick makes every link succeed regardless of whether the symbol exists on the device, so crashes usually mean an absent symbol or a wrong struct offset. Re-verify every offset on the call path against the device binaries and use the crash-triage skill.

Can I trust the NDK sysroot headers for FFmpeg struct layouts on webOS?▼

No, the sysroot ships libraries at different versions than the TV runs, so layouts differ. Always probe the device itself with abi-probe.sh and pin offsets to the exact build, such as libavcodec.so.57.89.100 on this target.

When should I use a stub library versus linking the real one?▼

Link the real library with -l<name> whenever the NDK sysroot already provides it, gaining genuine link-time checking. Only stub libraries the sysroot lacks or ships under a different SONAME than the TV, which today means FFmpeg and libcurl.