mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
android: camera_worker: Use Camera3RequestDescriptor as cookie
Use Camera3RequestDescriptor as cookie for the Capture Request. The cookie is used to lookup descriptors map in CameraDevice::requestComplete(). The map will be transformed to a queue in subsequent commit. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
2eca16b674
commit
25b0216886
3 changed files with 6 additions and 4 deletions
|
@ -244,7 +244,8 @@ CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor(
|
||||||
* Create the CaptureRequest, stored as a unique_ptr<> to tie its
|
* Create the CaptureRequest, stored as a unique_ptr<> to tie its
|
||||||
* lifetime to the descriptor.
|
* lifetime to the descriptor.
|
||||||
*/
|
*/
|
||||||
request_ = std::make_unique<CaptureRequest>(camera);
|
request_ = std::make_unique<CaptureRequest>(camera,
|
||||||
|
reinterpret_cast<uint64_t>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -27,10 +27,10 @@ LOG_DECLARE_CATEGORY(HAL)
|
||||||
* by the CameraWorker which queues it to the libcamera::Camera after handling
|
* by the CameraWorker which queues it to the libcamera::Camera after handling
|
||||||
* fences.
|
* fences.
|
||||||
*/
|
*/
|
||||||
CaptureRequest::CaptureRequest(Camera *camera)
|
CaptureRequest::CaptureRequest(Camera *camera, uint64_t cookie)
|
||||||
: camera_(camera)
|
: camera_(camera)
|
||||||
{
|
{
|
||||||
request_ = camera_->createRequest(reinterpret_cast<uint64_t>(this));
|
request_ = camera_->createRequest(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CaptureRequest::addBuffer(Stream *stream, FrameBuffer *buffer, int fence)
|
void CaptureRequest::addBuffer(Stream *stream, FrameBuffer *buffer, int fence)
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#define __ANDROID_CAMERA_WORKER_H__
|
#define __ANDROID_CAMERA_WORKER_H__
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <libcamera/base/object.h>
|
#include <libcamera/base/object.h>
|
||||||
#include <libcamera/base/thread.h>
|
#include <libcamera/base/thread.h>
|
||||||
|
@ -22,7 +23,7 @@ class CameraDevice;
|
||||||
class CaptureRequest
|
class CaptureRequest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CaptureRequest(libcamera::Camera *camera);
|
CaptureRequest(libcamera::Camera *camera, uint64_t cookie);
|
||||||
|
|
||||||
const std::vector<int> &fences() const { return acquireFences_; }
|
const std::vector<int> &fences() const { return acquireFences_; }
|
||||||
libcamera::ControlList &controls() { return request_->controls(); }
|
libcamera::ControlList &controls() { return request_->controls(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue