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

QCamera::setCameraDevice has unclear behavior

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.8, 6.8.1
    • 6.8, 6.9
    • Multimedia
    • None
    • All
    • 1ca1fe5ce (dev), 19f03bb3c (6.8), b5709f2ef (tqtc/lts-6.5), 224525e39 (dev), 38ba20a8b (6.8), d6d3cf821 (tqtc/lts-6.5), d9824ffd2 (dev), 7bf47b006 (6.8), cf183429e (tqtc/lts-6.5)
    • Multimedia wk 43-44, Multimedia wk 47-48

    Description

      The method QCamera::setCameraDevice needs more clear behavior as to what happens to other properties when the device changes. Without the behavior clearly defined, it leads the platforms to have different behavior, and also it makes the functionality less usable for the user.

      The core issue is how a change in device affects other properties of the QCamera instance, such as flash-mode, focusDistance, zoom and so on. Different QCameraDevices have different capabilities, and support different sets of properties. The user should have some clearly defined expectations on what happens to these settings whenever the device changes.

      The documentation describes no behavior on how the discrepancy is handled. Currently, our backends have little to no consistent behavor on how this is handled. Some backends will detect whether some of the settings are supported on the new device, and in turn apply it to the physical device immediately after the device is changed. Other settings are ignored, leaving the setting in a state where it is set to a value previously set by the user, but no longer reflectes what is applied to the actual camera.

      I can think of two approaches to resolve this:

      1. Apply existing settings immediately to the new device if said feature is supported on the new device. An example of this is having the active flash or zoom "move" from one camera device to another when the switch happens. Some edge-cases should be considered in this approach.
        1. Settings that are not supported should have clear behavior. These can either be reset to default values, or we leave them in a state where they aren't active and the user needs to query the camera capabilities for each setting to know which is active.
        2. Some settings may be supported on the new device, but the range of valid values might change. An example of this is the range of supported zoom values. For these we could leave the setting to the out-of-bounds value, but not activate it. Alternatively, we could clamp said setting to the closest valid value.
      2. We can reset all settings unconditionally when changing device. This should involve documentation that encourages the user to run their camera configuration procedure over again whenever the camera device changes.

      Attachments

        For Gerrit Dashboard: QTBUG-129831
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: