nickspoon
vultum stultum habes
libgpvid is a library based on the recently-released GPH MPlayer sourcecode. It can be included in any app compiled for the GP2X with the official SDK. It's currently very basic - you can play a video at default volume, no seeking or pausing. So, without further adieu, an example:
This piece of code will simply play the video "test.avi" and then exit. Very simple, no? Doesn't get easier than this. Something to note, however, is that gp_play_video uses its own SDL_Init (won't work otherwise). So it's advisable to quit SDL if you're using it, then restart it again afterwards, like so:
To link, you need quite a complex chain of libraries:
The above will link the code perfectly well - and yes, there are two -lgpvids, this solves a dependency problem.
Download libgpvid.zip
Unzip the above into your arm-gp2x-linux folder in your SDK.
I *request* that people using this library give proper credit and, if it is used commercially, I *request* a free copy. It's under GPL, so if you want source, request it.
Enjoy!
Code:
#include <stdio.h>
#include <gvlib_export.h>
int main(int argc, char* argv[]) {
gp_play_video("test.avi");
return 0;
}
This piece of code will simply play the video "test.avi" and then exit. Very simple, no? Doesn't get easier than this. Something to note, however, is that gp_play_video uses its own SDL_Init (won't work otherwise). So it's advisable to quit SDL if you're using it, then restart it again afterwards, like so:
Code:
...
SDL_Quit();
gp_play_video("test.avi");
SDL_Init(SDL_INIT_VIDEO etc...);
To link, you need quite a complex chain of libraries:
Code:
-lgpvid -lmpcodecs -lmpdemux -lgpvid -laf -lao2 -losdep -lfaad2 -lfbdisp -lSDL_image -lmad -lvorbisidec -lnsl -lSDL -lpthread -ldl -lm -lpng -lz -ljpeg -lunicodefont -lSDL_inifile
The above will link the code perfectly well - and yes, there are two -lgpvids, this solves a dependency problem.
Download libgpvid.zip
Unzip the above into your arm-gp2x-linux folder in your SDK.
I *request* that people using this library give proper credit and, if it is used commercially, I *request* a free copy. It's under GPL, so if you want source, request it.
Enjoy!