1 Commits

Author SHA1 Message Date
marfrit 5541e01d26 iter2 phase2: vendoring spec concrete + dependency chain re-verified
Fetched gsth265parser.c (5409 lines) + .h (2440 lines) from GStreamer
main mirror. Plus GstBitReader (~600 LOC vendored separately) as
the parser's only non-self-contained dependency.

License LGPL v2.1+ (Intel + Sreerenj Balachandran), preserves verbatim
in vendored copies; compatible with backend COPYING.LGPL. Add README
note listing the two vendored files.

GLib adaptation mapped to 6 mechanical replacements:
  GArray/g_array_* -> plain C dynamic arrays (count+ptr)
  g_malloc/g_free  -> libc malloc/free
  g_clear_pointer  -> inline free+NULL
  g_assert         -> propagate parser-failure-code (NOT abort!)
  gboolean/gint/etc -> stdbool/stdint
  GST_DEBUG_*      -> backend's request_log/error_log

Vendor the FULL parser unchanged per upstream-alignment rule; dead
code (PPS/slice/SEI parsing we don't strictly need) is acceptable
to preserve upstream-bug-fix-sync simplicity.

Header strategy concretized: new src/hevc-ctrls/v4l2-hevc-ext-controls.h
~50 lines with verbatim kernel UAPI defs; runtime probe via
VIDIOC_QUERYCTRL at backend init, stored per-driver_data, gated by
both kernel-supports + active driver-kind is vdpu381/383.

Build system impact: 2-line Makefile.am addition, no autoconf, no
pkg-config changes. Compile time uptick acceptable.

New constraints (6 total):
  1. Vendored LGPL header verbatim preservation + README note
  2. Hand-build install path (carries from iter1)
  3. Reboot needed after HEVC OOPS recovery (iter2 test cycle)
  5. Replace g_assert with error propagation, not abort
  6. Parser interpretation may differ from kernel even with same spec

Ready for Phase 3 (mostly inherited from iter1 + iter2 phase 0).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 08:42:07 +00:00