summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi
ModeNameSize
-rw-r--r--README.md1113logplain
-rw-r--r--cam_helper.cpp2361logplain
-rw-r--r--cam_helper.hpp3880logplain
-rw-r--r--cam_helper_imx219.cpp3978logplain
-rw-r--r--cam_helper_imx477.cpp3516logplain
-rw-r--r--cam_helper_ov5647.cpp2019logplain
d---------controller1287logplain
d---------data201logplain
-rw-r--r--md_parser.cpp2991logplain
-rw-r--r--md_parser.hpp3567logplain
-rw-r--r--md_parser_rpi.cpp697logplain
-rw-r--r--md_parser_rpi.hpp652logplain
-rw-r--r--meson.build1643logplain
-rw-r--r--raspberrypi.cpp35727logplain
id='n226' href='#n226'>226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * request.cpp - Capture request handling
 */

#include <libcamera/request.h>

#include <map>

#include <libcamera/buffer.h>
#include <libcamera/camera.h>
#include <libcamera/stream.h>

#include "camera_controls.h"
#include "log.h"

/**
 * \file request.h
 * \brief Describes a frame capture request to be processed by a camera
 */

namespace libcamera {

LOG_DEFINE_CATEGORY(Request)

/**
 * \enum Request::Status
 * Request completion status
 * \var Request::RequestPending
 * The request hasn't completed yet
 * \var Request::RequestComplete
 * The request has completed
 * \var Request::RequestCancelled
 * The request has been cancelled due to capture stop
 */

/**
 * \class Request
 * \brief A frame capture request
 *
 * A Request allows an application to associate buffers and controls on a
 * per-frame basis to be queued to the camera device for processing.
 */

/**
 * \brief Create a capture request for a camera
 * \param[in] camera The camera that creates the request
 * \param[in] cookie Opaque cookie for application use
 *
 * The \a cookie is stored in the request and is accessible through the
 * cookie() method at any time. It is typically used by applications to map the
 * request to an external resource in the request completion handler, and is
 * completely opaque to libcamera.
 *
 */
Request::Request(Camera *camera, uint64_t cookie)
	: camera_(camera), cookie_(cookie), status_(RequestPending),
	  cancelled_(false)
{
	/**
	 * \todo Should the Camera expose a validator instance, to avoid
	 * creating a new instance for each request?
	 */
	validator_ = new CameraControlValidator(camera);
	controls_ = new ControlList(validator_);
}

Request::~Request()
{
	for (auto it : bufferMap_) {
		Buffer *buffer = it.second;
		delete buffer;
	}

	delete controls_;
	delete validator_;
}

/**
 * \fn Request::controls()
 * \brief Retrieve the request's ControlList
 *
 * Requests store a list of controls to be applied to all frames captured for
 * the request. They are created with an empty list of controls that can be
 * accessed through this method and updated with ControlList::operator[]() or
 * ControlList::update().
 *
 * Only controls supported by the camera to which this request will be
 * submitted shall be included in the controls list. Attempting to add an
 * unsupported control causes undefined behaviour.
 *