

along0612 wrote:I have developed a RTSP stream media player and it use the SDL as the audio and video render layer.
Now I want to port this media player to android platform. My app has multi threads(data receive thread, video decode thread, video surface update thread,etc.) created by SDL_CreateThread.
I have tried the offical SDL1.3 port, but failed! The log info always show:" non-VM thread making JNI calls".
is this SDL port fit for me? or how to solve my problem? Thank you.


pelya wrote:You have to make all SDL calls that draw to the screen only from your main thread, with official SDL 1.3 port. My port has a compatibility option for such apps, it's called AppDorsNotCallSdlFlip or something like that in AndroidAppSettings.cfg, but it will render a bit slower then.




#include <SDL/SDL.h>
void AndroidDummyBackgroundCallback(void) { /* do nothing */ }
SDL_ANDROID_SetApplicationPutToBackgroundCallback( &AndroidDummyBackgroundCallback, &AndroidDummyBackgroundCallback );



Is it normal that speed? Is there something I can do to get higher FPSs?
I believe they will run faster than 7 FPS on Desire. The main bottleneck, as far as I know, is the amount of textures that you are drawing - drawing one big texture will be far faster than drawing several small textures, so you should use pre-rendered background if you can. Also you may try to use glDrawTexiOES() function, instead of the usual glDrawArrays() - it is the GLES extension and not available in the usual OpenGL, and it's used to draw texture to screen without rotation or any 3D transformations, it may only stretch or shrink the texture along horizontal/vertical axis, so it should be somewhat faster on most hardware.


Return to Code Snippets for Android
Users browsing this forum: No registered users and 5 guests