Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Unable to set PixelFormat for QCamera on iOS
Qt 6.11 is out! See what's new in the release blog

Unable to set PixelFormat for QCamera on iOS

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 461 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    errollgarner
    wrote on last edited by errollgarner
    #1

    Hi,

    I am trying to make an iOS app using the back facing camera to run on iPad Air. Although, it seems like I can't set the PixelFormat I want. I am using the following code to construct the camera and change it's internal parameters:

    QCamera * camera;
    QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
    foreach (const QCameraInfo &cameraInfo, cameras) {
        if (cameraInfo.position() == QCamera::BackFace){
            camera = new QCamera(cameraInfo);
        }
    }
    
    QList<QCameraViewfinderSettings> ff = camera->supportedViewfinderSettings();
    for (int i = 0 ; i < ff.length() ; i++){
        qInfo() << i << ":" << ff[i].resolution() << "," << ff[i].pixelFormat();
    }
    
    camera->setViewfinderSettings(ff[14]);
    qInfo() << "Output format of camera:" << camera->viewfinderSettings().pixelFormat();
    

    The output given is:
    0 : QSize(192, 144) , Format_NV12
    1 : QSize(192, 144) , Format_ARGB32
    2 : QSize(352, 288) , Format_NV12
    3 : QSize(352, 288) , Format_ARGB32
    4 : QSize(480, 360) , Format_NV12
    5 : QSize(480, 360) , Format_ARGB32
    6 : QSize(640, 480) , Format_NV12
    7 : QSize(640, 480) , Format_ARGB32
    8 : QSize(960, 540) , Format_NV12
    9 : QSize(960, 540) , Format_ARGB32
    10 : QSize(1280, 720) , Format_NV12
    11 : QSize(1280, 720) , Format_ARGB32
    12 : QSize(1920, 1080) , Format_NV12
    13 : QSize(1920, 1080) , Format_ARGB32
    14 : QSize(2592, 1936) , Format_NV12
    15 : QSize(2592, 1936) , Format_ARGB32
    Output format of camera: Format_ARGB32

    So, even though I explicitly set the the camera's ViewFinderSettings to NV12 (element 14 in the list), the value in the camera's ViewFinder after the operation is still ARGB32. What is going on here? Am I forgetting something? Do I need to reset the camera after changing the parameters or something similar? Otherwise is this a know bug? If so, is it specific to this device? In any case, would there be a workaround?

    Thank you in advance for your help!

    E.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved