Repository navigation
Conversation
A plugin started without arguments now serves the cameras of the user's
configuration file on the user's default endpoint, and a reader opened
with only a group name looks there:
# ~/.config/isaaccapture/cameras.yaml
cameras:
head:
backend: synthetic
$ camera_plugin
CameraReader reader = CameraReader::open("head");
- default_endpoint_path() in camera_ipc is the path both sides agree on,
under $XDG_RUNTIME_DIR. A second plugin on the same machine is a named
instance (--instance) with its own endpoint. The plugin makes the
directory for its owner alone and refuses one that others can enter.
- load_config_file() reads the cameras: an id, a backend, and the backend's
options, three lines per camera. A file that cannot be used is reported
with its line.
- Without a file, or with --auto, the plugin serves every camera its
backends find plugged in. A backend offers that through Backend::discover;
the synthetic backend has nothing to find.
- CameraReader::open and list take the group first and the plugin's
location last, defaulting to this user's plugin.
- camera_bench reads from the default endpoint or a named instance too.
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
Tenth pull request of the camera interface, stacked on #1531 (
camera_bench), whose branch is this one's base.It removes the need to tell the plugin and its readers where to find each other and which cameras to serve. After this, the whole of it is:
default_endpoint_path()incamera_ipcis the socket path both sides agree on:$XDG_RUNTIME_DIR/isaaccapture/camera.sock, or under/tmp/isaaccapture-<uid>/when that variable is not set. The plugin makes the directory for its owner alone and refuses one that others can enter, which matters for the/tmpcase.--instance=NAMEon its own endpoint (camera-NAME.sock), and readers name the same instance. An instance name cannot carry a path.load_config_file()reads the cameras from YAML: an id,backend:, and that backend's options asname: value, three lines per camera, plus an optionalslots:. The default file is$XDG_CONFIG_HOME/isaaccapture/cameras.yaml. A file that cannot be used is reported with its line and what is expected there.--auto. Without a file, or with--auto, the plugin serves every camera its backends find plugged in. A backend offers that throughBackend::discover. The synthetic backend has nothing to find, so in this build--autoends with a message that says how to name cameras; the camera backends that follow implement it.CameraReader::open(group, options = {}, plugin = {})andlist(plugin = {});PluginLocationnames an instance or a socket path and defaults to this user's plugin. This replaces theopen(endpoint, group, options)form introduced in [CameraInterface] The connection between a camera plugin and its readers: camera_protocol, camera_endpoint, camera_reader #1528, so the common call needs no path.camera_benchreads from the default endpoint or a named instance too. The plugin's--endpointand--cameraarguments remain, for tests and one-off runs.Type of change
Testing
tests/cpp/core/camera_ipc/test_endpoint_path.cpp(2 cases): the default path with and withoutXDG_RUNTIME_DIR, named instances, instance names that carry a path are refused; the directory is created with mode 0700, and one that others can enter, a symlink, or a directory that cannot be made is refused.tests/cpp/plugins/camera/test_camera_config.cpp(4 cases): a file names cameras in order with their options and pool size; eight kinds of unusable file are reported with the line and what is expected; the default file location; discovery asks only the backends that can look.tests/cpp/plugins/camera/test_camera_plugin.cpp, one new case that runs plugins as processes with their own runtime and configuration directories: a plugin without arguments serves its configuration file and a reader that names only the group gets frames; a named instance runs beside it with its own cameras;--confignames another file;--autoand a missing file end with exit code 1; conflicting arguments with 2.camera_ipc, reader and plugin suites ran twice each under ThreadSanitizer with no reports. 15 repeated runs of the plugin suite without a failure.BUILD_PLUGINS=ON) with the project warning set promoted to errors.clang-format-14reports no changes;SKIP=check-copyright-year pre-commit run --all-filespasses.Checklist
SKIP=check-copyright-year pre-commit run --all-filescamera_ipc's READMEs)git commit -s) per the DCO🤖 Generated with Claude Code