Japanese
MOVIE TOOLS GUIDECinepak for SEGASaturn
BackForward
Cinepak for SEGA Saturn

Four. Cinepak Library


Cinepak library is a library that allows you to easily play QuickTime (Cinepak compressed) movies on SEGASATURN.

4.1 Library configuration

Figure 4.1 shows the configuration diagram of the Cinepak library.

Figure 4.1 Cinepak library configuration diagram

The Cinepak library does not control streams, so opening files and moving pickups (reading ahead of files) should be done by the application program.
Also, since display control is not performed, initialize sprites and set sprite commands, etc. in the application program.
The Cinepak library extracts files from movie files in memory or on a CD to specified addresses and plays audio while synchronizing AV.

4.2 Movie playback procedure

(1) Playback procedure

Figure 4.2 shows the steps to play 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;

/* Initialization */ CPK_Init();

/* Screen display settings */ Set the V blank IN interrupt using INT_???. Call CPK_VblIn(); within the V blank IN interrupt. Configure sprite commands, etc.

/* 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 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); } /* Movie end determination */ if (CPK_GetPlayStatus(cpk)==CPK_STAT_PLAY_END) break; } /* Movie abandonment */ CPK_DestroyStmMovie(cpk); /* Close stream */ STM_Close(stm);


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