EGL14.eglMakeCurrent冻结了我的游戏

时间:2017-09-20 11:31:01

标签: android unity3d opengl-es

我跟踪this tutorial以捕捉我的游戏视频,并且它正在运行。我在几个设备上测试过,它正在运行。但它与Nexus 7(2012)失败了。游戏冻结了。

调试library,我发现this file第143行中对EGL14.eglMakeCurrent的调用导致了它。

为什么EGL14.eglMakeCurrent调用可能会阻止执行?

编辑:当游戏冻结时,logcat中没有任何内容。我只能从adb bugreport获取此信息:

"Thread-597" prio=5 tid=76 Native
  | group="main" sCount=1 dsCount=0 obj=0x12d44190 self=0x80858858
  | sysTid=7984 nice=0 cgrp=apps sched=0/0 handle=0x80858d38
  | state=S schedstat=( 43302000 35740000 115 ) utm=2 stm=2 core=3 HZ=100
  | stack=0x80c74000-0x80c76000 stackSize=1036KB
  | held mutexes=
  native: #00 pc 00012444  /system/lib/libc.so (syscall+28)
  native: #01 pc 0001641b  /system/lib/libc.so (???)
  native: #02 pc 000167b1  /system/lib/libc.so (pthread_mutex_lock+310)
  native: #03 pc 00005b5c  /system/lib/libnvos.so (???)
  native: #04 pc 0000a7d8  /system/lib/egl/libGLESv2_tegra.so (???)
  native: #05 pc 00006ee3  /system/lib/egl/libEGL_tegra.so (???)
  native: #06 pc 00006f8f  /system/lib/egl/libEGL_tegra.so (???)
  native: #07 pc 000077db  /system/lib/egl/libEGL_tegra.so (eglMakeCurrent+34)
  native: #08 pc 0000ffc1  /system/lib/libEGL.so (android::egl_display_t::makeCurrent(android::egl_context_t*, android::egl_context_t*, void*, void*, void*, void*, void*, void*)+142)
  native: #09 pc 000125cf  /system/lib/libEGL.so (eglMakeCurrent+266)
  native: #10 pc 0005fffb  /system/lib/libandroid_runtime.so (???)
  native: #11 pc 00271ed3  /data/dalvik-cache/arm/system@framework@boot.oat (Java_com_google_android_gles_1jni_EGLImpl_eglMakeCurrent__Ljavax_microedition_khronos_egl_EGLDisplay_2Ljavax_microedition_khronos_egl_EGLSurface_2Ljavax_microedition_khronos_egl_EGLSurface_2Ljavax_microedition_khronos_egl_EGLContext_2+178)
  at com.google.android.gles_jni.EGLImpl.eglMakeCurrent(Native method)
  at com.mycopmany.mypackage.androidvideocapture.SharedContext.doneCurrent(SharedContext.java:104)
  at com.mycopmany.mypackage.androidvideocapture.Capturing$EncodeThread.run(Capturing.java:104)
  - locked <@addr=0x12f01780> (a com.mycopmany.mypackage.androidvideocapture.VideoCapture)

"Thread-602" prio=5 tid=82 Native
  | group="main" sCount=1 dsCount=0 obj=0x12dd5c50 self=0x7f2c42b0
  | sysTid=6302 nice=0 cgrp=apps sched=0/0 handle=0x7f2d5020
  | state=S schedstat=( 17164000 17265000 48 ) utm=0 stm=1 core=1 HZ=100
  | stack=0x81402000-0x81404000 stackSize=1036KB
  | held mutexes=
  native: #00 pc 00012444  /system/lib/libc.so (syscall+28)
  native: #01 pc 0001641b  /system/lib/libc.so (???)
  native: #02 pc 000167b1  /system/lib/libc.so (pthread_mutex_lock+310)
  native: #03 pc 00005b5c  /system/lib/libnvos.so (???)
  native: #04 pc 0000b64c  /system/lib/egl/libGLESv2_tegra.so (???)
  native: #05 pc 00007219  /system/lib/egl/libEGL_tegra.so (???)
  native: #06 pc 000077db  /system/lib/egl/libEGL_tegra.so (eglMakeCurrent+34)
  native: #07 pc 0000ff93  /system/lib/libEGL.so (android::egl_display_t::makeCurrent(android::egl_context_t*, android::egl_context_t*, void*, void*, void*, void*, void*, void*)+96)
  native: #08 pc 000125cf  /system/lib/libEGL.so (eglMakeCurrent+266)
  native: #09 pc 00061845  /system/lib/libandroid_runtime.so (???)
  native: #10 pc 009bf213  /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_opengl_EGL14_eglMakeCurrent__Landroid_opengl_EGLDisplay_2Landroid_opengl_EGLSurface_2Landroid_opengl_EGLSurface_2Landroid_opengl_EGLContext_2+178)
  at android.opengl.EGL14.eglMakeCurrent(Native method)
  at org.m4m.android.InputSurface.makeCurrent(InputSurface.java:145)
  at org.m4m.android.Surface.<init>(Surface.java:34)
  at org.m4m.android.MediaCodecEncoderPlugin.createInputSurface(MediaCodecEncoderPlugin.java:133)
  at org.m4m.domain.Encoder.getSurface(Encoder.java:34)
  at org.m4m.domain.pipeline.PluginConnector$26.onSurfaceAvailable(PluginConnector.java:354)
  at org.m4m.android.GameCapturerSource.setSurfaceSize(GameCapturerSource.java:52)
  at org.m4m.GLCapture.setSurfaceSize(GLCapture.java:89)
  at com.mycopmany.mypackage.androidvideocapture.VideoCapture.configure(VideoCapture.java:93)
  at com.mycopmany.mypackage.androidvideocapture.VideoCapture.beginCaptureFrame(VideoCapture.java:104)
  at com.mycopmany.mypackage.androidvideocapture.Capturing$EncodeThread.run(Capturing.java:96)
  - locked <@addr=0x12db64a0> (a com.mycopmany.mypackage.androidvideocapture.VideoCapture)