Add an initial StreamConfiguration implementation to hold configuration data for a single stream of a Camera. In its current form not many configuration parameters are supported but it's expected the number of options will grow over time. At this stage the pixel format is represented as an unsigned int to allow for easy mapping to the V4L2 API. This might be subject to change in the future as we finalize how libcamera shall represent pixel formats. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
77 lines
2.4 KiB
C++
77 lines
2.4 KiB
C++
/* 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.
|
|
*/
|
|
|
|
/**
|
|
* \struct StreamConfiguration
|
|
* \brief Configuration parameters for a stream
|
|
*
|
|
* The StreamConfiguration structure models all information which can be
|
|
* configured for a single video stream.
|
|
*/
|
|
|
|
/**
|
|
* \var StreamConfiguration::width
|
|
* \brief Stream width in pixels
|
|
*/
|
|
|
|
/**
|
|
* \var StreamConfiguration::height
|
|
* \brief Stream height in pixels
|
|
*/
|
|
|
|
/**
|
|
* \var StreamConfiguration::pixelFormat
|
|
* \brief Stream pixel format
|
|
*
|
|
* This is a little endian four character code representation of the pixel
|
|
* format described in V4L2 using the V4L2_PIX_FMT_* definitions.
|
|
*/
|
|
|
|
} /* namespace libcamera */
|