Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135256

Camera not functioning if permission granted later

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9
    • Multimedia
    • None
    • iOS/tvOS/watchOS, macOS

    Description

      Observed on macOS and iOS.

      If you have a QML setup similar to the following:

      CameraPermission {
          id: cameraPermission
          onStatusChanged: () => {
              if (status === Qt.PermissionStatus.Granted) {
                  myCamera.active = true
              }
          }
      }
      Component.onCompleted: cameraPermission.request()
      
      TestLib.CameraHelper {
          id: myCamera
          active: true
      }

      Then the camera will have the property "active" set to true, even before the permission is granted, and it will not transmit any frames. If the user then grants access, the camera will still not send transmit any frames even though it is still marked as active and permission is granted.

      This leaves the camera in an unusable state until the user switches device and then back. This method is impossible if the user only has a single camera connected.

      What do you expect to happen
      I expect the camera to not go into "active = true" whenever permission is not granted. Instead I expect it to start working once I assign true to the "active" property, only after permission has been granted.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            npskalerud Nils Petter Skålerud
            npskalerud Nils Petter Skålerud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes