blob: 0aebdac944cf495faec0eb85363c6dbeb6a220da (
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
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* capture.h - Cam capture
*/
#ifndef __CAM_CAPTURE_H__
#define __CAM_CAPTURE_H__
#include <memory>
#include <stdint.h>
#include <libcamera/buffer.h>
#include <libcamera/camera.h>
#include <libcamera/framebuffer_allocator.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
#include "buffer_writer.h"
#include "event_loop.h"
#include "options.h"
class Capture
{
public:
Capture(std::shared_ptr<libcamera::Camera> camera,
libcamera::CameraConfiguration *config,
EventLoop *loop);
int run(const OptionsParser::Options &options);
private:
int capture(libcamera::FrameBufferAllocator *allocator);
void requestComplete(libcamera::Request *request);
std::shared_ptr<libcamera::Camera> camera_;
libcamera::CameraConfiguration *config_;
std::map<const libcamera::Stream *, std::string> streamName_;
BufferWriter *writer_;
uint64_t last_;
EventLoop *loop_;
unsigned int captureCount_;
unsigned int captureLimit_;
};
#endif /* __CAM_CAPTURE_H__ */
|