Android MediaPlayer Doesn't Display Video on Scroll Plus 7 device when Native App calls eglSwapBuffers

380 Views Asked by At

I've an app that uses a Native Activity as it is mostly C++ code (cross platform).

I also need to play Video and Audio so have another Activity that uses MediaPlayer to play video and/or audio. This is used in conjunction with the Native Activity to play Video in front of the OpenGL rendered application.

The MediaPlayer activity is based upon that in the ApiDemos example, and works fine on MOST devices (Nexus 7/10, Galaxy S3/Tab2, even some low-cost devices like Fusion5).

BUT running it on a low-cost Scroll Plus 7" tablet - the code functions, but no Video is displayed.

The Audio plays, the Video Controls show and are usable.

NOTE: I have actually been able to hack with the code to get the Video showing - though this is not a solution it may help someone identify the problem.

In my Native Code where the Open Gl render calls eglSwapBuffers, if I comment this line out the Video shows. (I complete the rendering in a loop inside android_main)

Obviously this means my OpenGL Rendering that needs to go on in the background stops working, so I cannot fix it this way.

Device: Scroll Plus 7" TABLET by Storage Options Jelly Bean 4.1 From LogCat i believe it is running a CedarX-based Media Decoder/Renderer.

1

There are 1 best solutions below

0
On

After 4 days on this issue, I've finally found out that the Video was being drawn BEHIND my OpenGL. Why only on this device I don't know. All the other aspects of the Video Activity (the controls etc) are in front where it should be.

The eglSwapBuffers was a red-herring, in that case I was not drawing anything to the screen.