The CameraLens class abstracts camera lens and provides helper functions to ease interactions with them. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
45 lines
802 B
C++
45 lines
802 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2021, Google Inc.
|
|
*
|
|
* camera_lens.h - A camera lens controller
|
|
*/
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include <libcamera/base/class.h>
|
|
#include <libcamera/base/log.h>
|
|
|
|
namespace libcamera {
|
|
|
|
class MediaEntity;
|
|
class V4L2Subdevice;
|
|
|
|
class CameraLens : protected Loggable
|
|
{
|
|
public:
|
|
explicit CameraLens(const MediaEntity *entity);
|
|
~CameraLens();
|
|
|
|
int init();
|
|
int setFocusPostion(int32_t position);
|
|
|
|
const std::string &model() const { return model_; }
|
|
|
|
protected:
|
|
std::string logPrefix() const override;
|
|
|
|
private:
|
|
LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraLens)
|
|
|
|
int validateLensDriver();
|
|
|
|
const MediaEntity *entity_;
|
|
std::unique_ptr<V4L2Subdevice> subdev_;
|
|
|
|
std::string model_;
|
|
};
|
|
|
|
} /* namespace libcamera */
|