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

QCamera/QCameraImageCapture hangs if no QCameraViewfinder is set on macOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.7.0
    • Multimedia
    • None
    • Qt 5.7

      macOS 10.12.4

      Apple LLVM version 8.1.0 (clang-802.0.42)

      Target: x86_64-apple-darwin16.5.0

      Thread model: posix
    • macOS

      Hi,

      I have stumbled on the issue of QCamera causing a freeze of the Qt application if the camera is not provided with a QCameraViewfinder. When a capture is invoked vie QCameraImageCapture the thread responsible for obtaining the image starts waiting for an update to the viewfinder (avfimagecapturecontrol.mm). If no viewfinder is specified, no update is signaled and the capture thread just hangs. Thus, the camera does not produce any images. Moreover if stop() of QCamera is called the whole application freezes because the stop() method waits for the capture calls to finish. The documentation states that a viewfinder can be provided but it does not say it is a must.

      The effect can be reproduced by using the camera example provided with Qt. If the line that sets the viewfinder in camera.cpp is commented out, the application no-longer shows captured images. Instead it does nothing when the capture button is clicked. By inspecting the threads one can see that the capture thread is blocked.

      I have stumbled upon the issue in 5.7.  It could still persist in the newer versions.

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

            ylopes Yoann Lopes
            vtodorov Vladimir Todorov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes