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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
version: 1
algorithms:
- Agc:
- Awb:
- BlackLevelCorrection:
R: 256
Gr: 256
Gb: 256
B: 256
- ColorProcessing:
- GammaSensorLinearization:
x-intervals: [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
y:
red: [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]
green: [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]
blue: [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]
- LensShadingCorrection:
x-size: [ 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625 ]
y-size: [ 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625 ]
sets:
- ct: 3000
r: [
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024
Size(2048, 1536),
Size(2160, 1080),
Size(2560, 1080),
Size(2560, 1440),
Size(2560, 1600),
Size(2560, 2048),
Size(<
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
SizeRange StreamFormats::range(const PixelFormat &pixelformat) const
{
auto const it = formats_.find(pixelformat);
if (it == formats_.end())
return {};
const std::vector<SizeRange> &ranges = it->second;
if (ranges.size() == 1)
return ranges[0];
LOG(Stream, Debug) << "Building range from discrete sizes";
SizeRange range({ UINT_MAX, UINT_MAX }, { 0, 0 });
for (const SizeRange &limit : ranges) {
if (limit.min < range.min)
range.min = limit.min;
if (limit.max > range.max)
range.max = limit.max;
}
range.hStep = 0;
range.vStep = 0;
return range;
}
/**
* \struct StreamConfiguration
* \brief Configuration parameters for a stream
*
* The StreamConfiguration structure models all information which can be
* configured for a single video stream.
*/
/**
* \todo This function is deprecated and should be removed once all pipeline
* handlers provide StreamFormats.
*/
StreamConfiguration::StreamConfiguration()
: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),
stream_(nullptr)
{
}
/**
* \brief Construct a configuration with stream formats
*/
StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),
stream_(nullptr), formats_(formats)
{
}
/**
* \var StreamConfiguration::size
* \brief Stream size in pixels
*/
/**
* \var StreamConfiguration::pixelFormat
* \brief Stream pixel format
*/
/**
* \var StreamConfiguration::stride
* \brief Image stride for the stream, in bytes
*
* The stride value reports the number of bytes between the beginning of
* successive lines in an image buffer for this stream. The value is
* valid after successfully validating the configuration with a call to
* CameraConfiguration::validate().
*/
/**
* \var StreamConfiguration::frameSize
* \brief Frame size for the stream, in bytes
*
* The frameSize value reports the number of bytes necessary to contain one
* frame of an image buffer for this stream. This total includes the bytes
* required for all image planes. The value is valid after successfully
* validating the configuration with a call to CameraConfiguration::validate().
*/
/**
* \var StreamConfiguration::bufferCount
* \brief Requested number of buffers to allocate for the stream
*/
/**
* \fn StreamConfiguration::stream()
* \brief Retrieve the stream associated with the configuration
*
* When a camera is configured with Camera::configure() Stream instances are
* associated with each stream configuration entry. This function retrieves the
* associated Stream, which remains valid until the next call to
* Camera::configure() or Camera::release().
*
* \return The stream associated with the configuration
*/
/**
* \fn StreamConfiguration::setStream()
* \brief Associate a stream with a configuration
*
* This function is meant for the PipelineHandler::configure() function and
* shall not be called by applications.
*
* \param[in] stream The stream
*/
/**
* \fn StreamConfiguration::formats()
* \brief Retrieve advisory stream format information
*
* This function retrieves information about the pixel formats and sizes
* supported by the stream configuration. The sizes are advisory and not all of
* them are guaranteed to be supported by the stream. Users shall always inspect
* the size in the stream configuration after calling
* CameraConfiguration::validate().
*
* \return Stream formats information
*/
/**
* \brief Assemble and return a string describing the configuration
*
* \return A string describing the StreamConfiguration
*/
std::string StreamConfiguration::toString() const
{
return size.toString() + "-" + pixelFormat.toString();
}
/**
* \enum StreamRole
* \brief Identify the role a stream is intended to play
*
* The StreamRole describes how an application intends to use a stream. Roles
* are specified by applications and passed to cameras, that then select the
* most appropriate streams and their default configurations.
*
* \var Raw
* The stream is intended to capture raw frames from the sensor.
* \var StillCapture
* The stream is intended to capture high-resolution, high-quality still images
* with low frame rate. The captured frames may be exposed with flash.
* \var VideoRecording
* The stream is intended to capture video for the purpose of recording or
* streaming. The video stream may produce a high frame rate and may be
* enhanced with video stabilization.
* \var Viewfinder
* The stream is intended to capture video for the purpose of display on the
* local screen. Trade-offs between quality and usage of system resources are
* acceptable.
*/
/**
* \typedef StreamRoles
* \brief A vector of StreamRole
*/
/**
* \class Stream
* \brief Video stream for a camera
*
* The Stream class models all static information which are associated with a
* single video stream. Streams are exposed by the Camera object they belong to.
*
* Cameras may supply more than one stream from the same video source. In such
* cases an application can inspect all available streams and select the ones
* that best fit its use case.
*
* \todo Add capabilities to the stream API. Without this the Stream class only
* serves to reveal how many streams of unknown capabilities a camera supports.
* This in itself is productive as it allows applications to configure and
* capture from one or more streams even if they won't be able to select the
* optimal stream for the task.
*/
/**
* \brief Construct a stream with default parameters
*/
Stream::Stream()
{
}
/**
* \fn Stream::configuration()
* \brief Retrieve the active configuration of the stream
* \return The active configuration of the stream
*/
/**
* \var Stream::configuration_
* \brief The stream configuration
*
* The configuration for the stream is set by any successful call to
* Camera::configure() that includes the stream, and remains valid until the
* next call to Camera::configure() regardless of if it includes the stream.
*/
} /* namespace libcamera */
|