mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
libcamera: Provide a Request object
Implement a Request object used by applications to queue image capture requests to a camera. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
1d7b6297f2
commit
5aef825764
7 changed files with 177 additions and 0 deletions
|
@ -11,10 +11,12 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <libcamera/request.h>
|
||||
#include <libcamera/signal.h>
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class Buffer;
|
||||
class PipelineHandler;
|
||||
class Stream;
|
||||
class StreamConfiguration;
|
||||
|
@ -31,6 +33,7 @@ public:
|
|||
|
||||
const std::string &name() const;
|
||||
|
||||
Signal<Request *, const std::map<Stream *, Buffer *> &> requestCompleted;
|
||||
Signal<Camera *> disconnected;
|
||||
|
||||
int acquire();
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <libcamera/camera_manager.h>
|
||||
#include <libcamera/event_dispatcher.h>
|
||||
#include <libcamera/event_notifier.h>
|
||||
#include <libcamera/request.h>
|
||||
#include <libcamera/signal.h>
|
||||
#include <libcamera/stream.h>
|
||||
#include <libcamera/timer.h>
|
||||
|
|
|
@ -5,6 +5,7 @@ libcamera_api = files([
|
|||
'event_dispatcher.h',
|
||||
'event_notifier.h',
|
||||
'libcamera.h',
|
||||
'request.h',
|
||||
'signal.h',
|
||||
'stream.h',
|
||||
'timer.h',
|
||||
|
|
44
include/libcamera/request.h
Normal file
44
include/libcamera/request.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2019, Google Inc.
|
||||
*
|
||||
* request.h - Capture request handling
|
||||
*/
|
||||
#ifndef __LIBCAMERA_REQUEST_H__
|
||||
#define __LIBCAMERA_REQUEST_H__
|
||||
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <libcamera/signal.h>
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class Buffer;
|
||||
class Camera;
|
||||
class Stream;
|
||||
|
||||
class Request
|
||||
{
|
||||
public:
|
||||
explicit Request(Camera *camera);
|
||||
Request(const Request &) = delete;
|
||||
Request &operator=(const Request &) = delete;
|
||||
|
||||
int setBuffers(const std::map<Stream *, Buffer *> &streamMap);
|
||||
Buffer *findBuffer(Stream *stream) const;
|
||||
|
||||
private:
|
||||
friend class Camera;
|
||||
|
||||
int prepare();
|
||||
void bufferCompleted(Buffer *buffer);
|
||||
|
||||
Camera *camera_;
|
||||
std::map<Stream *, Buffer *> bufferMap_;
|
||||
std::unordered_set<Buffer *> pending_;
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
#endif /* __LIBCAMERA_REQUEST_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue