Repository navigation
Conversation
Endpoint puts a Publisher on a socket and speaks the camera_wire messages: it tells each reader what is published, and on a subscription sends the group's pool descriptors and from then on its frame events. One thread accepts readers and handles the handshake, subscriptions and releases. Frame events are not sent from it: they are encoded and sent on the publishing thread, inside Publisher::publish, with a send that does not block, so nothing sits between a frame set being published and its event being on the socket. A closed connection ends the reader's subscription and returns every frame set it held, whether the reader exited or was killed. A reader that breaks the protocol is dropped without affecting the others. 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
stop() ended the endpoint's thread but kept the listening socket, so a reader that connected afterwards was accepted by the kernel and then waited for an answer nobody would send. stop() now closes the listener, which removes the socket file and releases the path: a reader that tries to connect is refused at once. start() takes the path again. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Farbod Motlagh <fmotlagh@nvidia.com>
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
Fifth pull request of the camera interface, stacked on #1526 (
camera_wire), whose branch is this one's base.It adds
camera_endpoint: the camera plugin's side of the conversation with readers.Endpointputs acamera_corePublisheron a socket (camera_ipc) and speaks the messages ofcamera_wire. It tells each reader what is published; when a reader subscribes it sends the group's pool descriptors and from then on the group's frame events.Publisher::publish, with a send that does not block. There is no queue and no hand-over to another thread on that path.polluntil a reader sends something.stop()closes the listener, so a reader that tries to connect afterwards is refused at once instead of waiting in a queue nobody serves;start()takes the path again.isaaccapture::Loggerasisaaccapture.camera_endpoint.Endpoint: readers arriving, subscribing, being refused and leaving. Nothing is logged per frame.The reader library that talks to it comes next; the tests here play the reader's part with the socket and the codec directly.
Type of change
Testing
tests/cpp/core/camera_endpoint/test_endpoint.cpp(Catch2, 9 cases, taggedunit): a reader is told what is published; a reader with another protocol version is refused and its connection closed; a subscriber maps the pools from the descriptors it is sent and reads the pixels of each frame set, a held frame set is not rewritten, and the release brings the newest one with the number skipped; subscriptions that cannot be served are refused with a reason and the connection stays usable; a reader that disappears while holding frame sets gives them back; readers that break the protocol are dropped and a well-behaved one keeps receiving; a reader that never releases does not slow another; stopping closes every reader and the endpoint can serve again; a group needs its memory named before readers can subscribe. Run withctest -L camera_endpoint.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