Repository navigation
Conversation
…reader The plugin and a reader exchange six messages over their socket: Hello and Welcome (the catalog of what is published), Subscribe and Subscribed (with one pool descriptor per stream), then Frame per frame set and Release when the reader is done with it. A connection carries one subscription. The messages are FlatBuffers tables in a schema kept inside the module, so a reader and a plugin from different builds keep understanding each other: the schema only grows, and a message type a build does not know is ignored. It is not under src/core/schema because these messages are never recorded. WireEncoder and decode_wire_message convert to and from camera_core types, so nothing outside the module sees FlatBuffers. Encoding a frame event allocates nothing once the encoder's buffer has grown. Decoding treats its input as coming from another process and checks it in full. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
6 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fourth pull request of the camera interface, stacked on #1523 (the message socket), whose branch is this one's base.
It adds
camera_wire: what the camera plugin and a reader say to each other over their socket. There are six messages:src/core/camera_wire/fbs/camera_wire.fbs). A reader and a plugin can come from different builds (a wheel and a locally built plugin, say), so the format has to tolerate added fields. The schema only grows: fields are appended with fresh ids, everything is a table, and a message type a build does not know is ignored rather than treated as an error. It is not undersrc/core/schemabecause that directory holds what goes into recordings, with golden files, and these messages are never recorded.WireEncoderanddecode_wire_messageconvert to and fromcamera_coretypes. The generated header is exposed by a separate target (camera::camera_wire_schema) that only the codec and its tests link.The endpoint (the plugin's side of the conversation) and the reader come next and use these messages; nothing sends them yet.
Type of change
Testing
tests/cpp/core/camera_wire/test_codec.cpp(Catch2, 7 cases, taggedunit): every message survives encoding and decoding with all its fields, including unknown times and defaults; an encoder is reused across messages; empty, random and cut-short bytes are rejected, and every prefix of a valid message is either refused or read without going out of bounds (checked under AddressSanitizer); too many streams, planes or images, an unknown pixel format, a body type without a body and an oversized message are rejected; a union member from a newer peer and a message with no body are ignored. Run withctest -L camera_wire.clang-format-14reports no changes;SKIP=check-copyright-year pre-commit run --all-filespasses.Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCO🤖 Generated with Claude Code