Skip to content

feat(pj_base): align VideoFrame proto to Foxglove + zero-copy view decode#111

Merged
facontidavide merged 3 commits into
mainfrom
feat/videoframe-foxglove-align
Jun 2, 2026
Merged

feat(pj_base): align VideoFrame proto to Foxglove + zero-copy view decode#111
facontidavide merged 3 commits into
mainfrom
feat/videoframe-foxglove-align

Conversation

@facontidavide
Copy link
Copy Markdown
Contributor

What

Align the canonical PJ.VideoFrame proto to Foxglove's CompressedVideo and add a zero-copy decode entry point, so one decoder serves both schemas.

  • Swap field numbers to timestamp=1, frame_id=2, data=3, format=4 (was format=3, data=4) — now wire-identical to foxglove.CompressedVideo.
  • Add deserializeVideoFrameView(data, size, anchor): returns a VideoFrame whose .data aliases the input buffer (no copy of the H.264/H.265 bitstream) and carries the caller-supplied anchor. The owning deserializeVideoFrame() is unchanged.
  • Codec + video_frame_codec_test updated (golden-bytes Foxglove-layout lock + view-aliasing assertion).

Why

Lets PlotJuggler 4 load + render canonical video end-to-end (companion PRs in PJ4 and pj-official-plugins). One wire layout → a single decoder handles PJ.VideoFrame and foxglove.CompressedVideo.

⚠️ Breaking wire change + release

Changing a canonical-object wire format is a MAJOR per the versioning policy. The C++ sdk::VideoFrame struct layout is unchanged, so abidiff stays clean and abi/baseline.abi is untouched. Old-layout PJ.VideoFrame payloads must be regenerated. I did not bump conanfile.py/PJ_PACKAGE_VERSION — proposing the maintainer cut the corresponding release on merge (the plugins PR pins it).

Test

./build.sh && ./test.sh green.

🤖 Generated with Claude Code

… push_message slot

Rename the runtime-host vtable tail slot push_message_v2 -> push_message and
remove the now-redundant eager push_raw_message slot, leaving one definitive
push entry point. The C++ SDK wrapper pushMessage is unchanged, so plugin
sources that go through it are unaffected; only code that wires the vtable slot
by name needs the new name. Dropping a slot reduces the vtable, so this is an
ABI-breaking change and the layout sentinel asserts are updated accordingly.

Contents:
- data_source_protocol.h: rename push_message_v2 -> push_message; drop the push_raw_message slot
- sdk/data_source_host_views.hpp: align the guard/call/strings with push_message; drop the raw-message path
- sdk/data_source_patterns.hpp: update the slot reference
- pj_base/CMakeLists.txt + rename push_message_v2_test.cpp -> push_message_test.cpp
- abi_layout_sentinels_test.cpp: update the tail-slot asserts for the reduced vtable
- docs (USER_GUIDE, ARCHITECTURE, data-source-guide, message-parser-guide), mock_data_source, and the affected library/file-source tests
…w decode

Swap PJ.VideoFrame field numbers to match foxglove.CompressedVideo
(timestamp=1, frame_id=2, data=3, format=4) so a single decoder serves both
the canonical and Foxglove video schemas. Add deserializeVideoFrameView(),
which returns a frame whose `data` aliases the input buffer (no copy of the
H.264/H.265 bitstream) and carries the caller-supplied anchor; the owning
deserializeVideoFrame() is unchanged.

BREAKING (wire format): canonical PJ.VideoFrame payloads written before this
change (format=3, data=4) are no longer read correctly and must be regenerated.
The C++ sdk::VideoFrame struct layout is unchanged, so abidiff stays clean. Per
the versioning policy a canonical-schema wire-format change is a MAJOR; the
maintainer should cut the corresponding release on merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@facontidavide facontidavide force-pushed the feat/videoframe-foxglove-align branch from c526dff to 2b7d775 Compare June 1, 2026 22:01
@facontidavide facontidavide merged commit a17f6f5 into main Jun 2, 2026
4 checks passed
@facontidavide facontidavide deleted the feat/videoframe-foxglove-align branch June 2, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants