Open pierre-the-fighter-pilot opened 1 year ago
Here is an example of what my app does:
The transitions are managed internally without using Android animations. Of note is the crashes happen at any random time and in fact, usually happen when only the clock timer changes.
It seems the bug was on my side with an update to the overlay view done outside the UI thread
After ensuring all my UI and overlay UI code runs on the UI thread, I still experience the issue as originally described. I confirm that there is a race condition in the drawing/rendering of the overlay causing the main thread to issue an IllegalStateException in android.graphics.RenderNode.endRecording (RenderNode.java) logcat4.txt
Describe the bug
Please add a clear description of what the bug is, and fill the list below.
To Reproduce
Record a long video snapshot with overlay (lots of them, with views (mostly TextViews) changing, but no animation). Observe a random crash (closure of the activity).
There seems to be a race condition related to the drawing of overlay views. Is there a restriction as to which thread can be used to make changes to the overlay views?
Expected behavior
Error handling preventing the loss of the video being recorded.
XML layout
Part of the XML layout with the CameraView declaration, so we can read its attributes.
Screenshots
No screenshot. Activity randomly shutting down
Logs
This was the original log when I first observed the issue:
It seemed as though this was a race condition around the "mConfig.overlayDrawer.draw(mConfig.overlayTarget);" call in TextureMediaEncoder.java, so I put a synchronized scope around it. It reduced the issue quite a bit but not completely. This is the new log I have: