pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ANR when stopStream()

AlwaysYang opened this issue · comments

commented

Describe the bug
ANR :
fun ExecutorService.secureSubmit(code: () -> Unit) {
try { submit { code() }.get() } catch (ignored: Exception) {}
}

To Reproduce
stopStream()

Expected behavior

Screenshots

Smartphone (please complete the following information):

  • Library version [2.4.5]
  • Device: [e.g. Pixel 6a]
  • OS: [e.g. Android13]
  • Media server [e.g. srs, version 5.0]
  • Class used [e.g. RtmpCamera1]
    1

Additional context

07-11 15:29:03.343 26007 26044 E AndroidRuntime: FATAL EXCEPTION: |ANR-WatchDog|
07-11 15:29:03.343 26007 26044 E AndroidRuntime: Process: net.whir.emp.endusertest, PID: 26007
07-11 15:29:03.343 26007 26044 E AndroidRuntime: com.github.anrwatchdog.ANRError: Application Not Responding for at least 5000 ms.
07-11 15:29:03.343 26007 26044 E AndroidRuntime: Caused by: com.github.anrwatchdog.ANRError$$$_Thread: main (state = WAITING)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at sun.misc.Unsafe.park(Native Method)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:450)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at com.pedro.common.ExtensionsKt.secureSubmit(Extensions.kt:87)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at com.pedro.library.view.GlStreamInterface.removeMediaCodecSurface(GlStreamInterface.kt:130)
07-11 15:29:03.343 26007 26044 E AndroidRuntime: 	at com.pedro.library.base.StreamBase.stopSources(StreamBase.kt:387)

Hello,

Can you tell me library version used? because that logcat is not related with the last version lines
Can you reproduce the error consistently?

After check a bit others version. This seems that you are using version 2.4.5
I did a commit for this error. If you can reproduce the case, get the last commit of master branch and test if your error is solved

commented

After check a bit others version. This seems that you are using version 2.4.5 I did a commit for this error. If you can reproduce the case, get the last commit of master branch and test if your error is solved

Thank you. I will try to integrate the source code into the project and let users test it, which may take a little time