Files
external_libcamera/include/libcamera/camera.h
Niklas Söderlund 75476f86d2 libcamera: camera: extend camera object to support streams
A camera consists of one or more video streams originating from the same
video source. The different streams could for example have access to
different hardware blocks in the video pipeline and therefore be able to
process the video source in different ways.

All static information describing each stream need to be recorded at
camera creation. After a camera is created an application can retrieve
the static information about its streams at any time.

Update all pipeline handlers to register one stream per camera, this
will be extended in the future for some of the pipelines.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-01 08:11:33 +01:00

56 lines
1.0 KiB
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>
#include <libcamera/signal.h>
namespace libcamera {
class PipelineHandler;
class Stream;
class Camera final
{
public:
static std::shared_ptr<Camera> create(PipelineHandler *pipe,
const std::string &name,
const std::vector<Stream *> &streams);
Camera(const Camera &) = delete;
Camera &operator=(const Camera &) = delete;
const std::string &name() const;
Signal<Camera *> disconnected;
int acquire();
void release();
const std::vector<Stream *> &streams() const;
private:
Camera(PipelineHandler *pipe, const std::string &name);
~Camera();
friend class PipelineHandler;
void disconnect();
std::shared_ptr<PipelineHandler> pipe_;
std::string name_;
std::vector<Stream *> streams_;
bool acquired_;
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_CAMERA_H__ */