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

CameraBin error: "Cannot identify device '/dev/video0'."

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.10.0
    • 5.7.1, 5.10
    • Multimedia
    • None
    • OS : Gentoo

      a UVC camera

    Description

      This bug is similar to QTBUG-64080 but has a different root cause and I've written a separate patch for it.

      What's wrong?

      Suppose I have a QML Camera object and a web cam connected to the PC. First I initialise the camera object with default one: 

      Camera {
          id : myCamera
          deviceId : QtMultimedia.defaultCamera.deviceId
          cameraState : Camera.LoadedState
      }

      Then I unplug the camera and reassign myCamera to the default device (which is no camera now). 

      function enumerateCallbackOrWhatever() {
          myCamera.deviceId = QtMultimedia.defaultCamera.deviceId
      }

      Then I see the error

      CameraBin error: "Cannot identify device '/dev/video0'."

      and myCamera.cameraStatus never gets out from Camera.LoadingStatus.

       

      Steps to reproduce:

      I've written a little reproducer project following the design of QDeclarativeCamera class from  ./imports/multimedia/qdeclarativecamera.cpp which you can use to make this bug emerge.

      1. Connect a camera to the PC
      2. Run the reproducer.  You should see messages like "status: 2" and "status: 4". This is the values of QCamera::status() of the default Camera.
      3. When you see "Please unplug the DEFAULT camera within 10 seconds" message please do that and wait a little bit
      4. The program will unload the camera, change it to the default device and will try to load it. As the result you should see the status changing from 3 to 1, then to 2 and finally you should see the error message I was talking about earlier and then nothing

       

      Attachments

        1. qt.patch
          2 kB
        2. reproducer.tar.gz
          1 kB
        3. SMPTE_Color_Bars.svg.png
          SMPTE_Color_Bars.svg.png
          2 kB

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            krokoziabla Vitaliy Kirsanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: