NEW 200417
iOS RTCPeerConnection releases hardware H.264 encoder only after pc.close()
https://bugs.webkit.org/show_bug.cgi?id=200417
Summary iOS RTCPeerConnection releases hardware H.264 encoder only after pc.close()
milen
Reported 2019-08-03 02:29:56 PDT
The case is: 1) Create WebRtc call with audio and video. 2) Stop the video and renegotiate the connection to be audio only. The expected result is: All video resouses to be released. There is no video to be encoded. The actual result is: The hardware H.264 encoder is not released. The only way to release it is to call pc.close(). There is a limit of the hardware H.264 encoders on the iOS. I tested in iPad Mini 2, iOS 12.4 and the limit is 4 encoders. When the limit is exhausted the log on the device says: ----------- default 15:21:25.212680 +0300 mediaserverd H.264-legacy: Init hw video encoder: dimension = 640 x 480, usage = 1 default 15:21:25.215500 +0300 mediaserverd AVE: Bottom extended pixels = 8 default 15:21:25.215832 +0300 mediaserverd Assert - (false) - f: /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleVXE380/AppleVXE380-445.6/Library/AppleVXE380FIGwrapper.cpp l: 3166 default 15:21:25.215923 +0300 kernel H264SecurityCheck WARNING: m_NumberOfClients reached MAX 4 default 15:21:25.216149 +0300 kernel VXE380 WARNING: m_ClientsSecurityCheck->AddClient failed default 15:21:25.216333 +0300 mediaserverd VXE FIG ERROR: kVTVideoEncoderNotAvailableNowErr. default 15:21:25.216611 +0300 mediaserverd Assert - (pDriverInstance) - f: /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleVXE380/AppleVXE380-445.6/Library/AppleVXE380UserLandLibrary.cpp l: 648 default 15:21:25.216866 +0300 mediaserverd AppleVXE380VA ERROR: AppleVXE380VA_DriverDelete, pDriverInstance NULL. default 15:21:25.217091 +0300 mediaserverd Assert - (err == noErr) - f: /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleVXE380/AppleVXE380-445.6/Library/AppleVXE380FIGwrapper.cpp l: 3302 default 15:21:25.217404 +0300 mediaserverd VXE FIG ERROR: AppleVXE380VA_DriverDelete failed. default 15:21:25.218634 +0300 mediaserverd H.264: failed to init video encoder, err = -108 ----------- A test app that could be used to reproduce the problem: https://milen-yordanov.github.io/ios-webrtc-hw-h264-encoders-limit/ A single RTCPeerConnection if renegotiated 5 times will reach the limit of HW H.264 encoders and will fail.
Attachments
Radar WebKit Bug Importer
Comment 1 2019-08-03 20:44:45 PDT
Note You need to log in before you can comment on or make changes to this bug.