Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.1
-
None
-
iPad Air 13 M2, iOS 18.1.1
-
-
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
Description
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.
Attachments
For Gerrit Dashboard: QTBUG-131530 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
606714,10 | FFmpeg, Darwin: Don't crash during texture-conversion | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
606715,4 | FFmpeg, Darwin: Handle RED_OR_ALPHA8 during texture conversion | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
607570,2 | FFmpeg, Darwin: Don't crash during texture-conversion | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
607572,2 | FFmpeg, Darwin: Handle RED_OR_ALPHA8 during texture conversion | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
607656,2 | FFmpeg, Darwin: Don't crash during texture-conversion | tqtc/lts-6.5 | qt/tqtc-qtmultimedia | Status: MERGED | +2 | 0 |
607699,2 | FFmpeg, Darwin: Handle RED_OR_ALPHA8 during texture conversion | tqtc/lts-6.5 | qt/tqtc-qtmultimedia | Status: MERGED | +2 | 0 |