Created attachment 413357 [details] Image comparing HLS WebHL playback on iPhone12 vs iPhone11 in iOS 14.2 As a follow-up to https://bugs.webkit.org/show_bug.cgi?id=215908 HLS WebGL playback is still broken on iPhone 12 devices in today's iOS 14.2 release (18B92) *Examples to Reproduce Issue* Device: iPhone 12 three.js example: Visit https://8w.8thwall.app/hls-threejs on an iPhone 12 running iOS 14.2 (18B92). The rotating cube has a video texture applied from an HLS stream. The video in the top left corner is using the same HLS stream but rendering on top of the page outside WebGL. babylon.js example: Visit https://www.babylonjs-playground.com/#9FSDC7#49 on iPhone 12 running iOS 14.2. The plane has a video texture applied from an HLS stream. Both examples work correctly on: iPhone 11 (Model MWLC2LL/A) running iOS 14.2 (18B92) iPhone SE (Model MX9Q2LL/A) running iOS 14.2 (18B92)
I can reproduce this in iPhone 12 Pro.
<rdar://problem/71102126>
On iPhone 12 fails with: Asked to copy an unsupported pixel format ('&8v0'). when interpreting the result of CVPixelBufferGetPixelFormatType. The supported ones are '420v' and '420f'. Unsure if the above pixel format is real fourcc format or just misinterpretation of OSType enumeration.
And to clarify: Not all WebGL video copies fail. It appears that at least the bunny one fails, but at least one other test case in bug 215908 succeeds
Kimmo, since you've triaged this already could you officially take it? Unfortunately James and I can't feasibly debug anything that happens only on real iOS hardware.
Created attachment 413929 [details] Patch
Comment on attachment 413929 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413929&action=review Very nice and well thought through fix. It looks good to me, especially given you've verified the fix on hardware - two small comments above. However I think it would be best if jer.noble reviewed this too and approved it. > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2216 > + (__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ /*empty dictionary*/ }, Just checking - it's okay to specify this property for all video playback? > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:2363 > + CVPixelBufferRef pixelBuffer = updateLastPixelBufferForWebGL(); One note - the software upload path into GraphicsContext goes through the call chain paintCurrentFrameInContext -> paintWithVideoOutput -> updateLastImage, which calls updateLastPixelBuffer. However, this doesn't have the same requirements on the pixel buffer format that copyVideoTextureToPlatformTexture does, so that call to updateLastPixelBuffer doesn't need to be updated to updateLastPixelBufferForWebGL.
Comment on attachment 413929 [details] Patch Since other reviewers seem busy, let me set r+ since you've tested this locally and it fixes a major regression. Please set cq? if you'd like me to cq+ it too.
Created attachment 414198 [details] Patch
Created attachment 414199 [details] Patch
(In reply to Kenneth Russell from comment #8) > Comment on attachment 413929 [details] > Patch > > Since other reviewers seem busy, let me set r+ since you've tested this > locally and it fixes a major regression. Please set cq? if you'd like me to > cq+ it too. Thanks for the review. Jer explained to me that using PixelBufferTransferSession is a software fallback. I moved the implementation to bug 218971 where we should improve the software fallback, since currently it's not really working (contributing to two regressions in iOS releases). I uploaded Jer's patch for treating the currently frequent-but-not-working format similar to a format we already support.
Committed r269893: <https://trac.webkit.org/changeset/269893> All reviewed patches have been landed. Closing bug and clearing flags on attachment 414199 [details].