gpt4 book ai didi

java - 无法创建 EGL 上下文

转载 作者:行者123 更新时间:2023-11-29 02:39:10 24 4
gpt4 key购买 nike

我在少数设备上遇到以下崩溃,代码在少数设备上运行良好。我不明白是哪部分代码造成了这次崩溃。几天前它工作正常,突然间我看到了这次崩溃。谁能告诉我是什么导致了这次崩溃。请帮助我

堆栈轨迹如下:

java.lang.RuntimeException: java.lang.RuntimeException: Failed to create EGL context: 0x3003                                                                                at org.webrtc.EglBase14.createEglContext(EglBase14.java:260)
at org.webrtc.EglBase14.<init>(EglBase14.java:58)
at org.webrtc.EglBase.create(EglBase.java:86)
at org.webrtc.EglRenderer$3.run(EglRenderer.java:194)
at org.webrtc.ThreadUtils$5.call(ThreadUtils.java:208)
at org.webrtc.ThreadUtils$5.call(ThreadUtils.java:205)
at org.webrtc.ThreadUtils$4.run(ThreadUtils.java:182)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
at org.webrtc.ThreadUtils.invokeAtFrontUninterruptibly(ThreadUtils.java:193)
at org.webrtc.ThreadUtils.invokeAtFrontUninterruptibly(ThreadUtils.java:205)
at org.webrtc.EglRenderer.init(EglRenderer.java:183)
at org.webrtc.SurfaceViewRenderer.init(SurfaceViewRenderer.java:101)
at org.webrtc.SurfaceViewRenderer.init(SurfaceViewRenderer.java:82)
at com.twilio.video.VideoView.setupRenderer(VideoView.java:158)
at com.twilio.video.VideoView.onAttachedToWindow(VideoView.java:91)
at android.view.View.dispatchAttachedToWindow(View.java:14538)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2844)
at android.view.ViewGroup.addViewInner(ViewGroup.java:4349)
at android.view.ViewGroup.addView(ViewGroup.java:4146)
at android.view.ViewGroup.addView(ViewGroup.java:4087)
at android.support.v7.widget.RecyclerView$5.addView(RecyclerView.java:676)
at android.support.v7.widget.ChildHelper.addView(ChildHelper.java:107)
at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:7399)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7357)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7345)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1459)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1408)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:580)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3374)
at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2901)
at android.view.View.measure(View.java:18811)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1112)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:632)
at android.view.View.measure(View.java:18811)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
at android.view.View.measure(View.java:18811)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
at android.view.View.measure(View.java:18811)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
at android.view.View.measure(View.java:18811)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:18811)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5952)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
at android.widget.LinearLayout.onM

最佳答案

问题与创建的上下文数量有关。当达到限制点时,多次创建 egl 上下文会导致 EglBase.create() 方法崩溃。确保您没有创建那么多 eglContext。我的设备上的限制似乎是 30。

根据 WebRTC 的文档调用 .release() 应该可以解决这个问题,但不幸的是它没有。

关于java - 无法创建 EGL 上下文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45392309/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com