diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2020-08-14 13:45:16 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2020-08-14 13:47:20 +0100 |
commit | 8725c570222722c6c95345e62126372fd7fc074d (patch) | |
tree | 939963d6905dfee9b78fdff9b628be3e2c46eb53 /simple-cam.cpp | |
parent | 01d900ad31ce070853b9134245c138f9098269fe (diff) |
simple-cam: Update to new camera ID API
The cameras can no longer be obtained by their 'name', but have an ID instead.
Update the code to reflect this and improve the documentation there.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'simple-cam.cpp')
-rw-r--r-- | simple-cam.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/simple-cam.cpp b/simple-cam.cpp index 00ad52b..56aed75 100644 --- a/simple-cam.cpp +++ b/simple-cam.cpp @@ -96,11 +96,11 @@ int main() cm->start(); /* - * Just as a test, list all names of the Camera registered in the + * Just as a test, list all id's of the Camera registered in the * system. They are indexed by name by the CameraManager. */ for (auto const &camera : cm->cameras()) - std::cout << camera->name() << std::endl; + std::cout << camera->id() << std::endl; /* * -------------------------------------------------------------------- @@ -117,9 +117,14 @@ int main() * Once done with it, application shall similarly 'release' the Camera. * * As an example, use the first available camera in the system. + * + * Cameras can be obtained by their ID or their index, to demonstrate + * this, the following code gets the ID of the first camera; then gets + * the camera associated with that ID (which is of course the same as + * cm->cameras()[0]). */ - std::string cameraName = cm->cameras()[0]->name(); - camera = cm->get(cameraName); + std::string cameraId = cm->cameras()[0]->id(); + camera = cm->get(cameraId); camera->acquire(); /* |