MOVIE TOOLS GUIDECinepak for SEGA Saturn
BackForward
Cinepak for SEGA Saturn

Four. Cinepak library


The Cinepak library is a library for easily playing QuickTime (Cinepak compressed) movies on SEGA SATURN.

4.1 Library configuration

Figure 4.1 shows a block diagram of the Cinepak library.

Figure 4.1 Cinepak library configuration diagram

The Cinepak library does not control the stream, so open the file or move the pickup (look ahead of the file) with the application program.
Also, since display control is not performed, use the application program to initialize sprites and set sprite commands.
The Cinepak library performs the expansion process to the specified address and the audio playback process while synchronizing the AV from the movie file on the memory or CD.

4.2 Movie playback procedure

(1) Playback procedure

Figure 4.2 shows the procedure for playing a movie using the stream system.

Figure 4.2 Movie playback procedure during memory playback

(2) Program example
The following is an example program that uses the stream system to play a movie.

#define WORK_BUF_SIZE 200 * 1024L
#define PCM_ADDR ((void *) 0x25a20000)
#define PCM_SIZE (4096L * 16)

/ * Work buffer * / Uint32 movie_work [CPK_24WORK_DSIZE]; / * Ring buffer * / Uint32 movie_buf [WORK_BUF_SIZE / sizeof (Uint32)]; StmHn stm; CpkHn cpk; Sint32 movie_x = 320;

/* Initialize */ CPK_Init ();

/ * Screen display settings * / Use INT_ ??? to set a V blank IN interrupt. Call CPK_VblIn (); in a V-blank IN interrupt. Make settings such as sprite commands.

/ * File initialization * / GFS_Init (‥); STM_Init (‥); STM_OpenGrp (); STM_SetExecGrp (‥); / * Open stream * / stm = STM_OpenFid (‥);

/ * Generate movie handle * / CPK_PARA_WORK_ADDR (& para) = movie_work; CPK_PARA_WORK_SIZE (& para) = CPK_24WORK_BSIZE; CPK_PARA_BUF_ADDR (& para) = movie_buf; CPK_PARA_BUF_SIZE (& para) = WORK_BUF_SIZE; CPK_PARA_PCM_ADDR (& para) = PCM_ADDR; CPK_PARA_PCM_SIZE (& para) = PCM_SIZE; cpk = CPK_CreateStmMovie (& para, stm);

/ * Setting the number of display colors * / CPK_SetColor (cpk, CPK_COLOR_15BIT); / * Setting the destination address * / CPK_SetDecodeAddr (cpk, ADDR_VRAM, 2 * movie_x); / * Start playing the movie * / CPK_Start (cpk); while (TRUE) { / * Movie playback process * / CPK_Task (cpk); if (CPK_IsDispTime (cpk) == TRUE) { / * Waiting for frame buffer switching * / SCL_DisplayFrame (); CPK_CompleteDisp (cpk); } / * Judgment of the end of the movie * / if (CPK_GetPlayStatus (cpk) == CPK_STAT_PLAY_END) break; } / * Abandonment of Mobi * / CPK_DestroyStmMovie (cpk); / * Close stream * / STM_Close (stm);


BackForward
MOVIE TOOLS GUIDECinepak for SEGA Saturn
Copyright SEGA ENTERPRISES, LTD ,. 1997