繁体   English   中英

视频显示几秒钟时Android DJI SDK错误

[英]Android DJI SDK error when video displayed for a few seconds

我不知道为什么会收到此错误:

E/UsbAccessoryService: recvBufferThread.start
E/UsbAccessoryService: RecvOsdRunnable true
E/UsbAccessoryService: rate 0.52 KB
E/UsbAccessoryService: parseVideoThread.start
E/DJIPackManager: pack senderType=14 cmdSet=9
E/UsbAccessoryService: ParseVideoRunnable true
E/DJIBaseProduct: Camera needCreateNew: true
E/DJIBaseProduct: put component
E/DJIBaseProduct: Gimbal needCreateNew: true
E/DJIBaseProduct: put component
E/DJIBaseProduct: FlightController needCreateNew: true
E/DJIBaseProduct: put component
E/DJIBaseProduct: update battery platformType: P4
E/DJIBaseProduct: update battery phantom
E/DJIBaseProduct: Battery needCreateNew: true
E/Event: Could not dispatch event: class dji.midware.data.model.P3.DataEyeGetPushFrontAvoidance to subscribing class class dji.sdk.FlightController.DJIIntelligentFlightAssistant$InnerEventBus
                                                              java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
                                                                  at dji.sdk.FlightController.DJIIntelligentFlightAssistant$InnerEventBus.onEventBackgroundThread(Unknown Source)
                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                  at java.lang.reflect.Method.invoke(Method.java:372)
                                                                  at dji.thirdparty.eventbus.EventBus.invokeSubscriber(EventBus.java:569)
                                                                  at dji.thirdparty.eventbus.EventBus.postToSubscription(EventBus.java:513)
                                                                  at dji.thirdparty.eventbus.EventBus.postSingleEvent(EventBus.java:475)
                                                                  at dji.thirdparty.eventbus.EventBus.post(EventBus.java:365)
                                                                  at dji.midware.data.manager.P3.t.post(Unknown Source)
                                                                  at dji.midware.data.manager.P3.t.setPushRecData(Unknown Source)
                                                                  at dji.midware.data.manager.P3.t.setPushRecPack(Unknown Source)
                                                                  at dji.midware.data.manager.P3.l.b(Unknown Source)
                                                                  at dji.midware.data.manager.P3.l.a(Unknown Source)
                                                                  at dji.midware.data.manager.P3.l.a(Unknown Source)
                                                                  at dji.midware.usb.P3.UsbAccessoryService$1.onGetBody(Unknown Source)
                                                                  at dji.midware.f.a.f.b(Unknown Source)
                                                                  at dji.midware.f.a.f.a(Unknown Source)
                                                                  at dji.midware.usb.P3.UsbAccessoryService$RecvBufferRunnable.run(Unknown Source)
                                                                  at java.lang.Thread.run(Thread.java:818)

来自 TextureView 的视频提要出现几秒钟,然后涉及显示视频提要的活动退出到 MainActivity。 (我使用 MainActivity 通过菜单转换到 VideoFeedActivity)。 我无法弄清楚空指针是什么或它来自哪里,因为我相信我正在正确初始化所有内容,但似乎并非如此。 在实现函数 onSurfaceTextureUpdated(SurfaceTexture texture) 的 SurfaceTextureListener 中,我正在对每一帧的位图进行分析。 但是我怀疑这就是问题所在,我相信这与无人机对象的初始化以及它们如何交互有关。 我尝试在加载视频流之前关闭 IntelligentFlightAssistant; 然而,这没有影响。

我想出了问题所在:

每次制作新帧来分析图像时,我都会创建一个新线程,这导致了失败。 为了解决这个问题,我做了一个新线程,只有在当前线程没有被使用的情况下才能创建一个新线程。 (我知道这种违背了线程的目的,但我不希望这个动作减慢运行应用程序的进程)。 无论如何,这解决了问题,现在程序运行良好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM