10using namespace Qt::StringLiterals;
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
55
56
57
58
59QCameraFormat::QCameraFormat()
noexcept =
default;
62
63
64QCameraFormat::QCameraFormat(
const QCameraFormat &other)
noexcept =
default;
67
68
69QCameraFormat &QCameraFormat::operator=(
const QCameraFormat &other)
noexcept =
default;
72
73
74QCameraFormat::~QCameraFormat() =
default;
77
78
79
82
83
84
85
86
87
88
89
90
93
94
95
96
97
98
99
100
101
102QVideoFrameFormat::PixelFormat QCameraFormat::pixelFormat()
const noexcept
104 return d ? d->pixelFormat : QVideoFrameFormat::Format_Invalid;
108
109
110
111
114
115
116
117
118QSize QCameraFormat::resolution()
const noexcept
120 return d ? d->resolution : QSize();
124
125
126
127
130
131
132
133
134float QCameraFormat::minFrameRate()
const noexcept
136 return d ? d->minFrameRate : 0;
140
141
142
143
144
145
146
149
150
151
152
153
154
155
156float QCameraFormat::maxFrameRate()
const noexcept
158 return d ? d->maxFrameRate : 0;
162
163
164QCameraFormat::QCameraFormat(QCameraFormatPrivate *p)
170
171
172bool QCameraFormat::operator==(
const QCameraFormat &other)
const
178 return d->pixelFormat == other.d->pixelFormat &&
179 d->minFrameRate == other.d->minFrameRate &&
180 d->maxFrameRate == other.d->maxFrameRate &&
181 d->resolution == other.d->resolution;
185
186
187
188
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
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
255
258
259
260QCameraDevice::QCameraDevice() =
default;
263
264
265QCameraDevice::QCameraDevice(
const QCameraDevice &other) =
default;
268
269
270QCameraDevice::~QCameraDevice() =
default;
273
274
275
276
277
278
279bool QCameraDevice::operator==(
const QCameraDevice &other)
const
281 return id() == other.id();
285
286
287bool QCameraDevice::isNull()
const
293
294
295
296
297
298
301
302
303
304
305
306
307QByteArray QCameraDevice::id()
const
309 return d ? d->id : QByteArray();
313
314
315
316
319
320
321
322
323bool QCameraDevice::isDefault()
const
325 return d ? d->isDefault :
false;
329
330
331
332
333
334
335
336
337
338
339
340
343
344
345
346
347
348
349
350
351
352
353
354
355QtVideo::Rotation QCameraDevice::correctionAngle()
const
357 return d ? QtVideo::Rotation(d->orientation) : QtVideo::Rotation::None;
361
362
363
364
365
366
369
370
371
372
373
374
375QString QCameraDevice::description()
const
377 return d ? d->description : QString();
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
417
418
419
420
421QCameraDevice::Position QCameraDevice::position()
const
423 return d ? d->position : QCameraDevice::UnspecifiedPosition;
427
428
429
430
431
432QList<QSize> QCameraDevice::photoResolutions()
const
434 return d ? d->photoResolutions : QList<QSize>{};
438
439
440
441
444
445
446
447
448QList<QCameraFormat> QCameraDevice::videoFormats()
const
450 return d ? d->videoFormats : QList<QCameraFormat>{};
453QCameraDevice::QCameraDevice(QCameraDevicePrivate *p)
458
459
460QCameraDevice& QCameraDevice::operator=(
const QCameraDevice& other) =
default;
463
464
465
466
467
469#ifndef QT_NO_DEBUG_STREAM
473 d.maybeSpace() << u"QCameraFormat(null)"_s;
475 const char *pixelFormatCharPtr = QMetaEnum::fromType<QVideoFrameFormat::PixelFormat>()
476 .valueToKey(format.pixelFormat());
477 QString pixelFormatString = pixelFormatCharPtr
478 ? QString::fromUtf8(pixelFormatCharPtr)
482 << u"QCameraFormat(resolution=%1x%2, pixelFormat=%3, minFrameRate=%4, maxFrameRate=%5"_s
483 .arg(format.resolution().width())
484 .arg(format.resolution().height())
485 .arg(pixelFormatString)
486 .arg(format.minFrameRate())
487 .arg(format.maxFrameRate());
495 d.maybeSpace() << u"QCameraDevice(name=%1, id=%2, position=%3)"_s
496 .arg(camera.description())
497 .arg(QLatin1StringView(camera.id()))
498 .arg(QLatin1StringView(
499 QMetaEnum::fromType<QCameraDevice::Position>().valueToKey(
500 camera.position())));
507#include "moc_qcameradevice.cpp"
Combined button and popup list for selecting options.
QDebug operator<<(QDebug d, const QCameraDevice &camera)
QDebug operator<<(QDebug dbg, const QFileInfo &fi)