20 case CAMERA_FRAMETYPE_UNSPECIFIED:
21 return QVideoFrameFormat::Format_Invalid;
22 case CAMERA_FRAMETYPE_NV12:
23 return QVideoFrameFormat::Format_NV12;
24 case CAMERA_FRAMETYPE_RGB8888:
25 return QVideoFrameFormat::Format_ARGB8888;
27 case CAMERA_FRAMETYPE_JPEG:
28 return QVideoFrameFormat::Format_Jpeg;
30 case CAMERA_FRAMETYPE_GRAY8:
31 return QVideoFrameFormat::Format_Y8;
32 case CAMERA_FRAMETYPE_CBYCRY:
33 return QVideoFrameFormat::Format_UYVY;
34 case CAMERA_FRAMETYPE_YCBCR420P:
35 return QVideoFrameFormat::Format_YUV420P;
36 case CAMERA_FRAMETYPE_YCBYCR:
37 return QVideoFrameFormat::Format_YUYV;
46 qWarning() <<
"Invalid camera unit:" << unit;
50 auto *p =
new QCameraDevicePrivate;
52 p->id = QByteArray::number(camera.unit());
53 p->description = camera.name();
54 p->isDefault = isDefault;
56 const QList<camera_frametype_t> frameTypes = camera.supportedVfFrameTypes();
58 for (camera_res_t res : camera.supportedVfResolutions()) {
59 const QSize resolution(res.width, res.height);
61 p->photoResolutions.append(resolution);
63 for (camera_frametype_t frameType : camera.supportedVfFrameTypes()) {
64 const QVideoFrameFormat::PixelFormat pixelFormat = fromCameraFrametype(frameType);
66 if (pixelFormat == QVideoFrameFormat::Format_Invalid)
69 auto *f =
new QCameraFormatPrivate;
70 p->videoFormats.append(f->create());
72 f->resolution = resolution;
73 f->pixelFormat = pixelFormat;
74 f->minFrameRate = 1.e10;
76 for (
double fr : camera.specifiedVfFrameRates(frameType, res)) {
77 if (fr < f->minFrameRate)
79 if (fr > f->maxFrameRate)