CRM32Pro_IVideo Class Reference
[MODULE 14: IVideo v2.40, player video interface]

IVideo. More...


Detailed Description

IVideo.

Player MPEG interface.

List of all members.

Public Member Functions

char PlayMPEG (char *file, char bSound=1, char bFilter=VIDEO_FILTER_NULL)
 Play MPEG-1 video and audio stream. Dump the surface result to screen.
Screen must be on system memory.
void SetFunction (int(*MyFunction)(int kPressed, SDL_Surface *sFrame, SDL_Rect *rDst))
 Set a function to be called each frame update.
void SetFX (int)
 Set a special fx for video stream.
It needs a fast CPU.
void SetPosition (int x, int y)
 Set position on screen to play the video. By default, the video positions is (0,0).
void SetScale (int width, int height)
 Set scaled size to play the video, call it before to play that video.

Member Function Documentation

char CRM32Pro_IVideo::PlayMPEG ( char *  file,
char  bSound = 1,
char  bFilter = VIDEO_FILTER_NULL 
)

Play MPEG-1 video and audio stream. Dump the surface result to screen.
Screen must be on system memory.

You can set/change FX effect while MPEG is playing.

Parameters:
file MPEG file to play
bSound 0: do not play audio stream - 1: play audio stream (by default)
bFilter See definition of VIDEO_FILTER_xx. VIDEO_FILTER_NULL by default.
Returns:
0 Failed
1 Ok
Examples:
Example05_VideoPlayer.cpp.
void CRM32Pro_IVideo::SetFunction ( int(*)(int kPressed, SDL_Surface *sFrame, SDL_Rect *rDst)  MyFunction  ) 

Set a function to be called each frame update.

To disable a previous function, you have to use SetFunction(NULL).

The parameters of MyFunction() are: kPressed is the key pressed during the playback, sFrame is a surface pointer to current frame and rDst is the destination rect.
Using this function is optional but on OpenGL video modes it has to be used blitting the sFrame on CRM32Pro.screen due to SDL,OpenGL and SMPEG requirements. Note this process is quite intensive due to the frame is generated on memory system and converted to an OpenGL texture before to upload it to the video memory.
Check Example05_VideoPlayer for futher information.

Parameters:
MyFunction pointer to function that will be executed each frame update. The function always must return 1 or it will stop the playback
Examples:
Example05_VideoPlayer.cpp.
void CRM32Pro_IVideo::SetFX ( int  effect  ) 

Set a special fx for video stream.
It needs a fast CPU.

Parameters:
effect Any of the FXSCREEN_xxx flag.
Examples:
Example05_VideoPlayer.cpp.
void CRM32Pro_IVideo::SetPosition ( int  x,
int  y 
)

Set position on screen to play the video. By default, the video positions is (0,0).

Parameters:
x desired X of the video playback. Use VIDEO_PLAY_CENTER to center on X axis.
y desired Y of the video playback. Use VIDEO_PLAY_CENTER to center on Y axis.
Examples:
Example05_VideoPlayer.cpp.
void CRM32Pro_IVideo::SetScale ( int  width,
int  height 
)

Set scaled size to play the video, call it before to play that video.

While the video is playing, it doesnt do anything.
By default, the video is not scaled.

Parameters:
width desired width of the video playback. 0 means do not scale the video on X axis.
height desired height of the video playback. 0 means do not scale the video on Y axis.

The documentation for this class was generated from the following files:

Generated on Mon Dec 21 17:04:40 2009 for CRM32Pro SDK v5.00 by  doxygen 1.6.1