The PipelineHandler which creates a Camera is responsible for serving any operation requested by the user. In order forward the public API calls, the camera needs to store a reference to its pipeline handler. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- Changes since v1: - Create pipeline handlers is shared pointers, make them inherit from std::enable_shared_from_this<> and stored them in shared pointers.
39 lines
729 B
C++
39 lines
729 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2018, Google Inc.
|
|
*
|
|
* camera.h - Camera object interface
|
|
*/
|
|
#ifndef __LIBCAMERA_CAMERA_H__
|
|
#define __LIBCAMERA_CAMERA_H__
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace libcamera {
|
|
|
|
class PipelineHandler;
|
|
|
|
class Camera final
|
|
{
|
|
public:
|
|
static std::shared_ptr<Camera> create(PipelineHandler *pipe,
|
|
const std::string &name);
|
|
|
|
Camera(const Camera &) = delete;
|
|
void operator=(const Camera &) = delete;
|
|
|
|
const std::string &name() const;
|
|
|
|
private:
|
|
Camera(PipelineHandler *pipe, const std::string &name);
|
|
~Camera();
|
|
|
|
std::shared_ptr<PipelineHandler> pipe_;
|
|
std::string name_;
|
|
};
|
|
|
|
} /* namespace libcamera */
|
|
|
|
#endif /* __LIBCAMERA_CAMERA_H__ */
|