10using namespace Qt::StringLiterals;
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
33
34
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
221
222
223
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
256
257
258
259
260
261
264
265
266QCameraDevice::QCameraDevice() =
default;
269
270
271QCameraDevice::QCameraDevice(
const QCameraDevice &other) =
default;
274
275
276QCameraDevice::~QCameraDevice() =
default;
279
280
281
282
283
284
285bool QCameraDevice::operator==(
const QCameraDevice &other)
const
287 return id() == other.id();
291
292
293bool QCameraDevice::isNull()
const
299
300
301
302
303
304
307
308
309
310
311
312
313QByteArray QCameraDevice::id()
const
315 return d ? d->id : QByteArray();
319
320
321
322
325
326
327
328
329bool QCameraDevice::isDefault()
const
331 return d ? d->isDefault :
false;
335
336
337
338
339
340
341
342
343
344
345
346
349
350
351
352
353
354
355
356
357
358
359
360
361QtVideo::Rotation QCameraDevice::correctionAngle()
const
363 return d ? QtVideo::Rotation(d->orientation) : QtVideo::Rotation::None;
367
368
369
370
371
372
375
376
377
378
379
380
381QString QCameraDevice::description()
const
383 return d ? d->description : QString();
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
423
424
425
426
427QCameraDevice::Position QCameraDevice::position()
const
429 return d ? d->position : QCameraDevice::UnspecifiedPosition;
433
434
435
436
437
438QList<QSize> QCameraDevice::photoResolutions()
const
440 return d ? d->photoResolutions : QList<QSize>{};
444
445
446
447
450
451
452
453
454QList<QCameraFormat> QCameraDevice::videoFormats()
const
456 return d ? d->videoFormats : QList<QCameraFormat>{};
459QCameraDevice::QCameraDevice(QCameraDevicePrivate *p)
464
465
466QCameraDevice& QCameraDevice::operator=(
const QCameraDevice& other) =
default;
469
470
471
472
473
475#ifndef QT_NO_DEBUG_STREAM
479 d.maybeSpace() << u"QCameraFormat(null)"_s;
481 const char *pixelFormatCharPtr = QMetaEnum::fromType<QVideoFrameFormat::PixelFormat>()
482 .valueToKey(format.pixelFormat());
483 QString pixelFormatString = pixelFormatCharPtr
484 ? QString::fromUtf8(pixelFormatCharPtr)
488 << u"QCameraFormat(resolution=%1x%2, pixelFormat=%3, minFrameRate=%4, maxFrameRate=%5"_s
489 .arg(format.resolution().width())
490 .arg(format.resolution().height())
491 .arg(pixelFormatString)
492 .arg(format.minFrameRate())
493 .arg(format.maxFrameRate());
501 d.maybeSpace() << u"QCameraDevice(name=%1, id=%2, position=%3)"_s
502 .arg(camera.description())
503 .arg(QLatin1StringView(camera.id()))
504 .arg(QLatin1StringView(
505 QMetaEnum::fromType<QCameraDevice::Position>().valueToKey(
506 camera.position())));
513#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)