Message ID | 20210929071708.299946-2-umang.jain@ideasonboard.com |
---|---|
State | Superseded |
Delegated to: | Umang Jain |
Headers | show |
Series |
|
Related | show |
Hi Umang, On Wed, Sep 29, 2021 at 12:47:06PM +0530, Umang Jain wrote: > 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> (I am missing why this change is required, but I welcome it as I think in the long term CaptureRequest should be made part of Camera3RequestDescriptor) > --- > src/android/camera_device.cpp | 3 ++- > src/android/camera_worker.cpp | 4 ++-- > src/android/camera_worker.h | 3 ++- > 3 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp > index 0fe11fe8..9287ea07 100644 > --- a/src/android/camera_device.cpp > +++ b/src/android/camera_device.cpp > @@ -244,7 +244,8 @@ CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor( > * Create the CaptureRequest, stored as a unique_ptr<> to tie its > * lifetime to the descriptor. > */ > - request_ = std::make_unique<CaptureRequest>(camera); > + request_ = std::make_unique<CaptureRequest>(camera, > + reinterpret_cast<uint64_t>(this)); > } > > /* > diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp > index 91313183..dabb3054 100644 > --- a/src/android/camera_worker.cpp > +++ b/src/android/camera_worker.cpp > @@ -27,10 +27,10 @@ LOG_DECLARE_CATEGORY(HAL) > * by the CameraWorker which queues it to the libcamera::Camera after handling > * fences. > */ > -CaptureRequest::CaptureRequest(Camera *camera) > +CaptureRequest::CaptureRequest(Camera *camera, uint64_t cookie) > : camera_(camera) > { > - request_ = camera_->createRequest(reinterpret_cast<uint64_t>(this)); > + request_ = camera_->createRequest(cookie); > } > > void CaptureRequest::addBuffer(Stream *stream, FrameBuffer *buffer, int fence) > diff --git a/src/android/camera_worker.h b/src/android/camera_worker.h > index 67ae50bd..c94f1632 100644 > --- a/src/android/camera_worker.h > +++ b/src/android/camera_worker.h > @@ -8,6 +8,7 @@ > #define __ANDROID_CAMERA_WORKER_H__ > > #include <memory> > +#include <stdint.h> > > #include <libcamera/base/object.h> > #include <libcamera/base/thread.h> > @@ -22,7 +23,7 @@ class CameraDevice; > class CaptureRequest > { > public: > - CaptureRequest(libcamera::Camera *camera); > + CaptureRequest(libcamera::Camera *camera, uint64_t cookie); > > const std::vector<int> &fences() const { return acquireFences_; } > libcamera::ControlList &controls() { return request_->controls(); } > -- > 2.31.0 >
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 0fe11fe8..9287ea07 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -244,7 +244,8 @@ CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor( * Create the CaptureRequest, stored as a unique_ptr<> to tie its * lifetime to the descriptor. */ - request_ = std::make_unique<CaptureRequest>(camera); + request_ = std::make_unique<CaptureRequest>(camera, + reinterpret_cast<uint64_t>(this)); } /* diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp index 91313183..dabb3054 100644 --- a/src/android/camera_worker.cpp +++ b/src/android/camera_worker.cpp @@ -27,10 +27,10 @@ LOG_DECLARE_CATEGORY(HAL) * by the CameraWorker which queues it to the libcamera::Camera after handling * fences. */ -CaptureRequest::CaptureRequest(Camera *camera) +CaptureRequest::CaptureRequest(Camera *camera, uint64_t cookie) : camera_(camera) { - request_ = camera_->createRequest(reinterpret_cast<uint64_t>(this)); + request_ = camera_->createRequest(cookie); } void CaptureRequest::addBuffer(Stream *stream, FrameBuffer *buffer, int fence) diff --git a/src/android/camera_worker.h b/src/android/camera_worker.h index 67ae50bd..c94f1632 100644 --- a/src/android/camera_worker.h +++ b/src/android/camera_worker.h @@ -8,6 +8,7 @@ #define __ANDROID_CAMERA_WORKER_H__ #include <memory> +#include <stdint.h> #include <libcamera/base/object.h> #include <libcamera/base/thread.h> @@ -22,7 +23,7 @@ class CameraDevice; class CaptureRequest { public: - CaptureRequest(libcamera::Camera *camera); + CaptureRequest(libcamera::Camera *camera, uint64_t cookie); const std::vector<int> &fences() const { return acquireFences_; } libcamera::ControlList &controls() { return request_->controls(); }