[libcamera-devel] [RFC v3 2/5] libcamera: Request: expose Camera from Request

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Dec 10 13:14:17 CET 2021


Hi Tomi,

On Fri, Dec 10, 2021 at 01:42:17PM +0200, Tomi Valkeinen wrote:
> On 09/12/2021 18:50, Laurent Pinchart wrote:
> > On Thu, Dec 09, 2021 at 11:29:03AM +0200, Tomi Valkeinen wrote:
> >> Request has Camera as a private member. Expose this so that users can
> >> more easily associate a received Request to a Camera.
> >>
> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
> >> ---
> >>   include/libcamera/request.h | 2 ++
> >>   src/libcamera/request.cpp   | 5 +++++
> >>   2 files changed, 7 insertions(+)
> >>
> >> diff --git a/include/libcamera/request.h b/include/libcamera/request.h
> >> index f434335b..6e8987b6 100644
> >> --- a/include/libcamera/request.h
> >> +++ b/include/libcamera/request.h
> >> @@ -60,6 +60,8 @@ public:
> >>   
> >>   	std::string toString() const;
> >>   
> >> +	std::shared_ptr<Camera> camera() const;
> > 
> > I'm not thrilled by this, as it would prevent us from removing the
> > camera pointer stored in the Request class, which I've been tempted to
> > do already.
> > 
> > Why do we need this, and do we have any alternative ?
> 
> I use it to associate the completed Request with a camera. But I guess 
> the same can be done with the cookie with a few more lines.

I've also commented in the review of the bindings that we could move the
completion handling mechanism from the CameraManager to the Camera
class, maybe that would also help avoiding the need to expose this
function ?

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list