We're seeing a peculiar issue when attempting to re-encode videos, and it only seems to happen on the Nexus 5. We use MediaCodec to compress and re-encode videos clientside, and sometimes when the task is running on a Nexus 5 we get the following crash:
05-15 16:25:15.023 E/AndroidRuntime( 4716): FATAL EXCEPTION: FinalizerWatchdogDaemon
05-15 16:25:15.023 E/AndroidRuntime( 4716): java.util.concurrent.TimeoutException: android.graphics.SurfaceTexture.finalize() timed out after 10 seconds
05-15 16:25:15.023 E/AndroidRuntime( 4716): at android.graphics.SurfaceTexture.nativeFinalize(Native Method)
05-15 16:25:15.023 E/AndroidRuntime( 4716): at android.graphics.SurfaceTexture.finalize(SurfaceTexture.java:353)
05-15 16:25:15.023 E/AndroidRuntime( 4716): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:190)
05-15 16:25:15.023 E/AndroidRuntime( 4716): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
05-15 16:25:15.023 E/AndroidRuntime( 4716): at java.lang.Thread.run(Thread.java:818)
Our code is relatively similar to to bigflake's DecodeEditEncodeTest (https://android.googlesource.com/platform/cts/+/jb-mr2-release/tests/tests/media/src/android/media/cts/DecodeEditEncodeTest.java), and we are also using their InputSurface, OutputSurface, and TextureRender classes (https://android.googlesource.com/platform/cts/+/jb-mr2-release/tests/tests/media/src/android/media/cts/). I am guessing that the issue occurs somewhere in OutputSurface or TextureRender as they're the classes that actually manipulate a surface texture.
The only reliable repro steps we can come up with is that it seems to happen somewhat randomly when several videos are queued to be re-encoded, even though the encoder only handles one video at a time.
Any help would be much appreciated.