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

declarative-camera crashes on startup under iOS 18.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.5.9, 6.8.2, 6.9.0 FF
    • 6.8.1
    • Multimedia
    • None
    • iPad Air 13 M2, iOS 18.1.1
    • iOS/tvOS/watchOS
    • b27e3f102 (dev), 9d1e0cfc2 (dev), 4d8c8e0ff (6.8), ac4fea47f (6.8), ae69e229d (tqtc/lts-6.5), 97c968303 (tqtc/lts-6.5)
    • Multimedia wk 47-48, Multimedia wk 49-50

      When booting declarative-camera example on newest iOS version, the application crashes instantly. Relevant log from Xcode:

      -[MTLTextureDescriptorInternal validateWithDevice:], line 1405: error 'Texture Descriptor Validation
      MTLTextureDescriptor has invalid pixelFormat (0).
      '
      -[MTLTextureDescriptorInternal validateWithDevice:]:1405: failed assertion `Texture Descriptor Validation
      MTLTextureDescriptor has invalid pixelFormat (0).
      '
      Message from debugger: killed
      Program ended with exit code: 9
      

      The relevant line in the code is in "qffmpeghwaccel_videotoolbox.mm". Function "TextureSet *VideoToolBoxTextureConverter::getTextures(AVFrame *frame)". The offending statement:

                 // Create a CoreVideo pixel buffer backed Metal texture image from the texture cache.
                  auto ret = CVMetalTextureCacheCreateTextureFromImage(
                                  kCFAllocatorDefault,
                                  mtc(cvMetalTextureCache),
                                  buffer, nil,
                                  rhiTextureFormatToMetalFormat(textureDescription->textureFormat[plane]),
                                  width, height,
                                  plane,
                                  &textureSet->cvMetalTexture[plane]);
      

      This is because "rhiTextureFormatToMetalFormat" segfaults if we supply it a pixelFormat of value invalid.

      My best guess so far is that iOS devices changed what kind of formats they favor to supply from the camera. My iPad device now only exposes formats of type NV12, and it seems we have no Metal code to handle this format.

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

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

              Created:
              Updated:
              Resolved: