Log in or register to post comments

VideoPlayback crash after adding 3 more targets

March 27, 2014 - 7:42am #1

I have an issue with expanding on the Vuforia VideoPlayback sample for Android.

My application works perfectly with 5 Videos/Targets but adding the 6th causes the following error:

03-27 14:41:40.683: E/AndroidRuntime(9234): FATAL EXCEPTION: GLThread 1569
03-27 14:41:40.683: E/AndroidRuntime(9234): java.lang.NullPointerException
03-27 14:41:40.683: E/AndroidRuntime(9234): 	at com.qualcomm.vuforia.samples.VideoPlayback.app.VideoPlayback.VideoPlaybackRenderer.initRendering(VideoPlaybackRenderer.java:359)
03-27 14:41:40.683: E/AndroidRuntime(9234): 	at com.qualcomm.vuforia.samples.VideoPlayback.app.VideoPlayback.VideoPlaybackRenderer.onSurfaceCreated(VideoPlaybackRenderer.java:200)
03-27 14:41:40.683: E/AndroidRuntime(9234): 	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
03-27 14:41:40.683: E/AndroidRuntime(9234): 	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)



I understand that this is an issue brought up in the forums before but I can't find the Threads it was mentioned in, and I also understand the solution is so maybe have onle one VideoPlayerHelper object which when it encounters a new Trigger imageswap unload the old video and load in the new one. I have tried this but feel i'm going in circles trying to get it to work. 

A point in the right direction would be greatly appreciated.

VideoPlayback crash after adding 3 more targets

March 28, 2014 - 8:38am #3

I have found the topic where it was suggested to comment out the code with regards to loading the videos in OnSurfaceCreated and OnSurface changed and to then load the video in when it's trigger has been detected (whilst unloading the rest of the videos).

I have changed my app to accomodate these changes with some success (tested with 5 Triggers to make sure the videos are loaded dynamically) but still when I add the 6th one I get the same error mentioned below.

It is saying that there is a null object on the line

GLES20.glGenTextures(1, t.mTextureID, 0);

But I am still getting the same error before to with loading the textures. I have commented out the offending code as it's not completely essential to my goal to have the videos pause at any time so the keyframes aren't needed.

VideoPlayback crash after adding 3 more targets

March 27, 2014 - 8:10am #2

As you said, this has been brought up before.

The unload technique is in the right direction. The problem with handling multiple videos is about memory handling;

note that the VideoPlayback feature is not a core feature of the Vuforia SDK per se, but it is a nice sample app that shows (at application code level, not at Vuforia SDK level) how you can use OpenGL + Android VideoPlayer to render a video on top of a target in AR.

Technically, the only link to the Vuforia API is that the video is rendered using a Modelview matrix which is computed using the QCAR Pose matrix as input (i.e. so that it appears on top of the Image target).



Log in or register to post comments