blob: 0b75f9d9bd19ed6af535d00171eb0e045090c4a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/* 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:
enum Status {
RequestPending,
RequestComplete,
RequestCancelled,
};
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;
Status status() const { return status_; }
private:
friend class Camera;
int prepare();
void complete(Status status);
void bufferCompleted(Buffer *buffer);
Camera *camera_;
std::map<Stream *, Buffer *> bufferMap_;
std::unordered_set<Buffer *> pending_;
Status status_;
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_REQUEST_H__ */
|