libcamera: request: Add cookie to make request tracking easier

Applications often have to map requests queued to a camera to external
resources. To make this easy, add a 64-bit integer cookie to the Request
class that is set when the request is created and can be retrieved at
any time, especially in the request completion handler. The cookie is
completely transparent for libcamera and is never modified.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart 2019-07-12 09:37:51 +03:00
parent 185fe3d4b4
commit 33d3c4e204
4 changed files with 30 additions and 6 deletions

View file

@ -10,6 +10,7 @@
#include <map>
#include <memory>
#include <set>
#include <stdint.h>
#include <string>
#include <libcamera/controls.h>
@ -93,7 +94,7 @@ public:
int allocateBuffers();
int freeBuffers();
Request *createRequest();
Request *createRequest(uint64_t cookie = 0);
int queueRequest(Request *request);
int start();