/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2021, Google Inc. * * camera_capabilities.h - Camera static properties manager */ #pragma once #include #include #include #include #include #include #include #include #include "camera_metadata.h" class CameraCapabilities { public: CameraCapabilities() = default; int initialize(std::shared_ptr camera, int orientation, int facing); CameraMetadata *staticMetadata() const { return staticMetadata_.get(); } libcamera::PixelFormat toPixelFormat(int format) const; unsigned int maxJpegBufferSize() const { return maxJpegBufferSize_; } std::unique_ptr requestTemplateManual() const; std::unique_ptr requestTemplatePreview() const; std::unique_ptr requestTemplateStill() const; std::unique_ptr requestTemplateVideo() const; private: LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraCapabilities) struct Camera3StreamConfiguration { libcamera::Size resolution; int androidFormat; int64_t minFrameDurationNsec; int64_t maxFrameDurationNsec; }; bool validateManualSensorCapability(); bool validateManualPostProcessingCapability(); bool validateBurstCaptureCapability(); std::set computeCapabilities(); void computeHwLevel( const std::set &caps); std::vector initializeYUVResolutions(const libcamera::PixelFormat &pixelFormat, const std::vector &resolutions); std::vector initializeRawResolutions(const libcamera::PixelFormat &pixelFormat); int initializeStreamConfigurations(); int initializeStaticMetadata(); std::shared_ptr camera_; int facing_; int orientation_; bool rawStreamAvailable_; int64_t maxFrameDuration_; camera_metadata_enum_android_info_supported_hardware_level hwLevel_; std::set capabilities_; std::vector streamConfigurations_; std::map formatsMap_; std::unique_ptr staticMetadata_; unsigned int maxJpegBufferSize_; std::set availableCharacteristicsKeys_; std::set availableRequestKeys_; std::set availableResultKeys_; }; 975e9f4db'>root/test/mapped-buffer.cpp
blob: 5de8201e45f60ca4a75b22b7c57b3d4a76740713 (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
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