summaryrefslogtreecommitdiff
path: root/src/libcamera/stream.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-01-21 21:47:49 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-02-01 08:11:33 +0100
commit50e184d3f1f1b89b15ccdf1268e68b43a435c7d0 (patch)
treeb37ac25bcad5feeac9b88fe1657a68df36b906d0 /src/libcamera/stream.cpp
parent92d9df69243000082559084a6fba2929cc18cc83 (diff)
libcamera: stream: add initial Stream class
Add an initial Stream implementation. The idea is that once capability support is added to the library each stream will describe its capabilities using this class. An application will then select one or more streams based on these capabilities and use them to configure the camera and capture. At this stage the Stream class is empty as capabilities are yet to be added. The class is still useful as it will be used to communicate how many streams a Camera object provides. 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>
Diffstat (limited to 'src/libcamera/stream.cpp')
-rw-r--r--src/libcamera/stream.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
new file mode 100644
index 00000000..9417c588
--- /dev/null
+++ b/src/libcamera/stream.cpp
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2019, Google Inc.
+ *
+ * stream.cpp - Video stream for a Camera
+ */
+
+#include <libcamera/stream.h>
+
+/**
+ * \file stream.h
+ * \brief Video stream for a Camera
+ *
+ * A camera device can provide frames in different resolutions and formats
+ * concurrently from a single image source. The Stream class represents
+ * one of the multiple concurrent streams.
+ *
+ * All streams exposed by a camera device share the same image source and are
+ * thus not fully independent. Parameters related to the image source, such as
+ * the exposure time or flash control, are common to all streams. Other
+ * parameters, such as format or resolution, may be specified per-stream,
+ * depending on the capabilities of the camera device.
+ *
+ * Camera devices expose at least one stream, and may expose additional streams
+ * based on the device capabilities. This can be used, for instance, to
+ * implement concurrent viewfinder and video capture, or concurrent viewfinder,
+ * video capture and still image capture.
+ */
+
+namespace libcamera {
+
+/**
+ * \class Stream
+ * \brief Video stream for a camera
+ *
+ * The Stream class models all static information which are associated with a
+ * single video stream. Streams are exposed by the Camera object they belong to.
+ *
+ * Cameras may supply more than one stream from the same video source. In such
+ * cases an application can inspect all available streams and select the ones
+ * that best fit its use case.
+ *
+ * \todo Add capabilities to the stream API. Without this the Stream class only
+ * serves to reveal how many streams of unknown capabilities a camera supports.
+ * This in itself is productive as it allows applications to configure and
+ * capture from one or more streams even if they won't be able to select the
+ * optimal stream for the task.
+ */
+
+} /* namespace libcamera */