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

Unable to access camera

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.5.0
    • Multimedia
    • None
    • Android

    Description

      When deploying to real device , camera was unable to open , Only a white screen appear

      I use the code from the code sample from the qt documentation 

       

      import QtQuick
      import QtQuick.Controls
      import QtMultimedia
      Window {
          width: Qt.platform.os === "android" || Qt.platform.os === "ios" ? Screen.width : 1280
          height: Qt.platform.os === "android" || Qt.platform.os === "ios" ? Screen.height : 720

          visible: true
          title: qsTr("Sample")
          objectName: "mainWindow"

          CaptureSession {
                imageCapture : ImageCapture

      {               id: imageCapture           }

                camera: Camera

      {               id: camera           }

                videoOutput: videoOutput
            }
            VideoOutput {
                id: videoOutput
                anchors.fill: parent

                MouseArea

      {               anchors.fill: parent;               onClicked: imageCapture.capture();           }

            }

            Image

      {           id: photoPreview           source: imageCapture.preview // always shows the last captured image       }

      }

       

       

       

      Below is the logs from ADB log 

      E ion     : ioctl c0044901 failed with code -1: Invalid argument
      W CameraBase: An error occurred while connecting to camera 3: Status(-8, EX_SERVICE_SPECIFIC): '10: connectHelper:1767: Failed to initialize camera "22": No such device (-19)'
      W libappCebuanaOTG_arm64-v8a.so: java.lang.RuntimeException: Fail to connect to camera service
      W libappCebuanaOTG_arm64-v8a.so:     at android.hardware.Camera.<init>(Camera.java:625)
      W libappCebuanaOTG_arm64-v8a.so:     at android.hardware.Camera.open(Camera.java:463)

      i believe android.hardware.camera is deprecated ?  

      Android now using android.hardware.camera2 

      Attachments

        Activity

          People

            laknoll Lars Knoll
            jhayar Jhay Tolentino
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: