summaryrefslogtreecommitdiff
path: root/include/linux/v4l2-controls.h
diff options
context:
space:
mode:
authorBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-01-22 18:17:19 +0100
committerBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-03-21 15:43:41 +0100
commitd716200d2b81aa884cf395ec742c6df06675306b (patch)
tree8df0a02b22e3d4e7e3ef5b2bcefcf1f40d8d84c7 /include/linux/v4l2-controls.h
parent4a5ad4e9b04e0c41efddc9800d4462c23c016904 (diff)
libcamera: ipa_manager: Store `IPAModule`s in `std::unique_ptr`
Express the ownership more clearly by using a smart pointer type. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include/linux/v4l2-controls.h')
0 files changed, 0 insertions, 0 deletions
/a> 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2020, Google Inc.
 *
 * camera_worker.cpp - Process capture requests on behalf of the Camera HAL
 */

#include "camera_worker.h"

#include <errno.h>
#include <string.h>
#include <sys/poll.h>

#include "camera_device.h"

using namespace libcamera;

LOG_DECLARE_CATEGORY(HAL)

/*
 * \class CaptureRequest
 * \brief Wrap a libcamera::Request associated with buffers and fences
 *
 * A CaptureRequest is constructed by the CameraDevice, filled with
 * buffers and fences provided by the camera3 framework and then processed
 * by the CameraWorker which queues it to the libcamera::Camera after handling
 * fences.
 */
CaptureRequest::CaptureRequest(libcamera::Camera *camera, uint64_t cookie)
	: camera_(camera)
{
	request_ = camera_->createRequest(cookie);
}

void CaptureRequest::addBuffer(Stream *stream, FrameBuffer *buffer, int fence)
{
	request_->addBuffer(stream, buffer);
	acquireFences_.push_back(fence);
}

void CaptureRequest::queue()
{
	camera_->queueRequest(request_.get());
}

/*
 * \class CameraWorker
 * \brief Process a CaptureRequest on an internal thread
 *
 * The CameraWorker class wraps a Worker that runs on an internal thread
 * and schedules processing of CaptureRequest through it.
 */
CameraWorker::CameraWorker()
{
	worker_.moveToThread(&thread_);
}

void CameraWorker::start()
{
	thread_.start();
}

void CameraWorker::stop()