Hi, I have been playing around with the videoplayback demo, it works fine until I add more video to it.
I have make 6 trackables for 6 videos, on one of my phone, it can play all 6 videos successfully.
But for another android phone, it can only play 4 and for another tablet it can only play 3
I have checked the log, the error occurs when it prepare the mediaplayer at mMediaPlayer.prepareAsync(); in VideoPlayerHelper.java
related logs:
12-13 17:15:10.247: E/OMXNodeInstance(14298): OMX_UseBuffer failed with error -2147479528 (0x80001018)
12-13 17:15:10.247: E/OMXCodec(14298): [OMX.TI.DUCATI1.VIDEO.DECODER] ERROR(0x80001000, 0)
12-13 17:15:10.247: W/AwesomePlayer(14298): onPrepareAsyncEvent() initVideoDecoder error(-2147483648)
12-13 17:15:10.247: E/MediaPlayer(15561): error (1, -2147483648)
12-13 17:15:10.247: D/DOMX(14298): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001000 - Error returned from OMX API in ducati
12-13 17:15:10.247: D/DOMX(14298): ERROR: Error From ComponentDeInit..
12-13 17:15:10.286: E/MediaPlayer(15561): Error (1,-2147483648)
12-13 17:15:10.286: E/QCAR(15561): Error while opening the file for fullscreen. Unloading the media player (Unspecified media player error, -2147483648)
12-13 17:15:10.286: E/MediaPlayer(15561): error (-38, 0)
Hi,
loading the videos for playback consumes memory on the device, so depending on the device you use you might face memory problems that cause the media player to fail; so some devices may be able to support more videos (e.g. 6) than other devices (e.g. 3 or 4), that is expected and normal.
To overcome this problem you could refactor the VP sample so to load videos only when the corresponding target is detected, and to unload the video (thuis freeing the memory) when a target is no longer detected; this way you will be able to reduce the number of videos simultaneously loaded in memory and you should eb able to handle even more than 4 videos on all your devices.
Note:
- the load() and unload() functions are defined in VideoPlaybackHelper.java
- the load() function is called from the VideoPlaybackRenderer.java in the onSurfaceCreated() and onSurfaceChanged() methods;
you should remove those load() calls from there and should place them in some code which is triggered from the rendering function when a target is detected.
I hope this helps.