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;
26 case CAMERA_FRAMETYPE_JPEG:
27 return QVideoFrameFormat::Format_Jpeg;
28 case CAMERA_FRAMETYPE_GRAY8:
29 return QVideoFrameFormat::Format_Y8;
30 case CAMERA_FRAMETYPE_CBYCRY:
31 return QVideoFrameFormat::Format_UYVY;
32 case CAMERA_FRAMETYPE_YCBCR420P:
33 return QVideoFrameFormat::Format_YUV420P;
34 case CAMERA_FRAMETYPE_YCBYCR:
35 return QVideoFrameFormat::Format_YUYV;
44 qWarning() <<
"Invalid camera unit:" << unit;
48 auto *p =
new QCameraDevicePrivate;
50 p->id = QByteArray::number(camera.unit());
51 p->description = camera.name();
52 p->isDefault = isDefault;
54 const QList<camera_frametype_t> frameTypes = camera.supportedVfFrameTypes();
56 for (camera_res_t res : camera.supportedVfResolutions()) {
57 const QSize resolution(res.width, res.height);
59 p->photoResolutions.append(resolution);
61 for (camera_frametype_t frameType : camera.supportedVfFrameTypes()) {
62 const QVideoFrameFormat::PixelFormat pixelFormat = fromCameraFrametype(frameType);
64 if (pixelFormat == QVideoFrameFormat::Format_Invalid)
67 auto *f =
new QCameraFormatPrivate;
68 p->videoFormats.append(f->create());
70 f->resolution = resolution;
71 f->pixelFormat = pixelFormat;
72 f->minFrameRate = 1.e10;
74 for (
double fr : camera.specifiedVfFrameRates(frameType, res)) {
75 if (fr < f->minFrameRate)
77 if (fr > f->maxFrameRate)