Error handling needed in CarWindow for failed frame encoding
Bug Report
Sometimes the pixelBuffer in SDLCarWindow is invalidated when the app is put in the background due to a VideoToolbox bug. This means that the CarWindow API can not encode the video frames and thus no video frames are sent to the head unit.
- This is sometimes fixed by putting the app on the device in the background and then bringing it back to the foreground. When the app is brought back to the foreground the
videoEncoderis destroyed and recreated in theSDLStreamingVideoLifecycleManager. I believe this is what fixes the issue. We should try to reset thevideoEncoderwhen the thepixelBufferisnil. - However if the bug persists after a few seconds then we should stop video streaming and let the developer know that video could not stream because of an error.
Reproduction Steps
- Connect navigation app using the CarWindow API to a SYNC 3 head unit. Open the SDL app.
- Turn off the ignition and close the doors. When screen goes dark, turn off the head unit by toggling the on/off switch on the back of the head unit. (Don't just switch off the TDK because then the library will sometimes not get a accessory disconnected notification)
- Lock the iPhone (This is what causes the VideoToolbox bug).
- Turn the TDK back on again and turn on the ignition.
- Unlock the iPhone
- If necessary, select the SDL app on the HMI.
Expected Behavior
The video streams to the head unit.
Observed Behavior
The CarWindow class does not stream video some of the time due to video encoding failing. This could happen the first time or tenth time the app is backgrounded.
OS & Version Information
- iOS Version: 13.0
- SDL iOS Version: 6.5
- Testing Against: SYNC 3.0
@joeygrover -san @theresalech -san This issue is a top priority for Toyota. Can the reproduction steps described actually reproduce this issue?
@E-SAITO-TMC The underlying issue causing the pixelBuffer to become nil was fixed, however proper error handling has not yet been added.
@joeljfischer -san Thank you, I understand. When will error handling be added?
@E-SAITO-TMC It will not be added in the release next week, and we have not begun planning for future releases. We will consider it for the July release.
@joeljfischer -san I understand. Thank you for your cooperation.